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
@@ -0,0 +1,93 @@
1
+ # Feature: {Feature Name}
2
+
3
+ > **Number**: {NN.NN.NN}
4
+ > **Parent**: [{sub-domain-name}](./{sub-domain}-index.md)
5
+ > **Status**: [SURFACE] / [PARTIAL] / [DEEP] / [EXHAUSTED]
6
+ > **Last updated**: {timestamp}
7
+
8
+ ## Overview
9
+
10
+ _What this feature is, why it exists, what user problem it solves. 2-3 sentences._
11
+
12
+ ## Role Lens
13
+
14
+ | Role | Access | What They See/Do |
15
+ |------|--------|-------------------|
16
+ | {Persona 1} | Full | _specific behavior for this role — actions, views, capabilities_ |
17
+ | {Persona 2} | Config | _specific behavior — what they configure, what they see_ |
18
+ | {Persona 3} | Read-only | _specific behavior — what they can view, what's hidden_ |
19
+ | {Persona 4} | None | _not visible — brief note on why or what they see instead_ |
20
+
21
+ > **Access levels**: Full · Config · Read-only · Reports · None
22
+ >
23
+ > **Rules:**
24
+ > - Every feature file MUST have a Role Lens table — no exceptions
25
+ > - Use persona names from `meta/personas.md`
26
+ > - "What They See/Do" must be SPECIFIC to this feature, not generic role descriptions
27
+ > - If a persona has "None" access, still list them — the explicit absence is valuable for downstream spec writers
28
+ > - This is the implementation-ready detail that IA/BE/FE spec writers consume directly
29
+
30
+ ## Behavior
31
+
32
+ _Detailed description of the feature's behavior._
33
+
34
+ ### Happy Path
35
+
36
+ _Step-by-step user interaction for the normal/expected case. Number each step._
37
+
38
+ 1. _User does X_
39
+ 2. _System responds with Y_
40
+ 3. _User confirms Z_
41
+ 4. _System completes action, shows confirmation_
42
+
43
+ ### Edge Cases / Failure Modes
44
+
45
+ | Scenario | What Happens | User Sees |
46
+ |----------|-------------|-----------|
47
+ | _edge case 1_ | _system behavior_ | _error message or fallback UI_ |
48
+ | _edge case 2_ | _system behavior_ | _error message or fallback UI_ |
49
+
50
+ ### States
51
+
52
+ | State | Trigger | What User Sees |
53
+ |-------|---------|---------------|
54
+ | Loading | _action initiated_ | _spinner, skeleton, progress bar_ |
55
+ | Empty | _no data exists yet_ | _empty state with CTA_ |
56
+ | Populated | _data loaded_ | _populated view_ |
57
+ | Error | _request failed_ | _error message with retry option_ |
58
+ | Partial | _incomplete data_ | _partial view with missing-data indicator_ |
59
+
60
+ ## Deep Think Annotations
61
+
62
+ | # | Hypothesis | Source | Outcome |
63
+ |---|-----------|--------|---------|
64
+ | DT-01 | _hypothesis about what this feature needs_ | _reasoning or industry precedent_ | ✅ CONFIRMED / ❌ REJECTED: _reason_ |
65
+
66
+ > Log every Deep Think hypothesis — both confirmed and rejected. This is the audit trail showing the agent explored beyond the obvious.
67
+
68
+ ## Cross-Cut Notes
69
+
70
+ _Quick references to how this feature interacts with features in other domains/sub-domains. These are pointers — detailed cross-cut analysis lives in the parent's CX file._
71
+
72
+ - Touches **{Domain/Sub-domain/Feature}** ([path](../../../path)) — _why: shared entity, trigger dependency, permission, etc._
73
+ - Consumed by **{Surface/Domain}** via API — _why: spoke surface reads this data through platform API_
74
+
75
+ > For detailed cross-cut analysis (synthesis questions, role scoping), see the CX file at the appropriate level.
76
+
77
+ ## Decisions
78
+
79
+ | # | Decision | Context |
80
+ |---|----------|---------|
81
+ | D-01 | _what was decided_ | _why this was the right call_ |
82
+
83
+ ## Open Questions
84
+
85
+ | # | Question | Owner | Deferred To |
86
+ |---|----------|-------|-------------|
87
+ | Q-01 | _question_ | User / Agent / /create-prd | _pipeline stage_ |
88
+
89
+ > **Notes for agents:**
90
+ > - Feature files are LEAF NODES — they are `.md` files, never folders
91
+ > - If a feature reveals 2+ interacting capabilities during drilling, it should be PROMOTED to a sub-domain (see Reactive Depth Protocol in `idea-extraction/SKILL.md`)
92
+ > - Status markers: `[SURFACE]` = identified only, `[PARTIAL]` = some depth, `[DEEP]` = all sections filled with edge cases, `[EXHAUSTED]` = Deep Think yields zero hypotheses + user confirms nothing missing
93
+ > - The Role Lens is the PRIMARY output consumed by `/write-fe-spec` and `/write-be-spec` — make it thorough
@@ -0,0 +1,55 @@
1
+ # {Node Name} — Index
2
+
3
+ > **Level**: {surface | domain | sub-domain}
4
+ > **Parent**: [{parent-name}](../{parent}-index.md)
5
+ > **Status**: [SURFACE] / [BREADTH] / [DEEP] / [EXHAUSTED]
6
+ > **Last updated**: {timestamp}
7
+
8
+ ## Overview
9
+
10
+ _What this node contains and why it exists. 2-3 sentences describing the domain or sub-domain's purpose and scope._
11
+
12
+ ## Children
13
+
14
+ | # | Name | Type | Path | Status | Deep Think |
15
+ |---|------|------|------|--------|------------|
16
+ | 01 | _{child-name}_ | domain / sub-domain / feature | [01-slug](./01-slug/) or [01.01-slug.md](./01.01-slug.md) | [SURFACE] | _N hypotheses_ |
17
+ | 02 | ... | ... | ... | ... | ... |
18
+
19
+ > **Type column values:**
20
+ > - `domain` — a top-level grouping within a surface (folder with index + CX)
21
+ > - `sub-domain` — a grouping within a domain that has 2+ interacting capabilities (folder with index + CX)
22
+ > - `feature` — a leaf node describing a single capability (.md file)
23
+
24
+ ## Role Matrix
25
+
26
+ | Child | {Persona 1} | {Persona 2} | {Persona 3} | {Persona 4} |
27
+ |-------|-------------|-------------|-------------|-------------|
28
+ | 01-child | ✅ Full | ⚙️ Config | 👁️ View | ❌ None |
29
+ | 02-child | ✅ Full | ✅ Full | ❌ None | ❌ None |
30
+
31
+ > **Legend**: ✅ Full access · ⚙️ Configuration only · 👁️ Read-only · 📊 Reports only · ❌ No access
32
+ >
33
+ > **Rules:**
34
+ > - Persona names come from `meta/personas.md` — use short names (e.g., "Tech", "Owner", "CSR", "Consumer")
35
+ > - NEVER redefine a persona here — reference only
36
+ > - Only list children that exist — the matrix grows as children are added
37
+ > - Access icons are shorthand; detailed per-role behavior lives in each feature file's **Role Lens**
38
+
39
+ ## Decision Log
40
+
41
+ | # | Decision | Context | Source |
42
+ |---|----------|---------|--------|
43
+ | D-01 | _what was decided_ | _why this was the right call_ | _conversation / document / user directive_ |
44
+
45
+ ## Open Questions
46
+
47
+ | # | Question | Owner | Deferred To |
48
+ |---|----------|-------|-------------|
49
+ | Q-01 | _question_ | User / Agent / /create-prd | _pipeline stage_ |
50
+
51
+ > **Notes for agents:**
52
+ > - This template is used at EVERY folder level in the fractal structure (surface, domain, sub-domain)
53
+ > - The content differs by level — a surface index lists domains, a domain index lists sub-domains/features
54
+ > - Status propagates upward: all children `[EXHAUSTED]` → node is `[EXHAUSTED]`; all `[DEEP]`+ → node is `[DEEP]`
55
+ > - When adding a new child, update BOTH the Children table AND the Role Matrix
@@ -1,57 +1,36 @@
1
- # Cross-Cut Ledger
1
+ # Global Cross-Cuts — {{PROJECT_NAME}}
2
2
 
3
- > This ledger is accumulated incrementally at every level of ideation.
4
- > It is NOT built in a single pass. Each level adds resolution.
5
- > Never clear entries — this is the audit trail.
3
+ > **Scope**: Cross-surface interactions for multi-product projects, or cross-domain interactions for single-surface projects.
4
+ > **Format**: Index + one-line summary. Detailed synthesis lives in lower-level CX files.
6
5
 
7
- ## Ledger
6
+ ## Cross-Surface Interaction Map
8
7
 
9
- ### Level 0 Surface Guesses (from domain map)
8
+ > Each row records that an interaction EXISTS between two surfaces or top-level domains. The Detail column links to the lower-level CX file where the full synthesis questions are answered.
10
9
 
11
- _Noted during global domain mapping. Low confidence, not yet validated._
10
+ | # | Source Surface/Domain | Target Surface/Domain | Summary | Roles | Detail |
11
+ |---|----------------------|----------------------|---------|-------|--------|
12
+ | CX-01 | _Web / Consumer Platform_ | _Desktop / Shop Ops_ | _Desktop diagnostic workflow consumes web supplier data via API_ | Tech, Owner | [detail](surfaces/desktop/desktop-cx.md#CX-03) |
13
+ | CX-02 | _Web / Device History_ | _Mobile / Device Guardian_ | _Mobile app syncs with web device history for owner verification_ | Consumer | [detail](surfaces/mobile/mobile-cx.md#CX-01) |
12
14
 
13
- | Domain A | Domain B | Suspected Connection | Status |
14
- |----------|----------|---------------------|--------|
15
- | _Domain 01_ | _Domain 05_ | _Likely share customer entity_ | `pending` |
15
+ > **Rules:**
16
+ > - This file is an INDEX with one-line summaries — not the source of truth for cross-cut details
17
+ > - Detailed synthesis (5 questions, role scoping) lives in the lower-level CX file linked in the Detail column
18
+ > - For single-surface projects, this file covers cross-DOMAIN interactions (same content as would appear in a surface-level CX)
19
+ > - For multi-product projects, this file covers cross-SURFACE interactions
20
+ > - Use `CX-NN` numbering. This file's entries are distinct from CX entries in lower-level files.
21
+ > - When referencing from other files, use `ideation-cx.md#CX-NN`
16
22
 
17
- ### Level 1 — Sub-Domain Connections (from breadth sweep)
23
+ ## Shared Domain Consumption _(multi-product only)_
18
24
 
19
- _Noted during domain breadth mapping. Medium confidence, connection identified at sub-area level._
25
+ > Which shared domains are consumed by which spoke surfaces, and through what mechanism.
20
26
 
21
- | Domain A.Sub-Area | Domain B.Sub-Area | Connection | Status |
22
- |-------------------|-------------------|------------|--------|
23
- | _01.Inventory_ | _05.Supplier Catalog_ | _Parts lookup cross-references supplier data_ | `pending` |
27
+ | Shared Domain | Owner | Consumed By | Mechanism | Detail |
28
+ |--------------|-------|-------------|-----------|--------|
29
+ | _Device History_ | Web (hub) | Desktop, Mobile | REST API | [web/02-device-history-cx.md](surfaces/web/02-device-history/device-history-cx.md) |
30
+ | _Payments_ | Web (hub) | Desktop | REST API | [web/03-payments-cx.md](surfaces/web/03-payments/payments-cx.md) |
24
31
 
25
- ### Level 2+ — Evidence-Backed (from vertical drilling)
32
+ ## Rejected Cross-Surface Pairs
26
33
 
27
- _Confirmed during vertical drilling with specific evidence. High confidence._
28
-
29
- | Domain A.Sub-Area.Feature | Domain B.Sub-Area.Feature | Evidence | Status |
30
- |--------------------------|--------------------------|----------|--------|
31
- | _02.Inventory.Purgatory_ | _01.Payments.PreAuth_ | _Pre-auth clears purgatory on completion_ | `✅ confirmed` |
32
-
33
- ## Synthesis Outcomes
34
-
35
- For each confirmed pair, the five synthesis questions have been asked and answered.
36
-
37
- ### [Interaction Name]: Domain A × Domain B
38
-
39
- **Connection**: _One-sentence description of the interaction._
40
-
41
- 1. **Shared state conflict**: _Who owns the entity? What's the merge strategy?_
42
- 2. **Trigger chain**: _Does A trigger B? Rollback if B fails? Sync or async?_
43
- 3. **Permission intersection**: _Does permission in A affect B?_
44
- 4. **Notification fan-out**: _Does event in A notify actors in B?_
45
- 5. **State transition conflict**: _Can A and B race? Data consistency impact?_
46
-
47
- **Outcome**: `✅ confirmed → [Interaction Name]` | `❌ rejected: [reason]`
48
-
49
- ---
50
-
51
- _Repeat Synthesis Outcomes for each confirmed cross-cut pair._
52
-
53
- ## Rejected Pairs
54
-
55
- | Domain A | Domain B | Reason for Rejection |
56
- |----------|----------|---------------------|
57
- | _Domain 03_ | _Domain 07_ | _No shared state, no trigger dependency, independent lifecycles_ |
34
+ | # | Surface A | Surface B | Reason for Rejection |
35
+ |---|-----------|-----------|---------------------|
36
+ | R-01 | _Desktop_ | _Mobile_ | _No direct interaction — both consume web API independently_ |
@@ -16,16 +16,31 @@
16
16
  - Cross-cut Detection: always-on
17
17
  - Deep Think Protocol: active
18
18
 
19
+ ## Structural Classification
20
+
21
+ - **Project Shape**: [single-surface | multi-surface-shared | multi-product-hub | multi-product-peer]
22
+ - **Hub Surface** _(hub-and-spoke only)_: [surface name that owns shared domains]
23
+ - **Surfaces**: [list of identified surfaces, e.g., "Web (Astro/React), Desktop (Rust/Tauri), Mobile (React Native)" — or "N/A" for single-surface]
24
+ - **Classification Basis**: [how this was determined — "detected from document", "user interview", "inferred from one-liner"]
25
+
26
+ > **Project Shapes:**
27
+ > - `single-surface` — One platform. Domains are top-level children of `ideation/`.
28
+ > - `multi-surface-shared` — 2+ platforms, same stack, >80% shared logic. Domains at top level with surface annotations.
29
+ > - `multi-product-hub` — 2+ platforms, one is the central platform/API. Hub owns shared domains. Spokes reference via CX.
30
+ > - `multi-product-peer` — 2+ platforms, no primary. `shared/` folder as a peer for cross-surface domains.
31
+
19
32
  ## Progress Summary
20
33
 
21
34
  | Metric | Value |
22
35
  |--------|-------|
36
+ | Total surfaces | _N_ |
23
37
  | Total domains | _N_ |
24
- | SURFACE | _N_ |
25
- | BREADTH | _N_ |
26
- | DEEP | _N_ |
27
- | EXHAUSTED | _N_ |
28
- | Cross-cut pairs confirmed | _N_ |
38
+ | Total leaf features | _N_ |
39
+ | Max depth reached | _N_ |
40
+ | Leaf nodes at [SURFACE] | _N_ |
41
+ | Leaf nodes at [DEEP] | _N_ |
42
+ | Leaf nodes at [EXHAUSTED] | _N_ |
43
+ | CX entries confirmed | _N_ |
29
44
  | Deep Think hypotheses confirmed | _N_ |
30
45
  | Deep Think hypotheses rejected | _N_ |
31
46
 
@@ -42,54 +57,55 @@
42
57
  | Competitive Landscape | [competitive-landscape.md](meta/competitive-landscape.md) | _status_ |
43
58
  | Constraints | [constraints.md](meta/constraints.md) | _status_ |
44
59
 
45
- ### Domain Documents
46
-
47
- | # | Domain | Path | Status | Sub-areas | Deep Think |
48
- |---|--------|------|--------|-----------|------------|
49
- | 01 | _Domain Name_ | [01-domain-slug.md](domains/01-domain-slug.md) | `[SURFACE]` | _N_ sub-areas | _N_ hypotheses |
50
-
51
- ### Cross-Cut Ledger
60
+ ### Global Cross-Cuts
52
61
 
53
62
  | Document | Path |
54
63
  |----------|------|
55
- | Cross-Cut Ledger | [cross-cut-ledger.md](cross-cuts/cross-cut-ledger.md) |
64
+ | Global Cross-Cuts | [ideation-cx.md](ideation-cx.md) |
56
65
 
57
- ## Domain Map
66
+ ### Structure Map
58
67
 
59
- Visual status of all domains with sub-area breakdowns:
68
+ > **For single-surface projects**, domains are listed directly below.
69
+ > **For multi-product projects**, expand each surface section.
70
+ > Every domain below is a FOLDER containing: `{domain}-index.md`, `{domain}-cx.md`, and child features/sub-domains.
60
71
 
61
- ```
62
- Domain 01: [Domain Name] [STATUS]
63
- ├── Sub-area A [STATUS] — N sub-topics
64
- ├── Sub-area B [STATUS] — N sub-topics
65
- └── Sub-area C [STATUS] — N sub-topics
72
+ #### _{Surface Name or "Top-Level Domains" for single-surface}_
66
73
 
67
- Domain 02: [Domain Name] [STATUS]
68
- ├── ...
69
- └── ...
70
- ```
74
+ | # | Domain | Path | Status | Children | Depth | Deep Think |
75
+ |---|--------|------|--------|----------|-------|------------|
76
+ | 01 | _Domain Name_ | [01-slug/](./01-slug/) | `[SURFACE]` | _N children_ | _N levels_ | _N hypotheses_ |
71
77
 
72
- Status markers: `[SURFACE]` `[BREADTH]` → `[DEEP]` → `[EXHAUSTED]`
78
+ _Repeat surface sections for multi-product projects._
79
+
80
+ #### Hub-Owned Shared Domains _(hub-and-spoke only)_
81
+
82
+ _Shared domains live inside the hub surface's domain tree. Listed here for visibility._
83
+
84
+ | # | Domain | Hub Path | Consumed By | Status |
85
+ |---|--------|----------|-------------|--------|
86
+ | NN | _Domain Name_ | [web/NN-slug/](surfaces/web/NN-slug/) | Desktop, Mobile | `[SURFACE]` |
73
87
 
74
88
  ## Decision Log
75
89
 
76
- Numbered decisions with source references. Each decision links to the domain file where it was made.
90
+ Numbered decisions with source references.
77
91
 
78
92
  | # | Decision | Source | Domain |
79
93
  |---|----------|--------|--------|
80
- | 1 | _Decision description_ | _Discussion context_ | [domain-file.md](domains/NN-domain.md) |
94
+ | D-01 | _Decision description_ | _Discussion context_ | [domain-index.md](./path) |
81
95
 
82
96
  ## MoSCoW Summary
83
97
 
98
+ > Features reference their fractal path. Path format: `{surface}/{domain}.{sub-domain}.{feature}`
99
+
84
100
  ### Must Have
85
- - _Feature 1_ → Domain NN
86
- - _Feature 2_ → Domain NN
101
+ - _Feature 1_ → `web/01.02.01` ([link](./path/01.02.01-feature.md))
102
+ - _Feature 2_ → `desktop/01.01.03` ([link](./path/01.01.03-feature.md))
87
103
 
88
104
  ### Should Have
89
- - _Feature 3_ → Domain NN
105
+ - _Feature 3_ → `web/02.01` ([link](./path))
90
106
 
91
107
  ### Could Have
92
- - _Feature 4_ → Domain NN
108
+ - _Feature 4_ → `desktop/01.03.02.04` ([link](./path))
93
109
 
94
110
  ### Won't Have (Now)
95
111
  - _Feature 5_ — Reason for exclusion
@@ -14,7 +14,7 @@ Use when writing slice entries during `/plan-phase` Step 4:
14
14
  **Surfaces**: Contract, API, DB, UI
15
15
 
16
16
  #### Tasks
17
- - [ ] Contract: Zod schema for [entity] ← no tag (orchestrator handles sequentially)
17
+ - [ ] Contract: {{CONTRACT_LIBRARY}} schema for [entity] ← no tag (orchestrator handles sequentially)
18
18
  - [ ] `BE` API endpoints for [entity] ← backend agent
19
19
  - [ ] `FE` [entity] page and components ← frontend agent
20
20
  - [ ] `QA` Integration tests for [entity] ← QA agent (runs FIRST to write failing tests, AND after BE+FE to verify)
@@ -1,21 +1,50 @@
1
- # Placeholder Workflow Mapping
2
-
3
- Maps tech stack placeholders to the source keys and consuming workflows.
4
-
5
- | Placeholder | Source Key | Workflows |
6
- |---|---|---|
7
- | `{{DATABASE_SKILLS}}` | `DATABASE_*` (accumulated) | create-prd, write-architecture-spec, write-be-spec-classify |
8
- | `{{AUTH_SKILL}}` | `AUTH_PROVIDER` | create-prd, write-be-spec-classify |
9
- | `{{BACKEND_FRAMEWORK_SKILL}}` | `BACKEND_FRAMEWORK` / `API_LAYER` | write-be-spec-classify |
10
- | `{{API_DESIGN_SKILL}}` | `API_LAYER` (default: `api-design-principles`) | create-prd, create-prd-architecture, write-architecture-spec-design, write-be-spec-classify |
11
- | `{{FRONTEND_FRAMEWORK_SKILL}}` | `FRONTEND_FRAMEWORK` | write-fe-spec-classify |
12
- | `{{FRONTEND_DESIGN_SKILL}}` | `CSS_FRAMEWORK` / `UI_LIBRARY` | write-fe-spec-classify |
13
- | `{{ACCESSIBILITY_SKILL}}` | surface: `accessibility-compliance` | write-fe-spec-classify, write-fe-spec-write, write-architecture-spec-design, validate-phase |
14
- | `{{LANGUAGE_SKILL}}` | `LANGUAGE` | implement-slice-setup, implement-slice-tdd, write-be-spec-classify, write-fe-spec-classify, evolve-contract |
15
- | `{{CI_CD_SKILL}}` | `CI_CD` | create-prd-compile, decompose-architecture-structure, plan-phase, verify-infrastructure, validate-phase |
16
- | `{{HOSTING_SKILL}}` | `HOSTING` | create-prd-architecture, decompose-architecture-structure, plan-phase, verify-infrastructure, validate-phase |
17
- | `{{ORM_SKILL}}` | `ORM` | create-prd-architecture, write-be-spec-classify, implement-slice-setup, verify-infrastructure, validate-phase |
18
- | `{{UNIT_TESTING_SKILL}}` | `UNIT_TESTING` | create-prd-compile, implement-slice-setup, implement-slice-tdd, write-be-spec-classify, evolve-contract |
19
- | `{{E2E_TESTING_SKILL}}` | `E2E_TESTING` | create-prd-compile, implement-slice-tdd, validate-phase |
20
- | `{{STATE_MANAGEMENT_SKILL}}` | `STATE_MANAGEMENT` | write-fe-spec-classify, implement-slice-setup |
21
- | `{{SECURITY_SKILLS}}` | `SECURITY` + surface triggers (accumulated) | create-prd-security, write-architecture-spec-design, validate-phase |
1
+ # Map Column Reference
2
+
3
+ Maps surface stack map columns and cross-cutting categories to the workflows that consume them.
4
+
5
+ > **How workflows use the map**: See `.agent/instructions/tech-stack.md` for the surface stack map format and resolution rules. Workflows determine their surface context (from shard directory or slice surface tag), then look up the corresponding row and column.
6
+
7
+ ## Per-Surface Columns
8
+
9
+ | Column | Workflows That Consume It |
10
+ |--------|--------------------------|
11
+ | **Languages** | write-be-spec-classify, write-fe-spec-classify, implement-slice-setup, implement-slice-tdd, evolve-contract |
12
+ | **BE Frameworks** | write-be-spec-classify |
13
+ | **FE Frameworks** | write-fe-spec-classify |
14
+ | **FE Design** | write-fe-spec-classify |
15
+ | **ORMs** | create-prd-architecture, write-be-spec-classify, implement-slice-setup, verify-infrastructure, validate-phase |
16
+ | **State Mgmt** | write-fe-spec-classify, implement-slice-setup |
17
+ | **Databases** | create-prd-architecture, write-architecture-spec-design, write-be-spec-classify |
18
+ | **Unit Tests** | create-prd-compile, write-be-spec-classify, implement-slice-setup, implement-slice-tdd, evolve-contract |
19
+ | **E2E Tests** | create-prd-compile, implement-slice-tdd, validate-phase |
20
+ | **Test Cmd** | implement-slice-tdd, validate-phase, evolve-contract |
21
+ | **Validation Cmd** | implement-slice-tdd, validate-phase, evolve-contract |
22
+ | **Lint Cmd** | validate-phase |
23
+ | **Build Cmd** | validate-phase |
24
+ | **Dev Cmd** | verify-infrastructure |
25
+ | **Package Mgr** | bootstrap-agents-fill |
26
+
27
+ ## Cross-Cutting Categories
28
+
29
+ | Category | Workflows That Consume It |
30
+ |----------|--------------------------|
31
+ | **Auth** | create-prd-security, write-be-spec-classify |
32
+ | **CI/CD** | create-prd-compile, decompose-architecture-structure, plan-phase-write, verify-infrastructure, validate-phase |
33
+ | **Hosting** | create-prd-architecture, decompose-architecture-structure, plan-phase-write, verify-infrastructure, validate-phase |
34
+ | **Security** | create-prd-security, write-architecture-spec-design, validate-phase |
35
+ | **API Design** | create-prd-architecture, write-architecture-spec-design, write-be-spec-classify |
36
+ | **Accessibility** | write-fe-spec-classify, write-fe-spec-write, write-architecture-spec-design, validate-phase |
37
+ | **Contract Library** | tdd-contract-first rule, implement-slice-setup |
38
+
39
+ ## Surface Context Resolution
40
+
41
+ How each workflow determines which surface's row to read:
42
+
43
+ | Workflow Type | Resolution Method |
44
+ |--------------|-------------------|
45
+ | Spec-writing (`write-be-spec`, `write-fe-spec`) | Shard directory path: `docs/plans/desktop/be/` → surface `desktop`; flat `docs/plans/be/` → surface `shared` |
46
+ | Implementation (`implement-slice`) | Slice's `surface:` tag from the phase plan |
47
+ | Planning (`plan-phase`) | Iterates ALL surfaces in the map |
48
+ | Validation (`validate-phase`) | Runs per-surface commands for all surfaces |
49
+ | Cross-cutting (`verify-infrastructure`) | Uses cross-cutting table + primary surface for commands |
50
+ | Architecture (`create-prd-*`) | Map may be incomplete during these workflows — falls back to inline conversation context |
@@ -0,0 +1,32 @@
1
+ # Skill Loading Protocol
2
+
3
+ Standard procedure for loading skills from the surface stack map before beginning spec or implementation work.
4
+
5
+ ## How to Load Skills from the Surface Stack Map
6
+
7
+ 1. **Determine the surface**: Identify which surface this work belongs to from the directory path or phase plan (e.g., `docs/plans/web/be/` → surface `web`; flat `docs/plans/be/` → surface `shared`).
8
+
9
+ 2. **Read the surface stack map**: Open `.agent/instructions/tech-stack.md` and locate this surface's row.
10
+
11
+ 3. **For each skill category** relevant to your workflow (Languages, Databases, BE Frameworks, FE Frameworks, FE Design, ORMs, Auth, Unit Tests, E2E Tests, State Mgmt, Accessibility, CI/CD, Hosting, Security):
12
+ - Read the skill name(s) listed in that cell
13
+ - For each skill directory name, read `.agent/skills/[skill]/SKILL.md`
14
+ - Follow its conventions (language, testing, framework, design, etc.)
15
+
16
+ 4. **Cross-cutting skills**: Some categories (Auth, Security, CI/CD, Hosting, Accessibility) are in the cross-cutting section — not per-surface. Read those from the cross-cutting rows.
17
+
18
+ 5. **Missing skill fallback**: If any skill in the bundle is not installed in `.agent/skills/` and is not in `.agent/skill-library/MANIFEST.md`, read `.agent/skills/find-skills/SKILL.md` and follow its discovery methodology to search for a community equivalent before proceeding without it.
19
+
20
+ ## Which Categories to Load Per Workflow
21
+
22
+ | Workflow | Required Categories |
23
+ |----------|-------------------|
24
+ | `write-be-spec-classify` | Languages, Databases, Auth, BE Frameworks, ORMs, Unit Tests |
25
+ | `write-fe-spec-classify` | Languages, FE Frameworks, FE Design, Accessibility, State Mgmt |
26
+ | `write-architecture-spec-design` | Databases, Security, API Design |
27
+ | `implement-slice-tdd` | Languages, Unit Tests, E2E Tests |
28
+ | `validate-phase` | Unit Tests, E2E Tests, CI/CD, Hosting, Accessibility, Security |
29
+
30
+ ## Surface Stack Map Verification
31
+
32
+ Before loading, verify the required cells have filled values. If any required cell is empty → **HARD STOP**: tell the user to run `/create-prd` first to make tech stack decisions.
@@ -0,0 +1,29 @@
1
+ # Slice Completion Gates
2
+
3
+ Checklists that must pass before a slice can be marked complete. Every unchecked item is a hard stop.
4
+
5
+ ## UI Completeness Check (FE slices only)
6
+
7
+ - [ ] Every acceptance criterion mentioning "user sees", "user can", "displays", or "shows" has a rendered implementation — not just a passing test
8
+ - [ ] Every new route in this slice is wired into the app's navigation (not just exported as a component)
9
+ - [ ] Loading, error, and empty states are rendered in the UI — not just covered by tests
10
+ - [ ] The feature is reachable from the app's entry point via normal user navigation
11
+
12
+ Non-FE slices skip this block.
13
+
14
+ ## Spec Traceability Gate (all slices)
15
+
16
+ - [ ] Re-read the BE spec section(s) for every endpoint in this slice — every response field, error code, and validation rule has a corresponding test tagged with the spec reference
17
+ - [ ] Re-read the IA shard's `## Edge Cases` section for this slice's domain — every edge case relevant to this slice has a `// IA-EDGE:` tagged test
18
+ - [ ] No `// DECISION:` annotations exist for behaviors that are actually specified in the BE spec or IA shard (i.e., no spec-defined behavior was treated as an undocumented implementation decision)
19
+ - [ ] The {{CONTRACT_LIBRARY}} contract written in Step 2 matches the delivered implementation field-for-field — no fields added, removed, or renamed during implementation without a corresponding contract update
20
+
21
+ ## Resource Cleanup Gate (all slices)
22
+
23
+ - [ ] Every database client or connection created in this slice has a corresponding cleanup call (`disconnect`, `close`, `end`, `dispose`) in a `finally` block or lifecycle hook
24
+ - [ ] Every event listener or subscription registered in UI components has a corresponding cleanup in the component's unmount/destroy lifecycle
25
+ - [ ] Every `setInterval` or `setTimeout` with a stored reference has a corresponding `clearInterval`/`clearTimeout` on cleanup
26
+ - [ ] No file handles or streams are opened without corresponding `close`/`destroy` calls
27
+ - [ ] If using connection pools — pool size is configured (not left at framework default) and documented via code comment: `// POOL: max=N, reason=...`
28
+
29
+ > ❌ STOP — Do not call `notify_user` if any of the above are unchecked. Fix the gap and re-run the Test Cmd from the surface stack map.
@@ -18,8 +18,8 @@ For each slice in the phase plan (`docs/plans/phases/phase-N.md`):
18
18
 
19
19
  4. Identify the BE spec section(s) for each endpoint in this slice
20
20
  5. For each endpoint:
21
- - Verify every Zod-validated field in the BE spec has a corresponding test
22
- - Verify every error code defined in the BE spec has a corresponding test
21
+ - Verify every {{CONTRACT_LIBRARY}}-validated field in the BE spec has a corresponding test
22
+ - Verify every error code defined in the BE spec has a corresponding test that asserts the **full error response shape** (status + error code + message), not just the HTTP status
23
23
  - Verify every auth rule (role, ownership check) defined in the BE spec has a corresponding permission test
24
24
 
25
25
  ### IA Shard Coverage
@@ -33,7 +33,7 @@ For each slice in the phase plan (`docs/plans/phases/phase-N.md`):
33
33
 
34
34
  If any flow, field, error code, auth rule, IA acceptance criterion, or accessibility requirement has no corresponding test:
35
35
 
36
- > ❌ STOP — Do not mark this phase as complete. List the uncovered items. Either write the missing tests and re-run `{{TEST_COMMAND}}`, or if the item was genuinely deferred (valid boundary stub + tracking issue), document the deferral explicitly in the phase validation report.
36
+ > ❌ STOP — Do not mark this phase as complete. List the uncovered items. Either write the missing tests and re-run the Test Cmd from `.agent/instructions/commands.md`, or if the item was genuinely deferred (valid boundary stub + tracking issue), document the deferral explicitly in the phase validation report.
37
37
 
38
38
  ## Pass Criteria
39
39
 
@@ -0,0 +1,39 @@
1
+ # TDD Testing Policy
2
+
3
+ ## Assertion Depth Rule
4
+
5
+ Every test must assert **at minimum**:
6
+ - Response status code AND response body structure (not just status)
7
+ - At least one specific field value from the response body
8
+ - For error paths: the full error shape (code + message), not just the status code
9
+ - Contract tests must assert both valid input accepted AND invalid input rejected with the correct error shape
10
+
11
+ Tests that only assert `status == 200` without checking the response body are **insufficient** and will be flagged during QA anti-cheat audit.
12
+
13
+ ## Anti-Mock-Abuse Rules
14
+
15
+ | Test Type | Mocking Policy |
16
+ |-----------|---------------|
17
+ | **Unit tests** | Mocking external dependencies allowed and expected |
18
+ | **Integration tests** | At least one test per endpoint must hit a real test database — no mocked DB responses |
19
+ | **E2E tests** | No mocks allowed — full stack or it doesn't count |
20
+
21
+ **Banned patterns**:
22
+ - Mocking the module under test (testing a mock of what you're building)
23
+ - Mock chains (mocking a mock that mocks another dependency)
24
+ - Tests where the mock returns exactly the expected value (circular, proves nothing)
25
+
26
+ **Test order**: Unit → Integration → E2E (if applicable)
27
+
28
+ ## QA Anti-Cheat Audit
29
+
30
+ Before marking tests as passing, verify:
31
+
32
+ - [ ] No tests with zero assertions
33
+ - [ ] No tautological tests (e.g., `expect(true).toBe(true)`, `expect(mock).toEqual(mock)`)
34
+ - [ ] No `test.skip` without a `BOUNDARY:` reference and tracking issue
35
+ - [ ] Every test that asserts a response also asserts the response body, not just the status code
36
+ - [ ] No tests that mock the thing they're supposed to test (e.g., mocking the handler to test the handler)
37
+ - [ ] Error path tests actually trigger the error condition — they don't just mock the error response
38
+
39
+ In sequential mode, the agent self-audits against this checklist. In parallel mode, the QA-GREEN agent runs this explicitly.
@@ -4,7 +4,7 @@ Use this template when compiling `docs/plans/vision.md` as the human-readable ex
4
4
 
5
5
  > **Important**: `vision.md` is a summary document for human consumption. The pipeline reads
6
6
  > `docs/plans/ideation/ideation-index.md` directly — not this file. All the depth, domain
7
- > files, cross-cut ledger, and structured data live in the `ideation/` folder.
7
+ > files, CX files, and structured data live in the `ideation/` folder's fractal tree.
8
8
 
9
9
  ```markdown
10
10
  # [Project Name] — Vision
@@ -12,7 +12,7 @@ Use this template when compiling `docs/plans/vision.md` as the human-readable ex
12
12
  > One-sentence pitch: [from Step 4]
13
13
 
14
14
  > **This is a human-readable project summary.** For pipeline-grade detail, see
15
- > [ideation-index.md](ideation/ideation-index.md) and the domain files it references.
15
+ > [ideation-index.md](ideation/ideation-index.md) and the fractal domain tree it references.
16
16
 
17
17
  ## Problem Statement
18
18
  [Condensed from `meta/problem-statement.md`]
@@ -25,26 +25,26 @@ Not the full 6-field exploration — that detail stays in the personas file.]
25
25
  [2-3 paragraphs describing what the product does and why it matters.]
26
26
 
27
27
  ## Domain Map
28
- [One paragraph per domain, condensed from the domain files in `ideation/domains/`.
29
- Each domain links to its full file.]
28
+ [One paragraph per domain, condensed from the ideation domain folders (paths in `ideation-index.md` Structure Map).
29
+ Each domain links to its folder's index file.]
30
30
 
31
31
  ## Feature Inventory (MoSCoW)
32
32
  ### Must Have (Phase 1)
33
- [Feature names + one-line description. Links to domain files for drill-down detail.]
33
+ [Feature names + one-line description. Links to domain folder index files for drill-down detail.]
34
34
  ### Should Have (Phase 2)
35
35
  [Feature names + one-line description.]
36
36
  ### Could Have (Phase 3+)
37
37
  ### Won't Have (explicitly excluded)
38
38
 
39
39
  ## Key Cross-Cutting Interactions
40
- [Top confirmed interactions from `cross-cuts/cross-cut-ledger.md`.
41
- Full synthesis detail stays in the ledger.]
40
+ [Top confirmed interactions from `ideation-cx.md` (global) and domain-level `*-cx.md` files.
41
+ Full synthesis detail stays in the CX files.]
42
42
 
43
43
  ## Constraints Summary
44
44
  [Condensed from `meta/constraints.md` — budget, timeline, team, compliance, performance, surfaces.]
45
45
 
46
46
  ## Success Metrics
47
- [Key metrics with concrete targets. Full details in relevant domain files.]
47
+ [Key metrics with concrete targets. Full details in relevant domain folder feature files.]
48
48
 
49
49
  ## Competitive Landscape
50
50
  [Condensed from `meta/competitive-landscape.md` — competitors, differentiation, moat.]