@kennethsolomon/shipkit 3.10.1 → 3.11.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 (57) hide show
  1. package/README.md +121 -49
  2. package/commands/sk/autopilot.md +2 -2
  3. package/commands/sk/context-budget.md +5 -0
  4. package/commands/sk/eval.md +5 -0
  5. package/commands/sk/health.md +5 -0
  6. package/commands/sk/help.md +32 -8
  7. package/commands/sk/learn.md +5 -0
  8. package/commands/sk/resume-session.md +5 -0
  9. package/commands/sk/safety-guard.md +5 -0
  10. package/commands/sk/save-session.md +5 -0
  11. package/commands/sk/security-check.md +2 -2
  12. package/commands/sk/set-profile.md +8 -0
  13. package/commands/sk/status.md +4 -9
  14. package/package.json +1 -1
  15. package/skills/sk:accessibility/SKILL.md +10 -1
  16. package/skills/sk:autopilot/SKILL.md +26 -45
  17. package/skills/sk:brainstorming/SKILL.md +13 -0
  18. package/skills/sk:context/SKILL.md +11 -15
  19. package/skills/sk:context-budget/SKILL.md +126 -0
  20. package/skills/sk:dashboard/SKILL.md +3 -4
  21. package/skills/sk:dashboard/server.js +0 -65
  22. package/skills/sk:e2e/SKILL.md +3 -3
  23. package/skills/sk:eval/SKILL.md +188 -0
  24. package/skills/sk:fast-track/SKILL.md +0 -9
  25. package/skills/sk:frontend-design/SKILL.md +232 -0
  26. package/skills/sk:gates/SKILL.md +2 -3
  27. package/skills/sk:health/SKILL.md +146 -0
  28. package/skills/sk:learn/SKILL.md +138 -0
  29. package/skills/sk:lint/SKILL.md +3 -3
  30. package/skills/sk:perf/SKILL.md +3 -3
  31. package/skills/sk:resume-session/SKILL.md +95 -0
  32. package/skills/sk:retro/SKILL.md +1 -2
  33. package/skills/sk:review/SKILL.md +2 -2
  34. package/skills/sk:safety-guard/SKILL.md +134 -0
  35. package/skills/sk:save-session/SKILL.md +84 -0
  36. package/skills/sk:setup-claude/SKILL.md +40 -4
  37. package/skills/sk:setup-claude/scripts/__pycache__/apply_setup_claude.cpython-314.pyc +0 -0
  38. package/skills/sk:setup-claude/scripts/apply_setup_claude.py +0 -1
  39. package/skills/sk:setup-claude/templates/.claude/settings.json.template +110 -26
  40. package/skills/sk:setup-claude/templates/.claude/statusline.sh +1 -15
  41. package/skills/sk:setup-claude/templates/CLAUDE.md.template +69 -138
  42. package/skills/sk:setup-claude/templates/commands/brainstorm.md.template +2 -13
  43. package/skills/sk:setup-claude/templates/hooks/config-protection.sh +71 -0
  44. package/skills/sk:setup-claude/templates/hooks/console-log-warning.sh +42 -0
  45. package/skills/sk:setup-claude/templates/hooks/cost-tracker.sh +26 -0
  46. package/skills/sk:setup-claude/templates/hooks/post-edit-format.sh +53 -0
  47. package/skills/sk:setup-claude/templates/hooks/pre-compact.sh +1 -12
  48. package/skills/sk:setup-claude/templates/hooks/safety-guard.sh +72 -0
  49. package/skills/sk:setup-claude/templates/hooks/session-start.sh +0 -11
  50. package/skills/sk:setup-claude/templates/hooks/session-stop.sh +0 -7
  51. package/skills/sk:setup-claude/templates/hooks/suggest-compact.sh +35 -0
  52. package/skills/sk:setup-claude/tests/__pycache__/test_apply_setup_claude.cpython-314.pyc +0 -0
  53. package/skills/sk:setup-claude/tests/test_apply_setup_claude.py +2 -33
  54. package/skills/sk:setup-optimizer/SKILL.md +68 -15
  55. package/skills/sk:start/SKILL.md +34 -11
  56. package/skills/sk:test/SKILL.md +3 -3
  57. package/skills/sk:setup-claude/templates/tasks/workflow-status.md.template +0 -28
@@ -34,115 +34,65 @@
34
34
  ## Workflow — Follow This Order
35
35
  <!-- LOCK -->
36
36
 
37
- **Flow:** Read → Explore → Design → Accessibility → Plan → Branch → Migrate → Write Tests Implement → LintVerify Tests Security → Performance → Review → E2E Tests → Finish → Sync Features
38
-
39
- Progress is tracked in `tasks/workflow-status.md`. This file persists across conversations.
40
-
41
- | # | Step | Command | Type | Loop? |
42
- |---|------|---------|------|-------|
43
- | 1 | Read Todo | read `tasks/todo.md` | required | no |
44
- | 2 | Read Lessons | read `tasks/lessons.md` | required | no |
45
- | 3 | Explore | `/sk:brainstorm` | required | no |
46
- | 4 | Design | `/sk:frontend-design` or `/sk:api-design` | optional (confirm to skip) | no |
47
- | 5 | Accessibility | `/sk:accessibility` | optional (confirm to skip) | no |
48
- | 6 | Plan | `/sk:write-plan` | required | no |
49
- | 7 | Branch | `/sk:branch` | required | no |
50
- | 8 | Migrate | `/sk:schema-migrate` | optional (confirm to skip) | no |
51
- | 9 | Write Tests | `/sk:write-tests` | required | no |
52
- | 10 | Implement | `/sk:execute-plan` | required | no |
53
- | 11 | Commit | `/sk:smart-commit` | required | no |
54
- | 12 | Lint + Dep Audit | `/sk:lint` | required | yes — must be clean |
55
- | 13 | Verify Tests | `/sk:test` | required | yes — 100% coverage required |
56
- | 14 | Security | `/sk:security-check` | required | yes — must reach 0 issues |
57
- | 15 | Performance | `/sk:perf` | optional (confirm to skip) | yes — loop until critical/high = 0 |
58
- | 16 | Review + Simplify | `/sk:review` | required | yes — must reach 0 issues |
59
- | 17 | E2E Tests | `/sk:e2e` | required | yes — all scenarios must pass |
60
- | 18 | Update | `/sk:update-task` | required | no |
61
- | 19 | Finalize | `/sk:finish-feature` | required | no |
62
- | 20 | Sync Features | `/sk:features` | required | no |
63
- | 21 | Release | `/sk:release` | optional (confirm to skip) | no |
37
+ **Flow:** Explore → Design → Plan → Branch → Write Tests + Implement → CommitGatesFinalize
38
+
39
+ Progress is tracked via git branch + `tasks/todo.md` checkboxes.
40
+
41
+ | # | Step | Command | Type |
42
+ |---|------|---------|------|
43
+ | 1 | Explore | `/sk:brainstorm` | required |
44
+ | 2 | Design | `/sk:frontend-design` or `/sk:api-design` | optional (auto-skip) |
45
+ | 3 | Plan | `/sk:write-plan` | required |
46
+ | 4 | Branch | `/sk:branch` | required |
47
+ | 5 | Write Tests + Implement | `/sk:write-tests` then `/sk:execute-plan` | required |
48
+ | 6 | Commit | `/sk:smart-commit` | required |
49
+ | 7 | Gates | `/sk:gates` | required (hard gate) |
50
+ | 8 | Finalize | `/sk:finish-feature` | required |
64
51
 
65
52
  ### Step Details
66
53
 
67
- 1. **Read** `tasks/todo.md` pick the next incomplete task
68
- 2. **Read** `tasks/lessons.md` — review past corrections before writing code
69
- 3. **Explore** — run `/sk:brainstorm` to clarify requirements, constraints, and approach. No code in this step.
70
- 4. **Design** — run `/sk:frontend-design` for UI mockup or `/sk:api-design` for API contracts. No code — design only. Skip if pure backend with no UI and no new API. After the design summary, the skill asks if you want a Pencil visual mockup — answer `y` only if you have the Pencil app open and Pencil MCP connected. Use `/sk:frontend-design --pencil` to jump directly to the Pencil phase.
71
- 5. **Accessibility** — run `/sk:accessibility` to audit the design spec for WCAG 2.1 AA compliance. Produces `tasks/accessibility-findings.md`. Skip if backend-only with no frontend.
72
- 6. **Plan** — run `/sk:write-plan` to write a decision-complete plan into `tasks/todo.md` using brainstorm + design outputs. No code in this step.
73
- 7. **Branch** — run `/sk:branch` to create a feature branch auto-named from the current task.
74
- 8. **Migrate** — run `/sk:schema-migrate` for database changes. Skip if no schema changes needed.
75
- 9. **Write Tests** — run `/sk:write-tests` (TDD red phase). Write failing tests for all planned code. If modifying existing behavior, update existing tests first. Tests SHOULD fail — no implementation yet.
76
- 10. **Implement** — run `/sk:execute-plan` to execute `tasks/todo.md` checkboxes in small batches, making the failing tests pass (TDD green phase). Log progress to `tasks/progress.md`.
77
- 11. **Commit** — run `/sk:smart-commit` to commit tests + implementation
78
- 12. **Lint + Dep Audit** — run `/sk:lint` — auto-detects and runs all project linters plus dependency vulnerability audits. Fix all issues immediately, then re-run until clean. Do not ask to re-run — fix and re-run automatically. Gates own their commits — commit any fixes before moving on.
79
- 13. **Verify Tests** — run `/sk:test` — auto-detects and runs all project test suites. **100% test coverage required.** Fix failures immediately, then re-run. Do not ask to re-run — fix and re-run automatically. Gates own their commits — commit any fixes before moving on.
80
- 14. **Security** — run `/sk:security-check`. Must reach 0 issues across all severities. Fix issues immediately, commit, then re-run. Loop until clean. Gates own their commits — commit any fixes before moving on.
81
- 15. **Performance** — run `/sk:perf` to audit for performance issues. Produces `tasks/perf-findings.md`. Fix critical/high findings, commit, then re-run. Loop until critical/high = 0. Skip if confirmed with user. Gates own their commits — commit any fixes before moving on.
82
- 16. **Review + Simplify** — run `/sk:review`. First runs a simplify pre-pass on changed files, then performs full multi-dimensional review. Must reach 0 issues including nitpicks. Fix issues immediately, commit, then re-run. Loop until clean. Gates own their commits — commit any fixes before moving on.
83
- 17. **E2E Tests** — run `/sk:e2e`. Verifies the complete, reviewed, secure implementation works end-to-end from a user's perspective using agent-browser. All scenarios must pass. Cannot be skipped. Gates own their commits — commit any fixes before moving on.
84
- 18. **Update** — run `/sk:update-task` to mark the task done in `tasks/todo.md` and log completion to `tasks/progress.md`.
85
- 19. **Finalize** — run `/sk:finish-feature` for changelog + PR
86
- 20. **Sync Features** — run `/sk:features` to sync `docs/sk:features/` specs with what was actually shipped.
87
- 21. **Release** — run `/sk:release` if deploying. Skip if not ready.
88
-
89
- ### Workflow Tracker Rules
90
-
91
- **These rules are mandatory for every step:**
92
-
93
- 1. **Read tracker first.** At the start of every step, read `tasks/workflow-status.md` to verify the current step. If the step being run does not match the `>> next <<` step, STOP and ask the user to confirm skipping the intervening steps.
94
-
95
- 2. **Update tracker after.** At the end of every step, update `tasks/workflow-status.md`:
96
- - Set the current step's Status to `done`, `skipped`, or `partial`
97
- - Add relevant Notes (e.g., "clean on attempt 2", "backend-only, no UI")
98
- - Move `>> next <<` to the next pending step
99
-
100
- 3. **Optional steps** (4, 5, 8, 15, 21): Ask the user "Skip [step]?" and require explicit confirmation. Record the reason in Notes.
101
-
102
- 4. **Auto-skip detection.** Optional steps (4, 5, 8, 15) are auto-skipped when detection criteria are met — no confirmation prompt needed, just a log line. Detection runs after the plan is written (step 6) by scanning `tasks/todo.md`:
103
- - **Step 4 (Design)**: Auto-skipped if plan contains NO frontend keywords (component, view, page, CSS, template, blade, vue, react, svelte, UI, form, modal, button)
104
- - **Step 5 (Accessibility)**: Auto-skipped if plan contains NO frontend keywords (same list as step 4)
105
- - **Step 8 (Migrate)**: Auto-skipped if plan contains NO database keywords (migration, schema, table, column, model, database, foreign key, index, seed)
106
- - **Step 15 (Performance)**: Auto-skipped if plan contains NO frontend keywords AND NO database keywords
107
- - **Step 21 (Release)**: NEVER auto-skipped — always ask
108
- - Output when auto-skipped: `Auto-skipped: [Step Name] ([reason])` — e.g., `Auto-skipped: Design (no frontend keywords detected in plan)`
109
-
110
- 5. **Gates own their commits.** Each hard gate (steps 12–17) is responsible for committing any fixes it produces before passing control to the next step. There are no separate conditional commit steps.
111
-
112
- 6. **Loop steps are HARD GATES** (12, 13, 14, 16, 17): These steps BLOCK all forward progress until they pass clean. Fix issues immediately and re-run. Do NOT ask the user to re-run — fix and re-run automatically. Track attempt number in Notes (e.g., "clean on attempt 3").
113
- - **Step 12 (Lint)**: All detected linting tools must pass — every single one.
114
- - **Step 13 (Verify Tests)**: All detected test suites (BE + FE) must pass with 100% coverage on new code.
115
- - **Step 14 (Security)**: 0 issues across all severities.
116
- - **Step 16 (Review)**: 0 issues including nitpicks.
117
- - **Step 17 (E2E Tests)**: All scenarios must pass. 0 failures allowed.
118
- - **Step 15 (Performance)**: Optional gate — if run, loop until critical/high findings = 0. Can be skipped with explicit confirmation.
119
- - **DO NOT mark these steps as `done` until every check passes.** If even one tool fails, the step is NOT done. Never proceed to the next step with errors remaining.
120
-
121
- 7. **Never skip steps without confirmation.** Steps cannot run out of order. Hard gate steps (12, 13, 14, 16, 17) can NEVER be skipped. Optional gate step (15) requires explicit confirmation to skip.
122
-
123
- 8. **Requirements change mid-workflow?** Stop the current step and run `/sk:change` immediately. It will classify the scope (behavior tweak / new requirements / scope shift) and tell you exactly where to re-enter the workflow. Never continue implementing stale requirements.
124
-
125
- 8. **Never auto-advance.** When one step completes, stop and tell the user which step is next. Do not proceed automatically.
126
-
127
- 9. **Never write code during design or plan phases.** Steps 1-6 are reading/exploring/planning/design only — no code, no file edits (except `tasks/` files).
128
-
129
- 10. **Step completion summary is NON-NEGOTIABLE.** After finishing ANY step, you MUST output a summary block in this exact format before stopping:
54
+ 1. **Explore** — run `/sk:brainstorm`. Reads `tasks/todo.md`, `tasks/lessons.md`, and `tasks/findings.md` automatically. Clarifies requirements, constraints, and approach. No code in this step.
55
+ 2. **Design** — run `/sk:frontend-design` for UI mockup (includes `/sk:accessibility` audit) or `/sk:api-design` for API contracts. No code design only. Auto-skipped if no frontend/API keywords in the task. Use `--pencil` for Pencil visual mockup.
56
+ 3. **Plan** — run `/sk:write-plan` to write a decision-complete plan into `tasks/todo.md`. No code in this step. After the plan is written, auto-skip detection runs for step 2 if not already done.
57
+ 4. **Branch** — run `/sk:branch` to create a feature branch auto-named from the current task.
58
+ 5. **Write Tests + Implement** — run `/sk:write-tests` (TDD red phase), then `/sk:execute-plan` (TDD green phase). Includes `/sk:schema-migrate` if database keywords detected in the plan. Log progress to `tasks/progress.md`.
59
+ 6. **Commit** — run `/sk:smart-commit` to commit tests + implementation.
60
+ 7. **Gates** — run `/sk:gates` to execute all quality gates in optimized parallel batches (lint, test, security, perf, review, e2e). This is a **hard gate** — blocks all forward progress until every check passes. Individual gate commands (`/sk:lint`, `/sk:test`, `/sk:security-check`, `/sk:perf`, `/sk:review`, `/sk:e2e`) are still available standalone.
61
+ 8. **Finalize** — run `/sk:finish-feature` for changelog, PR creation, `/sk:update-task`, `/sk:features` sync. Ask about `/sk:release` (never auto-skipped).
62
+
63
+ ### Workflow Rules
130
64
 
65
+ 1. **Auto-advance by default.** Move to the next step automatically after each step completes. Pause only at: plan approval (step 3), PR push (step 8), and release confirmation.
66
+
67
+ 2. **Conditional summary.** Only output the step summary block when the step was `skipped`, `partial`, or required fixes. Clean passes just move on silently.
131
68
  ```
132
- --- Step [#] [Name]: [done/skipped/partial] ---
133
- Summary: [1-2 sentence summary of what was done]
69
+ --- Step [#] [Name]: [skipped/partial] ---
70
+ Summary: [1-2 sentence summary]
134
71
  Next step: [#] [Name] — run `[command]`
135
72
  ```
136
73
 
137
- This tells the user exactly what happened and what to do next. Never finish a step silently.
74
+ 3. **Auto-skip detection.** After the plan is written (step 3), scan `tasks/todo.md` for keywords:
75
+ - **Step 2 (Design)**: Auto-skip if NO frontend keywords (component, view, page, CSS, template, blade, vue, react, svelte, UI, form, modal, button) AND NO API keywords (endpoint, route, controller, API)
76
+ - **Migrate** (inside step 5): Auto-skip if NO database keywords (migration, schema, table, column, model, database, foreign key, index, seed)
77
+ - **Performance** (inside gates): Auto-skip if NO frontend AND NO database keywords
78
+ - **Release** (inside step 8): NEVER auto-skipped — always ask
79
+ - Output: `Auto-skipped: [Name] ([reason])`
80
+
81
+ 4. **Gates are a hard gate.** Step 7 BLOCKS all forward progress until every check passes. Gates auto-fix and re-run internally. Do NOT ask the user to re-run — fix and re-run automatically.
82
+
83
+ 5. **Squash gate commits.** When a gate requires fixes, collect all fixes for that gate pass, then make ONE commit: `fix(<gate>): resolve <gate> issues`. Do not commit after each individual fix. Each gate produces at most one commit per pass.
84
+
85
+ 6. **Never write code during explore, design, or plan phases.** Steps 1-3 are reading/exploring/planning/design only — no code, no file edits (except `tasks/` files).
86
+
87
+ 7. **Requirements change mid-workflow?** Stop and run `/sk:change` immediately. It classifies the scope and tells you where to re-enter.
138
88
 
139
89
  ### Fix & Retest Protocol
140
90
 
141
- **Applies to steps 12, 13, 14, 15, 16, 17 — any step that can produce code changes.**
91
+ **Applies to all gates — any gate that can produce code changes.**
142
92
 
143
- When any of these steps require a fix, classify the fix before committing:
93
+ When a gate requires a fix, classify the fix before committing:
144
94
 
145
- **a. Format/style/config/wording change** → commit and re-run the gate. No test update needed.
95
+ **a. Format/style/config/wording change** (formatter auto-fix, CSS tweak, copy change, config value, comment) include in the gate's squash commit and re-run. No test update needed.
146
96
 
147
97
  **b. Logic change** (new branch, modified condition, new data path, query change, new function, changed algorithm, API change) → trigger protocol:
148
98
  1. Update or add failing unit tests for the new behavior
@@ -152,14 +102,9 @@ When any of these steps require a fix, classify the fix before committing:
152
102
 
153
103
  **Exception:** Lint formatter auto-fixes (Prettier, Pint, gofmt, cargo fmt) are never logic changes — bypass protocol automatically.
154
104
 
155
- ### Tracker Reset
156
-
157
- - When starting a new task, check if `tasks/workflow-status.md` has any `done` or `skipped` steps. If yes, ask: "Existing workflow detected. Start fresh and reset tracker?"
158
- - Reset sets all steps to `not yet` and marks step 1 as `>> next <<`.
159
-
160
105
  ### Bug Fix Flow
161
106
 
162
- When fixing a bug (not building a feature), use `/sk:debug` as the entry point. This sets up a shorter workflow:
107
+ Use `/sk:debug` as the entry point:
163
108
 
164
109
  | # | Step | Command |
165
110
  |---|------|---------|
@@ -168,55 +113,34 @@ When fixing a bug (not building a feature), use `/sk:debug` as the entry point.
168
113
  | 3 | Write Tests | `/sk:write-tests` (regression test) |
169
114
  | 4 | Fix | implement the fix |
170
115
  | 5 | Commit | `/sk:smart-commit` |
171
- | 6 | Lint | `/sk:lint` |
172
- | 7 | Commit | `/sk:smart-commit` (skip if clean) |
173
- | 8 | Verify Tests | `/sk:test` |
174
- | 9 | Commit | `/sk:smart-commit` (skip if clean) |
175
- | 10 | Security | `/sk:security-check` |
176
- | 11 | Commit | `/sk:smart-commit` (skip if clean) |
177
- | 12 | Review | `/sk:review` |
178
- | 13 | Commit | `/sk:smart-commit` (skip if clean) |
179
- | 14 | Update | `/sk:update-task` |
180
- | 15 | Finalize | `/sk:finish-feature` |
181
-
182
- Start with `/sk:debug` to investigate, then follow the abbreviated flow.
116
+ | 6 | Gates | `/sk:gates` |
117
+ | 7 | Finalize | `/sk:finish-feature` |
183
118
 
184
119
  ### Hotfix Flow
185
120
 
186
- For production emergencies that need to ship immediately, use `/sk:hotfix`. Skips brainstorm, design, and write-tests. Quality gates still apply.
121
+ For production emergencies. Skips brainstorm, design, and write-tests. Quality gates still apply.
187
122
 
188
123
  | # | Step | Command |
189
124
  |---|------|---------|
190
125
  | 1 | Investigate | `/sk:debug` |
191
126
  | 2 | Branch | `/sk:branch` |
192
127
  | 3 | Fix | implement directly |
193
- | 4 | Smoke Test | run existing tests |
194
- | 5 | Commit | `/sk:smart-commit` |
195
- | 6 | Lint | `/sk:lint` |
196
- | 7 | Commit | `/sk:smart-commit` (skip if clean) |
197
- | 8 | Verify Tests | `/sk:test` |
198
- | 9 | Commit | `/sk:smart-commit` (skip if clean) |
199
- | 10 | Security | `/sk:security-check` |
200
- | 11 | Commit | `/sk:smart-commit` (skip if clean) |
201
- | 12 | Review | `/sk:review` |
202
- | 13 | Commit | `/sk:smart-commit` (skip if clean) |
203
- | 14 | Update | `/sk:update-task` |
204
- | 15 | Finalize | `/sk:finish-feature` |
128
+ | 4 | Commit | `/sk:smart-commit` |
129
+ | 5 | Gates | `/sk:gates` |
130
+ | 6 | Finalize | `/sk:finish-feature` |
205
131
 
206
132
  After merging: add a regression test and a lessons.md entry.
207
133
 
208
134
  ### Requirement Change Flow
209
135
 
210
- When requirements change mid-workflow, run `/sk:change` to avoid implementing the wrong behavior:
136
+ When requirements change mid-workflow, run `/sk:change`:
211
137
 
212
138
  | # | Step | Command |
213
139
  |---|------|---------|
214
140
  | 1 | Assess | `/sk:change` — classify scope (Tier 1/2/3) |
215
- | 2 | Tier 1 (test update only) | update tests → re-enter at step 9 |
216
- | 3 | Tier 2 (plan revision) | revise plan → re-enter at step 6 |
217
- | 4 | Tier 3 (re-brainstorm) | re-enter at step 3 |
218
-
219
- Never update tests or implementation based on a changed requirement without going through `/sk:change` first.
141
+ | 2 | Tier 1 (test update only) | update tests → re-enter at step 5 |
142
+ | 3 | Tier 2 (plan revision) | revise plan → re-enter at step 3 |
143
+ | 4 | Tier 3 (re-brainstorm) | re-enter at step 1 |
220
144
 
221
145
  ## Sub-Agent Patterns
222
146
  <!-- BEGIN:sub-agent-patterns -->
@@ -327,15 +251,15 @@ Entry format:
327
251
 
328
252
  ## Testing — TDD, 100% Coverage Required
329
253
 
330
- Tests are written **before** implementation (step 9) and verified **after** (step 14).
254
+ Tests are written **before** implementation (step 5) and verified during gates (step 7).
331
255
 
332
256
  ### TDD Flow
333
257
 
334
258
  1. `/sk:write-tests` — write failing tests based on the plan (RED)
335
259
  2. `/sk:execute-plan` — implement code to make tests pass (GREEN)
336
- 3. `/sk:test` — verify all tests pass with 100% coverage (VERIFY)
260
+ 3. `/sk:test` — verify all tests pass with 100% coverage (VERIFY — runs as part of `/sk:gates`)
337
261
 
338
- Every new function, endpoint, component, and module needs tests. No code proceeds past step 12 without 100% coverage on new code.
262
+ Every new function, endpoint, component, and module needs tests. No code proceeds past gates without 100% coverage on new code.
339
263
 
340
264
  ## 3-Strike Protocol
341
265
 
@@ -356,27 +280,34 @@ Create entries in: `[ARCH_CHANGELOG_DIR]`
356
280
  |---------|---------|
357
281
  | `/sk:accessibility` | WCAG 2.1 AA audit — runs after design, before implementation |
358
282
  | `/sk:api-design` | Design API contracts (endpoints, payloads, auth, errors) before implementation |
359
- | `/sk:autopilot` | Hands-free workflow — all 21 steps, auto-skip, auto-advance, auto-commit |
360
- | `/sk:brainstorm` | Explore requirements and design |
283
+ | `/sk:autopilot` | Hands-free workflow — all 8 steps, auto-skip, auto-advance, auto-commit |
284
+ | `/sk:brainstorm` | Explore requirements and design (includes search-first research) |
361
285
  | `/sk:branch` | Create feature branch auto-named from current task |
362
286
  | `/sk:change` | Handle mid-workflow requirement changes — re-enter at correct step |
363
287
  | `/sk:context` | Load all context files + output session brief for fast session start |
288
+ | `/sk:context-budget` | Audit context window token consumption and find savings |
364
289
  | `/sk:dashboard` | Read-only workflow Kanban board — localhost server, multi-worktree |
365
290
  | `/sk:debug` | Investigate and debug issues (bug fix entry point) |
366
291
  | `/sk:e2e` | E2E behavioral verification using agent-browser (final quality gate) |
292
+ | `/sk:eval` | Define, run, and report on evaluations for agent reliability |
367
293
  | `/sk:execute-plan` | Execute `tasks/todo.md` checkboxes in batches |
368
294
  | `/sk:fast-track` | Abbreviated workflow for small changes — skip planning, keep all gates |
369
295
  | `/sk:features` | Sync feature specs with shipped implementation |
370
296
  | `/sk:finish-feature` | Changelog + PR creation |
371
297
  | `/sk:frontend-design` | UI mockup before implementation. Prompts to create Pencil visual mockup |
372
298
  | `/sk:gates` | Run all quality gates in optimized parallel batches |
299
+ | `/sk:health` | Harness self-audit scorecard (7 categories, 0-70) |
373
300
  | `/sk:hotfix` | Emergency fix workflow — skip design/TDD, quality gates enforced |
301
+ | `/sk:learn` | Extract reusable patterns from sessions into learned instincts |
374
302
  | `/sk:lint` | Auto-detect and run all project linters + dependency audits |
375
303
  | `/sk:perf` | Performance audit — bundle, N+1, Core Web Vitals, memory |
376
304
  | `/sk:release` | Version bump + changelog + tag |
305
+ | `/sk:resume-session` | Resume a previously saved session with full context restoration |
377
306
  | `/sk:retro` | Post-ship retrospective: velocity, blockers, action items |
378
307
  | `/sk:reverse-doc` | Generate architecture/design docs from existing code |
379
308
  | `/sk:review` | Self-review with simplify pre-pass + multi-dimensional review |
309
+ | `/sk:safety-guard` | Protect against destructive ops (careful/freeze/guard modes) |
310
+ | `/sk:save-session` | Save current session state for cross-session continuity |
380
311
  | `/sk:scope-check` | Compare implementation against plan, detect scope creep |
381
312
  | `/sk:security-check` | OWASP security audit on changed files |
382
313
  | `/sk:seo-audit` | SEO audit — dual-mode (source templates + dev server), ask-before-fix |
@@ -19,16 +19,7 @@ Explore design and clarify requirements **before** any code is written.
19
19
 
20
20
  ## Steps
21
21
 
22
- 0. **Check workflow tracker:**
23
- - Read `tasks/workflow-status.md`. If it doesn't exist, create it using the standard
24
- 14-step template (all steps `not yet`, step 1 `>> next <<`).
25
- - If any steps show `done`, `skipped`, or `partial`: ask the user —
26
- "Existing workflow detected. Start fresh and reset tracker?" Wait for confirmation.
27
- - If yes: reset all steps to `not yet`, mark step 1 as `>> next <<`, and clear all Notes
28
- (except the default labels: optional, conditional, loop).
29
- - If no: continue from current state (the user is resuming a prior workflow).
30
-
31
- 1. **Read context files first:**
22
+ 0. **Read context files first:**
32
23
  - If `tasks/findings.md` exists and has content, read it — summarize prior decisions
33
24
  and ask: extend, revise, or start fresh?
34
25
  - If `tasks/lessons.md` exists, read it in full. Apply every active lesson as a design
@@ -65,9 +56,7 @@ Explore design and clarify requirements **before** any code is written.
65
56
 
66
57
  ## When Done
67
58
 
68
- 1. Update `tasks/workflow-status.md`: set step 1 (`/sk:brainstorm`) to `done`, move `>> next <<` to the next pending step.
69
- 2. Print the full workflow status dashboard table.
70
- 3. Tell the user:
59
+ 1. Tell the user:
71
60
  > "Brainstorming complete. Findings saved to `tasks/findings.md`."
72
61
  4. If step 2 (`/sk:frontend-design`) is next, ask: "Step 2 is `/sk:frontend-design` (optional). Run it or skip?"
73
62
 
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env bash
2
+ # config-protection.sh — PreToolUse hook for Edit/Write
3
+ # Blocks modifications to linter/formatter configs.
4
+ # Override: SHIPKIT_ALLOW_CONFIG_EDIT=1
5
+
6
+ set -euo pipefail
7
+
8
+ if [[ "${SHIPKIT_ALLOW_CONFIG_EDIT:-0}" == "1" ]]; then
9
+ exit 0
10
+ fi
11
+
12
+ # Read the tool input from stdin
13
+ INPUT=$(cat)
14
+
15
+ # Extract the file path from the tool input
16
+ FILE_PATH=$(echo "$INPUT" | grep -oE '"file_path"\s*:\s*"[^"]*"' | head -1 | sed 's/.*: *"//;s/"$//')
17
+
18
+ if [[ -z "$FILE_PATH" ]]; then
19
+ exit 0
20
+ fi
21
+
22
+ BASENAME=$(basename "$FILE_PATH")
23
+
24
+ # Protected config patterns
25
+ PROTECTED_CONFIGS=(
26
+ ".eslintrc"
27
+ ".eslintrc.js"
28
+ ".eslintrc.cjs"
29
+ ".eslintrc.json"
30
+ ".eslintrc.yml"
31
+ ".eslintrc.yaml"
32
+ "eslint.config.js"
33
+ "eslint.config.mjs"
34
+ "eslint.config.cjs"
35
+ ".prettierrc"
36
+ ".prettierrc.js"
37
+ ".prettierrc.cjs"
38
+ ".prettierrc.json"
39
+ ".prettierrc.yml"
40
+ ".prettierrc.yaml"
41
+ "prettier.config.js"
42
+ "prettier.config.mjs"
43
+ "biome.json"
44
+ "biome.jsonc"
45
+ ".stylelintrc"
46
+ ".stylelintrc.json"
47
+ ".stylelintrc.js"
48
+ "stylelint.config.js"
49
+ "phpstan.neon"
50
+ "phpstan.neon.dist"
51
+ "pint.json"
52
+ "rector.php"
53
+ ".php-cs-fixer.php"
54
+ ".php-cs-fixer.dist.php"
55
+ ".rubocop.yml"
56
+ ".golangci.yml"
57
+ ".golangci.yaml"
58
+ "rustfmt.toml"
59
+ ".clang-format"
60
+ )
61
+
62
+ for config in "${PROTECTED_CONFIGS[@]}"; do
63
+ if [[ "$BASENAME" == "$config" ]]; then
64
+ echo "BLOCKED: Modifying linter/formatter config '$BASENAME'."
65
+ echo "Fix the code instead of weakening the rules."
66
+ echo "Override: set SHIPKIT_ALLOW_CONFIG_EDIT=1"
67
+ exit 2
68
+ fi
69
+ done
70
+
71
+ exit 0
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env bash
2
+ # console-log-warning.sh — Stop hook
3
+ # Scans git-modified files for debug statements and warns if found.
4
+
5
+ set -uo pipefail
6
+
7
+ PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
8
+ cd "$PROJECT_ROOT"
9
+
10
+ MODIFIED_FILES=$(git diff --name-only --diff-filter=ACMR 2>/dev/null)
11
+ STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACMR 2>/dev/null)
12
+ ALL_FILES=$(echo -e "${MODIFIED_FILES}\n${STAGED_FILES}" | sort -u | grep -v '^$')
13
+
14
+ if [[ -z "$ALL_FILES" ]]; then
15
+ exit 0
16
+ fi
17
+
18
+ DEBUG_PATTERNS='console\.log\|console\.warn\|console\.error\|console\.debug\|console\.trace\|debugger\b\|\bdd(\|\bdump(\|\bvar_dump(\|\bprint_r(\|\blog\.Print\|log\.Debug\|\bpdb\.set_trace\|\bbreakpoint()'
19
+
20
+ FOUND=0
21
+ REPORT=""
22
+
23
+ while IFS= read -r file; do
24
+ [[ -z "$file" || ! -f "$file" ]] && continue
25
+ MATCHES=$(grep -n "$DEBUG_PATTERNS" "$file" 2>/dev/null || true)
26
+ if [[ -n "$MATCHES" ]]; then
27
+ FOUND=$((FOUND + 1))
28
+ REPORT+=" $file:\n"
29
+ while IFS= read -r match; do
30
+ REPORT+=" $match\n"
31
+ done <<< "$MATCHES"
32
+ fi
33
+ done <<< "$ALL_FILES"
34
+
35
+ if [[ $FOUND -gt 0 ]]; then
36
+ echo ""
37
+ echo "WARNING: Debug statements found in $FOUND modified file(s):"
38
+ echo -e "$REPORT"
39
+ echo "Consider removing before committing."
40
+ fi
41
+
42
+ exit 0
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env bash
2
+ # cost-tracker.sh — Stop hook (async)
3
+ # Logs session metadata to .claude/sessions/cost-log.jsonl
4
+
5
+ set -uo pipefail
6
+
7
+ PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
8
+ SESSIONS_DIR="$PROJECT_ROOT/.claude/sessions"
9
+ LOG_FILE="$SESSIONS_DIR/cost-log.jsonl"
10
+
11
+ mkdir -p "$SESSIONS_DIR"
12
+
13
+ BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
14
+ TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
15
+ DATE=$(date +"%Y-%m-%d")
16
+
17
+ # Count commits made during this session (last 8 hours)
18
+ RECENT_COMMITS=$(git log --since="8 hours ago" --oneline 2>/dev/null | wc -l | tr -d ' ')
19
+
20
+ # Count modified files
21
+ MODIFIED_COUNT=$(git diff --name-only 2>/dev/null | wc -l | tr -d ' ')
22
+ STAGED_COUNT=$(git diff --cached --name-only 2>/dev/null | wc -l | tr -d ' ')
23
+
24
+ echo "{\"timestamp\":\"$TIMESTAMP\",\"date\":\"$DATE\",\"branch\":\"$BRANCH\",\"commits\":$RECENT_COMMITS,\"modified_files\":$MODIFIED_COUNT,\"staged_files\":$STAGED_COUNT}" >> "$LOG_FILE"
25
+
26
+ exit 0
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env bash
2
+ # post-edit-format.sh — PostToolUse hook for Edit
3
+ # Auto-formats the edited file using the project's formatter.
4
+
5
+ set -uo pipefail
6
+
7
+ INPUT=$(cat)
8
+ FILE_PATH=$(echo "$INPUT" | grep -oE '"file_path"\s*:\s*"[^"]*"' | head -1 | sed 's/.*: *"//;s/"$//')
9
+
10
+ if [[ -z "$FILE_PATH" || ! -f "$FILE_PATH" ]]; then
11
+ exit 0
12
+ fi
13
+
14
+ EXT="${FILE_PATH##*.}"
15
+ PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
16
+
17
+ format_file() {
18
+ # Biome (JS/TS/JSON)
19
+ if [[ -f "$PROJECT_ROOT/biome.json" || -f "$PROJECT_ROOT/biome.jsonc" ]]; then
20
+ if [[ "$EXT" =~ ^(js|jsx|ts|tsx|json|jsonc)$ ]]; then
21
+ npx biome format --write "$FILE_PATH" 2>/dev/null && return 0
22
+ fi
23
+ fi
24
+
25
+ # Prettier (JS/TS/CSS/HTML/MD)
26
+ if [[ -f "$PROJECT_ROOT/.prettierrc" || -f "$PROJECT_ROOT/.prettierrc.json" || -f "$PROJECT_ROOT/.prettierrc.js" || -f "$PROJECT_ROOT/.prettierrc.cjs" || -f "$PROJECT_ROOT/prettier.config.js" || -f "$PROJECT_ROOT/prettier.config.mjs" ]]; then
27
+ if [[ "$EXT" =~ ^(js|jsx|ts|tsx|css|scss|html|md|json|yaml|yml|vue|svelte)$ ]]; then
28
+ npx prettier --write "$FILE_PATH" 2>/dev/null && return 0
29
+ fi
30
+ fi
31
+
32
+ # Pint (PHP)
33
+ if [[ -f "$PROJECT_ROOT/pint.json" || -f "$PROJECT_ROOT/vendor/bin/pint" ]]; then
34
+ if [[ "$EXT" == "php" ]]; then
35
+ "$PROJECT_ROOT/vendor/bin/pint" "$FILE_PATH" 2>/dev/null && return 0
36
+ fi
37
+ fi
38
+
39
+ # gofmt (Go)
40
+ if [[ "$EXT" == "go" ]]; then
41
+ command -v gofmt &>/dev/null && gofmt -w "$FILE_PATH" 2>/dev/null && return 0
42
+ fi
43
+
44
+ # cargo fmt (Rust)
45
+ if [[ "$EXT" == "rs" ]]; then
46
+ command -v rustfmt &>/dev/null && rustfmt "$FILE_PATH" 2>/dev/null && return 0
47
+ fi
48
+
49
+ return 0
50
+ }
51
+
52
+ format_file
53
+ exit 0
@@ -4,17 +4,6 @@
4
4
 
5
5
  echo "=== Pre-Compaction State Snapshot ==="
6
6
 
7
- # Workflow status
8
- if [ -f "tasks/workflow-status.md" ]; then
9
- echo ""
10
- echo "--- workflow-status.md ---"
11
- cat "tasks/workflow-status.md" 2>/dev/null | head -30
12
- TOTAL_LINES=$(wc -l < "tasks/workflow-status.md" 2>/dev/null | tr -d ' ')
13
- if [ "$TOTAL_LINES" -gt 30 ]; then
14
- echo " ... ($TOTAL_LINES total lines)"
15
- fi
16
- fi
17
-
18
7
  # Git status
19
8
  echo ""
20
9
  echo "--- Uncommitted Changes ---"
@@ -38,7 +27,7 @@ fi
38
27
 
39
28
  echo ""
40
29
  echo "--- Recovery ---"
41
- echo "Read tasks/workflow-status.md to restore current step."
30
+ echo "Read tasks/todo.md for current task and progress."
42
31
  echo "Read tasks/progress.md for recent work."
43
32
  echo "==================================="
44
33
  exit 0
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env bash
2
+ # safety-guard.sh — PreToolUse hook for Bash/Edit/Write
3
+ # Reads .claude/safety-guard.json for active mode and directory constraints.
4
+
5
+ set -uo pipefail
6
+
7
+ PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
8
+ GUARD_CONFIG="$PROJECT_ROOT/.claude/safety-guard.json"
9
+
10
+ if [[ ! -f "$GUARD_CONFIG" ]]; then
11
+ exit 0
12
+ fi
13
+
14
+ INPUT=$(cat)
15
+ MODE=$(python3 -c "import json; print(json.load(open('$GUARD_CONFIG')).get('mode', 'off'))" 2>/dev/null || echo "off")
16
+
17
+ if [[ "$MODE" == "off" ]]; then
18
+ exit 0
19
+ fi
20
+
21
+ # Extract tool info
22
+ TOOL_NAME="${TOOL_NAME:-}"
23
+ FILE_PATH=$(echo "$INPUT" | grep -oE '"file_path"\s*:\s*"[^"]*"' | head -1 | sed 's/.*: *"//;s/"$//')
24
+ COMMAND=$(echo "$INPUT" | grep -oE '"command"\s*:\s*"[^"]*"' | head -1 | sed 's/.*: *"//;s/"$//')
25
+
26
+ # Careful mode: block destructive commands
27
+ if [[ "$MODE" == "careful" || "$MODE" == "guard" ]]; then
28
+ if [[ -n "$COMMAND" ]]; then
29
+ DESTRUCTIVE_PATTERNS=(
30
+ "rm -rf"
31
+ "rm -fr"
32
+ "git push --force"
33
+ "git push -f"
34
+ "git reset --hard"
35
+ "git clean -f"
36
+ "DROP TABLE"
37
+ "DROP DATABASE"
38
+ "chmod 777"
39
+ "chmod -R 777"
40
+ "--no-verify"
41
+ )
42
+ for pattern in "${DESTRUCTIVE_PATTERNS[@]}"; do
43
+ if echo "$COMMAND" | grep -qi "$pattern"; then
44
+ echo "BLOCKED by safety-guard (careful mode): destructive command detected."
45
+ echo " Command: $COMMAND"
46
+ echo " Pattern: $pattern"
47
+ echo " Disable: /sk:safety-guard off"
48
+ exit 2
49
+ fi
50
+ done
51
+ fi
52
+ fi
53
+
54
+ # Freeze mode: block writes outside specified directory
55
+ if [[ "$MODE" == "freeze" || "$MODE" == "guard" ]]; then
56
+ FREEZE_DIR=$(python3 -c "import json; print(json.load(open('$GUARD_CONFIG')).get('freeze_dir', ''))" 2>/dev/null || echo "")
57
+ if [[ -n "$FREEZE_DIR" && -n "$FILE_PATH" ]]; then
58
+ # Resolve to absolute paths for comparison
59
+ ABS_FREEZE=$(cd "$PROJECT_ROOT" && cd "$FREEZE_DIR" 2>/dev/null && pwd || echo "$PROJECT_ROOT/$FREEZE_DIR")
60
+ ABS_FILE=$(cd "$(dirname "$FILE_PATH")" 2>/dev/null && echo "$(pwd)/$(basename "$FILE_PATH")" || echo "$FILE_PATH")
61
+
62
+ if [[ "$ABS_FILE" != "$ABS_FREEZE"* ]]; then
63
+ echo "BLOCKED by safety-guard (freeze mode): write outside frozen directory."
64
+ echo " File: $FILE_PATH"
65
+ echo " Allowed: $FREEZE_DIR"
66
+ echo " Disable: /sk:safety-guard off"
67
+ exit 2
68
+ fi
69
+ fi
70
+ fi
71
+
72
+ exit 0
@@ -15,17 +15,6 @@ if [ -n "$BRANCH" ]; then
15
15
  done
16
16
  fi
17
17
 
18
- # Current workflow step from workflow-status.md
19
- if [ -f "tasks/workflow-status.md" ]; then
20
- echo ""
21
- NEXT_STEP=$(grep -E ">>\s*next\s*<<" "tasks/workflow-status.md" 2>/dev/null | head -1)
22
- if [ -n "$NEXT_STEP" ]; then
23
- echo "Workflow: $NEXT_STEP"
24
- else
25
- echo "Workflow: all steps complete or not started"
26
- fi
27
- fi
28
-
29
18
  # Tech debt count
30
19
  if [ -f "tasks/tech-debt.md" ]; then
31
20
  TOTAL=$(grep -c "^### \[" "tasks/tech-debt.md" 2>/dev/null || echo 0)