@edupia-tutor/spec-driven-docs 0.14.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/bin/build.js +230 -0
- package/bin/index.js +598 -0
- package/commands/debug.md +830 -0
- package/commands/debug.tmpl +257 -0
- package/commands/define-product.md +652 -0
- package/commands/define-product.tmpl +158 -0
- package/commands/dev-gen-test.md +1010 -0
- package/commands/dev-gen-test.tmpl +490 -0
- package/commands/dev-run-test.md +744 -0
- package/commands/dev-run-test.tmpl +224 -0
- package/commands/dev-smoke-test.md +711 -0
- package/commands/dev-smoke-test.tmpl +217 -0
- package/commands/fix-bug.md +744 -0
- package/commands/fix-bug.tmpl +171 -0
- package/commands/generate-bdd.md +1054 -0
- package/commands/generate-bdd.tmpl +534 -0
- package/commands/generate-code.md +869 -0
- package/commands/generate-code.tmpl +349 -0
- package/commands/generate-design-spec.md +958 -0
- package/commands/generate-design-spec.tmpl +464 -0
- package/commands/generate-prd.md +748 -0
- package/commands/generate-prd.tmpl +254 -0
- package/commands/generate-spec-manifest.md +658 -0
- package/commands/generate-spec-manifest.tmpl +164 -0
- package/commands/generate-tech-docs.md +849 -0
- package/commands/generate-tech-docs.tmpl +355 -0
- package/commands/learn.md +636 -0
- package/commands/learn.tmpl +63 -0
- package/commands/map-testids.md +575 -0
- package/commands/map-testids.tmpl +81 -0
- package/commands/propose-scenario.md +623 -0
- package/commands/propose-scenario.tmpl +129 -0
- package/commands/qc-analyze.md +580 -0
- package/commands/qc-analyze.tmpl +86 -0
- package/commands/qc-design-test.md +562 -0
- package/commands/qc-design-test.tmpl +68 -0
- package/commands/qc-plan.md +543 -0
- package/commands/qc-plan.tmpl +49 -0
- package/commands/qc-report.md +554 -0
- package/commands/qc-report.tmpl +60 -0
- package/commands/qc-review.md +547 -0
- package/commands/qc-review.tmpl +53 -0
- package/commands/qc-run-test.md +604 -0
- package/commands/qc-run-test.tmpl +84 -0
- package/commands/refine-prd.md +772 -0
- package/commands/refine-prd.tmpl +140 -0
- package/commands/report-bug.md +639 -0
- package/commands/report-bug.tmpl +145 -0
- package/commands/review-code.md +677 -0
- package/commands/review-code.tmpl +104 -0
- package/commands/review-context.md +1047 -0
- package/commands/review-context.tmpl +415 -0
- package/commands/review-tech-docs.md +811 -0
- package/commands/review-tech-docs.tmpl +317 -0
- package/commands/setup-ai-first.md +545 -0
- package/commands/setup-ai-first.tmpl +358 -0
- package/commands/sync.md +451 -0
- package/commands/sync.tmpl +351 -0
- package/commands/update-framework.md +251 -0
- package/commands/update-framework.tmpl +151 -0
- package/commands/validate-traces.md +842 -0
- package/commands/validate-traces.tmpl +348 -0
- package/core/FRAMEWORK_VERSION +1 -0
- package/core/commands/debug.md +830 -0
- package/core/commands/define-product.md +652 -0
- package/core/commands/dev-gen-test.md +1010 -0
- package/core/commands/dev-run-test.md +744 -0
- package/core/commands/dev-smoke-test.md +711 -0
- package/core/commands/fix-bug.md +744 -0
- package/core/commands/generate-bdd.md +1054 -0
- package/core/commands/generate-code.md +869 -0
- package/core/commands/generate-design-spec.md +958 -0
- package/core/commands/generate-prd.md +748 -0
- package/core/commands/generate-spec-manifest.md +658 -0
- package/core/commands/generate-tech-docs.md +849 -0
- package/core/commands/learn.md +636 -0
- package/core/commands/map-testids.md +575 -0
- package/core/commands/propose-scenario.md +623 -0
- package/core/commands/qc-analyze.md +580 -0
- package/core/commands/qc-design-test.md +562 -0
- package/core/commands/qc-plan.md +543 -0
- package/core/commands/qc-report.md +554 -0
- package/core/commands/qc-review.md +547 -0
- package/core/commands/qc-run-test.md +604 -0
- package/core/commands/refine-prd.md +772 -0
- package/core/commands/report-bug.md +639 -0
- package/core/commands/review-code.md +677 -0
- package/core/commands/review-context.md +1047 -0
- package/core/commands/review-tech-docs.md +811 -0
- package/core/commands/setup-ai-first.md +545 -0
- package/core/commands/sync.md +451 -0
- package/core/commands/update-framework.md +251 -0
- package/core/commands/validate-traces.md +842 -0
- package/core/hooks/data-guard.js +141 -0
- package/core/hooks/settings.json +18 -0
- package/core/modules/android-compose/module.yaml +13 -0
- package/core/modules/android-compose/stack-profile.yaml +57 -0
- package/core/modules/angular/architecture-snippets/component-patterns.md +187 -0
- package/core/modules/angular/module.yaml +6 -0
- package/core/modules/angular/stack-profile.yaml +38 -0
- package/core/modules/context-engineering/architecture-snippets/context-design.md +119 -0
- package/core/modules/context-engineering/module.yaml +9 -0
- package/core/modules/context-engineering/stack-profile.yaml +61 -0
- package/core/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
- package/core/modules/dotnet/module.yaml +6 -0
- package/core/modules/dotnet/stack-profile.yaml +50 -0
- package/core/modules/flutter/module.yaml +14 -0
- package/core/modules/flutter/stack-profile.yaml +59 -0
- package/core/modules/golang/architecture-snippets/domain-layout.md +283 -0
- package/core/modules/golang/module.yaml +6 -0
- package/core/modules/golang/stack-profile.yaml +40 -0
- package/core/modules/ios-swiftui/module.yaml +13 -0
- package/core/modules/ios-swiftui/stack-profile.yaml +55 -0
- package/core/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
- package/core/modules/java-spring/module.yaml +15 -0
- package/core/modules/java-spring/stack-profile.yaml +28 -0
- package/core/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
- package/core/modules/nextjs/module.yaml +14 -0
- package/core/modules/nextjs/stack-profile.yaml +74 -0
- package/core/modules/nuxt/module.yaml +14 -0
- package/core/modules/nuxt/stack-profile.yaml +58 -0
- package/core/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
- package/core/modules/php-laravel/module.yaml +15 -0
- package/core/modules/php-laravel/stack-profile.yaml +56 -0
- package/core/modules/qc-playwright/stack-profile.yaml +66 -0
- package/core/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
- package/core/modules/react/module.yaml +14 -0
- package/core/modules/react/stack-profile.yaml +63 -0
- package/core/modules/react-native/module.yaml +14 -0
- package/core/modules/react-native/stack-profile.yaml +56 -0
- package/core/modules/vue/module.yaml +14 -0
- package/core/modules/vue/stack-profile.yaml +65 -0
- package/core/rules/data-protection.md +80 -0
- package/core/rules/workflow.md +44 -0
- package/core/skills/code/SKILL.md +770 -0
- package/core/skills/debug/SKILL.md +869 -0
- package/core/skills/design-spec/SKILL.md +589 -0
- package/core/skills/discovery/SKILL.md +554 -0
- package/core/skills/prd/SKILL.md +562 -0
- package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/core/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
- package/core/skills/qc/qa-analyst/business-rules.md +59 -0
- package/core/skills/qc/qa-analyst/data-flow.md +64 -0
- package/core/skills/qc/qa-analyst/spec-breakdown.md +61 -0
- package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
- package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
- package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
- package/core/skills/qc/qa-designer/functional/api.md +45 -0
- package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
- package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
- package/core/skills/qc/qa-designer/integration/api.md +42 -0
- package/core/skills/qc/qa-designer/integration/db.md +39 -0
- package/core/skills/qc/qa-designer/integration/gui.md +40 -0
- package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
- package/core/skills/qc/qa-designer/non-functional.md +40 -0
- package/core/skills/qc/qa-planner/test-plan.md +120 -0
- package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
- package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
- package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
- package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
- package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
- package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
- package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
- package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
- package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
- package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
- package/core/skills/qc/qa-runner/e2e.md +49 -0
- package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
- package/core/skills/qc/qa-runner/functional/api.md +35 -0
- package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
- package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
- package/core/skills/qc/qa-runner/integration.md +47 -0
- package/core/skills/qc/qa-runner/non-functional.md +49 -0
- package/core/skills/qc/qa-runner/report/report.md +37 -0
- package/core/skills/setup-ai-first/SKILL.md +216 -0
- package/core/skills/spec/SKILL.md +461 -0
- package/core/skills/test/SKILL.md +1297 -0
- package/core/steps/capture-lesson.md +79 -0
- package/core/steps/context-loader.md +307 -0
- package/core/steps/gate.md +87 -0
- package/core/steps/report-footer.md +100 -0
- package/core/steps/review-fanout.md +138 -0
- package/core/steps/spawn-agent.md +124 -0
- package/core/steps/trace-mirror.md +26 -0
- package/core/templates/architecture.template.md +113 -0
- package/core/templates/design-spec.template.md +217 -0
- package/core/templates/feature.template +259 -0
- package/core/templates/platform-guide.template.md +145 -0
- package/core/templates/prd.template.md +327 -0
- package/core/templates/product-definition.template.md +168 -0
- package/core/templates/project-context.yaml +161 -0
- package/docs/01-getting-started/README.md +19 -0
- package/docs/01-getting-started/core-concepts.md +102 -0
- package/docs/01-getting-started/installation.md +156 -0
- package/docs/01-getting-started/quickstart.md +85 -0
- package/docs/02-guides/README.md +26 -0
- package/docs/02-guides/developer/README.md +46 -0
- package/docs/02-guides/developer/bdd-and-trace.md +125 -0
- package/docs/02-guides/developer/commands.md +76 -0
- package/docs/02-guides/developer/pr-checklist.md +15 -0
- package/docs/02-guides/developer/scenarios.md +460 -0
- package/docs/02-guides/developer/workflow.md +121 -0
- package/docs/02-guides/product-owner/README.md +79 -0
- package/docs/02-guides/product-owner/commands.md +30 -0
- package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
- package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
- package/docs/02-guides/product-owner/scenarios.md +436 -0
- package/docs/02-guides/tester/README.md +75 -0
- package/docs/02-guides/tester/bug-reporting.md +117 -0
- package/docs/02-guides/tester/qc-automation.md +165 -0
- package/docs/02-guides/tester/reading-specs.md +79 -0
- package/docs/02-guides/tester/scenarios.md +186 -0
- package/docs/02-guides/tester/spec-manifest.md +130 -0
- package/docs/02-guides/tester/test-checklist.md +31 -0
- package/docs/02-guides/tester/workflow.md +77 -0
- package/docs/03-concepts/README.md +19 -0
- package/docs/03-concepts/architecture.md +248 -0
- package/docs/03-concepts/pipeline.md +274 -0
- package/docs/03-concepts/traceability.md +149 -0
- package/docs/04-operations/README.md +33 -0
- package/docs/04-operations/bug-flow.md +362 -0
- package/docs/04-operations/publishing.md +137 -0
- package/docs/04-operations/sync-and-update.md +522 -0
- package/docs/05-reference/README.md +32 -0
- package/docs/05-reference/command-cheatsheet.md +147 -0
- package/docs/05-reference/commands.md +232 -0
- package/docs/05-reference/modules.md +110 -0
- package/docs/05-reference/trace-schema.md +153 -0
- package/docs/README.md +49 -0
- package/hooks/data-guard.js +141 -0
- package/hooks/settings.json +18 -0
- package/modules/android-compose/module.yaml +13 -0
- package/modules/android-compose/stack-profile.yaml +57 -0
- package/modules/angular/architecture-snippets/component-patterns.md +187 -0
- package/modules/angular/module.yaml +6 -0
- package/modules/angular/stack-profile.yaml +38 -0
- package/modules/context-engineering/architecture-snippets/context-design.md +119 -0
- package/modules/context-engineering/module.yaml +9 -0
- package/modules/context-engineering/stack-profile.yaml +61 -0
- package/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
- package/modules/dotnet/module.yaml +6 -0
- package/modules/dotnet/stack-profile.yaml +50 -0
- package/modules/flutter/module.yaml +14 -0
- package/modules/flutter/stack-profile.yaml +59 -0
- package/modules/golang/architecture-snippets/domain-layout.md +283 -0
- package/modules/golang/module.yaml +6 -0
- package/modules/golang/stack-profile.yaml +40 -0
- package/modules/ios-swiftui/module.yaml +13 -0
- package/modules/ios-swiftui/stack-profile.yaml +55 -0
- package/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
- package/modules/java-spring/module.yaml +15 -0
- package/modules/java-spring/stack-profile.yaml +28 -0
- package/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
- package/modules/nextjs/module.yaml +14 -0
- package/modules/nextjs/stack-profile.yaml +74 -0
- package/modules/nuxt/module.yaml +14 -0
- package/modules/nuxt/stack-profile.yaml +58 -0
- package/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
- package/modules/php-laravel/module.yaml +15 -0
- package/modules/php-laravel/stack-profile.yaml +56 -0
- package/modules/qc-playwright/stack-profile.yaml +66 -0
- package/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
- package/modules/react/module.yaml +14 -0
- package/modules/react/stack-profile.yaml +63 -0
- package/modules/react-native/module.yaml +14 -0
- package/modules/react-native/stack-profile.yaml +56 -0
- package/modules/vue/module.yaml +14 -0
- package/modules/vue/stack-profile.yaml +65 -0
- package/package.json +49 -0
- package/rules/data-protection.md +80 -0
- package/rules/workflow.md +44 -0
- package/scripts/init.sh +49 -0
- package/scripts/migrate-specs.js +256 -0
- package/scripts/upgrade.sh +94 -0
- package/skills/code/SKILL.md +770 -0
- package/skills/code/SKILL.tmpl +176 -0
- package/skills/debug/SKILL.md +869 -0
- package/skills/debug/SKILL.tmpl +262 -0
- package/skills/design-spec/SKILL.md +589 -0
- package/skills/design-spec/SKILL.tmpl +95 -0
- package/skills/discovery/SKILL.md +554 -0
- package/skills/discovery/SKILL.tmpl +147 -0
- package/skills/prd/SKILL.md +562 -0
- package/skills/prd/SKILL.tmpl +188 -0
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
- package/skills/qc/qa-analyst/business-rules.md +59 -0
- package/skills/qc/qa-analyst/data-flow.md +64 -0
- package/skills/qc/qa-analyst/spec-breakdown.md +61 -0
- package/skills/qc/qa-designer/e2e/journey.md +41 -0
- package/skills/qc/qa-designer/exploratory/charter.md +68 -0
- package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
- package/skills/qc/qa-designer/functional/api.md +45 -0
- package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
- package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
- package/skills/qc/qa-designer/integration/api.md +42 -0
- package/skills/qc/qa-designer/integration/db.md +39 -0
- package/skills/qc/qa-designer/integration/gui.md +40 -0
- package/skills/qc/qa-designer/integration/kafka.md +40 -0
- package/skills/qc/qa-designer/non-functional.md +40 -0
- package/skills/qc/qa-planner/test-plan.md +120 -0
- package/skills/qc/qa-reviewer/script/e2e.md +87 -0
- package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
- package/skills/qc/qa-reviewer/script/functional.md +101 -0
- package/skills/qc/qa-reviewer/script/integration.md +91 -0
- package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
- package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
- package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
- package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
- package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
- package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
- package/skills/qc/qa-runner/e2e.md +49 -0
- package/skills/qc/qa-runner/exploratory/session.md +36 -0
- package/skills/qc/qa-runner/functional/api.md +35 -0
- package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
- package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
- package/skills/qc/qa-runner/integration.md +47 -0
- package/skills/qc/qa-runner/non-functional.md +49 -0
- package/skills/qc/qa-runner/report/report.md +37 -0
- package/skills/setup-ai-first/SKILL.md +216 -0
- package/skills/setup-ai-first/SKILL.tmpl +116 -0
- package/skills/spec/SKILL.md +461 -0
- package/skills/spec/SKILL.tmpl +174 -0
- package/skills/test/SKILL.md +1297 -0
- package/skills/test/SKILL.tmpl +296 -0
- package/steps/capture-lesson.md +79 -0
- package/steps/context-loader.md +307 -0
- package/steps/gate.md +87 -0
- package/steps/report-footer.md +100 -0
- package/steps/review-fanout.md +138 -0
- package/steps/spawn-agent.md +124 -0
- package/steps/trace-mirror.md +26 -0
- package/templates/architecture.template.md +113 -0
- package/templates/design-spec.template.md +217 -0
- package/templates/feature.template +259 -0
- package/templates/platform-guide.template.md +145 -0
- package/templates/prd.template.md +327 -0
- package/templates/product-definition.template.md +168 -0
- package/templates/project-context.yaml +161 -0
package/steps/gate.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Gate — Universal Entry Procedure
|
|
2
|
+
|
|
3
|
+
Every command must execute this gate before proceeding with its specific logic.
|
|
4
|
+
|
|
5
|
+
## Step 0 — Sub-Agent Mode Check
|
|
6
|
+
|
|
7
|
+
Before anything else, check if `$ARGUMENTS` is a JSON payload from an orchestrator:
|
|
8
|
+
|
|
9
|
+
1. Attempt to parse `$ARGUMENTS` as JSON.
|
|
10
|
+
2. If it parses successfully **and** contains `"_agent_mode": true`:
|
|
11
|
+
- **Skip Steps 1, 2, and 3 of this Gate entirely.**
|
|
12
|
+
- Set target file = `payload.target_file`
|
|
13
|
+
- Set loaded context = `payload.context` (do NOT run context-loader.md)
|
|
14
|
+
- Set UC scope = `payload.uc_id` (process only this UC)
|
|
15
|
+
- Set line range = `payload.uc_section` (read only that PRD section)
|
|
16
|
+
- Proceed directly to the command-specific logic.
|
|
17
|
+
3. If `$ARGUMENTS` is not JSON or `_agent_mode` is absent → continue to Step 1 (normal mode).
|
|
18
|
+
|
|
19
|
+
## Step 0-B — Model Check
|
|
20
|
+
|
|
21
|
+
*Skip this step if `_agent_mode: true` (sub-agent — orchestrator already validated).*
|
|
22
|
+
|
|
23
|
+
Complex generation and review commands require strong reasoning.
|
|
24
|
+
Using a smaller model risks missed edge cases, incomplete spec analysis, and architecture violations.
|
|
25
|
+
|
|
26
|
+
Display and wait for response:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
⚙️ MODEL CHECK
|
|
30
|
+
──────────────────────────────────────────────────────────────────
|
|
31
|
+
Recommended : claude-opus-4 (or latest Opus model)
|
|
32
|
+
Why needed : Spec analysis, architecture review, code generation
|
|
33
|
+
require deep reasoning. Smaller models miss edge cases.
|
|
34
|
+
|
|
35
|
+
To switch in Claude Code:
|
|
36
|
+
• Settings → Model → select "claude-opus"
|
|
37
|
+
• or: /model → choose claude-opus
|
|
38
|
+
|
|
39
|
+
Running on claude-opus?
|
|
40
|
+
Y — yes, on claude-opus → proceed
|
|
41
|
+
S — skip check (I accept lower quality risk with current model)
|
|
42
|
+
──────────────────────────────────────────────────────────────────
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- "Y" → proceed to Step 1.
|
|
46
|
+
- "S" → proceed to Step 1 (user accepts risk, add ⚠️ to final report).
|
|
47
|
+
- "N" or anything else → **STOP.** Output: "Please switch to claude-opus, then re-run this command."
|
|
48
|
+
|
|
49
|
+
## Step 1 — Resolve Target File
|
|
50
|
+
|
|
51
|
+
1. If `$ARGUMENTS` is provided and points to an existing file → use it directly as the target.
|
|
52
|
+
2. If `$ARGUMENTS` is a **bare UC-ID / ticket ID / partial name** (no path) → resolve it to a file by globbing the feature-package layout. The `{prd-slug}` is **not known yet**, so use a `*` wildcard for that segment, and a recursive `**` under `bdd/` so the platform subfolders (`bdd/web/`, `bdd/app/`, `bdd/system/`) are all covered:
|
|
53
|
+
- **BDD commands** (target is a `.feature`): `{specs_dir}/{domain}/*/bdd/**/{UC-ID}*.feature` — or `{specs_dir}/*/*/bdd/**/{UC-ID}*.feature` if the domain is also unknown. If a platform/scope is implied by the command (e.g. a system tech-doc needs the `system/` BDD), prefer the match under that platform subfolder.
|
|
54
|
+
- **PRD commands** (target is `prd.md`): `{specs_dir}/{domain}/*/prd.md` (match the feature folder whose id corresponds), else `{specs_dir}/*/*/prd.md`.
|
|
55
|
+
- **tech-docs commands**: `{specs_dir}/{domain}/*/tech-docs/{UC-ID}*-tech-design*.md`.
|
|
56
|
+
- **design-spec commands**: `{specs_dir}/{domain}/*/design-spec/{TICKET-ID}*.md`.
|
|
57
|
+
|
|
58
|
+
Once a file matches: set it as the target **and** record `domain` + `prd_slug` from its path (per the extraction rule in `context-loader.md` Step 1 — `prd_slug` = first segment after `{specs_dir}/{domain}/`). Every path the command later reads or writes (sibling BDD/tech-docs/design-spec/trace) uses **that resolved `prd_slug`**, so all artifacts stay in one feature package. If several files match (e.g. multiple platforms), pick per the command's platform/scope or list them and ask.
|
|
59
|
+
3. If `$ARGUMENTS` is empty or no match found:
|
|
60
|
+
- List files in the relevant directory for this command (e.g., `specs/*/*/prd.md` for PRD commands, `specs/*/*/bdd/**/*.feature` for BDD commands).
|
|
61
|
+
- Present the list to the user and ask: "Which file do you want to work with? (Enter number or filename)"
|
|
62
|
+
- Wait for user selection before continuing.
|
|
63
|
+
|
|
64
|
+
## Step 2 — Execute Context Loader
|
|
65
|
+
|
|
66
|
+
Load all project context by following the procedure in `steps/context-loader.md`.
|
|
67
|
+
Store all loaded context in memory for use throughout this command session.
|
|
68
|
+
|
|
69
|
+
## Step 3 — CHECKPOINT
|
|
70
|
+
|
|
71
|
+
After completing Steps 1 and 2, display a summary and wait for confirmation:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
CHECKPOINT
|
|
75
|
+
-----------
|
|
76
|
+
Target : {resolved file path}
|
|
77
|
+
Project : {project.name from project-context.yaml}
|
|
78
|
+
Tech stack : {language} / {framework}
|
|
79
|
+
Module : {module if set, else "not configured"}
|
|
80
|
+
Domains : {comma-separated domain list}
|
|
81
|
+
|
|
82
|
+
Proceed? (Y/N)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Wait for explicit "Y" or "N" from the user before continuing.
|
|
86
|
+
- "Y" → proceed to the command-specific steps below.
|
|
87
|
+
- "N" → stop and ask what the user wants to change.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Report Footer — Standard Command Output Format
|
|
2
|
+
|
|
3
|
+
Every command report must end with this standard footer section.
|
|
4
|
+
|
|
5
|
+
## Status Badge
|
|
6
|
+
|
|
7
|
+
Choose one based on outcome:
|
|
8
|
+
- `✅ Complete` — all steps succeeded, no issues found
|
|
9
|
+
- `❌ Failed` — command could not complete due to a blocking error
|
|
10
|
+
- `⚠️ Warnings` — completed with non-blocking issues that should be reviewed
|
|
11
|
+
|
|
12
|
+
## Output Artifacts
|
|
13
|
+
|
|
14
|
+
List every file created or modified by this command:
|
|
15
|
+
```
|
|
16
|
+
Output Artifacts:
|
|
17
|
+
{created|updated} {file-path} ({brief description})
|
|
18
|
+
{created|updated} {file-path} ({brief description})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If no files were written (e.g., review or analysis commands) → write `Output Artifacts: none (read-only)`.
|
|
22
|
+
|
|
23
|
+
## Pipeline Position
|
|
24
|
+
|
|
25
|
+
Print a one-line map of the pipeline with the CURRENT command's phase marked `◀ bạn ở đây`,
|
|
26
|
+
so the user always sees where this command sits in the end-to-end flow:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Discovery → PRD → [Design Spec] → BDD → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Find the current command in this phase legend and mark **its** phase in the map above:
|
|
33
|
+
|
|
34
|
+
| Phase | Commands |
|
|
35
|
+
|-------|----------|
|
|
36
|
+
| Discovery | `/define-product` |
|
|
37
|
+
| PRD | `/generate-prd` · `/refine-prd` · `/review-context` (PRD) |
|
|
38
|
+
| Design Spec | `/generate-design-spec` |
|
|
39
|
+
| BDD | `/generate-bdd` · `/review-context` (BDD) |
|
|
40
|
+
| Tech Design | `/generate-tech-docs` · `/map-testids` · `/review-tech-docs` |
|
|
41
|
+
| Code | `/generate-code` · `/review-code` |
|
|
42
|
+
| Dev Self-Check | `/dev-gen-test` · `/dev-run-test` · `/dev-smoke-test` |
|
|
43
|
+
| QC | `/qc-analyze` · `/qc-plan` · `/qc-design-test` · `/qc-review` · `/qc-run-test` · `/qc-report` |
|
|
44
|
+
| Trace Audit | `/validate-traces` |
|
|
45
|
+
|
|
46
|
+
For a **review command**, also append the 3-step review loop with the current step marked, e.g.:
|
|
47
|
+
`Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume`.
|
|
48
|
+
|
|
49
|
+
**Cross-cutting commands** (`/sync`, `/update-framework`, `/fix-bug`, `/debug`, `/learn`,
|
|
50
|
+
`/report-bug`, `/propose-scenario`, `/generate-spec-manifest`) sit outside the linear pipeline —
|
|
51
|
+
**omit the Pipeline line entirely** for these (do not force-fit them onto the map).
|
|
52
|
+
|
|
53
|
+
## Next Command Suggestion
|
|
54
|
+
|
|
55
|
+
Suggest the logical next command based on workflow phase:
|
|
56
|
+
|
|
57
|
+
| Current command | Suggest next |
|
|
58
|
+
|-------------------------|-----------------------------------------------|
|
|
59
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
60
|
+
| /define-product | `/generate-prd {product-definition-file}` |
|
|
61
|
+
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
62
|
+
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
63
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
64
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
65
|
+
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
66
|
+
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
67
|
+
| /qc-analyze | `/qc-plan {UC-ID}` (resolve 🔴 blocker gaps first) |
|
|
68
|
+
| /qc-plan | `/qc-design-test {UC-ID}` |
|
|
69
|
+
| /qc-design-test | `/qc-review {UC-ID}` (test-case review) |
|
|
70
|
+
| /qc-review (test-case) | `/qc-run-test {UC-ID}` if APPROVED; fix TCs if NEEDS_FIX |
|
|
71
|
+
| /qc-run-test | `/qc-report {UC-ID}` then `/qc-review {UC-ID}` (script review) |
|
|
72
|
+
| /qc-review (script) | `/qc-report {UC-ID}` then create PR if APPROVED |
|
|
73
|
+
| /qc-report | `/validate-traces {UC-ID}` to refresh Living Docs (qc_status) |
|
|
74
|
+
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
75
|
+
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
76
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/dev-gen-test {UC-ID}` |
|
|
77
|
+
| /dev-gen-test | `/dev-run-test {UC-ID}` |
|
|
78
|
+
| /dev-run-test (passing) | `/review-code {UC-ID}` |
|
|
79
|
+
| /dev-run-test (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
80
|
+
| /review-code | `/dev-smoke-test {UC-ID}` or create PR |
|
|
81
|
+
| /dev-smoke-test | Create PR and link to ticket |
|
|
82
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/dev-gen-test {UC-ID}`; all OK → create PR |
|
|
83
|
+
| /fix-bug | Create PR and link to ticket |
|
|
84
|
+
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
85
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
86
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
87
|
+
| /learn | Continue working — lesson applies on next command |
|
|
88
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
89
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
90
|
+
|
|
91
|
+
Format the footer as:
|
|
92
|
+
```
|
|
93
|
+
---
|
|
94
|
+
Status : {badge}
|
|
95
|
+
{Output Artifacts block}
|
|
96
|
+
Pipeline : Discovery → PRD → [BDD ◀ bạn ở đây] → Tech Design → Code → Dev Self-Check → QC → Trace Audit
|
|
97
|
+
(review cmd) Vòng review: [① phân tích ◀] → ② Review Board → ③ --resume
|
|
98
|
+
Next : {suggested command with example arguments}
|
|
99
|
+
```
|
|
100
|
+
*(Omit the `Pipeline` line for cross-cutting commands listed above.)*
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Exhaustive Review Fan-Out + Completeness Convergence
|
|
2
|
+
|
|
3
|
+
**Why this exists:** A single-pass review never lists every issue at once — the model
|
|
4
|
+
stops at "enough" findings, so each later review round surfaces *new* problems
|
|
5
|
+
(whack-a-mole). This procedure forces the review to **converge in one command run**:
|
|
6
|
+
fan out across review dimensions in parallel, then loop a completeness critic until a
|
|
7
|
+
round produces nothing new, *before* writing the findings file.
|
|
8
|
+
|
|
9
|
+
The calling command supplies two things:
|
|
10
|
+
- **DIMENSIONS** — the list of review dimensions to fan out over
|
|
11
|
+
(`/refine-prd` → the 4 lenses; `/review-context` → the P-checks or B-checks).
|
|
12
|
+
- **FINDINGS SCHEMA** — the YAML shape each finding must follow (defined in the command).
|
|
13
|
+
|
|
14
|
+
> **Sub-agent mode bypass:** If Gate Step 0 set `_agent_mode: true`, this whole
|
|
15
|
+
> procedure is **skipped** — the orchestrator is already running one dimension/UC per
|
|
16
|
+
> sub-agent. Run the command's checks directly on the scoped section and return findings.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Phase 1 — Parallel dimension scan
|
|
21
|
+
|
|
22
|
+
**How many sub-agents:** the agent *count* is not the completeness lever — breadth is
|
|
23
|
+
fixed by the DIMENSION taxonomy (adding agents to the same dimension just re-finds the
|
|
24
|
+
same issues), and *depth* is owned by the Phase 2 critic loop. Pick the **fan-out
|
|
25
|
+
granularity** by target size, reusing the `steps/spawn-agent.md` thresholds:
|
|
26
|
+
|
|
27
|
+
| Target size | Granularity | Agent count |
|
|
28
|
+
|-------------|-------------|-------------|
|
|
29
|
+
| ≤ 3 UCs **and** ≤ 300 lines | one agent per DIMENSION over the whole file | = number of dimensions |
|
|
30
|
+
| > 3 UCs **or** > 300 lines | one agent per **DIMENSION × UC-scope** (UCs + a PRD-global scope), batched to fit the agent cap | `dimensions × (UCs + 1)`, capped (see below) |
|
|
31
|
+
|
|
32
|
+
The larger granularity keeps each sub-agent's context small and its scan exhaustive on a
|
|
33
|
+
single UC — which is what prevents misses on big PRDs.
|
|
34
|
+
|
|
35
|
+
> **Global (non-UC) sections — required in `DIMENSION × UC` mode.** Per-UC agents only
|
|
36
|
+
> see one UC each, so PRD-wide sections that belong to no UC (scope, success metrics,
|
|
37
|
+
> problem statement, terminology, glossary, changelog) would go unscanned. Whenever you
|
|
38
|
+
> fan out per UC, also include a **"PRD-global"** scope (the non-UC sections, findings get
|
|
39
|
+
> `uc_id: ""`) alongside the UC list. So the natural agent count is `dimensions × (UCs + 1)`.
|
|
40
|
+
> (Not needed in the whole-file mode — there each agent already sees the global sections.)
|
|
41
|
+
|
|
42
|
+
### Agent cap — batch UCs when the fan-out gets too wide
|
|
43
|
+
|
|
44
|
+
`dimensions × (UCs + 1)` can explode on large PRDs (e.g. 6 checks × (8 UCs + 1) = 54
|
|
45
|
+
agents). Cap the wave at **`AGENT_CAP = 12`** agents and batch UC scopes to fit:
|
|
46
|
+
|
|
47
|
+
1. Build the scope list = `[UC1, UC2, …, UCn, PRD-global]` (length `UCs + 1`).
|
|
48
|
+
2. Compute scopes-per-agent-bucket: `groups = max(1, floor(AGENT_CAP / dimensions))`.
|
|
49
|
+
- If `groups ≥ UCs + 1` → no batching needed, run one agent per `DIMENSION × scope`.
|
|
50
|
+
- Else split the scope list into `groups` contiguous buckets of roughly equal size
|
|
51
|
+
(keep `PRD-global` in its own bucket if it fits; otherwise append it to the last
|
|
52
|
+
bucket). Each agent then handles **one DIMENSION over one bucket of UCs**.
|
|
53
|
+
3. Resulting wave size = `dimensions × groups ≤ AGENT_CAP`.
|
|
54
|
+
|
|
55
|
+
A batched agent reviews several UCs at once — still scoped far tighter than the whole
|
|
56
|
+
file, so coverage stays high. `AGENT_CAP` is the only knob; raise it if the host allows
|
|
57
|
+
more concurrency, lower it to save tokens. Whole-file mode (≤ 3 UCs) never hits the cap.
|
|
58
|
+
|
|
59
|
+
Spawn the chosen sub-agents using the Agent tool (send them in a single message so they
|
|
60
|
+
run concurrently). Each sub-agent gets a **fresh context window** and scans its scope
|
|
61
|
+
through its **one** dimension only — deeper coverage than one session juggling every
|
|
62
|
+
dimension at once (avoids lost-in-the-middle).
|
|
63
|
+
|
|
64
|
+
Sub-agent prompt template (fill the braces):
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
You are a {DIMENSION_NAME} reviewer. Read the full target file at {target_file}.
|
|
68
|
+
Scope: review ONLY through the {DIMENSION_NAME} lens/check — {DIMENSION_DESCRIPTION}.
|
|
69
|
+
Be exhaustive: scan every section, every UC, every AC/BR/scenario. Do not stop early.
|
|
70
|
+
Project context (terminology, entities, architecture):
|
|
71
|
+
{slim_context — banned terms, canonical entities, layer order, domains}
|
|
72
|
+
|
|
73
|
+
Return a JSON array of findings, each:
|
|
74
|
+
{ "dimension": "{DIMENSION_NAME}", "severity": "critical|major|minor",
|
|
75
|
+
"section": "...", "uc_id": "...", "quote": "<verbatim ≤120 chars>",
|
|
76
|
+
"finding": "...", "suggestion": "...", "auto_fixable": true|false }
|
|
77
|
+
Return [] if this dimension is clean. Return ONLY the JSON array.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Collect every sub-agent's array into one consolidated list `ALL_FINDINGS`.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Phase 2 — Completeness-critic convergence loop
|
|
85
|
+
|
|
86
|
+
This is the anti-whack-a-mole step. Repeat until **two consecutive rounds add zero new
|
|
87
|
+
findings**, or a hard cap of **3 rounds**, whichever comes first:
|
|
88
|
+
|
|
89
|
+
1. Spawn one **completeness-critic** sub-agent with the Agent tool. Give it:
|
|
90
|
+
- the full target file (`{target_file}`),
|
|
91
|
+
- the current `ALL_FINDINGS` list (so it knows what is already captured),
|
|
92
|
+
- the same slim context.
|
|
93
|
+
Prompt it:
|
|
94
|
+
```
|
|
95
|
+
Here is a document and a list of issues already found. Read the WHOLE document.
|
|
96
|
+
List ONLY real, additional issues NOT already in the list — gaps, ambiguities,
|
|
97
|
+
contradictions, missing edge/negative paths, coverage holes, terminology drift,
|
|
98
|
+
structural omissions, and any issue that a fix to an existing finding would expose.
|
|
99
|
+
Do NOT repeat anything already listed. Return the same finding JSON shape, or [] if
|
|
100
|
+
nothing new.
|
|
101
|
+
```
|
|
102
|
+
2. Append any genuinely new findings (not already in `ALL_FINDINGS`) to the list.
|
|
103
|
+
3. If this round returned 0 new → increment the dry-round counter; else reset it to 0.
|
|
104
|
+
4. Stop when dry-round counter reaches 2, or after 3 rounds total.
|
|
105
|
+
|
|
106
|
+
Record `convergence_rounds` (how many critic rounds ran) for the report.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Phase 3 — Dedup, resolve conflicts, merge
|
|
111
|
+
|
|
112
|
+
Sub-agents run **blind to each other** (independence = diverse coverage). They never
|
|
113
|
+
talk or reconcile among themselves — all duplicate/conflict resolution happens **here in
|
|
114
|
+
the orchestrator**, where the full set is visible.
|
|
115
|
+
|
|
116
|
+
1. **Deduplicate** `ALL_FINDINGS`: two findings are duplicates if they target the same
|
|
117
|
+
`section` + `uc_id` and describe the same underlying issue. Keep the one with the
|
|
118
|
+
richer `suggestion`; if they differ on severity, keep the **higher** severity.
|
|
119
|
+
2. **Resolve conflicts** — group remaining findings by `section` + `uc_id` and check for
|
|
120
|
+
contradictions (two findings whose `suggestion`s cannot both be applied, or that
|
|
121
|
+
propose opposite fixes for the same spot):
|
|
122
|
+
- If the two suggestions can be **merged** into one coherent fix → merge them into a
|
|
123
|
+
single finding.
|
|
124
|
+
- If they are **mutually exclusive** → emit **one** finding that states both options
|
|
125
|
+
and set `auto_fixable: false` with `status: "needs_discussion"` (PRD) /
|
|
126
|
+
`status: "pending"` (review) so a human picks — never silently drop one side.
|
|
127
|
+
- If a finding is **invalidated** by another (e.g. a structural finding says a section
|
|
128
|
+
is missing, but another quotes content from it) → drop the invalid one.
|
|
129
|
+
3. **Sort** by severity (critical → major → minor), then by `section` order in the file.
|
|
130
|
+
4. **Assign stable IDs** `F001, F002, …` in that sorted order.
|
|
131
|
+
5. Map each finding's `dimension` into the command's schema field
|
|
132
|
+
(`lens` for `/refine-prd`; `check_id` for `/review-context`).
|
|
133
|
+
6. Write the **single** findings file in the FINDINGS SCHEMA the command defines.
|
|
134
|
+
|
|
135
|
+
In the command's final report, add one line:
|
|
136
|
+
```
|
|
137
|
+
Convergence: {convergence_rounds} critic round(s) — findings file is complete; re-running should surface 0 new issues.
|
|
138
|
+
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Sub-Agent Orchestration Pattern
|
|
2
|
+
|
|
3
|
+
Used by heavy commands when the target exceeds the complexity threshold.
|
|
4
|
+
The main session becomes a **lightweight orchestrator** — it only coordinates.
|
|
5
|
+
Each unit of work runs in its own sub-agent with a fresh context window.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Complexity Thresholds
|
|
10
|
+
|
|
11
|
+
| Signal | Threshold | Action |
|
|
12
|
+
|--------|-----------|--------|
|
|
13
|
+
| UC count in PRD | > 3 UCs | spawn 1 agent per UC |
|
|
14
|
+
| PRD length | > 300 lines | spawn agents regardless of UC count |
|
|
15
|
+
|
|
16
|
+
If **either** threshold is exceeded → switch to orchestration mode.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Orchestrator Steps (main session)
|
|
21
|
+
|
|
22
|
+
### Step A — Build slim context
|
|
23
|
+
|
|
24
|
+
Extract only what sub-agents need — do NOT pass full CLAUDE.md or full business-dictionary:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"project_name": "{project.name}",
|
|
29
|
+
"tech_stack": {
|
|
30
|
+
"language": "{tech_stack.language}",
|
|
31
|
+
"framework": "{tech_stack.framework}",
|
|
32
|
+
"build_tool": "{tech_stack.build_tool}",
|
|
33
|
+
"test_framework": "{tech_stack.test_framework}",
|
|
34
|
+
"database": "{tech_stack.database}",
|
|
35
|
+
"module": "{tech_stack.module}"
|
|
36
|
+
},
|
|
37
|
+
"conventions": {
|
|
38
|
+
"build_command": "{conventions.build_command}",
|
|
39
|
+
"commit_format": "{conventions.commit_format}"
|
|
40
|
+
},
|
|
41
|
+
"paths": {
|
|
42
|
+
"specs_dir": "{paths.specs_dir}",
|
|
43
|
+
"trace_dir": "{paths.trace_dir}",
|
|
44
|
+
"tech_docs_dir": "{paths.tech_docs_dir}"
|
|
45
|
+
},
|
|
46
|
+
"architecture_summary": "<3-5 bullet points: layer order + key rules only>",
|
|
47
|
+
"domains": ["{domain1}", "{domain2}"],
|
|
48
|
+
"banned_terms": ["{term1}", "{term2}"]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Step B — Extract UC list
|
|
53
|
+
|
|
54
|
+
Scan the target PRD for `#### {TICKET-ID}-UC{N}:` headings.
|
|
55
|
+
Build list: `[ { uc_id, uc_name, line_start, line_end } ]`
|
|
56
|
+
|
|
57
|
+
### Step C — Announce plan
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
High complexity detected — {N} UCs / {L} lines in {prd_file}
|
|
61
|
+
Spawning {N} sub-agents (1 per UC)...
|
|
62
|
+
Agent 1 → {TICKET-ID}-UC1: {UC name}
|
|
63
|
+
Agent 2 → {TICKET-ID}-UC2: {UC name}
|
|
64
|
+
...
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Step D — Spawn one sub-agent per UC
|
|
68
|
+
|
|
69
|
+
Build payload and invoke Agent tool for each UC:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"_agent_mode": true,
|
|
74
|
+
"command": "generate-bdd",
|
|
75
|
+
"uc_id": "{TICKET-ID}-UC{N}",
|
|
76
|
+
"target_file": "{absolute path to PRD or feature file}",
|
|
77
|
+
"uc_section": { "line_start": {N}, "line_end": {N} },
|
|
78
|
+
"context": { "<slim context from Step A>" }
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
> **Command scope**: Only `/generate-bdd` initiates orchestration mode. `/generate-code` and `/dev-gen-test` can run as sub-agents (they respect `_agent_mode: true` from Gate Step 0), but they do not spawn further sub-agents — their scope is already a single UC.
|
|
83
|
+
|
|
84
|
+
Serialize this JSON and pass as `$ARGUMENTS` when invoking the sub-agent command.
|
|
85
|
+
|
|
86
|
+
### Step E — Collect and merge results
|
|
87
|
+
|
|
88
|
+
Each sub-agent returns:
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"uc_id": "{TICKET-ID}-UC{N}",
|
|
92
|
+
"files_created": ["path/to/file1", "path/to/file2"],
|
|
93
|
+
"status": "success | error",
|
|
94
|
+
"errors": []
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Merge into a single report (follow report-footer.md format).
|
|
99
|
+
If any sub-agent errors → list them clearly and suggest re-run for that UC only.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Sub-Agent Entry Point (called commands)
|
|
104
|
+
|
|
105
|
+
When `gate.md Step 0` detects `_agent_mode: true`:
|
|
106
|
+
|
|
107
|
+
1. Parse full payload from `$ARGUMENTS`
|
|
108
|
+
2. **Skip context-loader.md** — use `payload.context` directly
|
|
109
|
+
3. **Scope to `payload.uc_id` only** — do not process other UCs in the file
|
|
110
|
+
4. Read only the PRD section between `payload.uc_section.line_start` and `line_end`
|
|
111
|
+
5. Execute the command's normal logic for this single UC
|
|
112
|
+
6. Return structured result JSON (Step E format above)
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Context Window Savings
|
|
117
|
+
|
|
118
|
+
| Mode | What loads per session |
|
|
119
|
+
|------|------------------------|
|
|
120
|
+
| Single session (≤ 3 UC) | Full context + full PRD + all UCs |
|
|
121
|
+
| Orchestrator | Slim context + UC headings only |
|
|
122
|
+
| Each sub-agent | Slim context + **1 UC section only** |
|
|
123
|
+
|
|
124
|
+
The larger the PRD, the bigger the saving per sub-agent.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Refresh Living Docs panel mirror *(local, umbrella mode)*
|
|
2
|
+
|
|
3
|
+
*Skip entirely in single-service mode (no `services` and no `setup.spec_source`) — there
|
|
4
|
+
the repo's own `.trace/` IS the panel location, so nothing to mirror.*
|
|
5
|
+
|
|
6
|
+
After updating the authoritative TSV(s) at `{paths.trace_dir}`:
|
|
7
|
+
|
|
8
|
+
**When `setup.spec_source` is set (consolidated trace — the common case):**
|
|
9
|
+
`{paths.trace_dir}` resolves to `{spec_source}/.trace` — the single authoritative location.
|
|
10
|
+
This command runs from `service_root`, so the write is **cross-repo into the spec submodule**;
|
|
11
|
+
commit/push the spec submodule for the trace update (same as `feedback/`).
|
|
12
|
+
1. Resolve `panel_mirror = ./.trace` at the **current workspace root**.
|
|
13
|
+
2. If `panel_mirror` resolves to a different path than `{paths.trace_dir}`, copy each
|
|
14
|
+
just-updated `{UC-ID}.tsv` → `{panel_mirror}/{UC-ID}.tsv` (create the dir; overwrite).
|
|
15
|
+
No per-service namespacing — there is one trace set; the owning service is carried in each
|
|
16
|
+
row's `@trace.service`.
|
|
17
|
+
|
|
18
|
+
**Legacy (no `spec_source` — per-service trace):**
|
|
19
|
+
Copy each just-updated `{UC-ID}.tsv` → `{panel_mirror}/{service-name}/{UC-ID}.tsv`
|
|
20
|
+
(namespaced by `active_service`).
|
|
21
|
+
|
|
22
|
+
This keeps the open workspace's Living Docs panel current **between syncs** — it is a
|
|
23
|
+
**local convenience mirror only**. The merged `trace-report.json` (canonical, in
|
|
24
|
+
`{spec_source}/.living-docs/`) is rebuilt by `/sync` or `/validate-traces`. For orchestrated
|
|
25
|
+
commands, do this once in the orchestrator after all sub-agents return — not inside each
|
|
26
|
+
sub-agent.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# §1. Project Overview
|
|
2
|
+
|
|
3
|
+
Project : {{PROJECT_NAME}}
|
|
4
|
+
Language : {{LANGUAGE}} # e.g., Java 17 / TypeScript / C# / Go
|
|
5
|
+
Framework : {{FRAMEWORK}} # e.g., Spring Boot 3.2 / Angular 17 / .NET 8
|
|
6
|
+
Build : {{BUILD_COMMAND}} # e.g., mvn clean install -DskipTests / dotnet build / ng build
|
|
7
|
+
Test : {{TEST_COMMAND}} # e.g., mvn test / dotnet test / ng test
|
|
8
|
+
Domains : {{COMMA_SEPARATED_DOMAINS}}
|
|
9
|
+
|
|
10
|
+
# §2. Architecture
|
|
11
|
+
|
|
12
|
+
style: "{{ARCH_STYLE}}" # e.g., Layered / Clean / Hexagonal / Component-based
|
|
13
|
+
|
|
14
|
+
layers: "{{LAYER_STACK}}"
|
|
15
|
+
# Examples:
|
|
16
|
+
# Java/Spring: Controller → Facade → Service → Repository
|
|
17
|
+
# .NET Clean: Presentation → Application → Domain → Infrastructure
|
|
18
|
+
# Angular: Component → Service → HTTP Client → Backend API
|
|
19
|
+
# Go: Handler → UseCase → Repository → Domain
|
|
20
|
+
|
|
21
|
+
rules:
|
|
22
|
+
- "{{ARCH_RULE_1}}" # e.g., Controllers must not contain business logic
|
|
23
|
+
- "{{ARCH_RULE_2}}" # e.g., Services own transaction boundaries
|
|
24
|
+
- "{{ARCH_RULE_3}}" # e.g., Repositories must not call services
|
|
25
|
+
|
|
26
|
+
# Layer dependency direction (inner layers must not depend on outer):
|
|
27
|
+
# {{OUTER_LAYER}} → {{MIDDLE_LAYER}} → {{INNER_LAYER}}
|
|
28
|
+
|
|
29
|
+
# §3. Coding Standards
|
|
30
|
+
|
|
31
|
+
naming:
|
|
32
|
+
classes: "{{CLASS_NAMING}}" # e.g., PascalCase / PascalCase+Suffix
|
|
33
|
+
methods: "{{METHOD_NAMING}}" # e.g., camelCase / PascalCase
|
|
34
|
+
packages: "{{PACKAGE_NAMING}}" # e.g., lowercase / lowercase.snake_case
|
|
35
|
+
files: "{{FILE_NAMING}}" # e.g., PascalCase.java / kebab-case.ts
|
|
36
|
+
|
|
37
|
+
patterns:
|
|
38
|
+
response_wrapper: "{{RESPONSE_WRAPPER}}" # e.g., ApiResponse<T> / Result<T> / IActionResult
|
|
39
|
+
mapping: "{{MAPPING_LIBRARY}}" # e.g., MapStruct / AutoMapper / manual
|
|
40
|
+
exception_base: "{{BASE_EXCEPTION}}" # e.g., ResourceNotFoundException / DomainException
|
|
41
|
+
|
|
42
|
+
forbidden:
|
|
43
|
+
- "Magic numbers — use named constants"
|
|
44
|
+
- "Debug print statements in production code"
|
|
45
|
+
- "{{PROJECT_SPECIFIC_FORBIDDEN_PATTERN}}"
|
|
46
|
+
|
|
47
|
+
# §4. API Conventions
|
|
48
|
+
|
|
49
|
+
versioning: "{{API_VERSIONING}}" # e.g., /v1/ prefix / header-based / query param
|
|
50
|
+
auth: "{{AUTH_MECHANISM}}" # e.g., JWT Bearer / OAuth2 / API Key
|
|
51
|
+
|
|
52
|
+
http_status:
|
|
53
|
+
get_list: 200 # paginated or full list
|
|
54
|
+
get_single: 200
|
|
55
|
+
create: 201
|
|
56
|
+
update: 200
|
|
57
|
+
delete: 204
|
|
58
|
+
bad_request: 400
|
|
59
|
+
unauthorized: 401
|
|
60
|
+
forbidden: 403
|
|
61
|
+
not_found: 404
|
|
62
|
+
server_error: 500
|
|
63
|
+
|
|
64
|
+
error_response_format: |
|
|
65
|
+
{
|
|
66
|
+
"code": "ERROR_CODE",
|
|
67
|
+
"message": "Human readable message",
|
|
68
|
+
"details": {} // optional field-level errors
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
# §5. Error Handling
|
|
72
|
+
|
|
73
|
+
not_found_exception: "{{NOT_FOUND_EXCEPTION_CLASS}}" # e.g., ResourceNotFoundException
|
|
74
|
+
validation_exception: "{{VALIDATION_EXCEPTION_CLASS}}" # e.g., ValidationException
|
|
75
|
+
domain_exception: "{{DOMAIN_EXCEPTION_CLASS}}" # e.g., DomainException / BusinessRuleViolationException
|
|
76
|
+
|
|
77
|
+
global_handler: "{{GLOBAL_EXCEPTION_HANDLER}}" # e.g., @ControllerAdvice / ExceptionHandlerMiddleware
|
|
78
|
+
|
|
79
|
+
rules:
|
|
80
|
+
- "Never swallow exceptions silently"
|
|
81
|
+
- "Log at error level with full stack trace for 5xx"
|
|
82
|
+
- "{{PROJECT_SPECIFIC_ERROR_RULE}}"
|
|
83
|
+
|
|
84
|
+
# §6. Testing Standards
|
|
85
|
+
|
|
86
|
+
unit_test_framework: "{{UNIT_TEST_FW}}" # e.g., JUnit 5 + Mockito / xUnit + Moq / Jest
|
|
87
|
+
integration_test_framework: "{{IT_TEST_FW}}" # e.g., Spring Boot Test / WebApplicationFactory
|
|
88
|
+
|
|
89
|
+
coverage_targets:
|
|
90
|
+
unit: "{{UNIT_COVERAGE_PCT}}%" # e.g., 80%
|
|
91
|
+
integration: "{{IT_COVERAGE_PCT}}%" # e.g., key flows covered
|
|
92
|
+
|
|
93
|
+
naming_pattern: "{{TEST_METHOD_NAMING}}" # e.g., methodName_whenCondition_shouldExpectation
|
|
94
|
+
|
|
95
|
+
rules:
|
|
96
|
+
- "Unit tests mock direct dependencies only"
|
|
97
|
+
- "Integration tests cover happy path + main error paths"
|
|
98
|
+
- "Every scenario in .feature must have a corresponding test"
|
|
99
|
+
|
|
100
|
+
# §7. Git Conventions
|
|
101
|
+
|
|
102
|
+
branch_feature: "feature/{{TICKET_PREFIX}}-{N}-{slug}"
|
|
103
|
+
branch_fix: "fix/{{TICKET_PREFIX}}-{N}-{slug}"
|
|
104
|
+
branch_chore: "chore/{slug}"
|
|
105
|
+
|
|
106
|
+
commit_feature: "feat({{TICKET_PREFIX}}-{N}): {description}"
|
|
107
|
+
commit_fix: "fix({{TICKET_PREFIX}}-{N}): {description}"
|
|
108
|
+
commit_chore: "chore: {description}"
|
|
109
|
+
commit_docs: "docs: {description}"
|
|
110
|
+
|
|
111
|
+
pr_title: "{{TICKET_PREFIX}}-{N}: {feature name}"
|
|
112
|
+
pr_requires_review: true
|
|
113
|
+
pr_branch_protection: "{{BASE_BRANCH}}" # e.g., main / develop
|