@codename_inc/spectre 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +411 -0
- package/bin/spectre.js +8 -0
- package/package.json +23 -0
- package/plugins/spectre/.claude-plugin/plugin.json +5 -0
- package/plugins/spectre/agents/analyst.md +122 -0
- package/plugins/spectre/agents/dev.md +70 -0
- package/plugins/spectre/agents/finder.md +105 -0
- package/plugins/spectre/agents/patterns.md +207 -0
- package/plugins/spectre/agents/reviewer.md +128 -0
- package/plugins/spectre/agents/sync.md +151 -0
- package/plugins/spectre/agents/tester.md +209 -0
- package/plugins/spectre/agents/web-research.md +109 -0
- package/plugins/spectre/commands/architecture_review.md +120 -0
- package/plugins/spectre/commands/clean.md +313 -0
- package/plugins/spectre/commands/code_review.md +408 -0
- package/plugins/spectre/commands/create_plan.md +117 -0
- package/plugins/spectre/commands/create_tasks.md +374 -0
- package/plugins/spectre/commands/create_test_guide.md +120 -0
- package/plugins/spectre/commands/evaluate.md +50 -0
- package/plugins/spectre/commands/execute.md +87 -0
- package/plugins/spectre/commands/fix.md +61 -0
- package/plugins/spectre/commands/forget.md +58 -0
- package/plugins/spectre/commands/handoff.md +161 -0
- package/plugins/spectre/commands/kickoff.md +115 -0
- package/plugins/spectre/commands/learn.md +15 -0
- package/plugins/spectre/commands/plan.md +170 -0
- package/plugins/spectre/commands/plan_review.md +33 -0
- package/plugins/spectre/commands/quick_dev.md +101 -0
- package/plugins/spectre/commands/rebase.md +73 -0
- package/plugins/spectre/commands/recall.md +5 -0
- package/plugins/spectre/commands/research.md +159 -0
- package/plugins/spectre/commands/scope.md +119 -0
- package/plugins/spectre/commands/ship.md +172 -0
- package/plugins/spectre/commands/sweep.md +82 -0
- package/plugins/spectre/commands/test.md +380 -0
- package/plugins/spectre/commands/ux_spec.md +91 -0
- package/plugins/spectre/commands/validate.md +343 -0
- package/plugins/spectre/hooks/hooks.json +34 -0
- package/plugins/spectre/hooks/scripts/bootstrap.cjs +99 -0
- package/plugins/spectre/hooks/scripts/handoff-resume.cjs +410 -0
- package/plugins/spectre/hooks/scripts/lib.cjs +83 -0
- package/plugins/spectre/hooks/scripts/load-knowledge.cjs +120 -0
- package/plugins/spectre/hooks/scripts/precompact-warning.cjs +19 -0
- package/plugins/spectre/hooks/scripts/register_learning.cjs +144 -0
- package/plugins/spectre/hooks/scripts/test_bootstrap.cjs +84 -0
- package/plugins/spectre/hooks/scripts/test_handoff-resume.cjs +858 -0
- package/plugins/spectre/hooks/scripts/test_load-knowledge.cjs +285 -0
- package/plugins/spectre/hooks/scripts/test_register-learning.cjs +146 -0
- package/plugins/spectre/skills/spectre-apply/SKILL.md +189 -0
- package/plugins/spectre/skills/spectre-guide/SKILL.md +358 -0
- package/plugins/spectre/skills/spectre-learn/SKILL.md +635 -0
- package/plugins/spectre/skills/spectre-learn/references/recall-template.md +31 -0
- package/plugins/spectre/skills/spectre-tdd/SKILL.md +111 -0
- package/src/config.test.js +134 -0
- package/src/install.test.js +273 -0
- package/src/lib/config.js +516 -0
- package/src/lib/constants.js +60 -0
- package/src/lib/doctor.js +168 -0
- package/src/lib/install.js +482 -0
- package/src/lib/knowledge.js +217 -0
- package/src/lib/paths.js +98 -0
- package/src/lib/project.js +473 -0
- package/src/main.js +150 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 👻 | Complete cleanup flow - clean, inspect, lint, test - primary agent
|
|
3
|
+
---
|
|
4
|
+
# clean: Analyze recent changes for dead code and artifacts from failed branches
|
|
5
|
+
|
|
6
|
+
## Description
|
|
7
|
+
|
|
8
|
+
- **What** — Analyze a scoped working set (commit range, unstaged changes, or context window) to identify dead code, orphaned artifacts, and remnants from abandoned implementation attempts; dispatch parallel subagents to investigate and validate findings
|
|
9
|
+
- **Outcome** — Clean code with all dead artifacts from recent work removed; validated removal tasks ready for execution
|
|
10
|
+
|
|
11
|
+
## Variables
|
|
12
|
+
|
|
13
|
+
### Dynamic Variables
|
|
14
|
+
|
|
15
|
+
- `commit_id`: Optional starting commit - analyzes all changes **from and including this commit** through HEAD plus staged/unstaged/untracked — (via ARGUMENTS: $ARGUMENTS)
|
|
16
|
+
- **INCLUDES** the commit_id commit itself and all subsequent commits through HEAD
|
|
17
|
+
- If commit_id equals HEAD, working set will be staged + unstaged + untracked only
|
|
18
|
+
- If commit_id is invalid or not in history, **STOP and ask user for guidance**
|
|
19
|
+
- `scope_mode`: One of: `commit_range`, `unstaged`, `context` — determines working set
|
|
20
|
+
- `target_out_dir`: Optional OUT_DIR override
|
|
21
|
+
|
|
22
|
+
### Static Variables
|
|
23
|
+
|
|
24
|
+
- `out_dir`: docs/tasks/{branch_name}
|
|
25
|
+
- `analysis_dir`: {out_dir}/cleanup_analysis
|
|
26
|
+
- `reports_subdir`: {analysis_dir}/area_reports
|
|
27
|
+
- `validation_subdir`: {analysis_dir}/validations
|
|
28
|
+
- `max_parallel_agents`: 4
|
|
29
|
+
|
|
30
|
+
## ARGUMENTS Input
|
|
31
|
+
|
|
32
|
+
Optional scope specification. If ambiguous, ask user to clarify.
|
|
33
|
+
|
|
34
|
+
<ARGUMENTS> $ARGUMENTS </ARGUMENTS>
|
|
35
|
+
|
|
36
|
+
## Codebase Structure
|
|
37
|
+
|
|
38
|
+
**Relevant Files**:
|
|
39
|
+
|
|
40
|
+
- Working set files determined by scope
|
|
41
|
+
- `package.json` — Dependencies context
|
|
42
|
+
- `tsconfig.json` — TypeScript configuration
|
|
43
|
+
- `.gitignore` — Exclusion patterns to respect
|
|
44
|
+
|
|
45
|
+
## Instructions
|
|
46
|
+
|
|
47
|
+
- **Primary goal**: Remove dead code artifacts left behind from recent work, especially failed implementation branches
|
|
48
|
+
- Never mark production code as safe to remove without validation
|
|
49
|
+
- Respect .gitignore patterns when analyzing files
|
|
50
|
+
- Document uncertainty clearly; flag items requiring manual review
|
|
51
|
+
- All file paths must be absolute from repository root
|
|
52
|
+
- Focus on artifacts likely created during recent work: unused functions, orphaned imports, commented-out code, debug statements
|
|
53
|
+
- **File safety**: Default filenames (`working_set.json`, `initial_findings.md`, `duplication_report.md`, `cleanup_summary.md`) must never overwrite existing files—if a target exists, create a scoped variant (append scope/task/timestamp) and use that path in messaging.
|
|
54
|
+
- when committing, —no-verify and eslint-disable, or committing code with eslint-disable, is expressly forbidden without the user's explicit permission.
|
|
55
|
+
|
|
56
|
+
## Step (1/7) - Determine Working Set Scope
|
|
57
|
+
|
|
58
|
+
- **Action** — DetermineScope: Identify which files to analyze
|
|
59
|
+
- **If** ARGUMENTS contains `commit_id` or commit SHA:
|
|
60
|
+
- **First**: Validate commit_id exists: `git rev-parse --verify {commit_id}^{commit} 2>/dev/null`
|
|
61
|
+
- **If validation fails**: STOP and ask user "Commit {commit_id} is invalid or not found in history. Please provide a valid commit SHA or ref."
|
|
62
|
+
- **Else**: proceed with discovery
|
|
63
|
+
- Committed changes: `git log --name-only --pretty=format: {commit_id}^..HEAD | sort -u`
|
|
64
|
+
- **IMPORTANT**: Uses `{commit_id}^..HEAD` to INCLUDE the commit_id commit itself
|
|
65
|
+
- Staged changes: `git diff --cached --name-only`
|
|
66
|
+
- Unstaged changes: `git diff --name-only`
|
|
67
|
+
- Untracked files: `git ls-files --others --exclude-standard`
|
|
68
|
+
- **Working Set** = UNION of all four sets above
|
|
69
|
+
- **ElseIf** ARGUMENTS specifies "unstaged" or "staged":
|
|
70
|
+
- Staged changes: `git diff --cached --name-only`
|
|
71
|
+
- Unstaged changes: `git diff --name-only`
|
|
72
|
+
- Untracked files: `git ls-files --others --exclude-standard`
|
|
73
|
+
- **Working Set** = UNION of all three
|
|
74
|
+
- **ElseIf** ARGUMENTS specifies "context" or mentions current session:
|
|
75
|
+
- Ask user: "Which files from our current session should I analyze? List the files/directories or say 'all discussed files'"
|
|
76
|
+
- **Wait** — User specifies files
|
|
77
|
+
- **Working Set** = User-specified files
|
|
78
|
+
- **Else** (scope ambiguous):
|
|
79
|
+
- Ask user: "How should I scope the cleanup analysis?"
|
|
80
|
+
- `1` — From a specific commit (provide SHA)
|
|
81
|
+
- `2` — Current unstaged/staged changes only
|
|
82
|
+
- `3` — Files we've discussed in this session
|
|
83
|
+
- **Wait** — User selects scope mode
|
|
84
|
+
- **Action** — RecordWorkingSet: Save working set to `{analysis_dir}/working_set.json`
|
|
85
|
+
- Include: file list, scope mode, commit range (if applicable)
|
|
86
|
+
- **Action** — DetermineOutputDir: Set output location
|
|
87
|
+
- `branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)`
|
|
88
|
+
- **If** user specifies `target_out_dir` → `OUT_DIR={target_out_dir}`
|
|
89
|
+
- **Else** → `OUT_DIR={out_dir}`
|
|
90
|
+
- `mkdir -p "OUT_DIR/{analysis_dir}/{reports_subdir}"`
|
|
91
|
+
- `mkdir -p "OUT_DIR/{analysis_dir}/{validation_subdir}"`
|
|
92
|
+
|
|
93
|
+
## Step (2/7) - Analyze Working Set for Dead Code Patterns
|
|
94
|
+
|
|
95
|
+
- **Action** — IdentifyDeadCodePatterns: Scan working set files for common dead code indicators
|
|
96
|
+
- **Patterns to detect** (ordered by likelihood after failed branches):
|
|
97
|
+
1. **Orphaned imports** — imports with no usage in the file
|
|
98
|
+
2. **Unused functions/variables** — declared but never called/referenced
|
|
99
|
+
3. **Commented-out code blocks** — large blocks of commented code (>5 lines)
|
|
100
|
+
4. **Debug artifacts** — debugger statements, TODO/FIXME from current work
|
|
101
|
+
5. **Temporary logging** — development-time logging to remove:
|
|
102
|
+
- console.log/warn/error without structured context (bare strings, variable dumps)
|
|
103
|
+
- Logging inside loops or hot paths (per-iteration logging)
|
|
104
|
+
- Debug prefixes: "DEBUG:", "TODO:", "TEMP:", "XXX:", "HACK:"
|
|
105
|
+
- Variable dumps: `console.log(varName)`, `console.log({var1, var2})`
|
|
106
|
+
- Checkpoint logs: "here", "got here", "reached X", "entering/exiting"
|
|
107
|
+
- Timing logs not part of production observability
|
|
108
|
+
- Commented-out logging statements
|
|
109
|
+
6. **Dead branches** — unreachable code paths, always-false conditions
|
|
110
|
+
7. **Orphaned exports** — exports not imported anywhere in codebase
|
|
111
|
+
8. **Duplicate implementations** — similar code suggesting abandoned refactor
|
|
112
|
+
9. **Test artifacts** — `.only`, skipped tests, test data that should be removed
|
|
113
|
+
10. **AI code slop** — patterns inconsistent with codebase style:
|
|
114
|
+
- Excessive comments a human wouldn't add or inconsistent with file style
|
|
115
|
+
- Unnecessary defensive checks/try-catch in trusted codepaths
|
|
116
|
+
- Casts to `any` to bypass type issues
|
|
117
|
+
- Over-documentation of obvious code
|
|
118
|
+
- Verbose patterns where codebase uses concise ones
|
|
119
|
+
- For each file in working set: identify potential issues with file:line references
|
|
120
|
+
- **Action** — ChunkAnalysis: Group findings by file/module for parallel investigation
|
|
121
|
+
- Create 2-5 investigation chunks based on working set size
|
|
122
|
+
- Each chunk: area name, files, identified patterns, investigation focus
|
|
123
|
+
- **Action** — SaveInitialFindings: Write to `{analysis_dir}/initial_findings.md` (use a scoped variant like `initial_findings_{timestamp}.md` if the default exists; never overwrite)
|
|
124
|
+
- Include: pattern counts, file list per pattern, investigation priorities
|
|
125
|
+
|
|
126
|
+
## Step (3/7) - Analyze Duplication
|
|
127
|
+
|
|
128
|
+
- **Action** — DetectDuplication: Find repeated code patterns in working set
|
|
129
|
+
|
|
130
|
+
- **Patterns to detect**:
|
|
131
|
+
- Copy-pasted logic (>5 similar lines, 2+ instances)
|
|
132
|
+
- Nearly-identical functions with cosmetic differences (variable names differ, same logic)
|
|
133
|
+
- Repeated type definitions or interfaces
|
|
134
|
+
- Same validation/transform/fetch patterns across files
|
|
135
|
+
- **Output per cluster**:
|
|
136
|
+
- All instance locations (file:line)
|
|
137
|
+
- Pattern description
|
|
138
|
+
- Extraction recommendation (where to consolidate)
|
|
139
|
+
- Effort estimate (low/medium/high)
|
|
140
|
+
- Ignore intentional duplication (test fixtures, generated code)
|
|
141
|
+
|
|
142
|
+
- **Action** — GenerateDuplicationReport: Write `{analysis_dir}/duplication_report.md` (or a scoped variant if it already exists; do not overwrite)
|
|
143
|
+
|
|
144
|
+
- **Format**:
|
|
145
|
+
|
|
146
|
+
```plaintext
|
|
147
|
+
## Duplicate Code Clusters
|
|
148
|
+
|
|
149
|
+
### Cluster 1: {pattern_name} ({instance_count} instances)
|
|
150
|
+
- `{file1}:{lines}`
|
|
151
|
+
- `{file2}:{lines}`
|
|
152
|
+
- `{file3}:{lines}`
|
|
153
|
+
|
|
154
|
+
**Pattern**: {description}
|
|
155
|
+
**Recommendation**: Extract to `{suggested_location}`
|
|
156
|
+
**Effort**: {low|medium|high}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Step (4/7) - Dispatch Investigation Subagents
|
|
160
|
+
|
|
161
|
+
- **Action** — PrepareSubagentPrompts: Generate investigation prompts for each chunk
|
|
162
|
+
|
|
163
|
+
**Subagent Investigation Instructions Template**:
|
|
164
|
+
|
|
165
|
+
```markdown
|
|
166
|
+
You are investigating recent changes in {area_name} for dead code artifacts.
|
|
167
|
+
|
|
168
|
+
**Context**: These files were recently modified. Look for artifacts from failed implementation attempts, abandoned branches, or incomplete refactors.
|
|
169
|
+
|
|
170
|
+
**Files in scope**: {file_list}
|
|
171
|
+
**Initial patterns detected**: {patterns_for_area}
|
|
172
|
+
|
|
173
|
+
**Your task**:
|
|
174
|
+
1. Review all files in scope thoroughly
|
|
175
|
+
2. For EACH potential issue, verify:
|
|
176
|
+
- Is this code actually unused? (check imports, calls, references)
|
|
177
|
+
- Is this a remnant from a failed approach? (check git history if needed)
|
|
178
|
+
- Could this break something if removed? (check dependencies)
|
|
179
|
+
3. Categorize findings:
|
|
180
|
+
- SAFE_TO_REMOVE: Confirmed dead code, no dependencies
|
|
181
|
+
- NEEDS_VALIDATION: Likely dead but needs confirmation
|
|
182
|
+
- KEEP: Actually used or unclear
|
|
183
|
+
4. Document evidence for each finding
|
|
184
|
+
|
|
185
|
+
**Output format**: Markdown report with sections per issue type.
|
|
186
|
+
**Critical**: Be conservative. When in doubt, mark NEEDS_VALIDATION.
|
|
187
|
+
|
|
188
|
+
Save your report to: {reports_subdir}/{area_name}_report.md (if that file exists, append a unique identifier such as `{area_name}_{timestamp}.md`; never overwrite)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
- **Action** — SpawnSubagents: Launch parallel investigation agents (up to {max_parallel_agents})
|
|
192
|
+
- For each chunk: spawn subagent with investigation prompt
|
|
193
|
+
- Set output path: `{reports_subdir}/{area_name}_report.md` (or scoped variant if default exists)
|
|
194
|
+
- **Wait** — All investigation subagents complete and save reports
|
|
195
|
+
|
|
196
|
+
## Step (5/7) - Validate High-Risk Findings
|
|
197
|
+
|
|
198
|
+
- **Action** — ConsolidateReports: Read all investigation reports from `{reports_subdir}/`
|
|
199
|
+
- Group findings: SAFE_TO_REMOVE, NEEDS_VALIDATION, KEEP
|
|
200
|
+
- Extract SAFE_TO_REMOVE items involving:
|
|
201
|
+
- Function/class deletions
|
|
202
|
+
- File deletions
|
|
203
|
+
- Export removals
|
|
204
|
+
- **Action** — PrepareValidationPrompts: Generate validation prompts for high-risk items
|
|
205
|
+
|
|
206
|
+
**Subagent Validation Instructions Template**:
|
|
207
|
+
|
|
208
|
+
```markdown
|
|
209
|
+
You are validating a finding from dead code analysis.
|
|
210
|
+
|
|
211
|
+
**Original finding**:
|
|
212
|
+
{finding_description}
|
|
213
|
+
{file_path}:{line_numbers}
|
|
214
|
+
{reasoning_from_investigation}
|
|
215
|
+
|
|
216
|
+
**Your task**:
|
|
217
|
+
1. Search codebase for ANY usage (dynamic imports, string refs, reflection)
|
|
218
|
+
2. Check test files for usage
|
|
219
|
+
3. Verify the code is actually dead, not just indirectly used
|
|
220
|
+
4. Determine: CONFIRMED_SAFE, UNSAFE, or UNCERTAIN
|
|
221
|
+
|
|
222
|
+
**Output format**: Markdown with verdict, evidence, reasoning.
|
|
223
|
+
|
|
224
|
+
Save to: {validation_subdir}/{task_id}_validation.md (if that file exists, append a unique identifier; never overwrite)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
- **Action** — SpawnValidationAgents: Launch validation agents (up to {max_parallel_agents})
|
|
228
|
+
- **Wait** — All validation subagents complete
|
|
229
|
+
|
|
230
|
+
## Step (6/7) - Generate Removal Tasks, Verify & Commit
|
|
231
|
+
|
|
232
|
+
- **Action** — ReadValidations: Load validation results from `{validation_subdir}/`
|
|
233
|
+
- Group by verdict: CONFIRMED_SAFE, UNSAFE, UNCERTAIN
|
|
234
|
+
- **Action** — ReconcileFindings: Create final removal list
|
|
235
|
+
- CONFIRMED_SAFE → approved for removal
|
|
236
|
+
- UNSAFE → document why, exclude from removal
|
|
237
|
+
- UNCERTAIN → flag for manual review
|
|
238
|
+
- **Action** — GenerateSummary: Create `{analysis_dir}/cleanup_summary.md` (or a scoped variant if it already exists; do not overwrite)
|
|
239
|
+
- Sections:
|
|
240
|
+
- **Executive Summary**: Scope analyzed, findings count, safe removals
|
|
241
|
+
- **Safe Removals**: List with file:line, what to remove, why it's safe
|
|
242
|
+
- **Manual Review Required**: Items needing human decision
|
|
243
|
+
- **Excluded Items**: What was kept and why
|
|
244
|
+
- **Estimated Impact**: Lines of dead code to remove
|
|
245
|
+
- **Action** — CreateRemovalTasks: Generate removal task files
|
|
246
|
+
- For each CONFIRMED_SAFE: task with exact removal instructions
|
|
247
|
+
- Save to `{analysis_dir}/removal_tasks/task_{id}.md`
|
|
248
|
+
- **Action** — PresentFindings: Show user the summary and request approval
|
|
249
|
+
- Present summary: X files analyzed, Y items safe to remove, Z need review
|
|
250
|
+
- **Wait** — User approves specific tasks or all CONFIRMED_SAFE items
|
|
251
|
+
- **Action** — ExecuteRemovals: Perform removals sequentially
|
|
252
|
+
- **If**: User hasn't approved any tasks → Skip execution
|
|
253
|
+
- **Else**: For each approved task:
|
|
254
|
+
- File deletion → `rm {file_path}`
|
|
255
|
+
- Code removal → Use Edit tool to remove lines
|
|
256
|
+
- Document change in `{analysis_dir}/changes_log.md`
|
|
257
|
+
- **Action** — Verify: Run lint and tests
|
|
258
|
+
- Run lint, fix violations
|
|
259
|
+
- Run tests for affected areas
|
|
260
|
+
- **If**: Tests fail → Rollback change, document failure
|
|
261
|
+
- **Else**: Confirm removal successful
|
|
262
|
+
- **Action** — CommitPlanningArtifacts: Stage and commit analysis docs
|
|
263
|
+
- Check for uncommitted files in `{out_dir}` and `{analysis_dir}`:
|
|
264
|
+
- `working_set.json`, `initial_findings.md`, `duplication_report.md`
|
|
265
|
+
- `cleanup_summary.md`
|
|
266
|
+
- Area reports in `{reports_subdir}/`
|
|
267
|
+
- Validation reports in `{validation_subdir}/`
|
|
268
|
+
- Any other `.md` or `.json` artifacts created during this flow
|
|
269
|
+
- **If** uncommitted planning artifacts exist:
|
|
270
|
+
- Stage all: `git add {out_dir}/ {analysis_dir}/`
|
|
271
|
+
- Commit: `docs(clean): add cleanup analysis artifacts for {branch_name}`
|
|
272
|
+
- **Action** — CommitCodeChanges: Commit removals by type (chore/refactor/fix/test), conventional format
|
|
273
|
+
- **Action** — RenderFooter: Render Next Steps via `@skill-spectre:spectre-guide`
|
|
274
|
+
|
|
275
|
+
## Step (7/7) - ESLint Compliance Planning
|
|
276
|
+
|
|
277
|
+
**Purpose**: Systematically identify tech debt from eslint-disable comments in the working set.
|
|
278
|
+
|
|
279
|
+
**7a. Collect ESLint Bypasses**:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
grep -rn "eslint-disable\|@ts-ignore\|@ts-expect-error" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx"
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**7b. Group by Module**: Cluster findings by directory or logical module (files that import each other).
|
|
286
|
+
|
|
287
|
+
**7c. For each group with ≥2 bypasses**, dispatch @analyst in parallel:
|
|
288
|
+
|
|
289
|
+
```plaintext
|
|
290
|
+
Analyze ESLint bypasses in: {file_list}
|
|
291
|
+
|
|
292
|
+
For each bypass:
|
|
293
|
+
1. Identify the disabled rule(s)
|
|
294
|
+
2. Understand WHY it was disabled (type issue? legacy code? third-party types?)
|
|
295
|
+
3. Determine the proper fix (type narrowing, interface update, refactor, etc.)
|
|
296
|
+
|
|
297
|
+
Output a refactor plan:
|
|
298
|
+
- File: path
|
|
299
|
+
- Line: number
|
|
300
|
+
- Rule: disabled-rule-name
|
|
301
|
+
- Reason: why it exists
|
|
302
|
+
- Fix: specific refactor steps
|
|
303
|
+
- Effort: trivial / moderate / significant
|
|
304
|
+
- Risk: low / medium / high
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**7d. Present Refactor Summary**:
|
|
308
|
+
|
|
309
|
+
- Group by effort level (trivial fixes first)
|
|
310
|
+
- Flag high-risk items for user decision
|
|
311
|
+
- Create actionable items for future cleanup sprints
|
|
312
|
+
|
|
313
|
+
**Note**: This step is diagnostic. Actual refactoring happens in follow-up tasks, not during clean.
|