cfsa-antigravity 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +14 -0
  2. package/package.json +1 -1
  3. package/template/.agent/instructions/commands.md +8 -32
  4. package/template/.agent/instructions/example.md +21 -0
  5. package/template/.agent/instructions/patterns.md +3 -3
  6. package/template/.agent/instructions/tech-stack.md +71 -23
  7. package/template/.agent/instructions/workflow.md +12 -1
  8. package/template/.agent/rules/completion-checklist.md +6 -0
  9. package/template/.agent/rules/security-first.md +3 -3
  10. package/template/.agent/rules/vertical-slices.md +1 -1
  11. package/template/.agent/skill-library/MANIFEST.md +6 -0
  12. package/template/.agent/skill-library/stack/devops/git-advanced/SKILL.md +972 -0
  13. package/template/.agent/skill-library/stack/devops/git-workflow/SKILL.md +420 -0
  14. package/template/.agent/skills/api-versioning/SKILL.md +44 -298
  15. package/template/.agent/skills/api-versioning/references/typescript.md +157 -0
  16. package/template/.agent/skills/architecture-mapping/SKILL.md +13 -13
  17. package/template/.agent/skills/bootstrap-agents/SKILL.md +151 -152
  18. package/template/.agent/skills/clean-code/SKILL.md +64 -118
  19. package/template/.agent/skills/clean-code/references/typescript.md +126 -0
  20. package/template/.agent/skills/database-schema-design/SKILL.md +93 -317
  21. package/template/.agent/skills/database-schema-design/references/relational.md +228 -0
  22. package/template/.agent/skills/error-handling-patterns/SKILL.md +62 -557
  23. package/template/.agent/skills/error-handling-patterns/references/go.md +162 -0
  24. package/template/.agent/skills/error-handling-patterns/references/python.md +262 -0
  25. package/template/.agent/skills/error-handling-patterns/references/rust.md +112 -0
  26. package/template/.agent/skills/error-handling-patterns/references/typescript.md +178 -0
  27. package/template/.agent/skills/idea-extraction/SKILL.md +322 -224
  28. package/template/.agent/skills/logging-best-practices/SKILL.md +108 -767
  29. package/template/.agent/skills/logging-best-practices/references/go.md +49 -0
  30. package/template/.agent/skills/logging-best-practices/references/python.md +52 -0
  31. package/template/.agent/skills/logging-best-practices/references/typescript.md +215 -0
  32. package/template/.agent/skills/migration-management/SKILL.md +127 -311
  33. package/template/.agent/skills/migration-management/references/relational.md +214 -0
  34. package/template/.agent/skills/parallel-feature-development/SKILL.md +34 -43
  35. package/template/.agent/skills/pipeline-rubrics/references/be-rubric.md +1 -1
  36. package/template/.agent/skills/pipeline-rubrics/references/ia-rubric.md +2 -2
  37. package/template/.agent/skills/pipeline-rubrics/references/scoring.md +1 -1
  38. package/template/.agent/skills/pipeline-rubrics/references/vision-rubric.md +2 -1
  39. package/template/.agent/skills/prd-templates/SKILL.md +23 -6
  40. package/template/.agent/skills/prd-templates/references/be-spec-template.md +2 -2
  41. package/template/.agent/skills/prd-templates/references/decomposition-templates.md +2 -2
  42. package/template/.agent/skills/prd-templates/references/engineering-standards-template.md +2 -0
  43. package/template/.agent/skills/prd-templates/references/fe-spec-template.md +1 -1
  44. package/template/.agent/skills/prd-templates/references/fractal-cx-template.md +58 -0
  45. package/template/.agent/skills/prd-templates/references/fractal-feature-template.md +93 -0
  46. package/template/.agent/skills/prd-templates/references/fractal-node-index-template.md +55 -0
  47. package/template/.agent/skills/prd-templates/references/ideation-crosscut-template.md +26 -47
  48. package/template/.agent/skills/prd-templates/references/ideation-index-template.md +47 -31
  49. package/template/.agent/skills/prd-templates/references/operational-templates.md +1 -1
  50. package/template/.agent/skills/prd-templates/references/placeholder-workflow-mapping.md +50 -21
  51. package/template/.agent/skills/prd-templates/references/skill-loading-protocol.md +32 -0
  52. package/template/.agent/skills/prd-templates/references/slice-completion-gates.md +29 -0
  53. package/template/.agent/skills/prd-templates/references/spec-coverage-sweep.md +3 -3
  54. package/template/.agent/skills/prd-templates/references/tdd-testing-policy.md +39 -0
  55. package/template/.agent/skills/prd-templates/references/vision-template.md +8 -8
  56. package/template/.agent/skills/regex-patterns/SKILL.md +122 -540
  57. package/template/.agent/skills/regex-patterns/references/go.md +44 -0
  58. package/template/.agent/skills/regex-patterns/references/javascript.md +63 -0
  59. package/template/.agent/skills/regex-patterns/references/python.md +77 -0
  60. package/template/.agent/skills/regex-patterns/references/rust.md +43 -0
  61. package/template/.agent/skills/resolve-ambiguity/SKILL.md +1 -1
  62. package/template/.agent/skills/session-continuity/SKILL.md +11 -9
  63. package/template/.agent/skills/session-continuity/protocols/02-progress-generation.md +2 -2
  64. package/template/.agent/skills/session-continuity/protocols/04-pattern-extraction.md +1 -1
  65. package/template/.agent/skills/session-continuity/protocols/05-session-close.md +1 -1
  66. package/template/.agent/skills/session-continuity/protocols/09-parallel-claim.md +1 -1
  67. package/template/.agent/skills/session-continuity/protocols/10-placeholder-verification-gate.md +57 -78
  68. package/template/.agent/skills/session-continuity/protocols/11-parallel-synthesis.md +1 -1
  69. package/template/.agent/skills/spec-writing/SKILL.md +1 -1
  70. package/template/.agent/skills/tdd-workflow/SKILL.md +94 -317
  71. package/template/.agent/skills/tdd-workflow/references/typescript.md +231 -0
  72. package/template/.agent/skills/testing-strategist/SKILL.md +74 -687
  73. package/template/.agent/skills/testing-strategist/references/typescript.md +328 -0
  74. package/template/.agent/skills/workflow-automation/SKILL.md +62 -154
  75. package/template/.agent/skills/workflow-automation/references/inngest.md +88 -0
  76. package/template/.agent/skills/workflow-automation/references/temporal.md +64 -0
  77. package/template/.agent/workflows/bootstrap-agents-fill.md +85 -143
  78. package/template/.agent/workflows/bootstrap-agents-provision.md +90 -107
  79. package/template/.agent/workflows/create-prd-architecture.md +23 -16
  80. package/template/.agent/workflows/create-prd-compile.md +11 -12
  81. package/template/.agent/workflows/create-prd-design-system.md +1 -1
  82. package/template/.agent/workflows/create-prd-security.md +9 -11
  83. package/template/.agent/workflows/create-prd-stack.md +10 -4
  84. package/template/.agent/workflows/create-prd.md +9 -9
  85. package/template/.agent/workflows/decompose-architecture-structure.md +4 -6
  86. package/template/.agent/workflows/decompose-architecture-validate.md +18 -1
  87. package/template/.agent/workflows/decompose-architecture.md +18 -3
  88. package/template/.agent/workflows/evolve-contract.md +11 -11
  89. package/template/.agent/workflows/evolve-feature-classify.md +14 -6
  90. package/template/.agent/workflows/ideate-discover.md +72 -107
  91. package/template/.agent/workflows/ideate-extract.md +84 -63
  92. package/template/.agent/workflows/ideate-validate.md +26 -22
  93. package/template/.agent/workflows/ideate.md +9 -9
  94. package/template/.agent/workflows/implement-slice-setup.md +25 -23
  95. package/template/.agent/workflows/implement-slice-tdd.md +73 -89
  96. package/template/.agent/workflows/implement-slice.md +4 -4
  97. package/template/.agent/workflows/plan-phase-preflight.md +6 -2
  98. package/template/.agent/workflows/plan-phase-write.md +6 -8
  99. package/template/.agent/workflows/remediate-pipeline-assess.md +2 -1
  100. package/template/.agent/workflows/resolve-ambiguity.md +2 -2
  101. package/template/.agent/workflows/update-architecture-map.md +22 -5
  102. package/template/.agent/workflows/validate-phase-quality.md +155 -0
  103. package/template/.agent/workflows/validate-phase-readiness.md +167 -0
  104. package/template/.agent/workflows/validate-phase.md +19 -157
  105. package/template/.agent/workflows/verify-infrastructure.md +10 -10
  106. package/template/.agent/workflows/write-architecture-spec-design.md +23 -14
  107. package/template/.agent/workflows/write-be-spec-classify.md +25 -21
  108. package/template/.agent/workflows/write-be-spec.md +1 -1
  109. package/template/.agent/workflows/write-fe-spec-classify.md +6 -12
  110. package/template/.agent/workflows/write-fe-spec-write.md +1 -1
  111. package/template/AGENTS.md +6 -2
  112. package/template/GEMINI.md +5 -3
  113. package/template/docs/README.md +10 -10
  114. package/template/docs/kit-architecture.md +126 -33
  115. package/template/docs/plans/ideation/README.md +8 -3
  116. package/template/.agent/skills/prd-templates/references/ideation-domain-template.md +0 -55
@@ -76,12 +76,16 @@ Once a stage is locked, downstream stages may not contradict it. To change a loc
76
76
  | ↳ | `/evolve-feature-classify` | Feature description | Classified change + new content at entry point | Evolution |
77
77
  | ↳ | `/evolve-feature-cascade` | Classified change + entry point | Layer-by-layer additions + implementation impact | Evolution |
78
78
  | 8 | `/plan-phase` | Architecture + specs | Dependency-ordered TDD slices | Planning |
79
+ | ↳ | `/plan-phase-preflight` | Approved specs | Phase gate + completeness audit + consistency check | Planning |
80
+ | ↳ | `/plan-phase-write` | Preflight pass | Slices + acceptance criteria + progress files | Planning |
79
81
  | 9 | `/implement-slice` | Slice acceptance criteria | Working code via Red→Green→Refactor | Implementation |
80
82
  | ↳ | `/implement-slice-setup` | Slice from phase plan | Progress check + skills + contracts + parallel mode | Implementation |
81
83
  | ↳ | `/implement-slice-tdd` | Contract + tests | Red→Green→Refactor + validation + progress tracking | Implementation |
82
84
  | 9.5 | `/verify-infrastructure` | Implemented infra or auth slice | Operational verification report | Verification |
83
85
  | 10 | `/validate-phase` | Completed phase | Full validation gate | Verification |
84
- | 11 | `/evolve-contract` | Changed Zod schema | Safe schema migration | Maintenance |
86
+ | | `/validate-phase-quality` | Completed phase | Code quality gates — tests, coverage, lint, type-check, build, CI/CD, staging, migrations, spec coverage | Verification |
87
+ | ↳ | `/validate-phase-readiness` | Quality gates passed | Production readiness gates — API docs, accessibility, performance, security, dependency audit, results | Verification |
88
+ | 11 | `/evolve-contract` | Changed `{{CONTRACT_LIBRARY}}` schema | Safe schema migration | Maintenance |
85
89
 
86
90
  > **Note**: Rows marked with ↳ are independently-invocable sub-workflows (shards)
87
91
  > of their parent command. The parent orchestrates them in sequence, but each shard
@@ -173,4 +177,4 @@ graph TD
173
177
 
174
178
  ### Mandatory Validation
175
179
 
176
- **CRITICAL:** Run `{{VALIDATION_COMMAND}}` after **EVERY** code change. Do not finish a task until all pass.
180
+ **CRITICAL:** Run the Validation Cmd from `.agent/instructions/commands.md` after **EVERY** code change. Do not finish a task until all pass.
@@ -81,9 +81,11 @@ Once a stage is locked, downstream stages may not contradict it. To change a loc
81
81
  | 9 | `/implement-slice` | Slice acceptance criteria | Working code via Red→Green→Refactor | Implementation |
82
82
  | ↳ | `/implement-slice-setup` | Slice from phase plan | Progress check + skills + contracts + parallel mode | Implementation |
83
83
  | ↳ | `/implement-slice-tdd` | Contract + tests | Red→Green→Refactor + validation + progress tracking | Implementation |
84
- | 9.5 | `/verify-infrastructure` | Implemented infra or auth slice | Operational verification report | Verification |
84
+ | 7.5 | `/verify-infrastructure` | Implemented infra or auth slice | Operational verification report | Verification |
85
85
  | 10 | `/validate-phase` | Completed phase | Full validation gate | Verification |
86
- | 11 | `/evolve-contract` | Changed Zod schema | Safe schema migration | Maintenance |
86
+ | | `/validate-phase-quality` | Completed phase | Code quality gates — tests, coverage, lint, type-check, build, CI/CD, staging, migrations, spec coverage | Verification |
87
+ | ↳ | `/validate-phase-readiness` | Quality gates passed | Production readiness gates — API docs, accessibility, performance, security, dependency audit, results | Verification |
88
+ | 11 | `/evolve-contract` | Changed `{{CONTRACT_LIBRARY}}` schema | Safe schema migration | Maintenance |
87
89
 
88
90
 
89
91
  > **Note**: Rows marked with ↳ are independently-invocable sub-workflows (shards)
@@ -176,4 +178,4 @@ graph TD
176
178
 
177
179
  ### Mandatory Validation
178
180
 
179
- **CRITICAL:** Run `{{VALIDATION_COMMAND}}` after **EVERY** code change. Do not finish a task until all pass.
181
+ **CRITICAL:** Run the Validation Cmd from `.agent/instructions/commands.md` after **EVERY** code change. Do not finish a task until all pass.
@@ -35,19 +35,19 @@ The pipeline is a linear sequence of commands. Each step tells you what to run n
35
35
  You describe your idea (or point to a document with @file).
36
36
  The pipeline explores your idea using recursive breadth-before-depth:
37
37
  - Level 0: Maps all domains in your product
38
- - Level 1: Sweeps sub-areas within each domain
38
+ - Level 1: Sweeps each domain for sub-areas (Classification Gate: sub-domain folder or feature file?)
39
39
  - Level 2+: Drills vertically until each domain is exhausted
40
40
  At every level, a Deep Think protocol generates hypotheses based on
41
41
  domain knowledge — "Based on this industry, I'd expect X. Is that relevant?"
42
- Cross-cutting concerns are tracked continuously in a dedicated ledger.
43
- Each domain gets its own file the moment it's discovered (shard-as-you-go).
44
-
45
- Output: docs/plans/ideation/ folder:
46
- ideation-index.md ← pipeline key file (domain map, MoSCoW, coverage)
47
- domains/*.md one file per domain
48
- meta/*.md problem, personas, constraints, competitive landscape
49
- cross-cuts/ cross-cut ledger
50
- docs/plans/vision.md ← human-readable executive summary (not a pipeline input)
42
+ Cross-cutting concerns are tracked at the level where they occur (CX files).
43
+ Each domain gets its own folder the moment it's discovered (fractal-as-you-go).
44
+
45
+ Output: docs/plans/ideation/ folder (fractal tree):
46
+ ideation-index.md ← pipeline key file (structure map, MoSCoW, coverage)
47
+ ideation-cx.md global cross-cuts
48
+ domains/*/ domain folders (index + CX + feature files)
49
+ meta/*.md problem, personas, constraints, competitive landscape
50
+ docs/plans/vision.md ← human-readable executive summary (not a pipeline input)
51
51
 
52
52
  Step 2: /audit-ambiguity ideation ── MANDATORY ──
53
53
  Scores the ideation folder against a 12-dimension rubric.
@@ -15,14 +15,16 @@ The intelligence of the kit lives entirely within the `.agent/` directory.
15
15
  ├── instructions/ # Core directives (the "brainstem")
16
16
  ├── progress/ # State and memory (the "hippocampus")
17
17
  ├── rules/ # Non-negotiable constraints (the "laws")
18
- ├── skills/ # Reusable capabilities (the "tools")
18
+ ├── skill-library/ # Installable skill packages (the "toolbox")
19
+ ├── skills/ # Active capabilities (the "tools")
19
20
  └── workflows/ # Structured processes (the "playbooks")
20
21
  ```
21
22
 
22
23
  ### Core Components
23
24
 
24
- * **Instructions:** (`workflow.md`, `tech-stack.md`, `structure.md`, `patterns.md`, etc.) Baseline knowledge the agent needs to operate in the specific environment. These files ship as templates with `{{PLACEHOLDER}}` markers — they are not static files. The bootstrap system fills them progressively as tech decisions are confirmed during `/create-prd`. An instruction file with unfilled placeholders is a broken agent context. `workflow.md` enforces the mandatory execution sequence: Understand Context -> Check Skills -> Execute -> Validate.
25
+ * **Instructions:** (`workflow.md`, `tech-stack.md`, `structure.md`, `patterns.md`, `commands.md`) Baseline knowledge the agent needs to operate in the specific environment. These files ship as templates with `{{PLACEHOLDER}}` markers — they are not static files. The bootstrap system fills them progressively as tech decisions are confirmed during `/create-prd`. An instruction file with unfilled placeholders is a broken agent context. `workflow.md` enforces the mandatory execution sequence: Understand Context -> Check Skills -> Execute -> Validate.
25
26
  * **Rules:** Preemptively loaded constraints that apply to *every* task. Includes security best practices (`security-first.md`), TDD mandates (`tdd-contract-first.md`), and vertical-slice enforcement (`vertical-slices.md`).
27
+ * **Skill Library:** (`.agent/skill-library/`) Installable skill packages organized by category (e.g., `stack/databases/`, `stack/frontend-frameworks/`). Skills are provisioned from here into `.agent/skills/` by the bootstrap system when tech decisions are confirmed. Contains `MANIFEST.md` with the full taxonomy.
26
28
  * **Skills:** Modular capabilities (e.g., `technical-writer`, `brainstorming`). Agents load these explicitly when a task requires them, preventing context bloat.
27
29
  * **Workflows:** Step-by-step markdown checklists invoked via `/slash-commands` (e.g., `/create-prd`, `/implement-slice`). They chain skills together to achieve complex, multi-stage goals.
28
30
 
@@ -30,36 +32,87 @@ The intelligence of the kit lives entirely within the `.agent/` directory.
30
32
 
31
33
  ## 2. Ideation Architecture
32
34
 
33
- The ideation layer is the pipeline's first output and the source of truth for all downstream specification work. It replaces the former monolithic `vision.md` approach with a sharded folder structure that scales with project complexity.
35
+ The ideation layer is the pipeline's first output and the source of truth for all downstream specification work. It uses a **fractal folder structure** — every node (surface, domain, sub-domain) is a folder containing an index file, a cross-cut (CX) file, and its children. Leaf nodes are `.md` feature files. This pattern is universal regardless of project complexity.
34
36
 
35
37
  ### Pipeline Key File
36
38
 
37
- `docs/plans/ideation/ideation-index.md` is the **pipeline key file** — the primary entry point for all downstream workflows. When `/create-prd`, `/decompose-architecture`, or any specification workflow needs to understand the product, it reads `ideation-index.md` first, then follows links to relevant domain files for detail.
39
+ `docs/plans/ideation/ideation-index.md` is the **pipeline key file** — the primary entry point for all downstream workflows. When `/create-prd`, `/decompose-architecture`, or any specification workflow needs to understand the product, it reads `ideation-index.md` first, then follows links into the fractal tree.
38
40
 
39
41
  `docs/plans/vision.md` still exists but is a **human-readable executive summary** only — a sales pitch compiled from the ideation folder. No downstream workflow reads it as a data source.
40
42
 
41
- ### Folder Structure
43
+ ### Structural Classification (4 Project Shapes)
44
+
45
+ During `/ideate-extract`, every project is classified into one of four shapes that governs folder layout:
46
+
47
+ | Shape | When | Folder Pattern |
48
+ |-------|------|----------------|
49
+ | `single-surface` | One surface (e.g., web app only) | Flat `domains/` at top level |
50
+ | `multi-surface-shared` | Multiple surfaces sharing the same backend (e.g., web + mobile) | Flat `domains/` with surface annotations in feature files |
51
+ | `multi-product-hub` | One primary surface owns most logic; others consume it | Primary surface's folder owns shared domains; others reference them |
52
+ | `multi-product-peer` | Independent products with shared infrastructure | `shared/` folder for shared domains; surface folders for exclusive domains |
53
+
54
+ ### Fractal Folder Structure
42
55
 
43
56
  ```text
44
57
  docs/plans/ideation/
45
- ├── ideation-index.md # Pipeline key file domain map, MoSCoW summary, coverage
46
- ├── domains/ # One file per product domain
47
- ├── user-management.md
48
- │ ├── billing.md
49
- └── ...
58
+ ├── ideation-index.md # Super-index shape, structure map, MoSCoW, progress
59
+ ├── ideation-cx.md # Global CX cross-surface interactions (if multi-product)
60
+ ├── domains/ # Top-level domains (single/multi-surface-shared)
61
+ │ ├── 01-user-management/ # Each domain is a FOLDER, not a file
62
+ │ ├── user-management-index.md # Children table, Role Matrix, decisions
63
+ │ │ ├── user-management-cx.md # Cross-cuts between this domain's children
64
+ │ │ ├── 01-registration.md # Leaf feature file (Role Lens, behavior, edge cases)
65
+ │ │ ├── 02-authentication/ # Sub-domain (promoted from feature if complex)
66
+ │ │ │ ├── authentication-index.md
67
+ │ │ │ ├── authentication-cx.md
68
+ │ │ │ ├── 01-login.md
69
+ │ │ │ └── 02-password-reset.md
70
+ │ │ └── 03-roles.md
71
+ │ └── 02-billing/
72
+ │ ├── billing-index.md
73
+ │ ├── billing-cx.md
74
+ │ └── ...
50
75
  ├── meta/ # Structured metadata
51
76
  │ ├── problem-statement.md
52
77
  │ ├── personas.md
53
78
  │ ├── constraints.md
54
79
  │ └── competitive-landscape.md
55
- └── cross-cuts/ # Cross-cutting concern tracking
56
- └── cross-cut-ledger.md
80
+ └── [surfaces/] # Only for multi-product-hub or multi-product-peer
81
+ ├── web/
82
+ │ ├── web-index.md
83
+ │ ├── web-cx.md
84
+ │ └── 01-dashboard/...
85
+ └── mobile/
86
+ ├── mobile-index.md
87
+ ├── mobile-cx.md
88
+ └── 01-notifications/...
57
89
  ```
58
90
 
59
91
  **Key properties:**
60
- - **Shard-as-you-go**: Domain files are created the moment a domain is identified during exploration, not batched after all exploration is complete
61
- - **Living documents**: Domain files and the index are updated in place as exploration deepens they are never dated (see Dated File Convention below)
62
- - **Downstream consumers**: `/create-prd` reads `ideation-index.md` + `meta/constraints.md`; `/decompose-architecture` reads `ideation-index.md` + domain files; specification workflows reference domain files for sub-feature detail
92
+ - **Fractal pattern**: Every folder has an index + CX file. Every leaf is a feature `.md` file. This is universal no exceptions.
93
+ - **Reactive depth**: Folders are created during exploration when complexity is discovered, not pre-scaffolded. A feature file can be promoted to a sub-domain folder if it reveals internal complexity.
94
+ - **Numbering**: Children are numbered `{NN}-{slug}` within their parent. Paths are expressed as dot-separated (e.g., `01.02.03` = domain 01, sub-domain 02, feature 03).
95
+ - **Soft depth limit**: 4 levels recommended. Level 5 triggers a user prompt to confirm structured complexity isn't runaway nesting.
96
+
97
+ ### Role Integration
98
+
99
+ Roles (personas) are defined once in `meta/personas.md` and then referenced at every level of the tree:
100
+
101
+ | Location | What | Purpose |
102
+ |----------|------|---------|
103
+ | `meta/personas.md` | Full persona definitions (6 fields each) | Single source of truth |
104
+ | Node index files | **Role Matrix** — which personas access which children | Structural overview of role coverage |
105
+ | Feature files | **Role Lens** — per-persona behavior details | Downstream input for IA/BE/FE multitenancy specs |
106
+
107
+ ### Node Classification Gate
108
+
109
+ Before creating any new node (domain, sub-domain, or feature), the agent runs a classification gate:
110
+
111
+ 1. **What is it?** — Domain (top-level concept), sub-domain (2+ interacting capabilities), or feature (single capability)
112
+ 2. **Where does it go?** — Surface-exclusive, hub-owned, shared, or top-level (depends on project shape)
113
+ 3. **Does it already exist?** — Check for duplicates before creating
114
+
115
+ This prevents incorrect domain placement — the primary failure mode of the old flat structure.
63
116
 
64
117
  ### Exploration Model
65
118
 
@@ -67,20 +120,20 @@ The `/ideate` workflow uses **recursive breadth-before-depth exploration**:
67
120
 
68
121
  | Level | Scope | What happens |
69
122
  |---|---|---|
70
- | **Level 0** | Global domain map | Identify all top-level domains in the product. Each gets a file in `domains/`. |
71
- | **Level 1** | Sub-area sweep per domain | For each domain, identify all sub-areas. Mark each with a depth status marker. |
72
- | **Level 2+** | Vertical drilling | Drill into each sub-area until no new information emerges. Recursion: new domains discovered during drilling loop back to Level 0. |
123
+ | **Level 0** | Global domain map | Identify all top-level domains. Run Classification Gate for each. Create domain folders. |
124
+ | **Level 1** | Domain breadth sweep | For each domain, identify sub-areas. Classification Gate: sub-domain folder or feature file? Update Role Matrix. |
125
+ | **Level 2+** | Vertical drilling | Drill each child. Fill feature files (Role Lens, behavior, edge cases). Promote features to sub-domains if complex. |
73
126
 
74
- Each domain file tracks its sub-areas with status markers:
127
+ Each node tracks its status:
75
128
 
76
129
  | Marker | Meaning |
77
130
  |---|---|
78
131
  | `[SURFACE]` | Identified but unexplored |
79
- | `[BREADTH]` | Sub-areas listed, not detailed |
132
+ | `[BREADTH]` | Children listed, not detailed |
80
133
  | `[DEEP]` | Core logic, edge cases, interactions documented |
81
134
  | `[EXHAUSTED]` | Deep Think yielded nothing new — domain complete |
82
135
 
83
- A domain reaches `[EXHAUSTED]` only when the Deep Think protocol generates no new hypotheses.
136
+ Status propagates upward: a node is `[EXHAUSTED]` only when ALL its children are `[EXHAUSTED]`.
84
137
 
85
138
  ### Deep Think Protocol
86
139
 
@@ -88,14 +141,30 @@ At every exploration level, the agent actively generates hypotheses:
88
141
 
89
142
  > *"Based on [industry knowledge / domain patterns / cross-domain interaction], I'd expect [feature/concern/edge case]. Is that relevant to your product?"*
90
143
 
91
- Hypotheses are tracked in domain files with resolution status (confirmed/rejected/deferred). This prevents shallow exploration — the agent doesn't just record what the user says, it actively probes for what the user hasn't mentioned yet.
144
+ Hypotheses are tracked in feature files with resolution status (confirmed/rejected/deferred). This prevents shallow exploration — the agent doesn't just record what the user says, it actively probes for what the user hasn't mentioned yet.
145
+
146
+ ### Hierarchical Cross-Cuts
147
+
148
+ Cross-cutting concerns are tracked **at the level where they occur**, not in a single flat ledger:
92
149
 
93
- ### Cross-Cut Ledger
150
+ | CX File Location | What It Tracks |
151
+ |-----------------|----------------|
152
+ | `ideation-cx.md` (global) | Cross-surface interactions (multi-product only) |
153
+ | `{surface}-cx.md` | Cross-domain interactions within a surface |
154
+ | `{domain}-cx.md` | Cross-sub-domain interactions within a domain |
155
+ | `{sub-domain}-cx.md` | Cross-feature interactions within a sub-domain |
94
156
 
95
- Cross-cutting concerns (security, notifications, analytics, error handling, etc.) are tracked continuously in `cross-cuts/cross-cut-ledger.md` as they're discovered at any level, not batched into a separate pass. Each entry includes:
96
- - Which domains are involved
97
- - Confidence level (increases as exploration deepens)
98
- - Resolution status
157
+ Each CX entry includes which nodes interact, confidence level, 5 synthesis questions (trigger, data, flow, failure, scope), role scoping, and rejected pairs with reasoning.
158
+
159
+ ### Downstream Consumption
160
+
161
+ | Consumer | What It Reads |
162
+ |----------|--------------|
163
+ | `/create-prd` | `ideation-index.md` + `meta/constraints.md` |
164
+ | `/decompose-architecture` | `ideation-index.md` + domain indexes (walks fractal tree for shard boundary signals: depth, child count, CX density, Role Matrix) |
165
+ | Spec workflows | Domain indexes + feature files for sub-feature detail |
166
+
167
+ > **Important**: Ideation does NOT prescribe shard boundaries. `/decompose-architecture` reads the fractal tree and makes architectural decisions about where to draw shard lines.
99
168
 
100
169
  ---
101
170
 
@@ -136,7 +205,7 @@ This directory acts as the agent's long-term and working memory.
136
205
 
137
206
  ### Cross-references
138
207
 
139
- - **Dated File Convention** — See below in this section (Section 2) — governs which artifact paths use glob patterns vs. hardcoded names.
208
+ - **Dated File Convention** — See below in this section (Section 3) — governs which artifact paths use glob patterns vs. hardcoded names.
140
209
  - **Placeholder Verification Gate Protocol** — See Section 4.5 — governs the Step 0 guard that prevents workflows from reading `{{PLACEHOLDER}}`-dependent skills before bootstrap has run.
141
210
  - **Kit Maintenance Checklist** — See Section 6 — governs what must be updated when new workflows or skills are added.
142
211
  - **Surface Model** — `.agent/skills/prd-templates/references/surface-model.md` — The authoritative reference for surface types (web/mobile/cli/etc.) and implementation layers, and how the two models relate.
@@ -183,6 +252,29 @@ Workflow files declare skills in two places with different semantics:
183
252
 
184
253
  **Leaf workflows (shards)** should have body reads that match their frontmatter — if a skill is listed in a shard's frontmatter, the shard body should contain a corresponding `Read` instruction.
185
254
 
255
+ ### Shared References (`prd-templates/references/`)
256
+
257
+ The `prd-templates` skill contains a `references/` directory with 23 shared reference files that are consumed by multiple workflows. These references eliminate content duplication by centralizing:
258
+
259
+ | Reference Category | Examples | Used By |
260
+ |---|---|---|
261
+ | **Document templates** | `architecture-design-template.md`, `be-spec-template.md`, `fe-spec-template.md` | Spec and PRD writing workflows |
262
+ | **Shared policies** | `tdd-testing-policy.md`, `slice-completion-gates.md` | Implementation and validation workflows |
263
+ | **Classification procedures** | `fe-classification-procedures.md`, `placeholder-guard-template.md` | Classify shards of spec workflows |
264
+ | **Design system** | `design-system-decisions.md`, `design-system-prerequisite-check.md` | FE spec and PRD workflows |
265
+ | **Cross-cutting protocols** | `skill-loading-protocol.md`, `spec-coverage-sweep.md`, `surface-model.md` | 15+ workflows |
266
+
267
+ When a workflow needs a policy, template, or procedure, it references the shared file rather than inlining the content. This keeps workflows focused on orchestration logic and keeps shared policies maintainable in one place.
268
+
269
+ ### Skill Loading Protocol
270
+
271
+ Workflows that need stack-specific skills (Languages, Databases, FE Frameworks, etc.) reference `.agent/skills/prd-templates/references/skill-loading-protocol.md` instead of repeating the loading instructions inline. The protocol centralizes:
272
+
273
+ - How to read the surface stack map in `tech-stack.md`
274
+ - Which skill categories to load per workflow
275
+ - The missing-skill fallback procedure
276
+ - Surface stack map verification before loading
277
+
186
278
  ---
187
279
 
188
280
  ## 4.5. Bootstrap System
@@ -224,10 +316,11 @@ Two distinct gate types enforce placeholder readiness at different pipeline stag
224
316
 
225
317
  | Gate type | Where it runs | When | Purpose |
226
318
  |---|---|---|---|
227
- | **Spec-phase gate** | Step 0 of specification workflows (`create-prd-architecture`, `write-architecture-spec-design`, `write-fe-spec-classify`) | Before any skill reads | Guard spec authoring from unfilled stack placeholders |
228
- | **Implementation-phase gate** | `/implement-slice-setup` Step -1 | Before any code is written | Guard code generation from broken agent context across all seven instruction files |
319
+ | **Spec-phase gate** | Step 0 of specification workflows (`write-architecture-spec-design`, `write-be-spec-classify`, `write-fe-spec-classify`) | Before any skill reads | Guard spec authoring from unfilled stack placeholders |
320
+ | **Planning-phase gate** | `/plan-phase-write` | Before slice planning | Guard phase planning from unfilled CI/CD and Hosting skill placeholders |
321
+ | **Implementation-phase gate** | `/implement-slice-setup` Step -1 | Before any code is written | Guard code generation from broken agent context across all five instruction files |
229
322
 
230
- Both gates emit a **four-part hard stop message** per unfilled placeholder:
323
+ All three gates emit a **four-part hard stop message** per unfilled placeholder:
231
324
 
232
325
  1. **Which exact `{{PLACEHOLDER}}` is unfilled** — the literal placeholder name
233
326
  2. **Which pipeline stage fills it** — the `/create-prd-stack` decision that triggers bootstrap
@@ -242,7 +335,7 @@ For detailed per-workflow placeholder mappings and recovery commands, see `.agen
242
335
 
243
336
  ### Implementation-Phase Placeholder Gate
244
337
 
245
- Before any implementation begins, `/implement-slice-setup` (Step -1) scans all seven instruction files for unfilled `{{` patterns. If any are found, implementation stops with a specific remediation path per file. This gate is the last line of defense against broken agent context reaching the implementation phase.
338
+ Before any implementation begins, `/implement-slice-setup` (Step -1) scans all five instruction files for unfilled `{{` patterns. If any are found, implementation stops with a specific remediation path per file. This gate is the last line of defense against broken agent context reaching the implementation phase.
246
339
 
247
340
  ---
248
341
 
@@ -252,7 +345,7 @@ Before any implementation begins, `/implement-slice-setup` (Step -1) scans all s
252
345
 
253
346
  The defining architectural pattern of the code produced by this kit.
254
347
 
255
- 1. **Contract (Zod):** Define the schema first.
348
+ 1. **Contract ({{CONTRACT_LIBRARY}}):** Define the schema first.
256
349
  2. **Tests (Failing):** Write tests that assert against the contract.
257
350
  3. **Implementation:** Write the code to make the tests pass.
258
351
 
@@ -8,11 +8,16 @@ Ideation output created by `/ideate` — the pipeline's source of truth for prod
8
8
 
9
9
  ## Structure
10
10
 
11
- | Directory | Description |
11
+ The ideation folder uses a **fractal folder structure** — every domain is a folder containing an index file (`*-index.md`), a cross-cut file (`*-cx.md`), and child feature `.md` files. Sub-domains are nested folders following the same pattern.
12
+
13
+ | Path | Description |
12
14
  |---|---|
13
- | `domains/` | One file per domain, created during `/ideate-discover` as domains are explored |
15
+ | `ideation-index.md` | Pipeline key file structural classification, structure map, MoSCoW, progress |
16
+ | `ideation-cx.md` | Global cross-cuts (cross-surface interactions for multi-product projects) |
17
+ | `domains/` | Fractal domain folders — each containing index + CX + child features/sub-domains |
14
18
  | `meta/` | Structured metadata — problem statement, personas, constraints, competitive landscape |
15
- | `cross-cuts/` | Cross-cutting concern ledger, accumulated continuously during exploration |
19
+
20
+ > See `docs/kit-architecture.md` Section 2 for the full tree diagram and detailed documentation.
16
21
 
17
22
  ## Completion Requirement
18
23
 
@@ -1,55 +0,0 @@
1
- # Domain: {{DOMAIN_NAME}}
2
-
3
- > **Status**: `[SURFACE]` / `[BREADTH]` / `[DEEP]` / `[EXHAUSTED]`
4
- > **Domain number**: NN
5
- > **Last updated**: _timestamp_
6
-
7
- ## Overview
8
-
9
- _What this domain is, why it exists, what problem it solves within the product._
10
-
11
- ## Sub-Area Breadth Map
12
-
13
- Map all sub-areas before drilling any of them. Status markers track progress.
14
-
15
- | # | Sub-Area | Status | Sub-Topics | Deep Think |
16
- |---|----------|--------|------------|------------|
17
- | 1 | _Sub-area name_ | `[SURFACE]` | _N_ | _N hypotheses_ |
18
- | 2 | _Sub-area name_ | `[SURFACE]` | _N_ | _N hypotheses_ |
19
-
20
- ## Sub-Area Detail
21
-
22
- ### 1. {{Sub-Area Name}}
23
-
24
- **Status**: `[SURFACE]` / `[BREADTH]` / `[DEEP]` / `[EXHAUSTED]`
25
-
26
- #### Exploration
27
-
28
- _Vertical drill content — features, behaviors, edge cases, failure modes._
29
-
30
- #### Deep Think Annotations
31
-
32
- | Hypothesis | Source | Outcome |
33
- |-----------|--------|---------|
34
- | _"[X] likely needed because [Y]"_ | Agent domain knowledge | ✅ CONFIRMED / ❌ REJECTED |
35
-
36
- #### Cross-Cut Notes
37
-
38
- - Touches **Domain NN** ([domain-file.md](../domains/NN-domain.md)) because: _reason_
39
- - Touches **Domain NN** ([domain-file.md](../domains/NN-domain.md)) because: _reason_
40
-
41
- ---
42
-
43
- _Repeat the Sub-Area Detail section for each sub-area._
44
-
45
- ## Domain-Level Decisions
46
-
47
- | # | Decision | Context |
48
- |---|----------|---------|
49
- | _D#_ | _Decision_ | _Why this was decided_ |
50
-
51
- ## Open Questions
52
-
53
- | # | Question | Owner | Deferred To |
54
- |---|----------|-------|-------------|
55
- | 1 | _Question_ | User / Agent / `/create-prd` | _Stage_ |