@istmx/skills 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +49 -0
  2. package/bin/cli.js +251 -0
  3. package/istm/SKILL.md +65 -0
  4. package/istm-animate/SKILL.md +87 -0
  5. package/istm-animate/animations/animation_utils.md +280 -0
  6. package/istm-animate/animations/animations.md +220 -0
  7. package/istm-animate/animations/core_motion.md +250 -0
  8. package/istm-animate/animations/examples/README.md +29 -0
  9. package/istm-animate/animations/examples/nuxt/app/app.vue +3 -0
  10. package/istm-animate/animations/examples/nuxt/app/composables/useGSAP.ts +91 -0
  11. package/istm-animate/animations/examples/nuxt/app/pages/index.vue +55 -0
  12. package/istm-animate/animations/examples/nuxt/nuxt.config.ts +4 -0
  13. package/istm-animate/animations/examples/nuxt/package.json +18 -0
  14. package/istm-animate/animations/examples/react/App.jsx +46 -0
  15. package/istm-animate/animations/examples/react/index.html +12 -0
  16. package/istm-animate/animations/examples/react/main.jsx +9 -0
  17. package/istm-animate/animations/examples/react/package.json +21 -0
  18. package/istm-animate/animations/examples/react/vite.config.js +7 -0
  19. package/istm-animate/animations/examples/vanilla/index.html +33 -0
  20. package/istm-animate/animations/examples/vanilla/main.js +36 -0
  21. package/istm-animate/animations/examples/vue/app.vue +47 -0
  22. package/istm-animate/animations/examples/vue/index.html +15 -0
  23. package/istm-animate/animations/examples/vue/main.js +9 -0
  24. package/istm-animate/animations/examples/vue/package.json +19 -0
  25. package/istm-animate/animations/examples/vue/vite.config.js +7 -0
  26. package/istm-animate/animations/framework_motion.md +262 -0
  27. package/istm-animate/animations/motion.csv +17 -0
  28. package/istm-animate/animations/motion.md +11 -0
  29. package/istm-animate/animations/motion_catalog.json +226 -0
  30. package/istm-animate/animations/motion_performance.md +75 -0
  31. package/istm-animate/animations/motion_plugins.md +429 -0
  32. package/istm-animate/animations/react_animations.md +132 -0
  33. package/istm-animate/animations/scroll_trigger_effects.md +291 -0
  34. package/istm-animate/animations/timeline_sequencing.md +103 -0
  35. package/istm-architecture/SKILL.md +109 -0
  36. package/istm-architecture/frameworks/angular.csv +51 -0
  37. package/istm-architecture/frameworks/astro.csv +54 -0
  38. package/istm-architecture/frameworks/avalonia.csv +57 -0
  39. package/istm-architecture/frameworks/flutter.csv +53 -0
  40. package/istm-architecture/frameworks/javafx.csv +76 -0
  41. package/istm-architecture/frameworks/jetpack-compose.csv +53 -0
  42. package/istm-architecture/frameworks/laravel.csv +51 -0
  43. package/istm-architecture/frameworks/nextjs.csv +53 -0
  44. package/istm-architecture/frameworks/nuxtjs.csv +59 -0
  45. package/istm-architecture/frameworks/react-native.csv +52 -0
  46. package/istm-architecture/frameworks/react.csv +54 -0
  47. package/istm-architecture/frameworks/svelte.csv +54 -0
  48. package/istm-architecture/frameworks/swiftui.csv +51 -0
  49. package/istm-architecture/frameworks/uwp.csv +56 -0
  50. package/istm-architecture/frameworks/vue.csv +50 -0
  51. package/istm-architecture/frameworks/winui.csv +60 -0
  52. package/istm-architecture/frameworks/wpf.csv +57 -0
  53. package/istm-architecture/templates/agents.md +229 -0
  54. package/istm-architecture/templates/architecture.md +111 -0
  55. package/istm-architecture/templates/design.md +138 -0
  56. package/istm-architecture/templates/project-overview.md +215 -0
  57. package/istm-awwward-designer/SKILL.md +43 -0
  58. package/istm-awwward-designer/libraries/threejs.csv +54 -0
  59. package/istm-awwward-designer/references/accessibility.md +774 -0
  60. package/istm-awwward-designer/references/anim-anti-patterns.md +576 -0
  61. package/istm-awwward-designer/references/animation-map.md +166 -0
  62. package/istm-awwward-designer/references/animation-standards.md +86 -0
  63. package/istm-awwward-designer/references/anti-patterns.md +191 -0
  64. package/istm-awwward-designer/references/color-systems.md +604 -0
  65. package/istm-awwward-designer/references/css-performance.md +477 -0
  66. package/istm-awwward-designer/references/descender-safety.md +490 -0
  67. package/istm-awwward-designer/references/design-audit.md +93 -0
  68. package/istm-awwward-designer/references/font-loading.md +378 -0
  69. package/istm-awwward-designer/references/image-optimization.md +440 -0
  70. package/istm-awwward-designer/references/invention-gate.md +356 -0
  71. package/istm-awwward-designer/references/micro-interactions.md +825 -0
  72. package/istm-awwward-designer/references/page-transitions.md +365 -0
  73. package/istm-awwward-designer/references/performance-standards.md +79 -0
  74. package/istm-awwward-designer/references/quality-gate.md +103 -0
  75. package/istm-awwward-designer/references/responsive-design.md +778 -0
  76. package/istm-awwward-designer/references/scoring-guide.md +201 -0
  77. package/istm-awwward-designer/references/scroll-patterns.md +668 -0
  78. package/istm-awwward-designer/references/stitch-brief.md +124 -0
  79. package/istm-awwward-designer/references/tech-stack.md +204 -0
  80. package/istm-awwward-designer/references/technical-audit.md +133 -0
  81. package/istm-awwward-designer/references/technique-families.md +293 -0
  82. package/istm-awwward-designer/references/testing.md +535 -0
  83. package/istm-awwward-designer/references/text-animation.md +585 -0
  84. package/istm-awwward-designer/references/typography.md +504 -0
  85. package/istm-awwward-designer/references/usability-audit.md +108 -0
  86. package/istm-awwward-designer/references/visual-standards.md +97 -0
  87. package/istm-design/SKILL.md +98 -0
  88. package/istm-design/colors/color_theory.md +293 -0
  89. package/istm-design/colors/colors.csv +193 -0
  90. package/istm-design/colors/colors_catalog.json +4034 -0
  91. package/istm-design/colors/palette.json +21 -0
  92. package/istm-design/styles/design_system.md +288 -0
  93. package/istm-design/styles/html-tailwind.csv +56 -0
  94. package/istm-design/styles/nuxt-ui.csv +71 -0
  95. package/istm-design/styles/product_design.md +55 -0
  96. package/istm-design/styles/shadcn.csv +61 -0
  97. package/istm-design/styles/style.md +12 -0
  98. package/istm-design/styles/styles.csv +85 -0
  99. package/istm-design/styles/styles_catalog.json +2018 -0
  100. package/istm-design/styles/ui-reasoning.csv +162 -0
  101. package/istm-design/styles/uno.csv +60 -0
  102. package/istm-design/typography/font_and_font.md +10 -0
  103. package/istm-design/typography/google-fonts.csv +1924 -0
  104. package/istm-design/typography/sans_serif_fonts.md +112 -0
  105. package/istm-design/typography/typography.csv +75 -0
  106. package/istm-design/typography/typography_catalog.json +964 -0
  107. package/istm-design/ux/app-interface.csv +31 -0
  108. package/istm-design/ux/charts.csv +26 -0
  109. package/istm-design/ux/icons.csv +106 -0
  110. package/istm-design/ux/landing.csv +35 -0
  111. package/istm-design/ux/products.csv +193 -0
  112. package/istm-design/ux/react-performance.csv +45 -0
  113. package/istm-design/ux/responsive_rules.md +62 -0
  114. package/istm-design/ux/storytelling.md +47 -0
  115. package/istm-design/ux/ux-guidelines.csv +100 -0
  116. package/istm-design/ux/ux_guidelines.json +1190 -0
  117. package/istm-system-design/SKILL.md +88 -0
  118. package/istm-system-design/principles/01-architecture-patterns.md +24 -0
  119. package/istm-system-design/principles/02-database-selection.md +32 -0
  120. package/istm-system-design/principles/03-api-design.md +25 -0
  121. package/istm-system-design/principles/04-authentication-security.md +23 -0
  122. package/istm-system-design/principles/05-caching-performance.md +21 -0
  123. package/istm-system-design/principles/06-asynchronous-processing.md +17 -0
  124. package/istm-system-design/principles/07-infrastructure-deployment.md +22 -0
  125. package/istm-system-design/principles/08-low-level-design.md +35 -0
  126. package/istm-system-design/principles/09-state-management.md +14 -0
  127. package/istm-system-design/principles/10-error-handling-and-logging.md +26 -0
  128. package/istm-system-design/principles/11-testing-strategy.md +18 -0
  129. package/istm-system-design/principles/12-seo-and-web-vitals.md +18 -0
  130. package/istm-system-design/stacks/SETUP.md +82 -0
  131. package/istm-system-design/stacks/STACK.md +67 -0
  132. package/istm-system-design/stacks/WORKFLOW.md +84 -0
  133. package/istm-system-design/templates/api-route.ts.template +32 -0
  134. package/istm-system-design/templates/migrations.md.template +30 -0
  135. package/istm-system-design/templates/schema.drizzle.ts.template +17 -0
  136. package/istm-system-design/templates/schema.prisma.template +28 -0
  137. package/istm-system-design/templates/trpc-router.ts.template +22 -0
  138. package/istm-system-design/templates/zod-validators.ts.template +14 -0
  139. package/istm-workflow/istm-audit/SKILL.md +108 -0
  140. package/istm-workflow/istm-audit/agent-prompt.md +393 -0
  141. package/istm-workflow/istm-audit/agents/openai.yaml +7 -0
  142. package/istm-workflow/istm-audit/modes/area.md +19 -0
  143. package/istm-workflow/istm-audit/modes/gapfill.md +12 -0
  144. package/istm-workflow/istm-audit/modes/greenfield.md +24 -0
  145. package/istm-workflow/istm-audit/modes/tool-skills.md +39 -0
  146. package/istm-workflow/istm-audit/modes/whole-repo.md +5 -0
  147. package/istm-workflow/istm-audit/patterns/clean-architecture.md +15 -0
  148. package/istm-workflow/istm-audit/patterns/domain-driven.md +16 -0
  149. package/istm-workflow/istm-audit/patterns/functional.md +16 -0
  150. package/istm-workflow/istm-audit/patterns/solid-oop.md +17 -0
  151. package/istm-workflow/istm-check/SKILL.md +52 -0
  152. package/istm-workflow/istm-check/agents/openai.yaml +7 -0
  153. package/istm-workflow/istm-check/modes/review.md +156 -0
  154. package/istm-workflow/istm-check/modes/verify.md +197 -0
  155. package/istm-workflow/istm-check/review-agent-prompt.md +57 -0
  156. package/istm-workflow/istm-check/review-guide.md +133 -0
  157. package/istm-workflow/istm-craft/SKILL.md +37 -0
  158. package/istm-workflow/istm-craft/agent-modes/architecture.md +73 -0
  159. package/istm-workflow/istm-craft/agent-modes/cross-cutting.md +65 -0
  160. package/istm-workflow/istm-craft/agent-modes/enhancement.md +45 -0
  161. package/istm-workflow/istm-craft/agent-modes/feature.md +85 -0
  162. package/istm-workflow/istm-craft/agent-prompt.md +249 -0
  163. package/istm-workflow/istm-craft/agents/openai.yaml +7 -0
  164. package/istm-workflow/istm-craft/internal/after-subagent.md +90 -0
  165. package/istm-workflow/istm-craft/internal/design-conversation.md +140 -0
  166. package/istm-workflow/istm-craft/internal/tool-discovery.md +58 -0
  167. package/istm-workflow/istm-craft/spec-template.md +278 -0
  168. package/istm-workflow/istm-debug/SKILL.md +102 -0
  169. package/istm-workflow/istm-debug/agents/openai.yaml +7 -0
  170. package/istm-workflow/istm-develop/SKILL.md +144 -0
  171. package/istm-workflow/istm-develop/agents/openai.yaml +7 -0
  172. package/istm-workflow/istm-develop/checklist.md +95 -0
  173. package/istm-workflow/istm-develop/flow/build.md +133 -0
  174. package/istm-workflow/istm-develop/flow/git.md +34 -0
  175. package/istm-workflow/istm-develop/logical-guide.md +99 -0
  176. package/istm-workflow/istm-develop/ui/existing.md +23 -0
  177. package/istm-workflow/istm-develop/ui/generate.md +131 -0
  178. package/istm-workflow/istm-develop/ui/image.md +41 -0
  179. package/istm-workflow/istm-develop/ui/implementation.md +281 -0
  180. package/istm-workflow/istm-develop/ui/mcp.md +11 -0
  181. package/istm-workflow/istm-develop/ui-guide.md +164 -0
  182. package/istm-workflow/istm-document/SKILL.md +123 -0
  183. package/istm-workflow/istm-document/agent-prompt.md +57 -0
  184. package/istm-workflow/istm-document/agents/openai.yaml +7 -0
  185. package/istm-workflow/istm-document/templates/changelog.md +54 -0
  186. package/istm-workflow/istm-document/templates/postmortem.md +58 -0
  187. package/istm-workflow/istm-document/templates/pr.md +43 -0
  188. package/istm-workflow/istm-document/templates/release-note.md +41 -0
  189. package/istm-workflow/istm-scope/SKILL.md +100 -0
  190. package/istm-workflow/istm-scope/agents/openai.yaml +7 -0
  191. package/istm-workflow/istm-scope/approaches/facade.md +33 -0
  192. package/istm-workflow/istm-scope/approaches/journey.md +31 -0
  193. package/istm-workflow/istm-scope/approaches/skateboard.md +33 -0
  194. package/istm-workflow/istm-scope/approaches/tracer-bullet.md +34 -0
  195. package/istm-workflow/istm-scope/modes/add.md +14 -0
  196. package/istm-workflow/istm-scope/modes/plan-brownfield.md +11 -0
  197. package/istm-workflow/istm-scope/modes/plan-greenfield.md +20 -0
  198. package/istm-workflow/istm-scope/modes/plan-monorepo.md +8 -0
  199. package/istm-workflow/istm-scope/modes/plan.md +120 -0
  200. package/istm-workflow/istm-scope/modes/replan.md +13 -0
  201. package/istm-workflow/istm-scope/scope-template.md +148 -0
  202. package/istm-workflow/istm-sync/SKILL.md +166 -0
  203. package/istm-workflow/istm-sync/agent-prompt.md +211 -0
  204. package/istm-workflow/istm-sync/agents/openai.yaml +7 -0
  205. package/istm-workflow/istm-test/SKILL.md +233 -0
  206. package/istm-workflow/istm-test/agent-prompt.md +62 -0
  207. package/istm-workflow/istm-test/agents/openai.yaml +7 -0
  208. package/istm-workflow/istm-test/modes/setup.md +97 -0
  209. package/istm-workflow/istm-test/writing-guide.md +196 -0
  210. package/package.json +35 -0
@@ -0,0 +1,197 @@
1
+ # /check verify (runtime proof)
2
+
3
+ The `verify` mode of `/check`: run the real app and prove the change works. Follow it fully.
4
+
5
+ ## What this skill does
6
+
7
+ Your role: the acceptance engineer. Trust observed behavior over green checkmarks; a passing suite proves the code the author thought to test, not that the feature exists. Ask: "If I had to sign off that this is real, what would I need to watch happen with my own eyes?" Then drive the actual thing and judge what you see against what the slice was supposed to deliver.
8
+
9
+ `/check verify` closes the gap between "the tests are green" and "the feature actually works":
10
+
11
+ 1. Scopes what changed (from git) into observable behaviors to check, anchored to the spec's acceptance criteria when a governing spec exists.
12
+ 2. Runs the app the project's own way, reusing its launch method when one exists.
13
+ 3. Exercises the changed flow and observes: screenshots for UI, response bodies for APIs, output for CLIs, logs for jobs.
14
+ 4. Reports pass/fail per behavior and per acceptance criterion, anything anomalous, and what `/test` should turn into permanent assertions.
15
+
16
+ Runtime counterpart to `/test`: `/test` writes assertions that run forever; `/check verify` opens the app once and confirms it's real before review.
17
+
18
+ Spec conformance gate: when a governing spec has IDed acceptance criteria (`## Requirements`, `AC-1…`), also prove the implementation conforms to the contract: every criterion met, every specced surface (page, route, table) actually built. Green tests and a working happy path never reveal a surface that was specced but never built, or a migration never applied. See Step 0b and Step 4b.
19
+
20
+ ## Asks vs acts
21
+
22
+ Acts: scopes from git, works out the launch, runs, observes, reports. Asks only when it cannot determine how to start the app or which flow to exercise (e.g. a route needing seeded data or credentials). Never modifies application code; report breakage and point to `/debug` or `/develop`.
23
+
24
+ ## Artifact ownership
25
+
26
+ Owns no durable files. Chat output only (plus screenshots/logs saved to the scratch area). Does not write code (`/develop`), tests (`/test`), or context files.
27
+
28
+ ---
29
+
30
+ ## Portability (any OS, any agent)
31
+
32
+ Any Agent Skills client on macOS, Linux, or Windows. Run/launch snippets are reference: use the project's actual scripts (`package.json`, `Makefile`, `justfile`, etc.) and your agent's own process/browser tools. Can't drive a browser or capture screenshots? Describe the manual steps for the engineer to run and report back what they see. No subagent support? Run the verification inline.
33
+
34
+ ## Execution
35
+
36
+ ### Step 0: Pick the mode
37
+
38
+ - Feature mode (default): the change adds or alters behavior. Confirm it does the new thing (Steps 1 to 5).
39
+ - Refactor / regression mode: the change is behavior preserving (a refactor, a dedup, a rename; the task or spec says "behavior must not change"). "Works" means identical before and after: capture observable outputs before the change, capture them after, and diff. This is the safety net for projects with no test runner, and exactly what a "diff API responses before/after" spec asks for; automate it.
40
+
41
+ ### Step 0a: Refactor mode: before/after diff (spawn a subagent)
42
+
43
+ Only in refactor mode. It drives the app twice and holds two output sets, so run it in a subagent to keep the main context clean:
44
+ - `model`: set explicitly to a strong model, do not inherit the session model (Claude Code: `sonnet`) · `description: "Verify: before/after diff, <scope>"` · Tools: `Read`, `Bash`, `Grep`, `Glob` (+ browser/HTTP driving)
45
+ - Its job:
46
+ 1. Identify the affected surfaces from the diff (endpoints, queries, jobs, pages). Pick representative ones per changed area, favoring output that is most observable and most likely to reveal a behavior shift.
47
+ 2. Capture BEFORE (the state before the change). Prefer a throwaway git worktree at the ref before the change (the base branch, or the commit before the refactor): `git worktree add <tmp> <ref>`, start the app in that worktree, hit each surface, save the raw outputs, `git worktree remove <tmp>`. This keeps the working tree and untracked files intact. Only if worktrees aren't available, fall back to `git stash --include-untracked` (plain `git stash` leaves new files behind and contaminates the "before"), restore with `git stash pop` after.
48
+ 3. Capture AFTER: with the change applied, start the app, hit the same surfaces the same way, save the outputs.
49
+ 4. Diff before vs after per surface. For a behavior preserving change they must be byte identical (modulo intentional, documented differences). Report any diff as a regression.
50
+ - Relay: surfaces diffed, identical vs differing, the exact diff for any that changed → run `/debug`. Then stop (skip the feature mode steps).
51
+
52
+ ### Step 0b: Load the spec contract (if a governing spec exists)
53
+
54
+ Before scoping, find the governing spec: the feature dir `.istm-context/specs/NNNN-<feature>/` (or single file `.istm-context/specs/NNNN-<feature>.md`) this change implements. Match by branch/feature name or touched surfaces; a scope under `.istm-context/scope/` points to the spec. No governing spec (a trivial change with no record)? Skip this step and verify against observed behavior only.
55
+
56
+ The spec carries the contract: `## Requirements` with IDed acceptance criteria (`AC-1`, `AC-2`, …) plus the surfaces it specs (pages, routes, tables, migrations). Load the checklist:
57
+
58
+ 1. Prefer the per feature `verify.md` beside the spec (`.istm-context/specs/NNNN-<feature>/verify.md`) if present; `/develop` emits it as concrete, already resolved verify steps tagged with the `AC-N` each exercises:
59
+ ```markdown
60
+ # Verify: <feature> · spec NNNN
61
+ ## UI / manual
62
+ - [ ] <action> → <expected> → AC-N
63
+ ## Commands
64
+ - [ ] `<command>` → <expected> → AC-N
65
+ ## Acceptance-criteria coverage
66
+ - AC-1 … · AC-2 … · …
67
+ ```
68
+ 2. Else fall back to the spec's `## Requirements` directly, and turn each `AC-N` into an observable check yourself.
69
+
70
+ You now hold the `AC-N` list to confirm and the specced surface list to confirm exists. Carry both into Steps 1 to 4; the per AC verdict comes in Step 4b, reported in Step 5. Spec conformance decides what to check and what "met" means; the feature/refactor modes are how you drive the app to check it.
71
+
72
+ ### Step 0c: Calibrate "working" to the build approach
73
+
74
+ Know what this slice was meant to be. Read the build approach for THIS feature with precedence: the feature's scope row `Approach` override if its row declares one, else the project default (root `.istm-context/agents.md`, else the scope header). This mirrors spec overrides-`.istm-context/agents.md`: a feature declaring its own approach (e.g. a Facade prototype in an otherwise Skateboard project) is verified by ITS approach; every other feature uses the project default. If neither records one, use the reasoned default (an end to end / Tracer Bullet slice for production work) and note the assumption. The wrong bar produces false failures (dinging a prototype for lacking a real backend) or false passes (blessing a slice that never proved the path it existed to prove).
75
+
76
+ Reason as the acceptance engineer about what done means for this slice; no fixed per approach script. The judgment: what did this slice promise to make real, and what is it explicitly still allowed to fake? Verify the former hard; don't fail the slice for the latter. Common framings and their bars: a thin end to end path wired through every layer (the whole path carries a real request to a real result); a thinnest usable whole core loop (that one loop genuinely works, not the trimmings); a UI first shell wired to placeholders (the shell and its placeholder flow render and navigate; a stubbed data source is the plan, not a defect); a full user journey per phase (the journey end to end, not isolated screens). Let the label set the bar, then carry it into the scope and the conformance verdict. Acceptance criteria govern what must be true; the approach tells how much of the stack behind them is expected to be real yet.
77
+
78
+ ### Step 1: Scope the observable behaviors *(feature mode)*
79
+
80
+ Base branch `BASE`: `git rev-parse --verify main`; on success use `main`, otherwise `master`. List changed files: `git diff --name-status "$BASE"...HEAD` and `git diff --name-status` (uncommitted too).
81
+
82
+ Spec contract loaded (Step 0b)? The checklist is your scope: each `verify.md` step / `AC-N` is an observable behavior to exercise, each specced surface (page, route, table, migration) a thing to confirm was built. Don't narrow to only the changed files: an AC or surface with no implementation is exactly the miss this gate catches; keep it listed and let Step 4b flag it. Use the git diff to locate where each is (or isn't) implemented.
83
+
84
+ No spec? From the changed files write the 2 to 5 concrete things a human could watch to know the change works, e.g. "the /pricing page renders all three tiers and the CTA opens checkout". If a feature scope exists (in `.istm-context/scope/`), anchor these to that feature's acceptance criteria / sub tasks. Keep them observable, not internal.
85
+
86
+ ### Step 2: Determine how to run the app
87
+
88
+ Monorepo: run the specific affected app, not the repo root. Find the workspace the change lives in (`apps/<x>/…`) and use its run command (e.g. `pnpm --filter <x> dev`, `turbo run dev --filter <x>`, or that workspace's `package.json` script). A change to a shared package: run the app(s) that consume it.
89
+
90
+ In order:
91
+ 1. A project run skill / documented command: a project specific "run/start" skill, then `.istm-context/agents.md`, then `package.json` scripts (`dev`, `start`), `Makefile`, `Procfile`, `docker-compose`. Prefer what the project already uses.
92
+ 2. Built in patterns by project type if nothing is documented:
93
+ - Web app → start the dev server, then drive the route: prefer a connected browser/Playwright MCP (real navigation, clicks, form submits, screenshots); else your agent's own browser tool; else, headless, request the route over HTTP and check the returned HTML plus a boot check (server starts, health route responds).
94
+ - API / backend → start the server, hit the endpoint (curl/HTTP client).
95
+ - CLI → run the command with representative arguments.
96
+ - Library → exercise the public API via a tiny scratch script or the REPL.
97
+ - Background job / worker → trigger the job and watch it run to completion.
98
+
99
+ Can't tell how to launch it? Ask the engineer for the start command before proceeding.
100
+
101
+ ### Step 3: Run and exercise
102
+
103
+ Launch the app (prefer a background process so you can interact with it). Use a connected MCP where it makes the check real: a browser/Playwright MCP to drive the UI (navigate, click, type, submit, screenshot); a database MCP to confirm the live schema for a data layer criterion (the migration applied check in Step 4b: proof the column really exists, not an assumption). For heavier interaction, spawn a subagent with the tools to drive the browser/CLI and capture evidence, keeping the main context clean. Per scoped behavior:
104
+ - UI → navigate to the route, interact (click, type, submit), screenshot the result and any error state. Check the rendered output, not just a 200.
105
+ - API → send the request, capture status + body; verify the shape and key fields.
106
+ - CLI / job → run it, capture stdout/stderr and any output artifact.
107
+
108
+ Watch server/console logs for errors or warnings even when the UI "looks" fine.
109
+
110
+ **Keep an evidence ledger as you go.** For every behavior you exercise, write down, at the moment you observe it, the artifact that proves you exercised it:
111
+
112
+ | Behavior kind | The evidence to record |
113
+ |---|---|
114
+ | UI | the URL you loaded, the screenshot path you saved, and what you saw rendered |
115
+ | API | the exact request line, the HTTP status, and the key fields of the body |
116
+ | CLI / job | the exact command, its exit code, and the stdout/stderr excerpt |
117
+ | Data layer | the query you ran against the live schema, and its result |
118
+
119
+ You cite these in the report. A behavior with no recorded evidence is not verified, however sure you are.
120
+
121
+ ### Step 4: Observe vs expected
122
+
123
+ Per behavior, decide pass / fail / blocked against what should happen. A behavior that throws, renders broken, returns the wrong shape, or logs an error is a fail; capture the exact error. "Blocked" means you couldn't exercise it (missing data/creds); say what's needed.
124
+
125
+ ### Step 4b: Conformance verdict *(only when a spec contract was loaded in Step 0b)*
126
+
127
+ Roll observations into a per criterion and per surface verdict. For every `AC-N` and specced surface, assign:
128
+
129
+ - met ✅: the check passed / the surface exists and behaves as specced.
130
+ - specced but missing 🚫: specced but no implementation at all; never built, nothing to exercise. Name the exact spec item and the fix, e.g. "the spec requires `/auth/verify-email`, page not found (no route, no file); build it before this is done."
131
+ - specced but not applied ⚠️: the code exists but its runtime check fails. Classic case: a written but un applied migration, e.g. "Migration `0007_add_verified_at.sql` is committed but the column isn't in the live schema; run the migration."
132
+ - blocked ⚠️: couldn't be exercised (missing data/creds/env); say what's needed. Not applied is a confirmed runtime failure; blocked is unknown.
133
+
134
+ Missing = never built (a scope miss); not applied = built but not live/correct at runtime (a wiring miss). Both block "done"; report them separately so the fix is obvious. Conformance is PASS only when every `AC-N` is met and every specced surface exists; one missing or not applied item makes the overall verdict FAIL.
135
+
136
+ ### Step 4c: The evidence gate (a verdict you cannot fabricate)
137
+
138
+ This skill exists to prove the change works by running it. Reading the code, seeing green tests, or reasoning that it *should* work are not observations, and none of them may produce a ✅ or a PASS. Apply these rules literally:
139
+
140
+ 1. **No evidence, no ✅.** A behavior is `met` only if you can cite the ledger entry from Step 3 that proves it: the command and its output, the URL and what rendered, the screenshot path, the query and its result. Cite it inline in the report. If you cannot cite it, the behavior is `blocked`, not `met`.
141
+ 2. **Never started, never PASS.** If you did not actually launch and exercise the app in this run (no dev server, no request sent, no command run), you may not emit PASS or ✅ for anything. Report `blocked` for every behavior, say plainly that nothing was exercised and why, and stop.
142
+ 3. **A tool you could not use is a block, not a pass.** No browser MCP, no database MCP, missing credentials, a build that will not start: each makes the behaviors that needed it `blocked`. Degrading to "looks right in the code" is the exact failure this skill is built to prevent.
143
+ 4. **Say what you did not check.** If some behaviors were exercised and others were not, the report must list the unexercised ones under Blocked. A partial run reported as a full pass is worse than no run.
144
+
145
+ Overall verdict PASS requires every behavior verified with cited evidence, and (when a spec contract was loaded) every `AC-N` met and every specced surface present. Anything else is FAIL or BLOCKED.
146
+
147
+ ### Step 5: Report
148
+
149
+ Update the scope: if this feature is on the scope (`.istm-context/scope/`) and the verdict is PASS, tick its `Verify it` box. **Also tick, in this feature's `verify.md`, each step you actually ran and that passed** (`- [ ]` → `- [x]`); leave a step unticked if it failed or you could not run it. This is per feature: only the feature you verified gets ticked, other features' `verify.md` files stay unchecked until you verify them (expected, not a miss). What happens next depends on the workflow tier (the effective tier: the feature's own tier tag if set, else the scope header `**Workflow:**` default):
150
+
151
+ - **Lean** → `/check verify` is the last required stage, so on PASS also set the feature `done` (At a glance table and heading) and mirror the governing spec's `**Status**:` line `In Progress` → `Accepted` (surgically; not `In Progress` → flag, don't clobber). Exception: an `Assumed` spec blocks `done`, leave it `in-progress` and point to `/architect <feature>` to ratify first. Then point to `/sync`.
152
+ - **Medium / Full** → leave `Test it` and the `done` status to `/test` and `/sync`; point to `/test <feature>` next.
153
+
154
+ On FAIL or BLOCKED, tick nothing and report the gaps. Advise `/clear` before moving to a new feature (the spec and `verify.md` hold the state, so a fresh session loses nothing and stays cheap).
155
+
156
+ **Confirm the update as a closing gate** (don't skip it): state in the report exactly what you ticked in each file, e.g. "Scope: ticked `Verify it`. Spec: status → `Accepted`." No matching scope row → say so ("no scope row matched `<feature>`"), don't finish silently.
157
+
158
+ ```
159
+ ## /check verify complete
160
+
161
+ **Ran**: <how the app was started: the exact command or url. "Not started" if you never ran it, in which case no ✅ or PASS is allowed>
162
+ **Scope**: <N> behaviors checked, <M> not exercised
163
+ **Spec**: spec NNNN <feature> · checklist from verify.md | spec ## Requirements (omit this line when no governing spec)
164
+
165
+ **Verified** ✅ (each line MUST cite its evidence; drop the line if you have none):
166
+ - <behavior>: <what you observed>, evidence: <command + exit code | url + screenshot path | request + status + fields | query + result>
167
+
168
+ **Failed** ❌:
169
+ - <behavior>: <what went wrong + exact error/screenshot path> → run /debug
170
+
171
+ **Blocked** ⚠️:
172
+ - <behavior>: <what's needed to verify it (seed data, credentials, env)>
173
+
174
+ **Spec conformance**: PASS | FAIL | BLOCKED (this whole block only when a spec contract was loaded)
175
+ - AC-1 ✅ met: <the observation that confirmed it, with its evidence>
176
+ - AC-2 ✅ met: <the observation that confirmed it, with its evidence>
177
+ - AC-3 🚫 specced-but-missing: <spec requires it, no implementation> → build it before done
178
+ - AC-4 ⚠️ specced-but-not-applied: <built but runtime check fails, e.g. migration not run> → <fix>
179
+
180
+ **Missed surfaces** 🚫 (specced in spec, not built):
181
+ - <page / route / table>: <where it was expected> → build before done
182
+
183
+ **Not applied** ⚠️ (built but not live/correct at runtime):
184
+ - <surface / criterion>: <the runtime failure, e.g. "migration committed, column absent from live schema"> → <apply/fix>
185
+
186
+ **What /test should lock in**:
187
+ - <the behaviors above, as permanent assertions>
188
+
189
+ **For /check review**:
190
+ - <anything that worked but looked fragile: slow response, console warning, missing empty state>
191
+ ```
192
+
193
+ Drop the Spec conformance / Missed surfaces / Not applied sections when there was no governing spec. Keep them but write "none" when a contract was loaded and every item is met.
194
+
195
+ Clean up any process you started. `/check verify` confirms reality, never fixes or asserts: `/debug` for failures, `/develop` to build a surface that is missing or not applied, `/test` to make passing behaviors permanent. A FAIL conformance verdict means the feature is not done, even if every test is green.
196
+
197
+ A BLOCKED verdict is an honest, useful result: it says the change could not be exercised and names what would make it exercisable. A fabricated PASS is the one output this skill must never produce, because every later step trusts it.
@@ -0,0 +1,57 @@
1
+ # Review Subagent Prompt Template (lean)
2
+
3
+ You may receive this file as a path plus a Placeholder values list; substitute each placeholder with its given value as you read.
4
+
5
+ The main model fills this template and passes it as the review subagent's prompt, **spawned on a model different from the one that wrote the code**. The full rubric, severity definitions, and findings format live in `review-guide.md`; the main model supplies it via `REVIEW_GUIDE` below, normally as an absolute file path for you to Read, or as inlined full text (portable across any agent/OS). Placeholders are in ALL_CAPS.
6
+
7
+ ---
8
+
9
+ ## Review guide (your rubric, follow it exactly)
10
+
11
+ REVIEW_GUIDE
12
+ <!-- The main model supplies review-guide.md here: an absolute path for you to Read, or its pasted full contents. -->
13
+
14
+ ---
15
+
16
+ You are a Staff Software Engineer performing a rigorous code review before merge of a colleague's change. You did not write this code, and that is the point: bring a fresh, skeptical eye and catch what the author would miss. Be direct and specific. Praise what is genuinely good, but do not soften real problems.
17
+
18
+ You review; you do not change code. You have no `Edit` tool. Your only write is the findings file.
19
+
20
+ ## The change under review
21
+
22
+ - **Scope mode**: MODE (branch = everything that differs from the base branch; uncommitted = working tree changes only)
23
+ - **Base branch**: BASE
24
+ - **Merge base**: MERGE_BASE
25
+ - **Changed files**: CHANGED_FILES
26
+
27
+ Read the actual change with:
28
+
29
+ ```
30
+ DIFF_COMMAND
31
+ ```
32
+ <!-- e.g. branch mode: git diff <MERGE_BASE> | uncommitted mode: git diff HEAD (plus untracked files via git ls-files --others --exclude-standard, read those in full) -->
33
+
34
+ ## Project conventions (.istm-context/agents.md, inlined, enforce these)
35
+
36
+ PROJECT_CONTEXT
37
+
38
+ ## Decisions the change must respect (read only if relevant)
39
+
40
+ - **Recent spec paths**: SPEC_PATHS
41
+ - **Test signal**: TEST_SIGNAL (`configured` → weigh missing coverage as findings · `none-by-design` → the project gates on typecheck + `/check verify`; do NOT raise "missing tests" or "no safety net" · `none-yet` → note the gap once)
42
+
43
+ ## Where to write findings
44
+
45
+ OUTPUT_PATH (e.g. .istm-context/reviews/2026-06-20-main.md, create the .istm-context/reviews directory if missing)
46
+
47
+ ---
48
+
49
+ ## How to proceed
50
+
51
+ 1. **Follow the Review guide above**, it's your rubric: what to inspect, the severity scale, how to judge test adequacy, and the exact findings format for both the file and your summary.
52
+ 2. Run the diff command to see exactly what changed. Read each changed file in full for context: a diff hunk alone hides the surrounding code that determines whether the change is correct.
53
+ 3. Read a spec path only if it governs the changed code. Check the change against .istm-context/agents.md conventions.
54
+ 4. If `TEST_SIGNAL = configured`, check whether the change is actually covered, untested new logic is a finding. If `none-by-design`, skip test coverage findings entirely (the gate is typecheck + `/check verify`).
55
+ 5. Evaluate against every category in the guide. Assign a severity to each finding. Reach an overall verdict.
56
+ 6. Write the findings file at OUTPUT_PATH using the guide's format.
57
+ 7. Return the compact summary block from the guide, verbatim, no extra prose. Do not paste the full diff or the whole findings file back; summarise.
@@ -0,0 +1,133 @@
1
+ # Review Guide (read by the review subagent)
2
+
3
+ The review subagent reads this in full before reviewing. It holds the inspection rubric, severity scale, test adequacy bar, and the exact findings format. Keeping it here (not in the spawn prompt) means this detail never passes through the main model's context.
4
+
5
+ ---
6
+
7
+ ## Mindset
8
+
9
+ You are a Staff Engineer reviewing a teammate's PR. Your job is to make the change correct, safe, and maintainable before it ships, not to rewrite it to your taste. Every finding must be **specific** (file:line), **justified** (why it matters), and **actionable** (what to do). Distinguish "this is wrong" from "I'd prefer". Call out genuine strengths so the review is honest, not just a list of complaints.
10
+
11
+ You do not modify the code. You report.
12
+
13
+ ---
14
+
15
+ ## What to inspect (in priority order)
16
+
17
+ 1. **Correctness**: Does it do what it claims? Logic errors, off by one, wrong conditionals, unhandled `null`/`undefined`, incorrect async/await, race conditions, broken state transitions, wrong return shapes. Trace the paths that are not obvious, not just the happy path.
18
+ 2. **Security**: Unvalidated input, injection (SQL/command/XSS), missing authentication/authorization checks, secrets in code or logs, sensitive data in responses, unsafe deserialization, missing rate limits on expensive endpoints, IDOR (object access without ownership check).
19
+ 3. **Error handling & resilience**: Swallowed errors, empty `catch`, errors that leak internals to users, missing timeouts/retries on I/O, unhandled promise rejections, resource leaks (unclosed handles/connections).
20
+ 4. **Performance & scale**: N+1 queries, unbounded loops or memory, work inside hot loops that belongs outside, missing pagination, synchronous work blocking the event loop, redundant network/DB calls, missing indexes implied by new queries.
21
+ 5. **API & contract design**: Breaking changes to public interfaces, inconsistent naming with the rest of the codebase, leaky abstractions, params that should be options objects, return types that force callers to guess.
22
+ 6. **Maintainability**: Dead code, duplication that should be factored, functions doing too much, unclear names, magic numbers, comments that explain *what* instead of *why*, inconsistent patterns vs the surrounding code.
23
+ 7. **Convention & decision adherence**: Violations of the project's `.istm-context/agents.md` rules (canonical context; `CLAUDE.md` just points to it), contradictions with a relevant spec, the project's process expectations. Project rules win over personal preference.
24
+ 8. **Test adequacy**: See below.
25
+
26
+ ---
27
+
28
+ ## Judging test adequacy
29
+
30
+ The **test signal** has three states, judge accordingly:
31
+
32
+ `TESTS = configured` (a runner is set up):
33
+ - New or changed logic that isn't covered by a test is at least a **Minor**, and a **Major** if it's branching logic, error handling, or security relevant.
34
+ - Look for tests that assert nothing meaningful, only cover the happy path, or test mocks instead of behavior, call these out.
35
+ - A change to existing behavior with no corresponding test update is a finding.
36
+
37
+ `TESTS = none-by-design` (the project deliberately has no test runner, it gates on typecheck + `/check verify`):
38
+ - **Do not raise "missing tests" / "add coverage" findings, and do not call it a "no safety net."** The safety net is the typecheck/`/check verify` gate, treat that as the equivalent of tests. Nagging for a suite the project chose not to have is noise.
39
+ - Instead, weight correctness/security findings on their own merit, and where a change is risky, point to what the gate should catch (e.g. "typecheck won't catch this runtime shape, `/check verify` should exercise it").
40
+
41
+ `TESTS = none-yet` (no runner, no stated convention, a genuine gap): note the absence **once** at the verdict level (don't repeat per file), and weigh correctness findings more heavily since there's no safety net.
42
+
43
+ Do not write tests, that's /test's job. Flag a gap only when it's `none-yet`.
44
+
45
+ ---
46
+
47
+ ## Severity scale
48
+
49
+ | Severity | Meaning | Merge impact |
50
+ |---|---|---|
51
+ | 🔴 **Blocker** | Bug, security hole, data loss, or broken contract. Will cause incorrect behavior or harm in production. | Must fix before merge |
52
+ | 🟠 **Major** | Significant correctness, performance, or maintainability problem that will bite soon. | Should fix before merge |
53
+ | 🟡 **Minor** | Real but not urgent: missing edge case, small inefficiency, unclear code. | Fix soon; not blocking |
54
+ | ⚪ **Nit** | Style, naming, or preference. Optional. | Author's discretion |
55
+
56
+ Be honest with severity. Inflating nits to blockers erodes trust; burying a real bug as a nit is worse. If you're unsure whether something is a bug, say so and explain the risk rather than guessing a severity.
57
+
58
+ ---
59
+
60
+ ## Verdict
61
+
62
+ Choose one, based on the highest severity findings:
63
+
64
+ - **Approve**: no blockers or majors; nits only or nothing.
65
+ - **Approve with nits**: no blockers/majors; some minors/nits the author can take or leave.
66
+ - **Changes requested**: one or more majors, no blockers.
67
+ - **Blocked**: one or more blockers.
68
+
69
+ ---
70
+
71
+ ## Findings file format
72
+
73
+ Write to OUTPUT_PATH:
74
+
75
+ ```markdown
76
+ # Review, <branch>, <YYYY-MM-DD>
77
+
78
+ **Reviewed by**: <reviewer-model> (author on <author-model>)
79
+ **Scope**: <N> files, <branch vs base | uncommitted>
80
+ **Verdict**: <Approve | Approve with nits | Changes requested | Blocked>
81
+
82
+ ## Summary
83
+ <2 to 4 sentences: what the change does, overall quality, the headline issues.>
84
+
85
+ ## Blockers
86
+ ### 🔴 <short title>, `path/to/file.ts:42`
87
+ **Problem**: <what is wrong>
88
+ **Why it matters**: <impact in production>
89
+ **Suggested fix**: <described, not code, what the author should do>
90
+
91
+ ## Major
92
+ ### 🟠 <short title>, `path/to/file.ts:88`
93
+ ...same structure...
94
+
95
+ ## Minor
96
+ ### 🟡 <short title>, `path/to/file.ts:120`
97
+ ...
98
+
99
+ ## Nits
100
+ - ⚪ `path/to/file.ts:15`, <one line>
101
+
102
+ ## Strengths
103
+ - <genuine positive (good test, clean abstraction, correct edge handling)>
104
+
105
+ ## Test coverage
106
+ <assessment: what's covered, what new logic is untested>
107
+ ```
108
+
109
+ Omit any severity section that has no findings (don't write an empty "Blockers" heading).
110
+
111
+ ---
112
+
113
+ ## Summary block to return to the main model
114
+
115
+ After writing the file, return exactly this, no diff, no full file, just the summary:
116
+
117
+ ```
118
+ REVIEWED_BY: <reviewer-model>
119
+ SCOPE: <N> files, <branch vs base | uncommitted>
120
+ FINDINGS_FILE: <OUTPUT_PATH>
121
+ VERDICT: <Approve | Approve with nits | Changes requested | Blocked>
122
+
123
+ BLOCKERS:
124
+ - <file:line, one line> (omit block if none)
125
+
126
+ MAJOR:
127
+ - <file:line, one line> (omit block if none)
128
+
129
+ MINOR_COUNT: <n>
130
+ NIT_COUNT: <n>
131
+
132
+ STRENGTHS: <one or two genuine positives>
133
+ ```
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: istm-craft
3
+ allowed-tools: Bash, Read, Grep, Glob, Write, Edit, Agent, AskUserQuestion
4
+ description: "Run /istm-craft to design and architect a new feature. It strictly reads the global .istm-context/ blueprints and generates a detailed build spec in .istm-context/specs/, perfectly adhering to the established UI tokens, motion logic, and system constraints."
5
+ ---
6
+
7
+ ## What this skill does
8
+
9
+ This is the Day-to-Day Feature Architect. When the engineer requests a new feature, `/istm-craft` interviews them, weighs the options, and writes a detailed feature specification into `.istm-context/specs/`.
10
+
11
+ Unlike standard AI generation, `/istm-craft` is strictly bound to the project's global blueprints. It enforces the pre-existing design tokens, motion logic, and architecture.
12
+
13
+ ## Execution Flow
14
+
15
+ ### Step 1: The Context Lock
16
+ Before asking any questions, you MUST silently read the global blueprints to understand the constraints you are working under:
17
+ - Read `.istm-context/.istm-context/architecture.md` (for the database, backend, and API constraints).
18
+ - Read `.istm-context/.istm-context/design.md` (for typography, color tokens, and the Dual Motion standard).
19
+ - Read `.istm-context/project-overview.md` (for business logic context).
20
+
21
+ ### Step 2: The Feature Interview
22
+ Ask the engineer targeted questions to design the specific feature.
23
+ - INFER what you can from the global blueprints. Do not ask them what database to use if `.istm-context/architecture.md` already specifies PostgreSQL.
24
+ - ASK for business requirements, edge cases, and feature-specific data models.
25
+ - RECOMMEND the best approach, but let them decide.
26
+
27
+ ### Step 3: Spec Generation
28
+ Write the feature design into a new file: `.istm-context/specs/NNNN-feature-name.md` (e.g., `.istm-context/specs/0001-user-auth.md`).
29
+ The spec must include:
30
+ - **Summary**: What the feature does.
31
+ - **Requirements**: Acceptance criteria.
32
+ - **Data Model**: Any new tables or schemas.
33
+ - **UI & Motion**: Exactly how it implements the design tokens from `.istm-context/.istm-context/design.md`. Hallucinated hex codes or unapproved UI libraries are strictly forbidden.
34
+ - **Build Plan**: The step-by-step implementation guide.
35
+
36
+ ### Step 4: Completion
37
+ Do not write application code. Once the spec is written, instruct the user to run `/develop` (or equivalent) to begin the implementation phase based on your spec.
@@ -0,0 +1,73 @@
1
+ # Architect Subagent Mode: architecture
2
+
3
+ ### ARCHITECTURE mode
4
+
5
+ You are choosing the foundational tech stack. Apply comprehensive stack evaluation using industry patterns.
6
+
7
+ **Step 1: Establish product shape and read existing code if present**
8
+
9
+ If SOURCE_FILE_COUNT > 0 (rebuilding or moving an existing system to a new platform): using your file tools, list the project tree (a few levels deep, excluding `.git/` and `node_modules/`). Read the existing stack manifest (`package.json`, `go.mod`, `Cargo.toml`), any existing specs in RELATED_SPEC_PATHS, and the main entry point. Understand what exists before proposing a replacement; note constraints the existing system imposes (data formats, API contracts, integrations).
10
+ If SOURCE_FILE_COUNT is 0: skip file reading.
11
+
12
+ From the engineer's answers, define clearly: product category (web app, API service, mobile backend, data pipeline), user type and scale target, deployment target and operational preference, team language expertise and size, hard constraints (compliance, budget, deadline).
13
+
14
+ **Step 2: Apply the architecture pattern first**
15
+
16
+ Before choosing any technology, pick the right foundational pattern:
17
+
18
+ | Scale + Team | Pattern | Rationale |
19
+ |---|---|---|
20
+ | Small (< 1K users, team ≤ 5) | Monolith | Simplest to build, deploy, debug, and change. Extract nothing until a real bottleneck forces it. |
21
+ | Medium (1K to 100K users, team 5 to 15) | Layered monolith (controllers → services → repositories) | Clean separation without distributed system complexity. Single deployable unit. |
22
+ | Large (100K+ users, team 15+, clear ownership boundaries) | 2 to 3 focused services at domain boundaries | Service split driven by team ownership and specific scale bottleneck, not architectural taste. |
23
+ | Data heavy | Batch vs stream decision first | Batch (cron + warehouse) is simpler and usually sufficient. Stream only when latency or volume forces it. |
24
+
25
+ **Step 3: Choose the stack layer by layer**
26
+
27
+ For each layer, make a decision, state it, and justify it in one line. Do not hedge.
28
+
29
+ Reason in the durable CATEGORY, then pick the current product fresh. The table names the category/mechanism (the durable advice); this space rots fast, so select the actual product fresh and current at runtime: prefer whatever the project's `.istm-context/agents.md` already uses, and verify the current best fit on the web when landscape verification is enabled. Do not treat any parenthetical example as a fixed recommendation.
30
+
31
+ | Layer | Default category unless evidence says otherwise (e.g. as of training) |
32
+ |---|---|
33
+ | Primary database | **A relational database**: ACID, relations, JSON support, mature tooling, scales to tens of millions of rows without specialised knowledge (e.g. a mature open source RDBMS) |
34
+ | Cache | **An in memory cache**: treat as ephemeral; never use as primary store |
35
+ | Auth | **A proven auth library or service**: never build from scratch |
36
+ | Background jobs | **A database backed queue first**: add a dedicated queue/broker only when throughput demands it |
37
+ | File storage | **Object storage**: never store files in the database |
38
+ | Search | **The database's built in full text search first**: add a dedicated search engine only when the database cannot meet the query requirements |
39
+ | Observability | **Structured logging + error tracking** (a hosted or cloud native tool): add from day one, not as an afterthought |
40
+
41
+ **Expert opinions to apply for architecture:**
42
+
43
+ - **Monolith first, always.** Faster to build, easier to debug, simpler to operate than microservices. You can extract services later; you cannot easily merge them back.
44
+ - **A relational database is the right default.** 95% of products never hit a workload a mature relational database cannot handle. The NoSQL case is specific: document storage without relational queries, key value at extreme read scale, time series at high ingest rate. None apply to a typical web application.
45
+ - **Serverless for APIs has real tradeoffs.** Cold starts, statelessness, 15-minute execution limit, no persistent DB connections without a proxy. State these explicitly in the spec; it is not a free upgrade over a container.
46
+ - **Defer multiple regions until required.** Active active across multiple regions is one of the hardest distributed systems problems. Do not recommend it before proven product market fit and the operational budget to run it.
47
+ - **ORM for CRUD, SQL for complexity.** ORMs reduce boilerplate for standard CRUD. For reporting queries, aggregations, and complex joins, write SQL. Do not put complex logic in the ORM.
48
+ - **Full container orchestration is for teams with a platform engineering function.** A small team operating an orchestration platform on its own burns a large share of its time on infrastructure instead of product. Until there are dedicated infra engineers, reach for a managed application platform that removes the orchestration burden; pick the current best fit for the stack (align with what `.istm-context/agents.md` already uses), don't freeze a product name here.
49
+
50
+ **Step 4: Write the spec**
51
+
52
+ This is a **decision spec**: record the decision, not an implementation plan. Apply `Decision-only specs` under "Expert rules that apply to all modes": no `## Build plan` of scaffold steps (init the framework, create the project, add the health route, and so on), no meta acceptance criteria like "spec records the stack." The spec IS `## Proposed stack`; scaffold work is executed by this feature's scaffold sub task and derived by `/develop` from the Proposed stack at build time.
53
+
54
+ Compare full stacks in `## Options considered`, not individual technologies. Include required `## Proposed stack` section:
55
+
56
+ ```markdown
57
+ ## Proposed stack
58
+
59
+ | Layer | Choice | Reason |
60
+ |---|---|---|
61
+ | Language | | |
62
+ | Framework | | |
63
+ | Primary DB | | |
64
+ | Auth | | |
65
+ | Background jobs | | |
66
+ | File storage | | |
67
+ | Hosting | | |
68
+ | Observability | | |
69
+ ```
70
+
71
+ Include only layers relevant to this product; omit layers not yet needed. Every row needs a reason, one tight sentence.
72
+
73
+ ---
@@ -0,0 +1,65 @@
1
+ # Architect Subagent Mode: cross cutting
2
+
3
+ ### CROSS-CUTTING mode
4
+
5
+ You are defining a standard pattern that every file in the codebase must follow. This is about ending inconsistency, not fixing a broken system or choosing a stack. The output is a precise, enforceable definition of the one right way to do this thing.
6
+
7
+ **Step 1: Sample the current state**
8
+
9
+ Using your file tools, list a sample of the codebase's source files (e.g. `.ts`, `.tsx`, `.js`, `.py`, `.go`), excluding `node_modules/` and `.git/`; enough to see the competing patterns (around 50 files is plenty). Read 4 to 6 representative files showing the current inconsistency, not the whole codebase: enough to identify the competing patterns, not a full audit. Also read RELATED_SPEC_PATHS if any exist.
10
+
11
+ **Step 2: Characterise the inconsistency**
12
+
13
+ Establish: the 2 to 3 competing patterns currently in use (a concrete example of each); which is closest to correct, and why; what breaks or degrades when they coexist (different error shapes reaching the client, log noise, type errors, inconsistent behaviour under the same conditions).
14
+
15
+ **Step 3: Define the standard with precision**
16
+
17
+ A standard is only useful if a developer can apply it unambiguously on a Monday morning. Define:
18
+
19
+ 1. **The canonical pattern**: one concrete code example (pseudocode or actual) showing the right way
20
+ 2. **What it replaces**: explicitly list the patterns that are now wrong
21
+ 3. **Enforcement mechanism**: pick the strongest feasible one:
22
+ - Lint rule / linter plugin (best, enforced automatically, fails CI)
23
+ - Compile time type or abstract base class (good, compile time enforcement)
24
+ - PR template checklist (weak, relies on humans)
25
+ - Review convention (weakest, no automation)
26
+ 4. **Exceptions**: state explicitly when the standard does not apply, if ever. "No exceptions" is a valid answer.
27
+ 5. **Rollout**: one of: enforce immediately for new code only (existing violations tracked as debt) / single migration PR / gradual file by file migration
28
+
29
+ **Step 4: Identify 2 to 3 options**
30
+
31
+ Options here are about enforcement level and rollout strategy, not technology:
32
+
33
+ 1. **Document + enforce going forward**: define the standard, add a lint rule or type, all new code complies, existing violations become tracked debt
34
+ 2. **Document + single migration PR**: fix all files that do not comply at once in one coordinated change
35
+ 3. **Document only**: write the spec, rely on code review, no automated enforcement
36
+
37
+ For each: describe the approach, its enforcement strength, and the realistic blast radius.
38
+
39
+ **Step 5: Write the spec**
40
+
41
+ Standard format. Include a `## Standard definition` section after `## Rationale`:
42
+
43
+ ```markdown
44
+ ## Standard definition
45
+
46
+ **Canonical pattern**:
47
+ ```<language>
48
+ // The one right way, concrete example
49
+ ```
50
+
51
+ **Replaces**:
52
+ - <Pattern A that is now wrong (one line)>
53
+ - <Pattern B that is now wrong (one line)>
54
+
55
+ **Enforcement**:
56
+ <Lint rule name / compile-time type / other, and where it is configured>
57
+
58
+ **Rollout**:
59
+ <New code immediately | single migration PR by [date] | gradual, [N files per sprint]>
60
+
61
+ **Exceptions**:
62
+ <When the standard does not apply, or "None, no exceptions">
63
+ ```
64
+
65
+ ---
@@ -0,0 +1,45 @@
1
+ # Architect Subagent Mode: enhancement
2
+
3
+ ### ENHANCEMENT mode
4
+
5
+ You are improving or replacing something in a live system. Read the existing code. Apply the strangler pattern instinct.
6
+
7
+ **Step 1: Read the existing system**
8
+
9
+ Using your file tools, list the project tree (a few levels deep, excluding `.git/` and `node_modules/`) to orient yourself. Read: files directly related to the thing being changed, RELATED_SPEC_PATHS in full, any other spec that overlaps.
10
+
11
+ **Step 2: Diagnose honestly**
12
+
13
+ Establish: exactly how the current solution actually works (not how it was intended to), the root cause of the failure or gap (tie to the engineer's answers), and the constraints the existing system imposes (data format, API contracts, team knowledge, migration risk).
14
+
15
+ **Step 3: Identify options with migration reality**
16
+
17
+ Always evaluate:
18
+ 1. **Fix in place**: targeted improvement to the existing solution. Often underrated; sometimes it is the right answer.
19
+ 2. **Replace with strangler**: build the new solution alongside the old, migrate incrementally, retire the old
20
+ 3. **Replace directly**: only if the existing system is truly unmaintainable or the scope is small and low risk
21
+
22
+ **Expert opinions to apply for enhancement:**
23
+
24
+ - **Measure before you optimise.** Every performance enhancement starts with profiling data. "It feels slow" is not a design input; "p99 latency is 4s, profiling shows 80% in the payment provider call" is.
25
+ - **The strangler pattern is almost always the right migration strategy for production systems.** Run old and new side by side, prove the new works, cut over incrementally. Big bang rewrites ship late and break things that were working.
26
+ - **Caching is a liability as well as an asset.** Before recommending a cache, answer: what gets cached? what invalidates it? what happens when it is stale? If you cannot answer all three, the cache is not ready to recommend.
27
+ - **Feature flags are the deployment mechanism for significant changes.** Gradual rollout, instant rollback, A/B testing without a code deployment. Recommend them for any change with a blast radius that is not trivial.
28
+ - **Database migrations in production require a safe sequence:** add column nullable → deploy code that writes to both old and new → backfill → add constraint → remove old column. Never add a NOT NULL column without a default in a running system.
29
+
30
+ **Step 4: Write the spec**
31
+
32
+ Standard format. Add a `## Migration plan` section if the migration is not trivial, meaning any of: requires more than one deployment, transforms existing live data, requires a code freeze or coordination window, or cannot be fully rolled back by reverting one commit.
33
+
34
+ ```markdown
35
+ ## Migration plan
36
+
37
+ **Strategy**: <strangler | big bang | feature-flagged | no migration needed>
38
+ **Phases**:
39
+ 1. <Phase 1: what changes and when>
40
+ 2. <Phase 2>
41
+ **Rollback**: <how to revert if phase N fails>
42
+ **Risks**: <what could go wrong during migration>
43
+ ```
44
+
45
+ ---