sequant 1.17.0 → 1.19.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 (75) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +14 -2
  3. package/dist/bin/cli.js +7 -0
  4. package/dist/marketplace/external_plugins/sequant/.claude-plugin/plugin.json +21 -0
  5. package/dist/marketplace/external_plugins/sequant/README.md +38 -0
  6. package/dist/marketplace/external_plugins/sequant/hooks/post-tool.sh +292 -0
  7. package/dist/marketplace/external_plugins/sequant/hooks/pre-tool.sh +463 -0
  8. package/dist/marketplace/external_plugins/sequant/skills/_shared/references/prompt-templates.md +350 -0
  9. package/dist/marketplace/external_plugins/sequant/skills/_shared/references/subagent-types.md +131 -0
  10. package/dist/marketplace/external_plugins/sequant/skills/assess/SKILL.md +474 -0
  11. package/dist/marketplace/external_plugins/sequant/skills/clean/SKILL.md +211 -0
  12. package/dist/marketplace/external_plugins/sequant/skills/docs/SKILL.md +337 -0
  13. package/dist/marketplace/external_plugins/sequant/skills/exec/SKILL.md +807 -0
  14. package/dist/marketplace/external_plugins/sequant/skills/fullsolve/SKILL.md +678 -0
  15. package/dist/marketplace/external_plugins/sequant/skills/improve/SKILL.md +668 -0
  16. package/dist/marketplace/external_plugins/sequant/skills/loop/SKILL.md +374 -0
  17. package/dist/marketplace/external_plugins/sequant/skills/qa/SKILL.md +570 -0
  18. package/dist/marketplace/external_plugins/sequant/skills/qa/references/code-quality-exemplars.md +107 -0
  19. package/dist/marketplace/external_plugins/sequant/skills/qa/references/code-review-checklist.md +65 -0
  20. package/dist/marketplace/external_plugins/sequant/skills/qa/references/quality-gates.md +179 -0
  21. package/dist/marketplace/external_plugins/sequant/skills/qa/references/semgrep-rules.md +207 -0
  22. package/dist/marketplace/external_plugins/sequant/skills/qa/references/testing-requirements.md +109 -0
  23. package/dist/marketplace/external_plugins/sequant/skills/qa/scripts/quality-checks.sh +622 -0
  24. package/dist/marketplace/external_plugins/sequant/skills/reflect/SKILL.md +175 -0
  25. package/dist/marketplace/external_plugins/sequant/skills/reflect/references/documentation-tiers.md +70 -0
  26. package/dist/marketplace/external_plugins/sequant/skills/reflect/references/phase-reflection.md +95 -0
  27. package/dist/marketplace/external_plugins/sequant/skills/security-review/SKILL.md +358 -0
  28. package/dist/marketplace/external_plugins/sequant/skills/security-review/references/security-checklists.md +432 -0
  29. package/dist/marketplace/external_plugins/sequant/skills/solve/SKILL.md +697 -0
  30. package/dist/marketplace/external_plugins/sequant/skills/spec/SKILL.md +754 -0
  31. package/dist/marketplace/external_plugins/sequant/skills/spec/references/parallel-groups.md +72 -0
  32. package/dist/marketplace/external_plugins/sequant/skills/spec/references/recommended-workflow.md +92 -0
  33. package/dist/marketplace/external_plugins/sequant/skills/spec/references/verification-criteria.md +104 -0
  34. package/dist/marketplace/external_plugins/sequant/skills/test/SKILL.md +600 -0
  35. package/dist/marketplace/external_plugins/sequant/skills/testgen/SKILL.md +576 -0
  36. package/dist/marketplace/external_plugins/sequant/skills/verify/SKILL.md +281 -0
  37. package/dist/src/commands/conventions.d.ts +9 -0
  38. package/dist/src/commands/conventions.js +61 -0
  39. package/dist/src/commands/init.js +12 -0
  40. package/dist/src/commands/run.d.ts +13 -280
  41. package/dist/src/commands/run.js +23 -1956
  42. package/dist/src/commands/sync.js +3 -0
  43. package/dist/src/commands/update.js +3 -0
  44. package/dist/src/lib/conventions-detector.d.ts +62 -0
  45. package/dist/src/lib/conventions-detector.js +510 -0
  46. package/dist/src/lib/plugin-version-sync.d.ts +2 -1
  47. package/dist/src/lib/plugin-version-sync.js +28 -7
  48. package/dist/src/lib/settings.d.ts +8 -0
  49. package/dist/src/lib/settings.js +1 -0
  50. package/dist/src/lib/solve-comment-parser.d.ts +26 -0
  51. package/dist/src/lib/solve-comment-parser.js +63 -7
  52. package/dist/src/lib/stacks.d.ts +4 -2
  53. package/dist/src/lib/stacks.js +43 -3
  54. package/dist/src/lib/workflow/batch-executor.d.ts +117 -0
  55. package/dist/src/lib/workflow/batch-executor.js +574 -0
  56. package/dist/src/lib/workflow/phase-executor.d.ts +40 -0
  57. package/dist/src/lib/workflow/phase-executor.js +381 -0
  58. package/dist/src/lib/workflow/phase-mapper.d.ts +65 -0
  59. package/dist/src/lib/workflow/phase-mapper.js +147 -0
  60. package/dist/src/lib/workflow/pr-operations.d.ts +86 -0
  61. package/dist/src/lib/workflow/pr-operations.js +326 -0
  62. package/dist/src/lib/workflow/pr-status.d.ts +9 -7
  63. package/dist/src/lib/workflow/pr-status.js +13 -11
  64. package/dist/src/lib/workflow/run-summary.d.ts +36 -0
  65. package/dist/src/lib/workflow/run-summary.js +142 -0
  66. package/dist/src/lib/workflow/state-schema.d.ts +5 -5
  67. package/dist/src/lib/workflow/worktree-manager.d.ts +205 -0
  68. package/dist/src/lib/workflow/worktree-manager.js +918 -0
  69. package/package.json +3 -1
  70. package/templates/skills/exec/SKILL.md +1086 -29
  71. package/templates/skills/fullsolve/SKILL.md +11 -1
  72. package/templates/skills/qa/SKILL.md +1758 -142
  73. package/templates/skills/solve/SKILL.md +86 -0
  74. package/templates/skills/spec/SKILL.md +53 -0
  75. package/templates/skills/test/SKILL.md +256 -1
@@ -0,0 +1,474 @@
1
+ ---
2
+ name: assess
3
+ description: "Issue triage and status assessment - analyze current state and recommend next workflow phase."
4
+ license: MIT
5
+ metadata:
6
+ author: sequant
7
+ version: "1.0"
8
+ allowed-tools:
9
+ - Read
10
+ - Glob
11
+ - Grep
12
+ - Bash(git *)
13
+ - Bash(gh *)
14
+ ---
15
+
16
+ # Issue Assessment & Triage
17
+
18
+ You are the "Assessment Agent" for the current repository.
19
+
20
+ ## Purpose
21
+
22
+ When invoked as `/assess`, your job is to:
23
+
24
+ 1. Analyze the current state of a GitHub issue
25
+ 2. Determine what phase it's in (planning, implementation, QA, complete, blocked)
26
+ 3. Detect what artifacts exist (plan comments, branches, PRs, worktrees)
27
+ 4. Identify blockers, missing information, or staleness
28
+ 5. Show AC coverage status if applicable
29
+ 6. **Recommend** the next appropriate slash command (but don't execute it)
30
+
31
+ ## Behavior
32
+
33
+ Invocation:
34
+
35
+ - `/assess 123`:
36
+ - Treat `123` as the GitHub issue number
37
+ - Fetch issue details, comments, and related artifacts
38
+ - `/assess <description>`:
39
+ - Treat the text as context about what to assess
40
+
41
+ ### When to Use This Command
42
+
43
+ **Good use cases:**
44
+ - Picking up an unfamiliar issue ("What's the status of #147?")
45
+ - Resuming work after days/weeks away ("Where did I leave off?")
46
+ - Handoff scenarios ("What did the previous dev complete?")
47
+ - Daily triage ("Which issues are ready for next steps?")
48
+ - Debugging stalled issues ("Why isn't this progressing?")
49
+
50
+ **Not needed for:**
51
+ - Active work on an issue you just touched (you know the state)
52
+ - Simple "implement this feature" requests (just use `/spec` → `/exec`)
53
+ - Issues where the next step is obvious
54
+
55
+ ## Assessment Process
56
+
57
+ ### 1. Issue Context Gathering
58
+
59
+ Collect information about the issue:
60
+
61
+ **From GitHub:**
62
+
63
+ - Issue title, body, labels, status
64
+ - Acceptance Criteria (explicit or inferred)
65
+ - **All comments** (read every comment to gather complete context):
66
+ - Look for plan drafts, progress updates, QA reviews
67
+ - Comments often contain clarifications, updates, or additional AC added after the initial issue description
68
+ - Review discussion about implementation details, edge cases, or requirements mentioned in comments
69
+ - Check for feedback from previous review cycles or iterations
70
+ - Last activity timestamp
71
+ - Assigned developer(s)
72
+
73
+ **From Git:**
74
+ - Check if branch exists: `git branch -a | grep <issue-number>`
75
+ - Check if worktree exists: `git worktree list | grep <issue-number>`
76
+ - Check for related PRs: `gh pr list --search "in:title <issue-number>"`
77
+ - If branch exists, check commit history: `git log --oneline feature/<issue-number>*`
78
+
79
+ **From Codebase:**
80
+
81
+ - Look for TODOs mentioning the issue using the Grep tool: `Grep(pattern="TODO.*#<issue-number>")`
82
+ - Check for test files related to the feature
83
+ - Identify modified files (if branch exists)
84
+
85
+ ### 2. Phase Detection
86
+
87
+ Determine the current phase:
88
+
89
+ **Planning Phase** - Issue needs a plan:
90
+
91
+ - No plan comment exists
92
+ - AC are unclear or missing
93
+ - No technical approach documented
94
+ - **Indicators:** Issue just opened, labeled "needs planning", no detailed comments
95
+
96
+ **Implementation Phase** - Issue is being coded:
97
+
98
+ - Plan exists (in comments or inferred)
99
+ - Branch/worktree exists with commits
100
+ - Some AC partially met
101
+ - **Indicators:** Branch exists, recent commits, labeled "in progress"
102
+
103
+ **QA Phase** - Implementation complete, needs review:
104
+ - Branch has commits
105
+ - Developer claims implementation complete
106
+ - No QA review exists yet
107
+ - **Indicators:** PR open, labeled "ready for review", implementation comment exists
108
+
109
+ **Blocked Phase** - Issue is stuck:
110
+ - No activity for 7+ days
111
+ - Open questions in comments
112
+ - Dependency on another issue
113
+ - **Indicators:** Labeled "blocked", comments mention blockers, stale
114
+
115
+ **Complete Phase** - Issue is done:
116
+ - PR merged
117
+ - AC all met (based on QA review)
118
+ - Issue closed
119
+ - **Indicators:** Closed, PR merged, labeled "completed"
120
+
121
+ **Unclear Phase** - Can't determine state:
122
+ - Insufficient information
123
+ - Conflicting indicators
124
+ - **Action:** Request clarification
125
+
126
+ ### 3. Artifact Detection
127
+
128
+ List what exists:
129
+
130
+ **Planning Artifacts:**
131
+ - [ ] AC checklist in issue or comments
132
+ - [ ] Implementation plan (phases/steps)
133
+ - [ ] Architecture decisions documented
134
+ - [ ] Open questions identified
135
+
136
+ **Implementation Artifacts:**
137
+ - [ ] Feature branch: `feature/<issue-number>-<slug>`
138
+ - [ ] Worktree: `../worktrees/feature/<branch-name>/`
139
+ - [ ] Commits on branch: X commits since branching
140
+ - [ ] Modified files: [list key files]
141
+ - [ ] Tests written: [test file paths]
142
+
143
+ **QA Artifacts:**
144
+ - [ ] PR open: #<pr-number>
145
+ - [ ] QA review comment exists
146
+ - [ ] Test results: [passing/failing]
147
+ - [ ] Build status: [passing/failing]
148
+
149
+ **Blockers/Issues:**
150
+ - [ ] Open questions in comments
151
+ - [ ] Failed tests or build
152
+ - [ ] Dependency on issue #<other-issue>
153
+ - [ ] Missing resources or access
154
+ - [ ] Stale (no activity in X days)
155
+
156
+ ### 4. AC Coverage Analysis
157
+
158
+ If AC exist, assess coverage:
159
+
160
+ **For each AC item:**
161
+ - `MET` - Evidence suggests complete
162
+ - `IN_PROGRESS` - Partially implemented
163
+ - `NOT_STARTED` - No evidence of work
164
+ - `UNCLEAR` - Can't determine from available info
165
+
166
+ **Example:**
167
+ ```
168
+ AC Coverage:
169
+ - AC-1: Display fact-check queue in admin panel - MET
170
+ - AC-2: Allow editors to approve/reject items - IN_PROGRESS
171
+ - AC-3: Send email notifications on approval - NOT_STARTED
172
+ - AC-4: Log all actions in audit log - UNCLEAR (no audit log visible)
173
+
174
+ Coverage: 1/4 complete, 1/4 in progress, 1/4 not started, 1/4 unclear
175
+ ```
176
+
177
+ ### 5. Staleness Check
178
+
179
+ Flag if issue is stale:
180
+
181
+ - **Fresh:** Activity within 3 days
182
+ - **Aging:** 3-7 days since last activity
183
+ - **Stale:** 7-14 days since last activity
184
+ - **Abandoned:** 14+ days since last activity
185
+
186
+ For stale/abandoned issues, identify:
187
+ - Last actor (who touched it last)
188
+ - Last action type (commit, comment, label change)
189
+ - Likely cause of staleness (blocked, low priority, forgotten)
190
+
191
+ ## Output Structure
192
+
193
+ Produce a structured assessment:
194
+
195
+ ### Issue Summary
196
+ - **Issue:** #123 - <title>
197
+ - **Status:** <Open|Closed> | <labels>
198
+ - **Last Activity:** X days ago (<timestamp>)
199
+ - **Phase:** <Planning|Implementation|QA|Blocked|Complete|Unclear>
200
+
201
+ ### Acceptance Criteria
202
+ - AC-1: ... [MET|IN_PROGRESS|NOT_STARTED|UNCLEAR]
203
+ - AC-2: ... [MET|IN_PROGRESS|NOT_STARTED|UNCLEAR]
204
+ - ...
205
+ - **Coverage:** X/Y complete
206
+
207
+ (If AC don't exist or are unclear, note: "AC not clearly defined")
208
+
209
+ ### Artifacts Found
210
+ **Planning:**
211
+ - [x] Plan comment in issue #<comment-id>
212
+ - [ ] Architecture decisions documented
213
+
214
+ **Implementation:**
215
+ - [x] Branch: `feature/123-issue-slug` (5 commits)
216
+ - [x] Worktree: `../worktrees/feature/123-issue-slug/`
217
+ - [x] Modified files: `components/admin/FactCheckQueue.tsx`, `lib/queries/fact-checks.ts`
218
+ - [ ] Tests written
219
+
220
+ **QA:**
221
+ - [ ] PR open
222
+ - [ ] QA review complete
223
+
224
+ ### Blockers & Issues
225
+ - [ ] None identified
226
+ - [x] Stale (10 days since last commit)
227
+ - [x] Missing tests
228
+ - [ ] Depends on issue #<other>
229
+
230
+ ### Label Review
231
+
232
+ Analyze current labels vs issue content and suggest updates when mismatches are detected:
233
+
234
+ **Current Labels:** `enhancement`, `admin`
235
+ **Suggested Labels:** `enhancement`, `admin`, `refactor`
236
+ **Reason:** Issue body mentions structural changes across multiple files
237
+ **Quality Loop Impact:** Will auto-enable due to `refactor` label
238
+
239
+ **Suggested Action:**
240
+ ```bash
241
+ gh issue edit <N> --add-label refactor
242
+ ```
243
+
244
+ **Label Detection Hints:**
245
+ - `refactor` - Keywords: "refactor", "restructure", "reorganize", "cleanup", "migration"
246
+ - `complex` - Keywords: "complex", "major", "large-scale", "breaking"
247
+ - `ui`/`frontend` - Keywords: "component", "UI", "page", "form", "button", "modal"
248
+ - `backend` - Keywords: "API", "database", "query", "server", "endpoint"
249
+ - `cli` - Keywords: "command", "CLI", "script", "terminal"
250
+ - `docs` - Keywords: "documentation", "README", "guide", "tutorial"
251
+ - `security` - Keywords: "auth", "permission", "vulnerability", "secret", "token"
252
+ - `bug` - Keywords: "fix", "broken", "error", "crash", "doesn't work"
253
+
254
+ **When to Suggest Label Updates:**
255
+ - Issue body contains keywords not reflected in current labels
256
+ - Complexity dropdown selection doesn't match actual labels
257
+ - Quality loop would benefit from additional labels (complex/refactor/breaking)
258
+ - Area dropdown selection doesn't match current labels (ui/backend/cli/docs)
259
+
260
+ ### Recommendation
261
+
262
+ Based on the assessment, recommend one of:
263
+
264
+ **If Phase = Planning:**
265
+ ```
266
+ RECOMMENDATION: Run `/spec 123`
267
+ - Issue needs a clear plan and AC before implementation
268
+ - This will establish AC checklist and technical approach
269
+ ```
270
+
271
+ **If Phase = Implementation (not started):**
272
+ ```
273
+ RECOMMENDATION: Run `/exec 123`
274
+ - Plan exists and AC are clear
275
+ - Ready to begin implementation
276
+ - This will create feature worktree and start coding
277
+ ```
278
+
279
+ **If Phase = Implementation (in progress):**
280
+ ```
281
+ RECOMMENDATION: Continue `/exec 123`
282
+ - Implementation is underway (5 commits on branch)
283
+ - Worktree exists at: ../worktrees/feature/123-issue-slug/
284
+ - AC coverage: 1/4 complete, 2/4 in progress
285
+ - Navigate to worktree and continue implementation
286
+ ```
287
+
288
+ **If Phase = QA:**
289
+ ```
290
+ RECOMMENDATION: Run `/qa 123`
291
+ - Implementation appears complete
292
+ - Branch has 12 commits, last commit 2 days ago
293
+ - No QA review exists yet
294
+ - Review code and validate against AC
295
+ ```
296
+
297
+ **If Phase = Blocked:**
298
+ ```
299
+ RECOMMENDATION: Resolve blockers first
300
+ - Issue depends on #145 (not yet merged)
301
+ - Open question in comments: "Should we use email or in-app notifications?"
302
+ - Suggest: Review #145 status, clarify notification approach with team
303
+ - Once unblocked, run `/exec 123` to continue
304
+ ```
305
+
306
+ **If Phase = Complete:**
307
+ ```
308
+ RECOMMENDATION: No action needed
309
+ - PR #156 merged 3 days ago
310
+ - All AC met (per QA review)
311
+ - Issue can be closed
312
+ ```
313
+
314
+ **If Phase = Unclear:**
315
+ ```
316
+ RECOMMENDATION: Gather more information
317
+ - Unable to determine current state
318
+ - Missing information: [list what's unclear]
319
+ - Suggest: Review issue comments, check with team, or run `/spec 123` to establish baseline
320
+ ```
321
+
322
+ ### Context for Next Command
323
+
324
+ Provide relevant context to help the next command:
325
+
326
+ **Key Files to Review:**
327
+ - List the main components/files involved
328
+ - Point to relevant data layer code
329
+ - Reference architecture documentation if exists
330
+
331
+ **Similar Patterns:**
332
+ - Reference similar features in the codebase
333
+ - Point to reusable patterns
334
+
335
+ **Potential Risks:**
336
+ - Identify any error handling gaps
337
+ - Note external integrations not yet tested
338
+ - Flag potential database migrations needed
339
+
340
+ ## Examples
341
+
342
+ ### Example 1: Fresh Issue Needs Planning
343
+
344
+ ```
345
+ Issue Summary
346
+ - Issue: #147 - Add fact-check queue to admin panel
347
+ - Status: Open | needs-planning, admin
348
+ - Last Activity: 2 hours ago
349
+ - Phase: Planning
350
+
351
+ Acceptance Criteria
352
+ AC not clearly defined in issue
353
+ Inferred AC from description:
354
+ - Display pending fact-check items in queue
355
+ - Allow approval/rejection actions
356
+ - Send notifications on status change
357
+
358
+ Artifacts Found
359
+ Planning: None
360
+ Implementation: None
361
+ QA: None
362
+
363
+ Blockers & Issues
364
+ - [ ] No blockers
365
+
366
+ Recommendation
367
+ RECOMMENDATION: Run `/spec 147`
368
+ - Issue is fresh but lacks detailed AC and plan
369
+ - Need to establish clear requirements before implementation
370
+ ```
371
+
372
+ ### Example 2: Implementation In Progress, Stale
373
+
374
+ ```
375
+ Issue Summary
376
+ - Issue: #145 - Fix data validation edge cases
377
+ - Status: Open | in-progress, bug
378
+ - Last Activity: 10 days ago
379
+ - Phase: Implementation (Stale)
380
+
381
+ Acceptance Criteria
382
+ - AC-1: Handle basic validation - MET
383
+ - AC-2: Handle edge cases (empty, null, special chars) - IN_PROGRESS
384
+ - AC-3: Add validation tests - NOT_STARTED
385
+ Coverage: 1/3 complete
386
+
387
+ Artifacts Found
388
+ Implementation:
389
+ - [x] Branch: feature/145-validation-fixes (3 commits)
390
+ - [x] Worktree: ../worktrees/feature/145-validation-fixes/
391
+ - [x] Modified: lib/utils/validation.ts
392
+ - [ ] Tests not found
393
+
394
+ Blockers & Issues
395
+ - [x] Stale (10 days since last commit)
396
+ - [x] Missing tests
397
+ - [ ] No known blockers
398
+
399
+ Recommendation
400
+ RECOMMENDATION: Resume `/exec 145`
401
+ - Implementation is 1/3 complete but stale
402
+ - Worktree still exists, resume work there
403
+ - Focus on AC-2 (edge cases) and AC-3 (tests)
404
+ - Add tests before considering complete
405
+ ```
406
+
407
+ ### Example 3: Ready for QA
408
+
409
+ ```
410
+ Issue Summary
411
+ - Issue: #148 - Add bulk publishing to content updates
412
+ - Status: Open | ready-for-review
413
+ - Last Activity: 1 day ago
414
+ - Phase: QA
415
+
416
+ Acceptance Criteria
417
+ - AC-1: Multi-select in content updates list - UNCLEAR
418
+ - AC-2: Bulk publish action button - UNCLEAR
419
+ - AC-3: Confirmation dialog - UNCLEAR
420
+ - AC-4: Success/error feedback - UNCLEAR
421
+ Coverage: Unclear (need QA review to validate)
422
+
423
+ Artifacts Found
424
+ Implementation:
425
+ - [x] Branch: feature/148-bulk-publishing (15 commits)
426
+ - [x] Modified: components/admin/news/ContentUpdatesList.tsx, lib/admin/bulk-actions.ts
427
+ - [x] Tests: __tests__/bulk-publishing.test.ts
428
+ QA:
429
+ - [ ] No PR yet
430
+ - [ ] No QA review
431
+
432
+ Blockers & Issues
433
+ - [ ] No blockers
434
+ - Developer marked as "ready for review" in last comment
435
+
436
+ Recommendation
437
+ RECOMMENDATION: Run `/qa 148`
438
+ - Implementation appears complete (15 commits, tests added)
439
+ - Developer believes AC are met
440
+ - Need QA review to validate and assess A+ status
441
+ - Create PR if not exists, review code and test against AC
442
+ ```
443
+
444
+ ## Meta-Assessment
445
+
446
+ After providing the assessment, briefly note:
447
+
448
+ - **Confidence Level:** How certain are you about the phase detection? (High/Medium/Low)
449
+ - **Information Gaps:** What information would improve this assessment?
450
+ - **Alternative Interpretations:** Are there other ways to interpret the current state?
451
+
452
+ ## Notes
453
+
454
+ - This command is **read-only** - it analyzes but doesn't make changes
455
+ - It recommends but doesn't execute the next command
456
+ - Keep the assessment concise - aim for clarity, not exhaustiveness
457
+ - When in doubt about phase, say so - better to acknowledge uncertainty
458
+ - Use this to orient yourself, then proceed with the appropriate workflow command
459
+
460
+ ---
461
+
462
+ ## Output Verification
463
+
464
+ **Before responding, verify your output includes ALL of these:**
465
+
466
+ - [ ] **Issue Summary** - Issue number, title, status, last activity, phase
467
+ - [ ] **AC Coverage** - Each AC marked MET/IN_PROGRESS/NOT_STARTED/UNCLEAR
468
+ - [ ] **Artifacts Found** - Planning, implementation, and QA artifacts listed
469
+ - [ ] **Blockers & Issues** - Any blockers or staleness identified
470
+ - [ ] **Label Review** - Current vs suggested labels based on issue content analysis
471
+ - [ ] **Recommendation** - Specific next command to run with rationale
472
+ - [ ] **Confidence Level** - High/Medium/Low with information gaps noted
473
+
474
+ **DO NOT respond until all items are verified.**
@@ -0,0 +1,211 @@
1
+ ---
2
+ name: clean
3
+ description: "Repository Cleanup Command"
4
+ license: MIT
5
+ metadata:
6
+ author: sequant
7
+ version: "1.0"
8
+ allowed-tools:
9
+ - Bash(git branch:*)
10
+ - Bash(git status:*)
11
+ - Bash(git stash:*)
12
+ - Bash(git checkout:*)
13
+ - Bash(git clean:*)
14
+ - Bash(git add:*)
15
+ - Bash(git commit:*)
16
+ - Bash(git push:*)
17
+ - Bash(npm run build:*)
18
+ - Bash(npm run lint:*)
19
+ - Bash(ls:*)
20
+ - Bash(mv:*)
21
+ - Bash(mkdir:*)
22
+ - Bash(rm:*)
23
+ - Bash(find:*)
24
+ - Read
25
+ - Write
26
+ - Glob
27
+ - Grep
28
+ ---
29
+
30
+ # Repository Cleanup Command
31
+
32
+ Comprehensive, safe repository cleanup that archives stale files, removes artifacts, and commits changes.
33
+
34
+ ## Safety First
35
+
36
+ Before making ANY changes:
37
+ 1. Verify we're on `main` branch with clean working tree
38
+ 2. Run `npm run build` to ensure current state builds
39
+ 3. Create a safety checkpoint (stash any uncommitted work)
40
+
41
+ ## Cleanup Categories
42
+
43
+ ### Category 1: Safe to Auto-Archive (No Review Needed)
44
+
45
+ These files are always safe to archive - they're historical artifacts:
46
+
47
+ **Root directory patterns:**
48
+ - `*.backup` files (e.g., `CLAUDE.md.backup`)
49
+ - `CODE_REVIEW_PR_*.md` - Old PR reviews
50
+ - `*_AUDIT.md` files older than 30 days
51
+ - One-off shell scripts with dates in names
52
+
53
+ **docs/ patterns:**
54
+ - `ISSUE_*_PHASE_*.md` - Issue implementation specs (work is done)
55
+ - `*_IMPLEMENTATION.md` older than 30 days
56
+ - `content-audit-*.md` - Point-in-time audits
57
+ - City-specific audit files (e.g., `NYC_*_AUDIT.md`, `LA_*_REPORT.md`)
58
+
59
+ ### Category 2: Review Before Archiving
60
+
61
+ These need a quick check - might still be referenced:
62
+ - Files in `migrations/` (check if applied to database)
63
+ - `context/` directory contents
64
+ - Any `APPLY_*.md` or `apply-*.sh` files
65
+
66
+ ### Category 3: Always Keep
67
+
68
+ Never archive these:
69
+ - `CLAUDE.md` - Active project instructions
70
+ - `README.md` - Project readme
71
+ - `docs/WORKFLOW_COMMANDS.md` - Active workflow docs
72
+ - `docs/patterns/*` - Active pattern catalog
73
+ - `docs/CONTENT_STANDARDS.md` - Active standards
74
+ - Any file modified in the last 7 days
75
+
76
+ ## Archive Structure
77
+
78
+ ```
79
+ scripts/archive/
80
+ ├── one-off-migrations/ # Shell scripts for one-time tasks
81
+ ├── adhoc-migrations/ # SQL files applied manually (not via migrations tool)
82
+ └── deprecated/ # Old/replaced scripts
83
+
84
+ docs/archive/
85
+ ├── audits/ # Completed audits and reviews
86
+ ├── issue-specs/ # GitHub issue implementation specs
87
+ ├── implementation-reports/ # Feature implementation summaries
88
+ └── context/ # Old project context files
89
+ ```
90
+
91
+ ## Execution Steps
92
+
93
+ ### Step 1: Pre-flight Checks
94
+ ```bash
95
+ # Verify branch and status
96
+ git branch --show-current # Must be 'main'
97
+ git status --porcelain # Should be empty or only untracked
98
+
99
+ # Verify build works
100
+ npm run build
101
+ ```
102
+
103
+ If build fails or we're not on main with clean tree, STOP and report.
104
+
105
+ ### Step 2: Identify Cleanup Candidates
106
+
107
+ Scan for files matching Category 1 and 2 patterns. Create a manifest of what will be archived.
108
+
109
+ Report to user:
110
+ - Files to auto-archive (Category 1)
111
+ - Files needing review (Category 2)
112
+ - Total space to be reclaimed
113
+
114
+ ### Step 3: Execute Cleanup
115
+
116
+ 1. Create archive directories if needed
117
+ 2. Move Category 1 files to appropriate archive locations
118
+ 3. Move Category 2 files (after user confirmation via manifest)
119
+ 4. Remove artifacts:
120
+ - `.DS_Store` files (except in node_modules)
121
+ - Empty directories (except .git, node_modules, .next)
122
+ 5. Update `docs/archive/README.md` with current date
123
+
124
+ ### Step 4: Verification
125
+
126
+ ```bash
127
+ # Verify build still works
128
+ npm run build
129
+
130
+ # Verify no breaking imports
131
+ npm run lint
132
+ ```
133
+
134
+ If either fails, ROLLBACK all changes immediately.
135
+
136
+ ### Step 5: Commit and Push
137
+
138
+ ```bash
139
+ # Stage all changes
140
+ git add -A
141
+
142
+ # Create descriptive commit
143
+ git commit -m "chore: repository cleanup $(date +%Y-%m-%d)
144
+
145
+ Archived:
146
+ - [X] old issue specs
147
+ - [X] completed audits
148
+ - [X] one-off migration scripts
149
+ - [X] stale documentation
150
+
151
+ Build verified: passing"
152
+
153
+ # Push to origin
154
+ git push origin main
155
+ ```
156
+
157
+ ## Rollback Procedure
158
+
159
+ If anything goes wrong:
160
+ ```bash
161
+ git checkout -- .
162
+ git clean -fd
163
+ ```
164
+
165
+ ## Output Format
166
+
167
+ Report final summary:
168
+ ```
169
+ Repository Cleanup Complete
170
+
171
+ Archived:
172
+ - X files from root directory
173
+ - X files from docs/
174
+ - X migration scripts
175
+
176
+ Removed:
177
+ - X .DS_Store files
178
+ - X empty directories
179
+
180
+ Commit: [hash] pushed to origin/main
181
+
182
+ Next cleanup recommended: [date + 30 days]
183
+ ```
184
+
185
+ ## Usage Notes
186
+
187
+ - Run monthly or when repo feels cluttered
188
+ - Safe to run multiple times (idempotent)
189
+ - Will not touch files modified in last 7 days
190
+ - Always verifies build before and after
191
+
192
+ ---
193
+
194
+ ## BEGIN EXECUTION
195
+
196
+ Execute the cleanup following the steps above. Be thorough but safe - when in doubt, skip a file rather than risk breaking something.
197
+
198
+ ---
199
+
200
+ ## Output Verification
201
+
202
+ **Before responding, verify your output includes ALL of these:**
203
+
204
+ - [ ] **Pre-flight Results** - Branch check, build verification passed
205
+ - [ ] **Cleanup Manifest** - List of files to be archived/removed
206
+ - [ ] **Archive Summary** - Count of files archived by category
207
+ - [ ] **Build Verification** - Post-cleanup build/lint passed
208
+ - [ ] **Commit Details** - Commit hash and push confirmation
209
+ - [ ] **Next Cleanup Date** - Recommended date for next cleanup
210
+
211
+ **DO NOT respond until all items are verified.**