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