@istmx/skills 2.0.0 → 2.1.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 (230) hide show
  1. package/README.md +127 -51
  2. package/RELEASE_v2.1.0.md +69 -0
  3. package/bin/cli.js +64 -86
  4. package/context/conversation_transcript.md +768 -0
  5. package/context/progress.md +121 -0
  6. package/istm/SKILL.md +20 -11
  7. package/istm-animate/SKILL.md +19 -11
  8. package/istm-architecture/SKILL.md +70 -14
  9. package/istm-architecture/templates/agents.md +21 -2
  10. package/istm-awwward-designer/SKILL.md +31 -7
  11. package/istm-design/SKILL.md +26 -12
  12. package/istm-design/anti-laziness/architectural-patterns.md +55 -0
  13. package/istm-design/anti-laziness/parameter-tuning.md +44 -0
  14. package/istm-design/anti-laziness/prompt-engineering.md +52 -0
  15. package/istm-design/anti-laziness/reference-prompts.md +79 -0
  16. package/istm-design/archetypes/brandkit/SKILL.md +798 -0
  17. package/istm-design/archetypes/brutalist/SKILL.md +92 -0
  18. package/istm-design/archetypes/minimalist/SKILL.md +85 -0
  19. package/istm-design/archetypes/soft/SKILL.md +98 -0
  20. package/istm-design/core/ui-ux-pro-max/data/stacks/wpf.csv +1 -1
  21. package/istm-design/core/ui-ux-pro-max/scripts/design_system.py +1 -1
  22. package/istm-design/image-to-code/SKILL.md +1228 -0
  23. package/istm-design/imagegen/SKILL.md +987 -0
  24. package/istm-design/presets/airbnb/DESIGN.md +545 -0
  25. package/istm-design/presets/airbnb/README.md +5 -0
  26. package/istm-design/presets/airtable/DESIGN.md +554 -0
  27. package/istm-design/presets/airtable/README.md +5 -0
  28. package/istm-design/presets/apple/DESIGN.md +562 -0
  29. package/istm-design/presets/apple/README.md +5 -0
  30. package/istm-design/presets/binance/DESIGN.md +634 -0
  31. package/istm-design/presets/binance/README.md +5 -0
  32. package/istm-design/presets/bmw/DESIGN.md +544 -0
  33. package/istm-design/presets/bmw/README.md +5 -0
  34. package/istm-design/presets/bmw-m/DESIGN.md +503 -0
  35. package/istm-design/presets/bmw-m/README.md +5 -0
  36. package/istm-design/presets/bugatti/DESIGN.md +454 -0
  37. package/istm-design/presets/bugatti/README.md +5 -0
  38. package/istm-design/presets/cal/DESIGN.md +542 -0
  39. package/istm-design/presets/cal/README.md +5 -0
  40. package/istm-design/presets/catalog.md +127 -0
  41. package/istm-design/presets/claude/DESIGN.md +589 -0
  42. package/istm-design/presets/claude/README.md +5 -0
  43. package/istm-design/presets/clay/DESIGN.md +541 -0
  44. package/istm-design/presets/clay/README.md +5 -0
  45. package/istm-design/presets/clickhouse/DESIGN.md +544 -0
  46. package/istm-design/presets/clickhouse/README.md +5 -0
  47. package/istm-design/presets/cohere/DESIGN.md +451 -0
  48. package/istm-design/presets/cohere/README.md +5 -0
  49. package/istm-design/presets/coinbase/DESIGN.md +570 -0
  50. package/istm-design/presets/coinbase/README.md +5 -0
  51. package/istm-design/presets/composio/DESIGN.md +506 -0
  52. package/istm-design/presets/composio/README.md +5 -0
  53. package/istm-design/presets/cursor/DESIGN.md +537 -0
  54. package/istm-design/presets/cursor/README.md +5 -0
  55. package/istm-design/presets/dell-1996/DESIGN.md +632 -0
  56. package/istm-design/presets/dell-1996/README.md +5 -0
  57. package/istm-design/presets/elevenlabs/DESIGN.md +504 -0
  58. package/istm-design/presets/elevenlabs/README.md +5 -0
  59. package/istm-design/presets/expo/DESIGN.md +526 -0
  60. package/istm-design/presets/expo/README.md +5 -0
  61. package/istm-design/presets/ferrari/DESIGN.md +531 -0
  62. package/istm-design/presets/ferrari/README.md +5 -0
  63. package/istm-design/presets/figma/DESIGN.md +578 -0
  64. package/istm-design/presets/figma/README.md +5 -0
  65. package/istm-design/presets/framer/DESIGN.md +544 -0
  66. package/istm-design/presets/framer/README.md +5 -0
  67. package/istm-design/presets/hashicorp/DESIGN.md +575 -0
  68. package/istm-design/presets/hashicorp/README.md +5 -0
  69. package/istm-design/presets/hp/DESIGN.md +670 -0
  70. package/istm-design/presets/hp/README.md +5 -0
  71. package/istm-design/presets/ibm/DESIGN.md +550 -0
  72. package/istm-design/presets/ibm/README.md +5 -0
  73. package/istm-design/presets/intercom/DESIGN.md +546 -0
  74. package/istm-design/presets/intercom/README.md +5 -0
  75. package/istm-design/presets/kraken/DESIGN.md +125 -0
  76. package/istm-design/presets/kraken/README.md +5 -0
  77. package/istm-design/presets/lamborghini/DESIGN.md +288 -0
  78. package/istm-design/presets/lamborghini/README.md +5 -0
  79. package/istm-design/presets/linear/DESIGN.md +548 -0
  80. package/istm-design/presets/linear/README.md +5 -0
  81. package/istm-design/presets/lovable/DESIGN.md +298 -0
  82. package/istm-design/presets/lovable/README.md +5 -0
  83. package/istm-design/presets/mastercard/DESIGN.md +365 -0
  84. package/istm-design/presets/mastercard/README.md +5 -0
  85. package/istm-design/presets/meta/DESIGN.md +683 -0
  86. package/istm-design/presets/meta/README.md +5 -0
  87. package/istm-design/presets/minimax/DESIGN.md +746 -0
  88. package/istm-design/presets/minimax/README.md +5 -0
  89. package/istm-design/presets/mintlify/DESIGN.md +852 -0
  90. package/istm-design/presets/mintlify/README.md +5 -0
  91. package/istm-design/presets/miro/DESIGN.md +825 -0
  92. package/istm-design/presets/miro/README.md +5 -0
  93. package/istm-design/presets/mistral/DESIGN.md +773 -0
  94. package/istm-design/presets/mistral/README.md +5 -0
  95. package/istm-design/presets/mongodb/DESIGN.md +767 -0
  96. package/istm-design/presets/mongodb/README.md +5 -0
  97. package/istm-design/presets/nike/DESIGN.md +575 -0
  98. package/istm-design/presets/nike/README.md +5 -0
  99. package/istm-design/presets/nintendo-2001/DESIGN.md +649 -0
  100. package/istm-design/presets/nintendo-2001/README.md +5 -0
  101. package/istm-design/presets/notion/DESIGN.md +821 -0
  102. package/istm-design/presets/notion/README.md +5 -0
  103. package/istm-design/presets/nvidia/DESIGN.md +640 -0
  104. package/istm-design/presets/nvidia/README.md +5 -0
  105. package/istm-design/presets/ollama/DESIGN.md +539 -0
  106. package/istm-design/presets/ollama/README.md +5 -0
  107. package/istm-design/presets/opencode/DESIGN.md +521 -0
  108. package/istm-design/presets/opencode/README.md +5 -0
  109. package/istm-design/presets/pinterest/DESIGN.md +597 -0
  110. package/istm-design/presets/pinterest/README.md +5 -0
  111. package/istm-design/presets/playstation/DESIGN.md +661 -0
  112. package/istm-design/presets/playstation/README.md +5 -0
  113. package/istm-design/presets/posthog/DESIGN.md +690 -0
  114. package/istm-design/presets/posthog/README.md +5 -0
  115. package/istm-design/presets/raycast/DESIGN.md +669 -0
  116. package/istm-design/presets/raycast/README.md +5 -0
  117. package/istm-design/presets/renault/DESIGN.md +589 -0
  118. package/istm-design/presets/renault/README.md +5 -0
  119. package/istm-design/presets/replicate/DESIGN.md +616 -0
  120. package/istm-design/presets/replicate/README.md +5 -0
  121. package/istm-design/presets/resend/DESIGN.md +585 -0
  122. package/istm-design/presets/resend/README.md +5 -0
  123. package/istm-design/presets/revolut/DESIGN.md +636 -0
  124. package/istm-design/presets/revolut/README.md +5 -0
  125. package/istm-design/presets/runwayml/DESIGN.md +244 -0
  126. package/istm-design/presets/runwayml/README.md +5 -0
  127. package/istm-design/presets/sanity/DESIGN.md +357 -0
  128. package/istm-design/presets/sanity/README.md +5 -0
  129. package/istm-design/presets/sentry/DESIGN.md +551 -0
  130. package/istm-design/presets/sentry/README.md +5 -0
  131. package/istm-design/presets/shopify/DESIGN.md +516 -0
  132. package/istm-design/presets/shopify/README.md +5 -0
  133. package/istm-design/presets/slack/DESIGN.md +482 -0
  134. package/istm-design/presets/spacex/DESIGN.md +363 -0
  135. package/istm-design/presets/spacex/README.md +5 -0
  136. package/istm-design/presets/spotify/DESIGN.md +246 -0
  137. package/istm-design/presets/spotify/README.md +5 -0
  138. package/istm-design/presets/starbucks/DESIGN.md +580 -0
  139. package/istm-design/presets/starbucks/README.md +5 -0
  140. package/istm-design/presets/stripe/DESIGN.md +487 -0
  141. package/istm-design/presets/stripe/README.md +5 -0
  142. package/istm-design/presets/supabase/DESIGN.md +462 -0
  143. package/istm-design/presets/supabase/README.md +5 -0
  144. package/istm-design/presets/superhuman/DESIGN.md +448 -0
  145. package/istm-design/presets/superhuman/README.md +5 -0
  146. package/istm-design/presets/tesla/DESIGN.md +286 -0
  147. package/istm-design/presets/tesla/README.md +5 -0
  148. package/istm-design/presets/theverge/DESIGN.md +339 -0
  149. package/istm-design/presets/theverge/README.md +5 -0
  150. package/istm-design/presets/together/DESIGN.md +633 -0
  151. package/istm-design/presets/together/README.md +5 -0
  152. package/istm-design/presets/uber/DESIGN.md +636 -0
  153. package/istm-design/presets/uber/README.md +5 -0
  154. package/istm-design/presets/vercel/DESIGN.md +736 -0
  155. package/istm-design/presets/vercel/README.md +5 -0
  156. package/istm-design/presets/vodafone/DESIGN.md +538 -0
  157. package/istm-design/presets/vodafone/README.md +5 -0
  158. package/istm-design/presets/voltagent/DESIGN.md +521 -0
  159. package/istm-design/presets/voltagent/README.md +5 -0
  160. package/istm-design/presets/warp/DESIGN.md +526 -0
  161. package/istm-design/presets/warp/README.md +5 -0
  162. package/istm-design/presets/webflow/DESIGN.md +588 -0
  163. package/istm-design/presets/webflow/README.md +5 -0
  164. package/istm-design/presets/wired/DESIGN.md +497 -0
  165. package/istm-design/presets/wired/README.md +5 -0
  166. package/istm-design/presets/wise/DESIGN.md +544 -0
  167. package/istm-design/presets/wise/README.md +5 -0
  168. package/istm-design/presets/xai/DESIGN.md +465 -0
  169. package/istm-design/presets/xai/README.md +5 -0
  170. package/istm-design/presets/zapier/DESIGN.md +537 -0
  171. package/istm-design/presets/zapier/README.md +5 -0
  172. package/istm-design/references/pick-ui-library.md +1 -1
  173. package/istm-design/semantic-design/DESIGN.md +121 -0
  174. package/istm-design/semantic-design/SKILL.md +184 -0
  175. package/istm-system-design/SKILL.md +12 -5
  176. package/istm-workflow/istm-autoplan/SKILL.md +1905 -0
  177. package/istm-workflow/istm-autoplan/SKILL.md.tmpl +923 -0
  178. package/istm-workflow/istm-craft/SKILL.md +12 -6
  179. package/istm-workflow/istm-cso/ACKNOWLEDGEMENTS.md +14 -0
  180. package/istm-workflow/istm-cso/SKILL.md +1313 -0
  181. package/istm-workflow/istm-cso/SKILL.md.tmpl +407 -0
  182. package/istm-workflow/istm-cso/sections/audit-phases.md +253 -0
  183. package/istm-workflow/istm-cso/sections/audit-phases.md.tmpl +251 -0
  184. package/istm-workflow/istm-cso/sections/manifest.json +14 -0
  185. package/istm-workflow/istm-debt/SKILL.md +44 -0
  186. package/istm-workflow/istm-debug/SKILL.md +12 -3
  187. package/istm-workflow/istm-design-review/SKILL.md +2053 -0
  188. package/istm-workflow/istm-design-review/SKILL.md.tmpl +312 -0
  189. package/istm-workflow/istm-develop/SKILL.md +10 -4
  190. package/istm-workflow/istm-eng-review/SKILL.md +1112 -0
  191. package/istm-workflow/istm-eng-review/SKILL.md.tmpl +163 -0
  192. package/istm-workflow/istm-eng-review/sections/manifest.json +14 -0
  193. package/istm-workflow/istm-eng-review/sections/review-sections.md +942 -0
  194. package/istm-workflow/istm-eng-review/sections/review-sections.md.tmpl +225 -0
  195. package/istm-workflow/istm-gain/SKILL.md +50 -0
  196. package/istm-workflow/istm-health/SKILL.md +1104 -0
  197. package/istm-workflow/istm-health/SKILL.md.tmpl +320 -0
  198. package/istm-workflow/istm-qa/BROWSER.md +1468 -0
  199. package/istm-workflow/istm-qa/SKILL.md +1743 -0
  200. package/istm-workflow/istm-qa/SKILL.md.tmpl +354 -0
  201. package/istm-workflow/istm-qa/references/issue-taxonomy.md +85 -0
  202. package/istm-workflow/istm-qa/templates/qa-report-template.md +126 -0
  203. package/istm-workflow/istm-release/SKILL.md +989 -0
  204. package/istm-workflow/istm-release/SKILL.md.tmpl +160 -0
  205. package/istm-workflow/istm-release/sections/manifest.json +14 -0
  206. package/istm-workflow/istm-release/sections/release-body.md +547 -0
  207. package/istm-workflow/istm-release/sections/release-body.md.tmpl +420 -0
  208. package/istm-workflow/istm-review/SKILL.md +57 -0
  209. package/istm-workflow/istm-ship/SKILL.md +1504 -0
  210. package/istm-workflow/istm-ship/SKILL.md.tmpl +582 -0
  211. package/istm-workflow/istm-ship/sections/adversarial.md +218 -0
  212. package/istm-workflow/istm-ship/sections/adversarial.md.tmpl +19 -0
  213. package/istm-workflow/istm-ship/sections/apple-release.md +58 -0
  214. package/istm-workflow/istm-ship/sections/apple-release.md.tmpl +56 -0
  215. package/istm-workflow/istm-ship/sections/changelog.md +45 -0
  216. package/istm-workflow/istm-ship/sections/changelog.md.tmpl +3 -0
  217. package/istm-workflow/istm-ship/sections/greptile.md +51 -0
  218. package/istm-workflow/istm-ship/sections/greptile.md.tmpl +49 -0
  219. package/istm-workflow/istm-ship/sections/manifest.json +62 -0
  220. package/istm-workflow/istm-ship/sections/plan-completion.md +329 -0
  221. package/istm-workflow/istm-ship/sections/plan-completion.md.tmpl +31 -0
  222. package/istm-workflow/istm-ship/sections/pr-body.md +209 -0
  223. package/istm-workflow/istm-ship/sections/pr-body.md.tmpl +207 -0
  224. package/istm-workflow/istm-ship/sections/review-army.md +406 -0
  225. package/istm-workflow/istm-ship/sections/review-army.md.tmpl +56 -0
  226. package/istm-workflow/istm-ship/sections/test-coverage.md +264 -0
  227. package/istm-workflow/istm-ship/sections/test-coverage.md.tmpl +23 -0
  228. package/istm-workflow/istm-ship/sections/tests.md +403 -0
  229. package/istm-workflow/istm-ship/sections/tests.md.tmpl +116 -0
  230. package/package.json +6 -3
@@ -0,0 +1,56 @@
1
+ ## Step 9: Pre-Landing Review
2
+
3
+ Review the diff for structural issues that tests don't catch.
4
+
5
+ 1. Read `~/.claude/skills/istm-workflow/review/checklist.md`. If the file cannot be read, **STOP** and report the error.
6
+
7
+ 2. Run `git diff origin/<base>` to get the full diff (scoped to feature changes against the freshly-fetched base branch).
8
+
9
+ 3. Apply the review checklist in two passes:
10
+ - **Pass 1 (CRITICAL):** SQL & Data Safety, LLM Output Trust Boundary
11
+ - **Pass 2 (INFORMATIONAL):** All remaining categories
12
+
13
+ {{CONFIDENCE_CALIBRATION}}
14
+
15
+ {{DESIGN_REVIEW_LITE}}
16
+
17
+ Include any design findings alongside the code review findings. They follow the same Fix-First flow below.
18
+
19
+ {{REVIEW_ARMY}}
20
+
21
+ {{CROSS_REVIEW_DEDUP}}
22
+
23
+ 4. **Classify each finding from both the checklist pass and specialist review (Step 9.1-Step 9.2) as AUTO-FIX or ASK** per the Fix-First Heuristic in
24
+ checklist.md. Critical findings lean toward ASK; informational lean toward AUTO-FIX.
25
+
26
+ 5. **Auto-fix all AUTO-FIX items.** Apply each fix. Output one line per fix:
27
+ `[AUTO-FIXED] [file:line] Problem → what you did`
28
+
29
+ 6. **If ASK items remain,** present them in ONE AskUserQuestion:
30
+ - List each with number, severity, problem, recommended fix
31
+ - Per-item options: A) Fix B) Skip
32
+ - Overall RECOMMENDATION
33
+ - If 3 or fewer ASK items, you may use individual AskUserQuestion calls instead
34
+
35
+ 7. **After all fixes (auto + user-approved):**
36
+ - If ANY fixes were applied: commit fixed files by name (`git add <fixed-files> && git commit -m "fix: pre-landing review fixes"`), then **stay in this invocation and loop**: re-run the test suite (Step 5) on the fixed code, then re-run this review (Step 9 items 2-6) against the updated diff. Repeat until one full pass applies ZERO fixes — tests green and review clean — then continue to Step 12. NEVER stop to tell the user to run `/ship` again; a fix-and-rerun cycle has no user decision in it, and stopping there breaks the fully-automated contract (#2391).
37
+ - **Bound: 3 fix cycles.** If the 3rd cycle still applies fixes, STOP and report which findings keep reappearing — a review that won't converge is a genuine blocker worth human eyes, not a re-run request.
38
+ - If no fixes applied (all ASK items skipped, or no issues found): continue to Step 12.
39
+
40
+ 8. Output summary: `Pre-Landing Review: N issues — M auto-fixed, K asked (J fixed, L skipped)`
41
+
42
+ If no issues found: `Pre-Landing Review: No issues found.`
43
+
44
+ 9. Persist the review result to the review log:
45
+ ```bash
46
+ ~/.claude/skills/istm-workflow/bin/istm-workflow-review-log '{"skill":"review","timestamp":"TIMESTAMP","status":"STATUS","issues_found":N,"critical":N,"informational":N,"quality_score":SCORE,"specialists":SPECIALISTS_JSON,"findings":FINDINGS_JSON,"commit":"'"$(git rev-parse --short HEAD)"'","via":"ship"}'
47
+ ```
48
+ Substitute TIMESTAMP (ISO 8601), STATUS ("clean" if no issues, "issues_found" otherwise),
49
+ and N values from the summary counts above. The `via:"ship"` distinguishes from standalone `/review` runs.
50
+ - `quality_score` = the PR Quality Score computed in Step 9.2 (e.g., 7.5). If specialists were skipped (small diff), use `10.0`
51
+ - `specialists` = the per-specialist stats object compiled in Step 9.2. Each specialist that was considered gets an entry: `{"dispatched":true/false,"findings":N,"critical":N,"informational":N}` if dispatched, or `{"dispatched":false,"reason":"scope|gated"}` if skipped. Example: `{"testing":{"dispatched":true,"findings":2,"critical":0,"informational":2},"security":{"dispatched":false,"reason":"scope"}}`
52
+ - `findings` = array of per-finding records. For each finding (from checklist pass and specialists), include: `{"fingerprint":"path:line:category","severity":"CRITICAL|INFORMATIONAL","action":"ACTION"}`. ACTION is `"auto-fixed"`, `"fixed"` (user approved), or `"skipped"` (user chose Skip).
53
+
54
+ Save the review output — it goes into the PR body in Step 19.
55
+
56
+ ---
@@ -0,0 +1,264 @@
1
+ <!-- AUTO-GENERATED from test-coverage.md.tmpl — do not edit directly -->
2
+ <!-- Regenerate: bun run gen:skill-docs -->
3
+ ## Step 7: Test Coverage Audit
4
+
5
+ **Dispatch this step as a subagent** using the Agent tool with `subagent_type: "general-purpose"`. The subagent runs the coverage audit in a fresh context window — the parent only sees the conclusion, not intermediate file reads. This is context-rot defense.
6
+
7
+ **Subagent prompt:** Pass the following instructions to the subagent, with `<base>` substituted with the base branch:
8
+
9
+ > You are running a ship-workflow test coverage audit. Run `git diff <base>...HEAD` as needed. Do not commit or push — report only.
10
+ >
11
+ > 100% coverage is the goal — every untested path is a path where bugs hide and vibe coding becomes yolo coding. Evaluate what was ACTUALLY coded (from the diff), not what was planned.
12
+
13
+ ### Test Framework Detection
14
+
15
+ Before analyzing coverage, detect the project's test framework:
16
+
17
+ 1. **Read CLAUDE.md** — look for a `## Testing` section with test command and framework name. If found, use that as the authoritative source.
18
+ 2. **If CLAUDE.md has no testing section, auto-detect:**
19
+
20
+ ```bash
21
+ setopt +o nomatch 2>/dev/null || true # zsh compat
22
+ # Detect project runtime (markers are evidence, not commands to run blind)
23
+ [ -f manage.py ] && echo "RUNTIME:python FRAMEWORK:django"
24
+ { [ -f pyproject.toml ] || [ -f pytest.ini ] || [ -f tox.ini ] || [ -f setup.cfg ] || [ -f requirements.txt ]; } && echo "RUNTIME:python"
25
+ [ -f Gemfile ] || [ -f Rakefile ] || [ -f .rspec ] && echo "RUNTIME:ruby"
26
+ [ -f package.json ] && echo "RUNTIME:node"
27
+ [ -f go.mod ] && echo "RUNTIME:go"
28
+ [ -f Cargo.toml ] && echo "RUNTIME:rust"
29
+ [ -f pom.xml ] && echo "RUNTIME:jvm BUILD:maven"
30
+ { [ -f build.gradle ] || [ -f build.gradle.kts ]; } && echo "RUNTIME:jvm BUILD:gradle"
31
+ # Check for existing test infrastructure — config files, scripts, AND test files
32
+ ls jest.config.* vitest.config.* playwright.config.* cypress.config.* .rspec pytest.ini tox.ini phpunit.xml 2>/dev/null
33
+ [ -f package.json ] && grep -q '"test"[[:space:]]*:' package.json && echo "SCRIPT:package.json test"
34
+ [ -f Makefile ] && grep -qE '^(test|check):' Makefile && echo "TARGET:make test"
35
+ git ls-files | grep -cE '(^|/)(tests?|spec|__tests__)/|(^|/)tests?\.py$|(^|/)test_[^/]+\.py$|_test\.(go|py|rb|ts|js|exs)$|\.(test|spec)\.[jt]sx?$|_spec\.rb$|Test\.(java|kt)$' | sed 's/^/TESTFILES:/'
36
+ ```
37
+
38
+ 3. **If no framework detected:** falls through to the Test Framework Bootstrap step (Step 4) which handles full setup.
39
+
40
+ **0. Before/after test count:**
41
+
42
+ ```bash
43
+ # Count test files before any generation
44
+ git ls-files 2>/dev/null | grep -E '(\.test\.|\.spec\.|_test\.|_spec\.)' | wc -l
45
+ ```
46
+
47
+ Store this number for the PR body.
48
+
49
+ **1. Trace every codepath changed** using `git diff origin/<base>...HEAD`:
50
+
51
+ Read every changed file. For each one, trace how data flows through the code — don't just list functions, actually follow the execution:
52
+
53
+ 1. **Read the diff.** For each changed file, read the full file (not just the diff hunk) to understand context.
54
+ 2. **Trace data flow.** Starting from each entry point (route handler, exported function, event listener, component render), follow the data through every branch:
55
+ - Where does input come from? (request params, props, database, API call)
56
+ - What transforms it? (validation, mapping, computation)
57
+ - Where does it go? (database write, API response, rendered output, side effect)
58
+ - What can go wrong at each step? (null/undefined, invalid input, network failure, empty collection)
59
+ 3. **Diagram the execution.** For each changed file, draw an ASCII diagram showing:
60
+ - Every function/method that was added or modified
61
+ - Every conditional branch (if/else, switch, ternary, guard clause, early return)
62
+ - Every error path (try/catch, rescue, error boundary, fallback)
63
+ - Every call to another function (trace into it — does IT have untested branches?)
64
+ - Every edge: what happens with null input? Empty array? Invalid type?
65
+
66
+ This is the critical step — you're building a map of every line of code that can execute differently based on input. Every branch in this diagram needs a test.
67
+
68
+ **2. Map user flows, interactions, and error states:**
69
+
70
+ Code coverage isn't enough — you need to cover how real users interact with the changed code. For each changed feature, think through:
71
+
72
+ - **User flows:** What sequence of actions does a user take that touches this code? Map the full journey (e.g., "user clicks 'Pay' → form validates → API call → success/failure screen"). Each step in the journey needs a test.
73
+ - **Interaction edge cases:** What happens when the user does something unexpected?
74
+ - Double-click/rapid resubmit
75
+ - Navigate away mid-operation (back button, close tab, click another link)
76
+ - Submit with stale data (page sat open for 30 minutes, session expired)
77
+ - Slow connection (API takes 10 seconds — what does the user see?)
78
+ - Concurrent actions (two tabs, same form)
79
+ - **Error states the user can see:** For every error the code handles, what does the user actually experience?
80
+ - Is there a clear error message or a silent failure?
81
+ - Can the user recover (retry, go back, fix input) or are they stuck?
82
+ - What happens with no network? With a 500 from the API? With invalid data from the server?
83
+ - **Empty/zero/boundary states:** What does the UI show with zero results? With 10,000 results? With a single character input? With maximum-length input?
84
+
85
+ Add these to your diagram alongside the code branches. A user flow with no test is just as much a gap as an untested if/else.
86
+
87
+ **3. Check each branch against existing tests:**
88
+
89
+ Go through your diagram branch by branch — both code paths AND user flows. For each one, search for a test that exercises it:
90
+ - Function `processPayment()` → look for `billing.test.ts`, `billing.spec.ts`, `test/billing_test.rb`
91
+ - An if/else → look for tests covering BOTH the true AND false path
92
+ - An error handler → look for a test that triggers that specific error condition
93
+ - A call to `helperFn()` that has its own branches → those branches need tests too
94
+ - A user flow → look for an integration or E2E test that walks through the journey
95
+ - An interaction edge case → look for a test that simulates the unexpected action
96
+
97
+ Quality scoring rubric:
98
+ - ★★★ Tests behavior with edge cases AND error paths
99
+ - ★★ Tests correct behavior, happy path only
100
+ - ★ Smoke test / existence check / trivial assertion (e.g., "it renders", "it doesn't throw")
101
+
102
+ ### E2E Test Decision Matrix
103
+
104
+ When checking each branch, also determine whether a unit test or E2E/integration test is the right tool:
105
+
106
+ **RECOMMEND E2E (mark as [→E2E] in the diagram):**
107
+ - Common user flow spanning 3+ components/services (e.g., signup → verify email → first login)
108
+ - Integration point where mocking hides real failures (e.g., API → queue → worker → DB)
109
+ - Auth/payment/data-destruction flows — too important to trust unit tests alone
110
+
111
+ **RECOMMEND EVAL (mark as [→EVAL] in the diagram):**
112
+ - Critical LLM call that needs a quality eval (e.g., prompt change → test output still meets quality bar)
113
+ - Changes to prompt templates, system instructions, or tool definitions
114
+
115
+ **STICK WITH UNIT TESTS:**
116
+ - Pure function with clear inputs/outputs
117
+ - Internal helper with no side effects
118
+ - Edge case of a single function (null input, empty array)
119
+ - Obscure/rare flow that isn't customer-facing
120
+
121
+ ### REGRESSION RULE (mandatory)
122
+
123
+ **IRON RULE:** When the coverage audit identifies a REGRESSION — code that previously worked but the diff broke — a regression test is written immediately. No AskUserQuestion. No skipping. Regressions are the highest-priority test because they prove something broke.
124
+
125
+ A regression is when:
126
+ - The diff modifies existing behavior (not new code)
127
+ - The existing test suite (if any) doesn't cover the changed path
128
+ - The change introduces a new failure mode for existing callers
129
+
130
+ When uncertain whether a change is a regression, err on the side of writing the test.
131
+
132
+ Format: commit as `test: regression test for {what broke}`
133
+
134
+ **4. Output ASCII coverage diagram:**
135
+
136
+ Include BOTH code paths and user flows in the same diagram. Mark E2E-worthy and eval-worthy paths:
137
+
138
+ ```
139
+ CODE PATHS USER FLOWS
140
+ [+] src/services/billing.ts [+] Payment checkout
141
+ ├── processPayment() ├── [★★★ TESTED] Complete purchase — checkout.e2e.ts:15
142
+ │ ├── [★★★ TESTED] happy + declined + timeout ├── [GAP] [→E2E] Double-click submit
143
+ │ ├── [GAP] Network timeout └── [GAP] Navigate away mid-payment
144
+ │ └── [GAP] Invalid currency
145
+ └── refundPayment() [+] Error states
146
+ ├── [★★ TESTED] Full refund — :89 ├── [★★ TESTED] Card declined message
147
+ └── [★ TESTED] Partial (non-throw only) — :101 └── [GAP] Network timeout UX
148
+
149
+ LLM integration: [GAP] [→EVAL] Prompt template change — needs eval test
150
+
151
+ COVERAGE: 5/13 paths tested (38%) | Code paths: 3/5 (60%) | User flows: 2/8 (25%)
152
+ QUALITY: ★★★:2 ★★:2 ★:1 | GAPS: 8 (2 E2E, 1 eval)
153
+ ```
154
+
155
+ Legend: ★★★ behavior + edge + error | ★★ happy path | ★ smoke check
156
+ [→E2E] = needs integration test | [→EVAL] = needs LLM eval
157
+
158
+ **Fast path:** All paths covered → "Step 7: All new code paths have test coverage ✓" Continue.
159
+
160
+ **5. Generate tests for uncovered paths:**
161
+
162
+ If test framework detected (or bootstrapped in Step 4):
163
+ - Prioritize error handlers and edge cases first (happy paths are more likely already tested)
164
+ - Read 2-3 existing test files to match conventions exactly
165
+ - Generate unit tests. Mock all external dependencies (DB, API, Redis).
166
+ - For paths marked [→E2E]: generate integration/E2E tests using the project's E2E framework (Playwright, Cypress, Capybara, etc.)
167
+ - For paths marked [→EVAL]: generate eval tests using the project's eval framework, or flag for manual eval if none exists
168
+ - Write tests that exercise the specific uncovered path with real assertions
169
+ - Run each test. Passes → commit as `test: coverage for {feature}`
170
+ - Fails → fix once. Still fails → revert, note gap in diagram.
171
+
172
+ Caps: 30 code paths max, 20 tests generated max (code + user flow combined), 2-min per-test exploration cap.
173
+
174
+ If no test framework AND user declined bootstrap → diagram only, no generation. Note: "Test generation skipped — no test framework configured."
175
+
176
+ **Diff is test-only changes:** Skip Step 7 entirely: "No new application code paths to audit."
177
+
178
+ **6. After-count and coverage summary:**
179
+
180
+ ```bash
181
+ # Count test files after generation
182
+ git ls-files 2>/dev/null | grep -E '(\.test\.|\.spec\.|_test\.|_spec\.)' | wc -l
183
+ ```
184
+
185
+ For PR body: `Tests: {before} → {after} (+{delta} new)`
186
+ Coverage line: `Test Coverage Audit: N new code paths. M covered (X%). K tests generated, J committed.`
187
+
188
+ **7. Coverage gate:**
189
+
190
+ Before proceeding, check CLAUDE.md for a `## Test Coverage` section with `Minimum:` and `Target:` fields. If found, use those percentages. Otherwise use defaults: Minimum = 60%, Target = 80%.
191
+
192
+ Using the coverage percentage from the diagram in substep 4 (the `COVERAGE: X/Y (Z%)` line):
193
+
194
+ - **>= target:** Pass. "Coverage gate: PASS ({X}%)." Continue.
195
+ - **>= minimum, < target:** Use AskUserQuestion:
196
+ - "AI-assessed coverage is {X}%. {N} code paths are untested. Target is {target}%."
197
+ - RECOMMENDATION: Choose A because untested code paths are where production bugs hide.
198
+ - Options:
199
+ A) Generate more tests for remaining gaps (recommended)
200
+ B) Ship anyway — I accept the coverage risk
201
+ C) These paths don't need tests — mark as intentionally uncovered
202
+ - If A: Loop back to substep 5 (generate tests) targeting the remaining gaps. After second pass, if still below target, present AskUserQuestion again with updated numbers. Maximum 2 generation passes total.
203
+ - If B: Continue. Include in PR body: "Coverage gate: {X}% — user accepted risk."
204
+ - If C: Continue. Include in PR body: "Coverage gate: {X}% — {N} paths intentionally uncovered."
205
+
206
+ - **< minimum:** Use AskUserQuestion:
207
+ - "AI-assessed coverage is critically low ({X}%). {N} of {M} code paths have no tests. Minimum threshold is {minimum}%."
208
+ - RECOMMENDATION: Choose A because less than {minimum}% means more code is untested than tested.
209
+ - Options:
210
+ A) Generate tests for remaining gaps (recommended)
211
+ B) Override — ship with low coverage (I understand the risk)
212
+ - If A: Loop back to substep 5. Maximum 2 passes. If still below minimum after 2 passes, present the override choice again.
213
+ - If B: Continue. Include in PR body: "Coverage gate: OVERRIDDEN at {X}%."
214
+
215
+ **Coverage percentage undetermined:** If the coverage diagram doesn't produce a clear numeric percentage (ambiguous output, parse error), **skip the gate** with: "Coverage gate: could not determine percentage — skipping." Do not default to 0% or block.
216
+
217
+ **Test-only diffs:** Skip the gate (same as the existing fast-path).
218
+
219
+ **100% coverage:** "Coverage gate: PASS (100%)." Continue.
220
+
221
+ ### Test Plan Artifact
222
+
223
+ After producing the coverage diagram, write a test plan artifact so `/qa` and `/qa-only` can consume it:
224
+
225
+ ```bash
226
+ eval "$(~/.claude/skills/istm-workflow/bin/istm-workflow-slug 2>/dev/null)" && mkdir -p ~/.istm-workflow/projects/$SLUG
227
+ USER=$(whoami)
228
+ DATETIME=$(date +%Y%m%d-%H%M%S)
229
+ ```
230
+
231
+ Write to `~/.istm-workflow/projects/{slug}/{user}-{branch}-ship-test-plan-{datetime}.md`:
232
+
233
+ ```markdown
234
+ # Test Plan
235
+ Generated by /ship on {date}
236
+ Branch: {branch}
237
+ Repo: {owner/repo}
238
+
239
+ ## Affected Pages/Routes
240
+ - {URL path} — {what to test and why}
241
+
242
+ ## Key Interactions to Verify
243
+ - {interaction description} on {page}
244
+
245
+ ## Edge Cases
246
+ - {edge case} on {page}
247
+
248
+ ## Critical Paths
249
+ - {end-to-end flow that must work}
250
+ ```
251
+ >
252
+ > After your analysis, output a single JSON object on the LAST LINE of your response (no other text after it):
253
+ > `{"coverage_pct":N,"gaps":N,"diagram":"<full markdown coverage diagram for PR body>","tests_added":["path",...]}`
254
+
255
+ **Parent processing:**
256
+
257
+ 1. Read the subagent's final output. Parse the LAST line as JSON.
258
+ 2. Store `coverage_pct` (for Step 20 metrics), `gaps` (user summary), `tests_added` (for the commit).
259
+ 3. Embed `diagram` verbatim in the PR body's `## Test Coverage` section (Step 19).
260
+ 4. Print a one-line summary: `Coverage: {coverage_pct}%, {gaps} gaps. {tests_added.length} tests added.`
261
+
262
+ **If the subagent fails, times out, or returns invalid JSON:** Fall back to running the audit inline in the parent. Do not block /ship on subagent failure — partial results are better than none.
263
+
264
+ ---
@@ -0,0 +1,23 @@
1
+ ## Step 7: Test Coverage Audit
2
+
3
+ **Dispatch this step as a subagent** using the Agent tool with `subagent_type: "general-purpose"`. The subagent runs the coverage audit in a fresh context window — the parent only sees the conclusion, not intermediate file reads. This is context-rot defense.
4
+
5
+ **Subagent prompt:** Pass the following instructions to the subagent, with `<base>` substituted with the base branch:
6
+
7
+ > You are running a ship-workflow test coverage audit. Run `git diff <base>...HEAD` as needed. Do not commit or push — report only.
8
+ >
9
+ > {{TEST_COVERAGE_AUDIT_SHIP}}
10
+ >
11
+ > After your analysis, output a single JSON object on the LAST LINE of your response (no other text after it):
12
+ > `{"coverage_pct":N,"gaps":N,"diagram":"<full markdown coverage diagram for PR body>","tests_added":["path",...]}`
13
+
14
+ **Parent processing:**
15
+
16
+ 1. Read the subagent's final output. Parse the LAST line as JSON.
17
+ 2. Store `coverage_pct` (for Step 20 metrics), `gaps` (user summary), `tests_added` (for the commit).
18
+ 3. Embed `diagram` verbatim in the PR body's `## Test Coverage` section (Step 19).
19
+ 4. Print a one-line summary: `Coverage: {coverage_pct}%, {gaps} gaps. {tests_added.length} tests added.`
20
+
21
+ **If the subagent fails, times out, or returns invalid JSON:** Fall back to running the audit inline in the parent. Do not block /ship on subagent failure — partial results are better than none.
22
+
23
+ ---