@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.
- package/README.md +49 -0
- package/bin/cli.js +251 -0
- package/istm/SKILL.md +65 -0
- package/istm-animate/SKILL.md +87 -0
- package/istm-animate/animations/animation_utils.md +280 -0
- package/istm-animate/animations/animations.md +220 -0
- package/istm-animate/animations/core_motion.md +250 -0
- package/istm-animate/animations/examples/README.md +29 -0
- package/istm-animate/animations/examples/nuxt/app/app.vue +3 -0
- package/istm-animate/animations/examples/nuxt/app/composables/useGSAP.ts +91 -0
- package/istm-animate/animations/examples/nuxt/app/pages/index.vue +55 -0
- package/istm-animate/animations/examples/nuxt/nuxt.config.ts +4 -0
- package/istm-animate/animations/examples/nuxt/package.json +18 -0
- package/istm-animate/animations/examples/react/App.jsx +46 -0
- package/istm-animate/animations/examples/react/index.html +12 -0
- package/istm-animate/animations/examples/react/main.jsx +9 -0
- package/istm-animate/animations/examples/react/package.json +21 -0
- package/istm-animate/animations/examples/react/vite.config.js +7 -0
- package/istm-animate/animations/examples/vanilla/index.html +33 -0
- package/istm-animate/animations/examples/vanilla/main.js +36 -0
- package/istm-animate/animations/examples/vue/app.vue +47 -0
- package/istm-animate/animations/examples/vue/index.html +15 -0
- package/istm-animate/animations/examples/vue/main.js +9 -0
- package/istm-animate/animations/examples/vue/package.json +19 -0
- package/istm-animate/animations/examples/vue/vite.config.js +7 -0
- package/istm-animate/animations/framework_motion.md +262 -0
- package/istm-animate/animations/motion.csv +17 -0
- package/istm-animate/animations/motion.md +11 -0
- package/istm-animate/animations/motion_catalog.json +226 -0
- package/istm-animate/animations/motion_performance.md +75 -0
- package/istm-animate/animations/motion_plugins.md +429 -0
- package/istm-animate/animations/react_animations.md +132 -0
- package/istm-animate/animations/scroll_trigger_effects.md +291 -0
- package/istm-animate/animations/timeline_sequencing.md +103 -0
- package/istm-architecture/SKILL.md +109 -0
- package/istm-architecture/frameworks/angular.csv +51 -0
- package/istm-architecture/frameworks/astro.csv +54 -0
- package/istm-architecture/frameworks/avalonia.csv +57 -0
- package/istm-architecture/frameworks/flutter.csv +53 -0
- package/istm-architecture/frameworks/javafx.csv +76 -0
- package/istm-architecture/frameworks/jetpack-compose.csv +53 -0
- package/istm-architecture/frameworks/laravel.csv +51 -0
- package/istm-architecture/frameworks/nextjs.csv +53 -0
- package/istm-architecture/frameworks/nuxtjs.csv +59 -0
- package/istm-architecture/frameworks/react-native.csv +52 -0
- package/istm-architecture/frameworks/react.csv +54 -0
- package/istm-architecture/frameworks/svelte.csv +54 -0
- package/istm-architecture/frameworks/swiftui.csv +51 -0
- package/istm-architecture/frameworks/uwp.csv +56 -0
- package/istm-architecture/frameworks/vue.csv +50 -0
- package/istm-architecture/frameworks/winui.csv +60 -0
- package/istm-architecture/frameworks/wpf.csv +57 -0
- package/istm-architecture/templates/agents.md +229 -0
- package/istm-architecture/templates/architecture.md +111 -0
- package/istm-architecture/templates/design.md +138 -0
- package/istm-architecture/templates/project-overview.md +215 -0
- package/istm-awwward-designer/SKILL.md +43 -0
- package/istm-awwward-designer/libraries/threejs.csv +54 -0
- package/istm-awwward-designer/references/accessibility.md +774 -0
- package/istm-awwward-designer/references/anim-anti-patterns.md +576 -0
- package/istm-awwward-designer/references/animation-map.md +166 -0
- package/istm-awwward-designer/references/animation-standards.md +86 -0
- package/istm-awwward-designer/references/anti-patterns.md +191 -0
- package/istm-awwward-designer/references/color-systems.md +604 -0
- package/istm-awwward-designer/references/css-performance.md +477 -0
- package/istm-awwward-designer/references/descender-safety.md +490 -0
- package/istm-awwward-designer/references/design-audit.md +93 -0
- package/istm-awwward-designer/references/font-loading.md +378 -0
- package/istm-awwward-designer/references/image-optimization.md +440 -0
- package/istm-awwward-designer/references/invention-gate.md +356 -0
- package/istm-awwward-designer/references/micro-interactions.md +825 -0
- package/istm-awwward-designer/references/page-transitions.md +365 -0
- package/istm-awwward-designer/references/performance-standards.md +79 -0
- package/istm-awwward-designer/references/quality-gate.md +103 -0
- package/istm-awwward-designer/references/responsive-design.md +778 -0
- package/istm-awwward-designer/references/scoring-guide.md +201 -0
- package/istm-awwward-designer/references/scroll-patterns.md +668 -0
- package/istm-awwward-designer/references/stitch-brief.md +124 -0
- package/istm-awwward-designer/references/tech-stack.md +204 -0
- package/istm-awwward-designer/references/technical-audit.md +133 -0
- package/istm-awwward-designer/references/technique-families.md +293 -0
- package/istm-awwward-designer/references/testing.md +535 -0
- package/istm-awwward-designer/references/text-animation.md +585 -0
- package/istm-awwward-designer/references/typography.md +504 -0
- package/istm-awwward-designer/references/usability-audit.md +108 -0
- package/istm-awwward-designer/references/visual-standards.md +97 -0
- package/istm-design/SKILL.md +98 -0
- package/istm-design/colors/color_theory.md +293 -0
- package/istm-design/colors/colors.csv +193 -0
- package/istm-design/colors/colors_catalog.json +4034 -0
- package/istm-design/colors/palette.json +21 -0
- package/istm-design/styles/design_system.md +288 -0
- package/istm-design/styles/html-tailwind.csv +56 -0
- package/istm-design/styles/nuxt-ui.csv +71 -0
- package/istm-design/styles/product_design.md +55 -0
- package/istm-design/styles/shadcn.csv +61 -0
- package/istm-design/styles/style.md +12 -0
- package/istm-design/styles/styles.csv +85 -0
- package/istm-design/styles/styles_catalog.json +2018 -0
- package/istm-design/styles/ui-reasoning.csv +162 -0
- package/istm-design/styles/uno.csv +60 -0
- package/istm-design/typography/font_and_font.md +10 -0
- package/istm-design/typography/google-fonts.csv +1924 -0
- package/istm-design/typography/sans_serif_fonts.md +112 -0
- package/istm-design/typography/typography.csv +75 -0
- package/istm-design/typography/typography_catalog.json +964 -0
- package/istm-design/ux/app-interface.csv +31 -0
- package/istm-design/ux/charts.csv +26 -0
- package/istm-design/ux/icons.csv +106 -0
- package/istm-design/ux/landing.csv +35 -0
- package/istm-design/ux/products.csv +193 -0
- package/istm-design/ux/react-performance.csv +45 -0
- package/istm-design/ux/responsive_rules.md +62 -0
- package/istm-design/ux/storytelling.md +47 -0
- package/istm-design/ux/ux-guidelines.csv +100 -0
- package/istm-design/ux/ux_guidelines.json +1190 -0
- package/istm-system-design/SKILL.md +88 -0
- package/istm-system-design/principles/01-architecture-patterns.md +24 -0
- package/istm-system-design/principles/02-database-selection.md +32 -0
- package/istm-system-design/principles/03-api-design.md +25 -0
- package/istm-system-design/principles/04-authentication-security.md +23 -0
- package/istm-system-design/principles/05-caching-performance.md +21 -0
- package/istm-system-design/principles/06-asynchronous-processing.md +17 -0
- package/istm-system-design/principles/07-infrastructure-deployment.md +22 -0
- package/istm-system-design/principles/08-low-level-design.md +35 -0
- package/istm-system-design/principles/09-state-management.md +14 -0
- package/istm-system-design/principles/10-error-handling-and-logging.md +26 -0
- package/istm-system-design/principles/11-testing-strategy.md +18 -0
- package/istm-system-design/principles/12-seo-and-web-vitals.md +18 -0
- package/istm-system-design/stacks/SETUP.md +82 -0
- package/istm-system-design/stacks/STACK.md +67 -0
- package/istm-system-design/stacks/WORKFLOW.md +84 -0
- package/istm-system-design/templates/api-route.ts.template +32 -0
- package/istm-system-design/templates/migrations.md.template +30 -0
- package/istm-system-design/templates/schema.drizzle.ts.template +17 -0
- package/istm-system-design/templates/schema.prisma.template +28 -0
- package/istm-system-design/templates/trpc-router.ts.template +22 -0
- package/istm-system-design/templates/zod-validators.ts.template +14 -0
- package/istm-workflow/istm-audit/SKILL.md +108 -0
- package/istm-workflow/istm-audit/agent-prompt.md +393 -0
- package/istm-workflow/istm-audit/agents/openai.yaml +7 -0
- package/istm-workflow/istm-audit/modes/area.md +19 -0
- package/istm-workflow/istm-audit/modes/gapfill.md +12 -0
- package/istm-workflow/istm-audit/modes/greenfield.md +24 -0
- package/istm-workflow/istm-audit/modes/tool-skills.md +39 -0
- package/istm-workflow/istm-audit/modes/whole-repo.md +5 -0
- package/istm-workflow/istm-audit/patterns/clean-architecture.md +15 -0
- package/istm-workflow/istm-audit/patterns/domain-driven.md +16 -0
- package/istm-workflow/istm-audit/patterns/functional.md +16 -0
- package/istm-workflow/istm-audit/patterns/solid-oop.md +17 -0
- package/istm-workflow/istm-check/SKILL.md +52 -0
- package/istm-workflow/istm-check/agents/openai.yaml +7 -0
- package/istm-workflow/istm-check/modes/review.md +156 -0
- package/istm-workflow/istm-check/modes/verify.md +197 -0
- package/istm-workflow/istm-check/review-agent-prompt.md +57 -0
- package/istm-workflow/istm-check/review-guide.md +133 -0
- package/istm-workflow/istm-craft/SKILL.md +37 -0
- package/istm-workflow/istm-craft/agent-modes/architecture.md +73 -0
- package/istm-workflow/istm-craft/agent-modes/cross-cutting.md +65 -0
- package/istm-workflow/istm-craft/agent-modes/enhancement.md +45 -0
- package/istm-workflow/istm-craft/agent-modes/feature.md +85 -0
- package/istm-workflow/istm-craft/agent-prompt.md +249 -0
- package/istm-workflow/istm-craft/agents/openai.yaml +7 -0
- package/istm-workflow/istm-craft/internal/after-subagent.md +90 -0
- package/istm-workflow/istm-craft/internal/design-conversation.md +140 -0
- package/istm-workflow/istm-craft/internal/tool-discovery.md +58 -0
- package/istm-workflow/istm-craft/spec-template.md +278 -0
- package/istm-workflow/istm-debug/SKILL.md +102 -0
- package/istm-workflow/istm-debug/agents/openai.yaml +7 -0
- package/istm-workflow/istm-develop/SKILL.md +144 -0
- package/istm-workflow/istm-develop/agents/openai.yaml +7 -0
- package/istm-workflow/istm-develop/checklist.md +95 -0
- package/istm-workflow/istm-develop/flow/build.md +133 -0
- package/istm-workflow/istm-develop/flow/git.md +34 -0
- package/istm-workflow/istm-develop/logical-guide.md +99 -0
- package/istm-workflow/istm-develop/ui/existing.md +23 -0
- package/istm-workflow/istm-develop/ui/generate.md +131 -0
- package/istm-workflow/istm-develop/ui/image.md +41 -0
- package/istm-workflow/istm-develop/ui/implementation.md +281 -0
- package/istm-workflow/istm-develop/ui/mcp.md +11 -0
- package/istm-workflow/istm-develop/ui-guide.md +164 -0
- package/istm-workflow/istm-document/SKILL.md +123 -0
- package/istm-workflow/istm-document/agent-prompt.md +57 -0
- package/istm-workflow/istm-document/agents/openai.yaml +7 -0
- package/istm-workflow/istm-document/templates/changelog.md +54 -0
- package/istm-workflow/istm-document/templates/postmortem.md +58 -0
- package/istm-workflow/istm-document/templates/pr.md +43 -0
- package/istm-workflow/istm-document/templates/release-note.md +41 -0
- package/istm-workflow/istm-scope/SKILL.md +100 -0
- package/istm-workflow/istm-scope/agents/openai.yaml +7 -0
- package/istm-workflow/istm-scope/approaches/facade.md +33 -0
- package/istm-workflow/istm-scope/approaches/journey.md +31 -0
- package/istm-workflow/istm-scope/approaches/skateboard.md +33 -0
- package/istm-workflow/istm-scope/approaches/tracer-bullet.md +34 -0
- package/istm-workflow/istm-scope/modes/add.md +14 -0
- package/istm-workflow/istm-scope/modes/plan-brownfield.md +11 -0
- package/istm-workflow/istm-scope/modes/plan-greenfield.md +20 -0
- package/istm-workflow/istm-scope/modes/plan-monorepo.md +8 -0
- package/istm-workflow/istm-scope/modes/plan.md +120 -0
- package/istm-workflow/istm-scope/modes/replan.md +13 -0
- package/istm-workflow/istm-scope/scope-template.md +148 -0
- package/istm-workflow/istm-sync/SKILL.md +166 -0
- package/istm-workflow/istm-sync/agent-prompt.md +211 -0
- package/istm-workflow/istm-sync/agents/openai.yaml +7 -0
- package/istm-workflow/istm-test/SKILL.md +233 -0
- package/istm-workflow/istm-test/agent-prompt.md +62 -0
- package/istm-workflow/istm-test/agents/openai.yaml +7 -0
- package/istm-workflow/istm-test/modes/setup.md +97 -0
- package/istm-workflow/istm-test/writing-guide.md +196 -0
- package/package.json +35 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Architect Main Flow: design conversation
|
|
2
|
+
|
|
3
|
+
### Scope validation (before Framing)
|
|
4
|
+
|
|
5
|
+
Run these two checks in order; Check B before Check A.
|
|
6
|
+
|
|
7
|
+
**Check B: "Already built" detection (runs first)**
|
|
8
|
+
|
|
9
|
+
Scan the topic for phrases signalling an existing decision: "I built", "we built", "we're using", "we use", "I use", "we chose", "I chose", "already using", "already built", "just document", "document the decision we made", "decided to use", "we went with", "we're on".
|
|
10
|
+
|
|
11
|
+
If found, before anything else present a decision panel (plain text options where the agent has no picker): "This sounds like an existing decision you want to *document* rather than explore from scratch.", options: **Document it (write the spec from what you tell me) (recommended)** · **Go through the full design process**.
|
|
12
|
+
|
|
13
|
+
If they pick Document it:
|
|
14
|
+
1. Capture the rationale behind the already made decision, as plain text (free text, not MCQ) questions generated for this specific decision. Cover at least these three angles, worded for what they built, and add any that this decision clearly raises: the **alternatives** they considered before choosing this (even a brief "we looked at X and Y but went with Z"), the **main reason** they chose it over those alternatives, and the **tradeoffs** the team is accepting (what it makes harder). Ask more if the decision has other load bearing rationale worth recording; the goal is a faithful account, not a fixed three.
|
|
15
|
+
2. Wait for their answers.
|
|
16
|
+
3. Take the documentation path: skip the staged conversation. Keep their answers as `DOCUMENTATION_CONTEXT` alongside the design topic, and treat the staged answers slot as `"skipped, documenting an already-made decision"`. Still infer the framing (MODE, platform, stack) from the topic + `.istm-context/agents.md`.
|
|
17
|
+
4. Write the spec yourself as a documentation task: `DOCUMENTATION_CONTEXT` is the engineer's account. Read existing code if `SOURCE_FILE_COUNT` > 0 to verify and supplement (via a `scout` for a large repo). Document what was built, not another evaluation of options. Because this is **already shipped**, set `**Status**:` to **`Accepted`** at creation (not `Proposed`); same whenever the linked scope feature is already `existing` (shipped before this workflow existed).
|
|
18
|
+
|
|
19
|
+
If they pick the full process: proceed to Check A, then Framing and the staged conversation normally.
|
|
20
|
+
|
|
21
|
+
**Check A: Product vision vs. specific decision (runs second)**
|
|
22
|
+
|
|
23
|
+
Product scoped topic: describes what the product *is* rather than what to *decide* ("a B2B SaaS that manages teams", "a marketplace for freelancers"), names no specific technical component, feature, or technology, would need 5+ separate specs, and uses business/product language. Decision scoped: names a specific component, feature, or technical concern ("auth approach", "team invitations feature", "should we use PostgreSQL or MongoDB").
|
|
24
|
+
|
|
25
|
+
If product scoped, do not start the staged conversation yet:
|
|
26
|
+
|
|
27
|
+
1. Tell the engineer: "This describes a full product. /architect works one decision at a time. Let me help you pick the first foundational decision."
|
|
28
|
+
2. Generate 4 foundational first decision options tailored to the product type and present via your agent's interactive picker (`AskUserQuestion` on Claude Code), or the same options as plain text (question: "Which foundational decision should we design first?", header: "First decision"). For most products: tech stack/architecture, auth/identity, core domain data model, and the most important product specific concern, worded for what they described.
|
|
29
|
+
3. After selection: update the design topic to that decision and proceed to Framing.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### Framing: infer, don't interrogate (no fixed question round)
|
|
34
|
+
|
|
35
|
+
Infer the framing from the topic + `.istm-context/agents.md` + codebase, don't ask it. State it back in a line or two so a wrong read is cheap to correct, then spend all questions on the feature:
|
|
36
|
+
|
|
37
|
+
- **Mode**: `FEATURE` (new feature) · `ARCHITECTURE` (foundational stack) · `ENHANCEMENT` (changing something that exists) · `CROSS-CUTTING` (a project-wide standard). Infer from the topic and whether the thing exists in code; confirm only if genuinely ambiguous.
|
|
38
|
+
- **Platform**: web · mobile · API/backend · a mix. Infer from the stack in `.istm-context/agents.md`, never assume web; it changes the questions (mobile auth, offline, push differ from web).
|
|
39
|
+
- **Workspace (monorepo)**: if a monorepo (workspaces config, or `apps/*`/`packages/*` manifests), identify which workspace this feature belongs to (topic, path, or the scope row's `Code area`; ask if unclear). Read that workspace's nested `.istm-context/agents.md` for *its* stack (apps often differ; don't assume the root stack). Note the workspace in the spec's Context, and whether the decision is app-specific or repo-wide.
|
|
40
|
+
- **Stack & conventions**: language, framework, DB, community skills, from `.istm-context/agents.md` (the target workspace's in a monorepo). Inferred, never asked.
|
|
41
|
+
- **Constraints**: team size, scale, compliance, from `.istm-context/agents.md` / the product. Ask a per-feature compliance question only when *this* feature touches regulated data (payments, PII, health), never a generic deadline/team menu.
|
|
42
|
+
|
|
43
|
+
State it: *"Reading this as a new **FEATURE** on your existing stack (from `.istm-context/agents.md`), web (correct me if not)."* Then begin the staged design conversation.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### Staged design conversation: gated, acceptance criteria first (main model)
|
|
48
|
+
|
|
49
|
+
An ordered sequence of stages walked one dimension at a time: one question per real choice, offering the current real options with your suggested pick marked (one line why); the engineer chooses. Never bundle a whole decision (the full acceptance criteria set, data model, stack, endpoint table, or authz model) into one accept or change panel; that applies to every stage. Assemble the spec from their per question answers; the engineer confirms the assembled result in the final spec review (the one place a whole artifact is shown for accept or change), and the data model additionally gets a light confirm at the end of its own walk, because a wrong one cascades. No vital dimension is silently decided or skipped. What you build becomes the spec's `## Requirements` and `## Build plan` (decision only spec: the `## Proposed stack`). Generate every question from *this* topic; an auth feature, a reviews feature, and a stack decision share none.
|
|
50
|
+
|
|
51
|
+
Mechanics (every question, no exceptions):
|
|
52
|
+
- **Offer the real options; exactly one is marked `(recommended)`** with a one line why (you make the call, they override). List every choice that genuinely applies, not a token two. Where the picker caps the count (Claude Code's `AskUserQuestion` allows four), present the strongest and let the custom slot carry the rest, or split across rounds; never drop real options to fit.
|
|
53
|
+
- **The last choice is always a free text custom input.** Claude Code's picker appends that "Other" slot automatically (don't add your own); in a plain text fallback, add it explicitly as the final option. This holds for design questions and confirm panels alike (the data model, accept the spec, References consent, an overlapping spec): one recommended option plus the custom slot.
|
|
54
|
+
- **Grill down to the smallest load bearing decision.** Work out every decision this specific project needs, from the big architectural calls to the smallest tool and setup choices, and ask each as its own question with a recommended pick and current, real options you generate at runtime. No choice is too small to route through the engineer; never silently decide one for them.
|
|
55
|
+
- Capability first, per the picker/custom slot mechanics above. Batch related questions up to 4 per call, run as many rounds as a stage needs, fold prior answers forward so it reads as one continuous interview.
|
|
56
|
+
|
|
57
|
+
Still infer the framing, but ASK the design inputs. Within each stage, sort every dimension INFER / ASK / RECOMMEND (see *Asks vs acts*): INFER silently from the prompt/codebase/`.istm-context/agents.md`; ASK the engineer the design inputs (data model, stack, provider, methods, rules) one phase at a time with a suggested pick; RECOMMEND the small internal implementation details they don't want to weigh in on.
|
|
58
|
+
|
|
59
|
+
**Your mandate (senior+ role):** you are the Staff/Principal engineer accountable if this ships wrong. The spec is the complete build spec `/develop` implements from; any blank dimension becomes a question partway through the build, or a wrong guess. Leaving a gap is the failure mode; be exhaustive, cover everything a senior engineer would pin down before writing code.
|
|
60
|
+
|
|
61
|
+
**Before the stages, enumerate every load bearing dimension of this feature and assign each to the stage that owns it,** sorting each INFER / ASK / RECOMMEND. Checklist (not all apply; add feature specific ones):
|
|
62
|
+
|
|
63
|
+
- **Functional scope & boundaries**: what's in, what's explicitly out, key user flows with happy/unhappy paths
|
|
64
|
+
- **Data model & persistence**: entities, fields, types, nullability, relationships, indexes, uniqueness, retention/deletion
|
|
65
|
+
- **Lifecycle & state machine**: states, valid transitions, who/what triggers each
|
|
66
|
+
- **API / interface surface**: endpoints or actions, inputs, outputs, status codes, versioning
|
|
67
|
+
- **Authentication & authorization**: who may do what; ownership, roles, scoping across tenants
|
|
68
|
+
- **Validation & business rules**: limits, quotas, invariants that must always hold
|
|
69
|
+
- **External integrations**: providers, webhooks, idempotency, reconciliation
|
|
70
|
+
- **Library / provider & build vs buy**: central for any feature with a real implementation choice (auth, payments, search, storage, email, realtime); owned by Stage (c), whose rules apply (fresh current options, suggested pick, engineer chooses). For auth the mechanisms are: the project's existing platform/BaaS auth · a hosted auth provider · an auth library you host yourself · roll your own; pick the specific current products at runtime, never a frozen list.
|
|
71
|
+
- **Failure & edge cases**: concurrency, retries, timeouts, partial failure, empty/error/loading states
|
|
72
|
+
- **Performance & scale**: expected volume, pagination, async vs sync, caching
|
|
73
|
+
- **Security & compliance**: PII, encryption, audit logging, rate limiting, regulatory scope
|
|
74
|
+
- **Observability**: what to log, metrics, alerts
|
|
75
|
+
- **Configuration & secrets**: new env vars, feature flags, credentials
|
|
76
|
+
- **UX surface (if UI in scope)**: capture the requirements (what each screen must show/do, states, accessibility); leave pixel/layout detail to `/develop`
|
|
77
|
+
- **Discoverability & SEO (public facing features)**: for any publicly indexed page: metadata, structured data (JSON-LD), OG/social cards, canonical URLs, sitemap/robots, SSR/SSG vs client render. Skip for internal/auth walled surfaces.
|
|
78
|
+
- **UI design (when the topic IS a page/screen, e.g. "home page UI", "shop page UI")**: a real design decision; the spec is the page's build spec. Settle:
|
|
79
|
+
- **Design source: ASK, never assume.** Never auto pick the source (not even "a Figma MCP is connected, so use it"). Ask *"How should I get the design for this?"* as a panel with no recommendation picked in advance: **From Figma** (use, or offer to connect, the Figma MCP to pull the real tokens, spacing, components, and frames) · **From a screenshot or images I'll give you** · **From the existing `.istm-context/design.md` / current UI** · **No design yet, suggest a direction** (only if picked do you propose a style). The picker adds its own Other. Record the chosen source in the spec (for Figma, which file and frames) so `/develop` uses the same one. If they pick Figma but no MCP is connected, point them to connect it (see *Tool skills & MCP*), then proceed.
|
|
80
|
+
- **Design system**: a `.istm-context/design.md` (or a design tool MCP as above) is the source of truth if present. If not, decide the direction so `/develop` isn't inventing a look. A design system that doesn't exist yet is itself spec worthy (cross cutting; every page depends on it).
|
|
81
|
+
- **Page composition**: what sections/blocks the page contains and in what order (e.g. home: hero → featured categories → product grid → social proof → footer); the "what goes on the page" the engineer alone knows.
|
|
82
|
+
- **Component inventory**: the reusable components the page needs (cards, nav, filters, carousel), existing vs net new.
|
|
83
|
+
- **Asset strategy**: when no screenshot/design was given and the repo has no images, decide the fallback (real assets the engineer will add, or an online placeholder source, e.g. a stock photo or avatar placeholder service), so `/develop` doesn't stall or invent broken paths.
|
|
84
|
+
|
|
85
|
+
Then walk the stages in order as one continuous, step by step interview. Ask each dimension as its own question with a suggested pick, take the answer, move on. Do NOT lead any stage with a proposed bundle for accept or change; assemble as you go.
|
|
86
|
+
|
|
87
|
+
**Stage (a): Requirements (ask step by step, then DERIVE the acceptance criteria).** Do not open with a finished acceptance criteria list. Ask the requirements one question at a time, seeding each from the scope row's intent + seeds when present and suggesting an answer: the core job, the main (happy path) flow, the key rules and limits, the important failure cases. From the answers, derive the acceptance criteria (`AC-1`, `AC-2`, …) as you go; they are the contract `/develop` builds to and `/check verify` checks, the spine every later stage and build task hangs off. The engineer reviews the assembled ACs in the final spec, not partway through.
|
|
88
|
+
|
|
89
|
+
**Stage (b): Data model (MANDATORY, ASK → assemble → SHOW → confirm → iterate).** Never skipped for a data backed feature. ASK, don't guess: elicit in batched questions, never open with a finished schema: first the **entities**, then per entity the **fields** (name, type, required or nullable), then the **relationships** (which relates to which, cardinality 1:1 / 1:N / N:M), then the **rules and constraints** (uniqueness, retention, invariants). Offer example options inside a question to make answering fast, but no complete ERD filled in advance to accept or reject. Then assemble the model from their answers and SHOW it as an ERD style table: entities, primary keys, foreign keys, cardinality. Gate (a confirm panel, one recommended option): *"This matches what I described (recommended)"* · *"Change/add/remove a field or entity"* · *"A relationship is wrong"*. ITERATE (revise and SHOW again) until Accept. The signed off model is the coherent **target**; its migration lands in `## Build plan` sized to the feature (one migration normally; sliced across slices only for a large feature or a thin thread/Facade approach; omitted for a slice touching no schema), not one mandatory up front task.
|
|
90
|
+
|
|
91
|
+
**Stage (c): Stack & tool walk (you suggest, the engineer picks).** Drive the walk automatically in a sensible dependency order, batching independent layers up to 4 per round (the mechanics above), which cuts round trips; the engineer never has to ask you to move on. Batching separate layers as their own questions is not bundling a finished stack. Which layers apply is your judgment from the platform and topic, not a fixed script (a web app, a mobile app, an API service, and a data pipeline share no layer list). A typical web app walk, illustration only: application type / architecture pattern → language → framework → database / persistence → auth approach → hosting / deployment → background jobs → email / notifications → file storage / search → observability → API shape. Per layer, present the current, real options, mark your suggested pick (one line why, prefer reuse of what the project runs), let the engineer choose. Illustration only: ask the layers and the finer tool or setup decisions THIS project actually needs, not just those named here. Generate the options FRESH and CURRENT at runtime, never a hardcoded/canned list (this category rots fastest); be honest about staleness (*"as of my knowledge; this space moves fast, verify current"*). Skip any layer the existing stack already settles (INFER from `.istm-context/agents.md`; don't ask again about a decided layer). For an ENHANCEMENT most layers are inferred; for an ARCHITECTURE / greenfield stack decision this walk IS the whole conversation (see the ARCHITECTURE note below). For greenfield, the References consent below folds in a current landscape check (the web option runs it before the stack questions).
|
|
92
|
+
|
|
93
|
+
**References consent (one panel, capability first).** ONE ask, not two (web assistance gate and references ask combined). Ask before the stack drill down for a greenfield decision (so current options can be checked); the write step reuses the answer, never asks again. Record the outcome as `REFERENCES_LEVEL`:
|
|
94
|
+
- **question**: "Add a References section to the spec (where the recommendations come from, and optionally links)? The full reasoning (the Rationale) stays either way. For a greenfield stack decision the web option also checks the current tool landscape so the options are not stale. Web fetches cost some extra tokens."
|
|
95
|
+
- **header**: "References"
|
|
96
|
+
- **options** (each sets `REFERENCES_LEVEL`):
|
|
97
|
+
- `No references, keep it clean (recommended)` → `none`
|
|
98
|
+
- `Sources only (named project sources and practices, no web fetch)` → `sources`
|
|
99
|
+
- `Sources plus web verified links (fetches pages to confirm the links, costs some extra tokens)` → `sources+links` (for a greenfield stack decision this also runs the current landscape check)
|
|
100
|
+
|
|
101
|
+
For a greenfield/foundational ARCHITECTURE stack decision, make `Sources plus web verified links` the recommended pick instead (verify the landscape before presenting options). When `sources+links` is chosen for a greenfield stack decision and your agent has web tools, run ONE quick current landscape check before the stack panel; without web tools, proceed from your knowledge and flag the staleness.
|
|
102
|
+
- **Cap/cache web research (runs once, in a subagent).** The landscape check is a web fetch, so it runs in a read only `researcher` subagent on the cheapest model (Claude Code: `haiku`, never inheriting the session model). It runs once here; the links it confirms are what you later write into References, and nothing fetches them again. Search undecided layers only. Max 5 searches / 8 pages, official docs/registry first; return top options, freshness notes, links. Reuse `.istm-context/.agent-cache/research/<slug>.md` when under 30 days old unless asked for "latest today". Cap the reply at 40 lines, overflow to that cache file. No web capability → proceed from knowledge and flag the staleness.
|
|
103
|
+
|
|
104
|
+
**Agent Skills & MCP servers.** When this stack walk settles one or more NEW tools not already installed or declined, read `internal/tool-discovery.md` and follow it. Its Step 1 asks the engineer whether to look for Agent Skills and MCP servers at all, and nothing is searched, fetched, or installed until they say yes. On yes, the search runs in the background (a read only, fast, low cost subagent) so it overlaps with the rest of this interview, and the found skills and servers are offered on the main thread. Asking is mandatory; searching is not. Skip the file entirely when no new tool is chosen (an ENHANCEMENT reusing the existing stack).
|
|
105
|
+
|
|
106
|
+
**Stage (d): API / interface surface (walk each endpoint).** First which surfaces the feature needs, then per endpoint its method, inputs, outputs, auth requirement, and key errors. Then **close the value sourcing loop**: for each acceptance criterion, take every value it needs an action to produce, compute, or display, and confirm the surface names a source for it (an input param, a DB column, derived from a named value, or a prior decision). A required value with no named source is an undecided input, not a build detail: ASK the engineer when only they know it, RECOMMEND otherwise, and add the resolution to the surface before moving on. Procedural, not a checklist: trace each value the ACs need, do not scan a fixed list of sources. Illustrations of the pattern only: an AC that reads "streak is 0 when the last read is before yesterday in the user's local day" needs "the user's local day", so name where the timezone comes from (a column, a client param, request headers); a displayed total names its rounding/currency source; a per tenant view names how the tenant is resolved. This is what fills the spec's **Value sourcing** table and stops `/develop` from inventing the missing source.
|
|
107
|
+
|
|
108
|
+
**Stage (e): Security & authorization (walk each rule).** Who may do what, rule by rule (ownership, roles, scoping across tenants and orgs), plus any compliance scope this feature triggers (payments/PII/health).
|
|
109
|
+
|
|
110
|
+
**Stage (f): Edge cases & failure modes (walk each case).** The handling one failure at a time (concurrency, retries, timeouts, partial failure, empty/error/loading states).
|
|
111
|
+
|
|
112
|
+
**(UI page features**, topic IS a page/screen: insert a page design stage between (a) and (d) that walks page composition/sections, design system direction, component inventory, and asset strategy (the UI design checklist bullet) one question at a time, suggesting a pick each. No upfront full layout to accept or reject.**)**
|
|
113
|
+
|
|
114
|
+
**(ARCHITECTURE stack decisions**, the topic IS choosing the stack/foundation (e.g. `/architect stack & architecture`): do NOT lead with Stage (a) acceptance criteria as a set to confirm. The conversation IS the Stage (c) stack walk: layer by layer (application type → framework → database → auth → hosting → API → observability, and so on, plus every finer tool and setup decision this project needs), batched per the mechanics, suggesting a pick and letting the engineer choose. Any light acceptance criteria and a data model sketch are derived from the chosen stack afterward, not gated up front. Stages (b), (d), (e), (f) collapse into "derived from the chosen stack"; the walk is the work. After the stack walk, ALWAYS run the Tool skills & MCP offer for the tools just chosen (a stack decision picks the most tools: framework, database, auth, ORM, hosting). Do not skip it or defer it to a `/audit` follow-up; run it before you write the spec.**)**
|
|
115
|
+
|
|
116
|
+
**Quality bar per stage:** every option maps to a real, feature specific decision (never a placeholder like "how complex is the data model?"), each with a one line tradeoff; allow several answers where they are not exclusive. One question per dimension, suggested pick marked with a one line why, and never add your own Other. No `(basis: …)` tag or source citation in option labels; the source and reasoning behind a recommendation belong in the written spec (its Rationale, which always stays, and its References section when opted in), not the live panel.
|
|
117
|
+
|
|
118
|
+
**Collect the RECOMMEND items** you will settle yourself when you write the spec (calls better made with full design context) as a list; decide each there, stating the pick + one line why + the runner up, and never echo one back as an open question.
|
|
119
|
+
|
|
120
|
+
**Completeness gate (before writing, do not skip).** Do not start writing the spec until every load bearing dimension above is accounted for: each is ASKED, or INFERRED with the inference stated back, or explicitly not applicable. Any still open → keep asking; an unasked dimension becomes a guess partway through the build. Depth is the goal: when in doubt, ask the extra question. Never fold two distinct dimensions into one option, never end with a dimension silently skipped. A short interview is a red flag; a real feature spans many dimensions and many batched rounds.
|
|
121
|
+
|
|
122
|
+
**After all stages are signed off** (buildable feature spec): the confirmed acceptance criteria seed the spec's `## Requirements`; the confirmed data model, API surface, and stack derive `## Build plan` (each task tagged with the AC it satisfies; the data model is the target, its migration sized to the feature per the build approach, not one mandatory up front task). For a decision only spec (an ARCHITECTURE stack decision or a CROSS-CUTTING standard) there is no `## Requirements`/`## Build plan`: the spec is the decision itself (`## Proposed stack` / `## Standard definition`), and the feature that executes it (e.g. the scaffold sub task) derives its steps at `/develop` time. Order and slice the plan through your Staff/Principal lens on the feature's build approach (read in pre-flight: row override, else project default), reasoning about what it implies rather than a fixed recipe (e.g. Facade defers the migration; Tracer Bullet migrates only the thin thread's schema first, growing it per slice). With no approach on record, default to end to end slices and note the assumption. Then write the spec (below).
|
|
123
|
+
|
|
124
|
+
**What good, feature specific staged grilling looks like** (illustrations of depth, not a script; generate the equivalent, and current options, for the feature at hand):
|
|
125
|
+
- `/architect auth` (no auth yet) → (a) ACs for sign in/session/reset · (b) identity/session data model · (c) which sign in methods (email+password · magic link · OAuth · passkeys · SSO)? then which auth approach, options fresh & current, aligned to the stack (a project platform with built in auth is the aligned recommended pick, vs a hosted provider, a library you host yourself, roll your own) → its config · (e) roles (customer/admin), ownership · (f) lockout, token refresh failure; mobile: token storage, biometric, deep link callback.
|
|
126
|
+
- `/architect home page UI` (no design/screenshot given) → which sections and in what order (hero · featured · how it works · testimonials · pricing · CTA · footer)? · what does each section show/contain (copy, data, imagery)? · build to an existing `.istm-context/design.md`, or pick a direction? · which components (existing vs net new)? · assets: real files the engineer will add, or a placeholder source? · responsive/mobile behavior. When the UI isn't specified, *you* extract the page's contents from the engineer; don't invent them.
|
|
127
|
+
|
|
128
|
+
**Too vague to generate from?** (rare; the topic should have been narrowed first) There are no canned questions to fall back to. Narrow instead: run Scope validation again or ask one clarifying question, then generate the stage questions from the dimension checklist above. Feature specific questions always, never a generic MCQ list.
|
|
129
|
+
|
|
130
|
+
**Skip the staged conversation** on the "documenting a made decision" path (Check B); proceed directly to writing the spec with the documentation context.
|
|
131
|
+
|
|
132
|
+
**Enhancement mode guard**: if the inferred mode is `ENHANCEMENT` AND `SOURCE_FILE_COUNT = 0`, stop before the staged conversation and tell the engineer:
|
|
133
|
+
|
|
134
|
+
"Enhancement mode reads existing code to understand what's being changed, but no source files were found. What's the situation?
|
|
135
|
+
- A) The code exists in a different directory. Tell me the path and I'll check again.
|
|
136
|
+
- B) There is no existing implementation. Then this is really a new **FEATURE** (or **ARCHITECTURE**)."
|
|
137
|
+
|
|
138
|
+
Wait for their answer. If (A): run the source file count for that path again. If (B): switch the inferred mode and continue.
|
|
139
|
+
|
|
140
|
+
---
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Architect: Agent Skill and MCP discovery, asked for before it runs
|
|
2
|
+
|
|
3
|
+
Read this only when the stack walk (Stage c) settles one or more **new** tools (a framework, database, auth library, provider, and so on) that are not already installed or recorded as declined in `.istm-context/agents.md`. Skip it entirely when no new tool is chosen (e.g. an ENHANCEMENT reusing the existing stack).
|
|
4
|
+
|
|
5
|
+
## Step 1: Ask first (the consent gate)
|
|
6
|
+
|
|
7
|
+
<!-- TOOL-CONSENT:START (identical in /architect, /audit and /sync; edit all or none) -->
|
|
8
|
+
**Asking is mandatory. Searching is not.** Nothing is searched, fetched, installed, or spawned for Agent Skill and MCP discovery until the engineer has picked. Offer four choices: find them for me, I will name the ones I want, no and record the decline, or not now. Only the first may run a search command. Never silently skip the offer, and never run a search before the engineer agrees to one.
|
|
9
|
+
<!-- TOOL-CONSENT:END -->
|
|
10
|
+
|
|
11
|
+
Explain the value in a sentence or two, in your own words, then ask. Something close to:
|
|
12
|
+
|
|
13
|
+
> An Agent Skill teaches the agent a tool's real conventions, so the build follows them instead of guessing at them. An MCP server gives the agent live access to the real system (your database, your dashboard) rather than assumptions about it. Both are optional, both usually make the build better, and the ones that fit this stack are worth knowing about.
|
|
14
|
+
|
|
15
|
+
Then present a panel (capability first: `AskUserQuestion` on Claude Code, else the same options as plain text). Mark exactly one recommended. The picker appends its own free text option, so add one yourself only in a plain text fallback.
|
|
16
|
+
|
|
17
|
+
- **question**: "Want me to find Agent Skills and MCP servers for this stack?"
|
|
18
|
+
- **header**: "Agent skills"
|
|
19
|
+
- **options**:
|
|
20
|
+
1. `Yes, find them for me` (recommended): "I'll search the registry for the tools we just chose, then show you what I find. Nothing installs without your pick."
|
|
21
|
+
2. `I'll name the ones I want`: "Tell me which skills or servers, and I'll add exactly those. No searching."
|
|
22
|
+
3. `No, skip it`: "Build without them. I'll record the decline so nothing offers them again."
|
|
23
|
+
4. `Not now, later`: "I'll note them in the spec's `## Follow-up` so you can add them when you want."
|
|
24
|
+
|
|
25
|
+
**Act on the pick:**
|
|
26
|
+
|
|
27
|
+
- **`Yes, find them for me`** → Step 2, then Step 3.
|
|
28
|
+
- **`I'll name the ones I want`** → run no search. Ask which ones, take the list as given, confirm each with `npx skills add <owner>/<repo> --list` where that is practical, then install per Step 4 and record per Step 5.
|
|
29
|
+
- **`No, skip it`** → run nothing. Record the decline per Step 5, so a later stage does not offer the same tools again (the no nag rule).
|
|
30
|
+
- **`Not now, later`** → run nothing. Add the passive spec `## Follow-up` note per Step 6, naming the tools and what a skill or server would give them.
|
|
31
|
+
|
|
32
|
+
Only `Yes, find them for me` may run a search. Until that option is picked, do not spawn the discovery subagent, do not run `npx skills find`, and do not fetch anything.
|
|
33
|
+
|
|
34
|
+
## Step 2: Discover (only after `Yes, find them for me`)
|
|
35
|
+
|
|
36
|
+
- **Inventory first, discover in batch.** Build `TOOL_DISCOVERY_SET` from every chosen tool this feature touches: runtime, framework, router, styling or UI kit, database, ORM or query layer, auth and session, payments, email, storage, search, queue, AI or vector DB, browser testing, observability, hosting. Include package names and aliases. Do not stop after the first technology.
|
|
37
|
+
- **Run it in the background, keep interviewing.** Consent is given, so hand the whole `TOOL_DISCOVERY_SET` to a read only discovery subagent and do NOT wait on it: spawn it in the background (it blocks nothing) if your agent supports that, set its model explicitly to a fast, low cost tier (do not inherit the session model; on Claude Code spawn it as the `researcher` subagent type, which pins the model and gives it the registry CLI plus web tools), and have it run the detect and filter work below and return ONLY the compact candidate list (skills and MCP servers grouped by technology, already minus installed and declined). While it runs, continue the design conversation (stages d, e, f); collect its result just before the offer panel. This keeps the searches and fetched pages out of the main context and overlaps them with the interview. Fallback chain: no background support → run the same subagent blocking (it still isolates the search noise); no subagent at all → do the searches inline on the main thread. The offer panel always stays on the main thread (a subagent cannot prompt the engineer).
|
|
38
|
+
- **Detect fresh, never hardcode (the discovery subagent's job, or inline in the fallback).** For EACH item, run `npx skills find <tool-or-package>`; if weak, retry aliases from package or org names. Collect every credible Agent Skill; one hit must not suppress another tool's search. Confirm with `npx skills add <owner>/<repo> --list` when practical. If the CLI is interactive or unavailable, search `"<tool>" "agent skill"` and confirm before offering. MCP: connector list first, else `"<tool>" "MCP server"` per item. Never hardcode which tools have skills or servers.
|
|
39
|
+
- **Skip the known.** Do not offer what `npx skills list` or `.istm-context/agents.md` shows already installed, or what `.istm-context/agents.md` records as declined (the no nag rule). MCP (Model Context Protocol) is a cross tool standard: if a relevant server is already connected its tools simply appear available, so use them and do not offer them again.
|
|
40
|
+
- **Cache discovery.** Use `.istm-context/.agent-cache/tool-discovery/<slug>.md` when available: date, tool, skill and MCP candidates, installed and declined. Reuse it when under 30 days old, then subtract installed and declined before offering.
|
|
41
|
+
|
|
42
|
+
## Step 3: Offer what you found, the engineer chooses
|
|
43
|
+
|
|
44
|
+
Present one Agent Skills panel: "Install relevant Agent Skills for this stack?" with every found skill grouped by technology, plus skip and decline. Do not pick one winner. Then a separate optional MCP panel: "Optional MCP servers that could help this stack" with every found server, plus skip and decline. MCP is upside, not required.
|
|
45
|
+
|
|
46
|
+
Found nothing? Say so plainly and move on. Never invent a candidate to fill the panel.
|
|
47
|
+
|
|
48
|
+
## Step 4: Act on the pick
|
|
49
|
+
|
|
50
|
+
Skill: `npx skills add <owner>/<repo> -y` (into the project's agent). MCP: connecting is a user config step (their MCP settings, e.g. `claude mcp add …`), so you cannot do it for them. Point them there, and note that the tools are used automatically once connected.
|
|
51
|
+
|
|
52
|
+
## Step 5: Record
|
|
53
|
+
|
|
54
|
+
Skills installed → carry into the spec's `## Decision` **Implementation skills** field when you write it, and flag for the `## Agent skills` section of `.istm-context/agents.md` (one bullet per skill, with its location, so only the needed skills load). Servers connected → flag for that section's compact `MCP servers:` line. Anything declined or skipped → flag for its compact `Declined:` line so a later stage does not offer it again (root for project wide tech, the nested area doc for area specific tech). `/audit` and `/sync` own writing `.istm-context/agents.md`.
|
|
55
|
+
|
|
56
|
+
## Step 6: When nothing can be searched, installed, or connected
|
|
57
|
+
|
|
58
|
+
No search, install, or connect capability, or the engineer picked `Not now, later`: add a passive spec `## Follow-up` naming the skill or the MCP server the engineer could add for this tool, and what it would buy them.
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# Spec Template
|
|
2
|
+
|
|
3
|
+
File path: `.istm-context/specs/NNNN-kebab-case-title.md`
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
=== SPEC TEMPLATE START ===
|
|
8
|
+
# NNNN. Title (concise, noun-phrase form, e.g. "Adopt a relational database for primary storage")
|
|
9
|
+
|
|
10
|
+
**Date**: YYYY-MM-DD
|
|
11
|
+
**Status**: Proposed
|
|
12
|
+
|
|
13
|
+
## Summary
|
|
14
|
+
|
|
15
|
+
<!-- HUMAN QUICK READ (plain words, no dashes). Everyone reads this first, technical or not. -->
|
|
16
|
+
<Plain language overview in 2 to 4 short sentences. Say what this decision is, why it was made,
|
|
17
|
+
and what it means for building. A busy reader (technical or not) should get the gist in about 20
|
|
18
|
+
seconds. Explain any technical term in plain words (a short gloss in parentheses). Use no dashes
|
|
19
|
+
of any kind.>
|
|
20
|
+
|
|
21
|
+
## Context
|
|
22
|
+
|
|
23
|
+
<!-- DECISION RECORD (the WHY, human context; in a directory spec this section lives in rationale.md, not index.md; /develop skips it) -->
|
|
24
|
+
<What is the problem or decision to be made? What forces are at play (technical constraints,
|
|
25
|
+
team capabilities, cost, performance requirements, compliance)? What is the consequence of not
|
|
26
|
+
deciding? 2 to 4 paragraphs. Do not mention options here, only the problem space.>
|
|
27
|
+
|
|
28
|
+
## Requirements
|
|
29
|
+
|
|
30
|
+
<!-- BUILD SPEC (the WHAT, /develop builds to this; /check verify checks against it) -->
|
|
31
|
+
<!-- The contract. Seed the user stories + acceptance criteria from the scope feature's intent
|
|
32
|
+
and its acceptance-criteria seeds when a scope row exists, then refine with the engineer.
|
|
33
|
+
Acceptance criteria are the contract /develop builds to and /check verify checks. -->
|
|
34
|
+
|
|
35
|
+
**User stories**:
|
|
36
|
+
- As a <role>, I want <capability> so that <outcome>.
|
|
37
|
+
|
|
38
|
+
**Acceptance criteria** (the contract, each criterion is IDed and independently checkable):
|
|
39
|
+
- **AC-1**: <observable, testable outcome that must hold for the feature to be correct>
|
|
40
|
+
- **AC-2**: <the key edge case or failure that must be handled, e.g. "retry after timeout returns the same result (idempotent)">
|
|
41
|
+
- **AC-N**: <…>
|
|
42
|
+
|
|
43
|
+
<!-- Every task in ## Build plan references the AC(s) it satisfies, and every scenario in
|
|
44
|
+
Critical test scenarios maps to an AC. No AC without a build task; no build task without an AC. -->
|
|
45
|
+
|
|
46
|
+
## Options considered
|
|
47
|
+
|
|
48
|
+
<!-- DECISION RECORD (the WHY, human context; in a directory spec this section lives in rationale.md, not index.md; /develop skips it) -->
|
|
49
|
+
### Option 1: <Name>
|
|
50
|
+
|
|
51
|
+
<One paragraph describing this option.>
|
|
52
|
+
|
|
53
|
+
**Pros**:
|
|
54
|
+
- <benefit>
|
|
55
|
+
|
|
56
|
+
**Cons**:
|
|
57
|
+
- <drawback or tradeoff>
|
|
58
|
+
|
|
59
|
+
### Option 2: <Name>
|
|
60
|
+
|
|
61
|
+
<One paragraph describing this option.>
|
|
62
|
+
|
|
63
|
+
**Pros**:
|
|
64
|
+
- <benefit>
|
|
65
|
+
|
|
66
|
+
**Cons**:
|
|
67
|
+
- <drawback or tradeoff>
|
|
68
|
+
|
|
69
|
+
<!-- Add Option 3 / Option 4 if relevant. Maximum 4 options. Omit section entirely only
|
|
70
|
+
when documenting a decision already made with no alternatives considered. -->
|
|
71
|
+
|
|
72
|
+
## Decision
|
|
73
|
+
|
|
74
|
+
<!-- BUILD SPEC (the WHAT, /develop reads this) -->
|
|
75
|
+
**Chosen option**: Option N: <Name>
|
|
76
|
+
|
|
77
|
+
<One sentence stating the decision clearly.>
|
|
78
|
+
|
|
79
|
+
**Implementation skills**: `<skill-name>` (`<owner>/<repo>`, `<skills-dir>/<skill-name>/`) · `<skill-name>` (`<owner>/<repo>`, `<skills-dir>/<skill-name>/`)
|
|
80
|
+
<!-- Every installed community skill that informed this design; the engineer reads it during implementation. `<skills-dir>` is the project's real skills dir (`.claude/skills/`, `.agents/skills/`, or `skills/`), never hardcoded; `<owner>/<repo>` is the tool-agnostic identity. Omit the line if no community skills were used. -->
|
|
81
|
+
|
|
82
|
+
## Rationale
|
|
83
|
+
|
|
84
|
+
<!-- DECISION RECORD (the WHY, human context; in a directory spec this section lives in rationale.md, not index.md; /develop skips it) -->
|
|
85
|
+
<Why this option over the others? Reference the specific constraints and forces from Context.
|
|
86
|
+
Do not repeat the pros/cons list, explain the reasoning. 1 to 3 paragraphs.>
|
|
87
|
+
|
|
88
|
+
<!-- Feature design mode only. Include immediately after Rationale. -->
|
|
89
|
+
<!-- BUILD SPEC (the WHAT, /develop reads this) -->
|
|
90
|
+
## Feature design
|
|
91
|
+
|
|
92
|
+
**Data model sketch**:
|
|
93
|
+
<Entities, key fields, nullable/required, FK relationships, unique constraints>
|
|
94
|
+
|
|
95
|
+
**State transitions** (if applicable):
|
|
96
|
+
<e.g. order: draft → submitted → paid → fulfilled. Omit if no state machine>
|
|
97
|
+
|
|
98
|
+
**API surface**:
|
|
99
|
+
| Endpoint | Method | Key inputs | Key outputs | Auth | Key errors |
|
|
100
|
+
|---|---|---|---|---|---|
|
|
101
|
+
| /resource | POST | field:type (req) | id, status | bearer | 409, 422 |
|
|
102
|
+
|
|
103
|
+
**Value sourcing** (every value each action produces, computes, or displays names where it comes from; a required value with no named source is an undecided input, resolve it before this spec is done, do NOT leave the build to invent it):
|
|
104
|
+
| Action | Value produced / displayed | Source |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| <action> | <the value> | <an input param · a DB column · derived from X · decided in spec N> |
|
|
107
|
+
<!-- List every value each acceptance criterion needs this action to produce, not just the obvious ones. The point is to expose inputs the API table omits: a value the AC requires whose source is not an input, a column, or a prior decision is a gap. Diverse illustrations (pattern, not a checklist): a read that must show "the user's local day" names where the timezone comes from; a total shown to a user names the rounding/currency rule's source; a per-tenant list names how the tenant is resolved. Keep it procedural: trace each produced value to a named source; never work from a fixed list of "sources to check". -->
|
|
108
|
+
|
|
109
|
+
**Key invariants**:
|
|
110
|
+
<Rules that must always hold, enforced at application or DB layer>
|
|
111
|
+
|
|
112
|
+
**Security model**:
|
|
113
|
+
<Who can read/write what. Roles, ownership, public/private. Name compliance scope if applicable.>
|
|
114
|
+
|
|
115
|
+
**Configuration required**:
|
|
116
|
+
- `ENV_VAR_NAME`: purpose (omit section if no new env vars or credentials are needed)
|
|
117
|
+
|
|
118
|
+
<!-- Acceptance criteria are NOT restated here; they live once, IDed, in ## Requirements (the contract).
|
|
119
|
+
Reference their IDs (AC-N) from the test scenarios below and from ## Build plan tasks. -->
|
|
120
|
+
|
|
121
|
+
**Critical test scenarios** (each maps to an acceptance criterion in ## Requirements):
|
|
122
|
+
- Happy path: <main flow end to end>, verifies **AC-N**
|
|
123
|
+
- Failure case: <most important failure, such as concurrency, timeout, invalid state>, verifies **AC-N**
|
|
124
|
+
- Auth/permission: <who is denied and what they receive>, verifies **AC-N**
|
|
125
|
+
|
|
126
|
+
<!-- Architecture mode only. Include immediately after Rationale. -->
|
|
127
|
+
<!-- BUILD SPEC (the WHAT, /develop reads this) -->
|
|
128
|
+
## Proposed stack
|
|
129
|
+
|
|
130
|
+
| Layer | Choice | Reason |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
| Language | | |
|
|
133
|
+
| Framework | | |
|
|
134
|
+
| Primary DB | | |
|
|
135
|
+
| Auth | | |
|
|
136
|
+
| Hosting | | |
|
|
137
|
+
| Observability | | |
|
|
138
|
+
|
|
139
|
+
<!-- BUILD SPEC (the WHAT, /develop builds these in order; /check verify checks the AC each satisfies) -->
|
|
140
|
+
## Build plan
|
|
141
|
+
|
|
142
|
+
<!-- Ordered build tasks DERIVED from the surface above (data model, API, stack) and the acceptance
|
|
143
|
+
criteria in ## Requirements. Each task names the AC(s) it satisfies, so every AC traces to at least
|
|
144
|
+
one task and every task traces to an AC. The ORDER and slicing reflect the project's build approach
|
|
145
|
+
(Tracer Bullet, Skateboard, Facade, Journey, or a variant, read in pre-flight), reasoned about for
|
|
146
|
+
this feature rather than by a fixed recipe. The data model sketch is the coherent target; its
|
|
147
|
+
migration is sized to the feature (one migration normally; sliced across slices for a large feature
|
|
148
|
+
or a thin thread Tracer Bullet, deferred under Facade; omitted for a slice touching no schema).
|
|
149
|
+
When a scope feature row links this spec, these tasks are also written into that row's sub-tasks;
|
|
150
|
+
with no scope row, they live here as the source of truth (see /architect's derive-tasks step). -->
|
|
151
|
+
|
|
152
|
+
1. <Build task, e.g. "Create the migration for the confirmed data model">, satisfies **AC-1**
|
|
153
|
+
2. <Build task>, satisfies **AC-2**, **AC-3**
|
|
154
|
+
N. <Build task>, satisfies **AC-N**
|
|
155
|
+
|
|
156
|
+
## Consequences
|
|
157
|
+
|
|
158
|
+
<!-- BUILD SPEC (the WHAT, /develop reads this: the constraints the build must honor) -->
|
|
159
|
+
**Positive**:
|
|
160
|
+
- <what improves>
|
|
161
|
+
|
|
162
|
+
**Negative / tradeoffs**:
|
|
163
|
+
- <what gets worse or costs more>
|
|
164
|
+
|
|
165
|
+
**Neutral**:
|
|
166
|
+
- <notable side-effects, migrations needed, new patterns to learn, etc.>
|
|
167
|
+
|
|
168
|
+
## Follow-up
|
|
169
|
+
|
|
170
|
+
- [ ] <Action item or open question>
|
|
171
|
+
<!-- Omit section if there are no follow-up actions. -->
|
|
172
|
+
|
|
173
|
+
## References
|
|
174
|
+
|
|
175
|
+
<!-- INCLUDED ONLY WHEN THE ENGINEER OPTED IN (REFERENCES_LEVEL is `sources` or `sources+links`).
|
|
176
|
+
When REFERENCES_LEVEL is `none`, omit this whole section AND add no (basis: ...) citations
|
|
177
|
+
anywhere in the spec. The Rationale (the reasoning itself) still stays; only the citations and
|
|
178
|
+
links are gated, so a `none` document reads clean.
|
|
179
|
+
What this decision is grounded in. Group as below; omit empty groups. NEVER fabricate a URL,
|
|
180
|
+
name the source/practice instead. The *Links* group appears only at the `sources+links` level,
|
|
181
|
+
and every link in it must have been web verified during the Stage (c) landscape / tool-discovery
|
|
182
|
+
check (at `sources` there is no Links group). No link is fetched at write time or re-fetched
|
|
183
|
+
later; these links are here for a human to follow. -->
|
|
184
|
+
|
|
185
|
+
**Project sources** (verifiable, in this repo):
|
|
186
|
+
- <e.g. `.istm-context/agents.md`, the auth convention · spec 0003 · an installed community skill · already on the project's BaaS>
|
|
187
|
+
|
|
188
|
+
**Practices & standards**:
|
|
189
|
+
- <named practice/principle the decision rests on, e.g. idempotency keys for money ops · strangler pattern · OWASP session guidance>
|
|
190
|
+
|
|
191
|
+
**Links** (web verified only, `sources+links` level only):
|
|
192
|
+
- <Title: https://real-fetched-url> · <or "none verified">
|
|
193
|
+
|
|
194
|
+
<!-- Enhancement mode only, when migration is non-trivial. -->
|
|
195
|
+
## Migration plan
|
|
196
|
+
|
|
197
|
+
**Strategy**: <strangler | big bang | feature-flagged | no migration needed>
|
|
198
|
+
**Phases**:
|
|
199
|
+
1. <Phase 1>
|
|
200
|
+
2. <Phase 2>
|
|
201
|
+
**Rollback**: <how to revert if a phase fails>
|
|
202
|
+
**Risks**: <what could go wrong>
|
|
203
|
+
|
|
204
|
+
<!-- Cross-cutting mode only. Include immediately after Rationale. -->
|
|
205
|
+
## Standard definition
|
|
206
|
+
|
|
207
|
+
**Canonical pattern**:
|
|
208
|
+
```<language>
|
|
209
|
+
// The one right way, concrete example
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Replaces**:
|
|
213
|
+
- <Pattern that is now wrong>
|
|
214
|
+
|
|
215
|
+
**Enforcement**:
|
|
216
|
+
<Lint rule / compile-time type / other, and where it is configured>
|
|
217
|
+
|
|
218
|
+
**Rollout**:
|
|
219
|
+
<New code immediately | single migration PR | gradual migration schedule>
|
|
220
|
+
|
|
221
|
+
**Exceptions**:
|
|
222
|
+
<When the standard does not apply, or "None">
|
|
223
|
+
|
|
224
|
+
=== SPEC TEMPLATE END ===
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Filename conventions
|
|
229
|
+
|
|
230
|
+
- Format: `NNNN-kebab-case-title.md`
|
|
231
|
+
- NNNN: zero padded 4 digit number, incremented automatically
|
|
232
|
+
- Title: lowercase, hyphens, no articles at the start (`use-object-storage` not `the-use-of-object-storage`)
|
|
233
|
+
- Examples: `0001-adopt-relational-db-for-primary-storage.md`, `0002-adopt-feature-flags-for-rollout.md`
|
|
234
|
+
|
|
235
|
+
## Status values
|
|
236
|
+
|
|
237
|
+
The spec's status mirrors its feature's build lifecycle (scope: planned→`Proposed`, in-progress→`In Progress`, done→`Accepted`):
|
|
238
|
+
|
|
239
|
+
| Status | Meaning |
|
|
240
|
+
|---|---|
|
|
241
|
+
| `Proposed` | spec written, decision agreed, feature NOT yet built. Set by /architect at creation. |
|
|
242
|
+
| `In Progress` | The feature governed by this spec is being built. Set by /develop when the feature goes in-progress. |
|
|
243
|
+
| `Accepted` | The feature is built and verified (scope `done`), the "done and dusted" state. A spec is NOT `Accepted` until its feature ships. Set by /develop on completion or reconciled by /sync. |
|
|
244
|
+
| `Superseded by [NNNN](NNNN-title.md)` | Replaced by a newer spec |
|
|
245
|
+
|
|
246
|
+
**Which status behavior applies depends on whether a buildable scope feature links this spec:**
|
|
247
|
+
- **Feature linked spec** (a `.istm-context/scope/` row's `spec` cell points to it) → **feature mirrored**: `Proposed` → `In Progress` → `Accepted`, tracking the feature's build lifecycle (table above). Confirmation ratifies content but does not set `Accepted`; /develop advances it.
|
|
248
|
+
- **Standalone decision spec** (a foundational/stack or cross cutting standard with **no linked buildable feature**) → **decision status**: `Proposed` when written, then **`Accepted` once the engineer ratifies it** (on confirmation). There's no build phase to gate on, so it is not feature mirrored.
|
|
249
|
+
- **spec documenting already shipped work** (the "already built" path, or a feature already `existing`) → **born `Accepted`**, it describes reality that already exists.
|
|
250
|
+
|
|
251
|
+
**Umbrella child specs carry no lifecycle status.** In an umbrella directory (`NNNN-<x>/`), only the `index.md` has a `**Status**:` line, it mirrors the feature. The **child specs are spec content**, so **omit the `**Status**:` line on children** (they're governed by the umbrella). `/develop` and `/sync` advance the umbrella `index.md`'s status only, never a child's.
|
|
252
|
+
|
|
253
|
+
**A directory spec splits build spec from reasoning.** A directory spec (`NNNN-<x>/`) always contains exactly two core files, plus optional extras:
|
|
254
|
+
- **`index.md`**: the build spec `/develop` reads: `## Summary`, `## Requirements`, `## Decision`, the design/spec section, `## Build plan`, `## Consequences`, `## Follow-up`, and a one line `## Rationale` pointer to `rationale.md`. For an umbrella, `index.md` also opens with a **`## Structure`** section listing and linking every child spec (one line each: what it is + which decision it supports) and holds any **cross child contract**.
|
|
255
|
+
- **`rationale.md`**: everything in the decision record that `/develop` does not need: `## Context`, `## Options considered`, `## Rationale`, the `## References` section, and any supporting evidence (inventories, audits, a landscape scan). There is no separate `research/` folder; bulky evidence goes here, under its own subheading. This is read by humans and by `/architect` on update or supersede, never during a build.
|
|
256
|
+
- Optional: **`verify.md`** (verify steps), and **child specs** `NNNN-<child>.md` for an umbrella (each sufficient on its own to build from, each with a short inline rationale rather than its own `rationale.md`; promote a child to its own directory only if it grows heavy).
|
|
257
|
+
|
|
258
|
+
## Audience split: build spec vs decision record
|
|
259
|
+
|
|
260
|
+
A spec serves two audiences, and its sections divide cleanly between them:
|
|
261
|
+
|
|
262
|
+
- **Build spec** (what `/develop` reads to build): **`## Requirements`** (the acceptance criteria contract), **`## Decision`**, the design/spec section (**`## Feature design`** for a FEATURE spec, **`## Proposed stack`** for an ARCHITECTURE spec, or the equivalent spec table, e.g. `## Standard definition`), **`## Build plan`** (the ordered tasks derived from the surface + acceptance criteria), and **`## Consequences`** (the constraints the build must honor). This is the WHAT, the implementable spec. The **acceptance criteria in `## Requirements` are the contract `/develop` builds to and `/check verify` checks.**
|
|
263
|
+
- **Decision record** (human / future decision maker context, the WHY): **`## Context`**, **`## Options considered`**, **`## Rationale`**, and the **`## References`** section. This is decision history, not build input; `/develop` skips it. (**`## Summary`** stays with the build spec in `index.md`, it is the human quick read that orients before the spec.)
|
|
264
|
+
|
|
265
|
+
Where each audience's sections physically live depends on the spec shape:
|
|
266
|
+
- **Single file spec** (`NNNN-title.md`): both audiences share the one file; the decision record sections stay inline, written tight. Small specs are not split.
|
|
267
|
+
- **Directory spec** (`NNNN-title/`): the build spec is `index.md`, the decision record moves to `rationale.md`. The full reasoning is never removed, only relocated so a build never loads it.
|
|
268
|
+
|
|
269
|
+
## Writing rules
|
|
270
|
+
|
|
271
|
+
- **Be concise: state each point once.** This spec is loaded by later builds, so words cost tokens every time. Write tight technical prose: prefer bullets and short sentences over long paragraphs with many clauses, never repeat the same point across Context, Rationale, and Consequences, and never pad. Brevity applies to the reasoning most; the build spec sections stay complete but trimmed of waffle.
|
|
272
|
+
- Summary is the human quick read: plain words, 2 to 4 short sentences, no dashes; it comes first so everyone gets the gist fast
|
|
273
|
+
- Context describes the problem, not the solution; keep it to the forces that actually shaped the choice
|
|
274
|
+
- **`## Options considered`**: describe each option fairly (no straw men) but compactly, a one to two sentence description plus a tight pros/cons of only the load bearing tradeoffs, not an essay per option
|
|
275
|
+
- Rationale must reference specific forces from Context, not just repeat pros/cons; a few sentences, not paragraphs
|
|
276
|
+
- Consequences must include negatives, a spec with only positives is not credible
|
|
277
|
+
- Follow-up items are optional but recommended for high risk or foundational decisions
|
|
278
|
+
- **One decision per spec: keep it focused and scannable.** Length follows the decision, not a line count: don't pad, and never cut a required design field (data model, state machine, full API table, security model, acceptance criteria) to make the record shorter. If it needs *multiple independent decisions*, or the design won't fit cleanly in one scannable spec, split it into an **umbrella spec + child specs** (the directory shape) rather than letting one file sprawl.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug
|
|
3
|
+
allowed-tools: Bash, Read, Grep, Glob, Write, Edit, Agent
|
|
4
|
+
description: "Run /debug to find and fix the root cause of a bug (something failing, broken, throwing, or behaving wrong) when a test fails for a reason that is not obvious, /check verify finds a failure, or behavior is unexpected. Runs a reproduce, localize, hypothesize, test, fix, verify loop, makes the minimal fix, and hands a regression test to /test. No features, no extra refactors."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Output style (plain words, no dashes, no hyphens)
|
|
8
|
+
|
|
9
|
+
<!-- OUTPUT-STYLE:START -->
|
|
10
|
+
Write everything this skill produces, files and messages alike, in plain simple language. Keep technical terms that carry real meaning; explain each in plain words. Never use a dash or a hyphen as punctuation: no em dash, no en dash, and no hyphenated compounds. Write `read only`, not `read-only`. Say it in simple words, or reword the sentence. Code, file paths, command flags, and values other skills match on keep their hyphens. Use short sentences, commas, or parentheses. Clear beats clever.
|
|
11
|
+
<!-- OUTPUT-STYLE:END -->
|
|
12
|
+
|
|
13
|
+
## What this skill does
|
|
14
|
+
|
|
15
|
+
**Your role:** the investigator who trusts evidence over intuition. You treat a bug like a case to be proven, not a symptom to be silenced. You reproduce it on demand, narrow it to the smallest surface that still fails, and change exactly one thing at a time so every result *means* something. You resist the pull to patch what you see (the null, the crash) before you understand *why* it's there, because a fix you can't explain is a bug you haven't caught. You stop when the cause is proven and the fix is the smallest one that addresses it, no opportunistic refactors riding along.
|
|
16
|
+
|
|
17
|
+
A structured root cause investigation, not a guess and check. Bugs are found by a **loop**: reproduce → localize → hypothesize → test the hypothesis → fix the root cause → verify. This skill runs that loop with discipline (**one hypothesis at a time**, each confirmed or rejected by evidence before moving on) until the actual cause is proven, then applies the smallest fix that addresses it.
|
|
18
|
+
|
|
19
|
+
> This is an *internal investigation loop within a single run*, not the `/loop` skill (which runs a command again on a time interval). Reach for `/loop` only when you need to watch something over time, e.g. poll a flaky test across many runs.
|
|
20
|
+
|
|
21
|
+
## Asks vs acts
|
|
22
|
+
|
|
23
|
+
**Acts.** It reproduces, investigates, and fixes. It **asks only** when it cannot reproduce the bug from what it's given, then it asks for exact steps, inputs, environment, and the observed vs expected behavior. It does not ask permission to investigate.
|
|
24
|
+
|
|
25
|
+
## Artifact ownership
|
|
26
|
+
|
|
27
|
+
Writes the **minimal code fix** for the root cause. Recommends `/test` for the regression test (or writes a failing then passing test inline if that's the fastest proof). Does **not** add features, refactor unrelated code, or rewrite the spec. If the bug reveals a flawed decision (not just a coding mistake), it says so and points to `/architect` rather than papering over it.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Portability (any OS, any agent)
|
|
32
|
+
|
|
33
|
+
Written for any Agent Skills client on macOS, Linux, or Windows. Commands are **reference**, use the project's real test/run commands and your agent's own tools. The investigation can run in a subagent (below) or inline if your tool has no subagent.
|
|
34
|
+
|
|
35
|
+
## Execution
|
|
36
|
+
|
|
37
|
+
### Step 0: Capture the symptom
|
|
38
|
+
|
|
39
|
+
Pin down precisely, before touching code:
|
|
40
|
+
- **Observed** behavior (the exact error, stack trace, wrong output, or screenshot).
|
|
41
|
+
- **Expected** behavior.
|
|
42
|
+
- **Repro**: the steps, inputs, and environment that trigger it.
|
|
43
|
+
|
|
44
|
+
If any of these is unclear and you can't derive it, **ask**, you cannot debug what you can't reproduce.
|
|
45
|
+
|
|
46
|
+
### Step 1: Reproduce reliably
|
|
47
|
+
|
|
48
|
+
Get a **deterministic reproduction** (a failing test, a command, a request) that triggers the bug on demand. If it's intermittent, find what makes it deterministic (timing, ordering, data, concurrency). A bug you can't reproduce on command, you can't prove you've fixed. If you truly can't reproduce it, add instrumentation to catch it and say so, do not "fix" blind.
|
|
49
|
+
|
|
50
|
+
### Step 2: Localize
|
|
51
|
+
|
|
52
|
+
Narrow the failure to the smallest possible surface before theorizing:
|
|
53
|
+
- **Bisect the code path**: binary search where good input becomes bad output (logging/print at midpoints, breakpoints, or commenting out).
|
|
54
|
+
- **Bisect history**: if it's a regression, `git bisect` (or `git log -p` on the suspect files) to find the introducing change.
|
|
55
|
+
- **Read the actual values**: instrument inputs/outputs at the boundary; don't assume what they are.
|
|
56
|
+
|
|
57
|
+
### Step 3: Hypothesize (one at a time)
|
|
58
|
+
|
|
59
|
+
State a single, specific, falsifiable hypothesis for the root cause, e.g. "the date is parsed as local time, so the cutoff is off by the timezone offset." Root cause, not symptom: "the value is null here" is a symptom; *why* it's null is the cause. Resist shotgun changing several things at once.
|
|
60
|
+
|
|
61
|
+
### Step 4: Test the hypothesis
|
|
62
|
+
|
|
63
|
+
Design the smallest experiment that confirms or refutes it (a targeted log, an assertion, a one line change, a unit test). Run it.
|
|
64
|
+
- **Refuted** → discard it, return to Step 2/3 with what you learned. Do not keep a change that didn't help.
|
|
65
|
+
- **Confirmed** → you've found the root cause. Proceed.
|
|
66
|
+
|
|
67
|
+
Loop Steps 3 to 4 until a hypothesis is confirmed by evidence. **Never skip to a fix on a hunch**, an unverified fix is how a symptom gets patched while the bug survives.
|
|
68
|
+
|
|
69
|
+
### Step 5: Fix at the root
|
|
70
|
+
|
|
71
|
+
Make the **minimal, targeted** change that addresses the proven cause. Don't fix the symptom (clamping the null), fix the cause (why it's null). Resist scope creep, no opportunistic refactors riding along with the fix. Follow the project's conventions (`.istm-context/agents.md`, neighbouring code).
|
|
72
|
+
|
|
73
|
+
### Step 6: Verify and protect
|
|
74
|
+
|
|
75
|
+
- Run the Step 1 reproduction again, confirm it now passes.
|
|
76
|
+
- Run the surrounding test suite, confirm no regression.
|
|
77
|
+
- **Add a regression test** that fails without the fix and passes with it, so this bug can't silently return; write it inline, or hand the spec to `/test`.
|
|
78
|
+
- **Check for siblings**: the same root cause often hides in other places (same pattern, same bad assumption). Grep for them and note or fix them.
|
|
79
|
+
|
|
80
|
+
### Optional: run it in a subagent
|
|
81
|
+
|
|
82
|
+
For a hunt that is not trivial, spawn an investigation subagent so the iterative tool use doesn't fill the main context:
|
|
83
|
+
- `model`: set explicitly to a strong model, do not inherit the session model (Claude Code: `sonnet`)
|
|
84
|
+
- `description: "Debug: <symptom>"`
|
|
85
|
+
- Tools: `Read`, `Bash`, `Grep`, `Glob`, `Edit`, `Write`
|
|
86
|
+
- `prompt`: this loop + the captured symptom + reproduction + the relevant `.istm-context/agents.md` (inlined). Require it to report the root cause with evidence, not just "fixed it."
|
|
87
|
+
|
|
88
|
+
### Report
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
## /debug complete
|
|
92
|
+
|
|
93
|
+
**Symptom**: <observed vs expected>
|
|
94
|
+
**Reproduction**: <how it was triggered>
|
|
95
|
+
**Root cause**: <the proven cause, with the evidence that confirmed it>
|
|
96
|
+
**Fix**: <the minimal change (files touched)>
|
|
97
|
+
**Regression test**: <added inline | spec handed to /test>
|
|
98
|
+
**Siblings**: <same cause found/fixed elsewhere | none found>
|
|
99
|
+
**Deeper issue**: <if the bug reveals a design flaw, run /architect | none>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If the cause turns out to be a flawed decision rather than a coding mistake, lead with that, the right fix may be a spec update, not a code patch.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# OpenAI Codex adapter. This file supplies the interface metadata Codex shows in
|
|
2
|
+
# its agent picker. The skill's actual instructions live in ../SKILL.md, which the
|
|
3
|
+
# Agent Skills client installs alongside this file and loads when the skill runs.
|
|
4
|
+
interface:
|
|
5
|
+
display_name: "Debug"
|
|
6
|
+
short_description: "Find and fix root cause bugs"
|
|
7
|
+
default_prompt: "Run the debug skill: read its SKILL.md, then reproduce, localize, and fix the root cause of this failing behavior."
|