cfsa-antigravity 2.1.0 → 2.2.1

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 (46) hide show
  1. package/package.json +2 -2
  2. package/template/.agent/instructions/example.md +21 -0
  3. package/template/.agent/progress/.gitkeep +0 -0
  4. package/template/.agent/progress/memory/.gitkeep +0 -0
  5. package/template/.agent/progress/sessions/.gitkeep +0 -0
  6. package/template/.agent/skills/architecture-mapping/SKILL.md +8 -8
  7. package/template/.agent/skills/idea-extraction/SKILL.md +270 -279
  8. package/template/.agent/skills/pipeline-rubrics/references/ia-rubric.md +2 -2
  9. package/template/.agent/skills/pipeline-rubrics/references/scoring.md +1 -1
  10. package/template/.agent/skills/pipeline-rubrics/references/vision-rubric.md +2 -1
  11. package/template/.agent/skills/prd-templates/SKILL.md +11 -11
  12. package/template/.agent/skills/prd-templates/references/decomposition-templates.md +1 -1
  13. package/template/.agent/skills/prd-templates/references/engineering-standards-template.md +2 -0
  14. package/template/.agent/skills/prd-templates/references/fractal-cx-template.md +58 -0
  15. package/template/.agent/skills/prd-templates/references/fractal-feature-template.md +93 -0
  16. package/template/.agent/skills/prd-templates/references/fractal-node-index-template.md +55 -0
  17. package/template/.agent/skills/prd-templates/references/ideation-crosscut-template.md +26 -47
  18. package/template/.agent/skills/prd-templates/references/ideation-index-template.md +41 -49
  19. package/template/.agent/skills/prd-templates/references/slice-completion-gates.md +8 -0
  20. package/template/.agent/skills/prd-templates/references/vision-template.md +8 -8
  21. package/template/.agent/skills/resolve-ambiguity/SKILL.md +1 -1
  22. package/template/.agent/skills/spec-writing/SKILL.md +1 -1
  23. package/template/.agent/workflows/create-prd-architecture.md +7 -2
  24. package/template/.agent/workflows/create-prd-stack.md +1 -1
  25. package/template/.agent/workflows/create-prd.md +4 -3
  26. package/template/.agent/workflows/decompose-architecture-structure.md +2 -2
  27. package/template/.agent/workflows/decompose-architecture-validate.md +3 -3
  28. package/template/.agent/workflows/decompose-architecture.md +18 -3
  29. package/template/.agent/workflows/evolve-feature-classify.md +14 -6
  30. package/template/.agent/workflows/ideate-discover.md +71 -110
  31. package/template/.agent/workflows/ideate-extract.md +68 -104
  32. package/template/.agent/workflows/ideate-validate.md +24 -20
  33. package/template/.agent/workflows/ideate.md +7 -7
  34. package/template/.agent/workflows/implement-slice-tdd.md +25 -0
  35. package/template/.agent/workflows/remediate-pipeline-assess.md +2 -1
  36. package/template/.agent/workflows/resolve-ambiguity.md +2 -2
  37. package/template/.agent/workflows/validate-phase-quality.md +155 -0
  38. package/template/.agent/workflows/validate-phase-readiness.md +167 -0
  39. package/template/.agent/workflows/validate-phase.md +19 -154
  40. package/template/.agent/workflows/write-architecture-spec-design.md +8 -4
  41. package/template/AGENTS.md +5 -1
  42. package/template/GEMINI.md +2 -0
  43. package/template/docs/README.md +10 -10
  44. package/template/docs/kit-architecture.md +92 -25
  45. package/template/docs/plans/ideation/README.md +8 -3
  46. package/template/.agent/skills/prd-templates/references/ideation-domain-template.md +0 -61
@@ -2,7 +2,7 @@
2
2
 
3
3
  | # | Dimension | ✅ (must meet ALL criteria) | ⚠️ | ❌ |
4
4
  |---|---|---|---|---|
5
- | 1 | Feature Enumeration | (a) Every feature from the ideation index's Must Have list appears in at least one shard. (b) Every feature has a clear scope boundary (what's in, what's out). (c) Every shard's `## Features` section contains Level-1 sub-features from the ideation domain files — not architecture headlines — and every sub-feature is represented in at least one section body (User Interactions, Data Model, Access Control, or Edge Cases). | Some features vague, scope unclear, or sub-features listed in `## Features` but not represented in any section body | Major Must Have features missing, or `## Features` contains only architecture headlines with no sub-feature detail |
5
+ | 1 | Feature Enumeration | (a) Every feature from the ideation index's Must Have list appears in at least one shard. (b) Every feature has a clear scope boundary (what's in, what's out). (c) Every shard's `## Features` section contains Level-1 sub-features from the ideation domain tree (folder index + feature files) — not architecture headlines — and every sub-feature is represented in at least one section body (User Interactions, Data Model, Access Control, or Edge Cases). | Some features vague, scope unclear, or sub-features listed in `## Features` but not represented in any section body | Major Must Have features missing, or `## Features` contains only architecture headlines with no sub-feature detail |
6
6
  | 2 | Access Model | Every role has: a named role + an exhaustive list of what it CAN do + an exhaustive list of what it CANNOT do + escalation path. No role uses "standard access" without defining it. | Some roles defined but missing permission or restriction lists | No access model |
7
7
  | 3 | Data Model | Every entity has: named fields + field types + constraints + relationships with cardinality. No field uses "standard" or "typical" without defining it. | Structure present but field types or constraints missing | Absent |
8
8
  | 4 | User Flows | Every user flow has: trigger + step-by-step actions + system responses + error paths. No flow ends at "success" without defining what success looks like. | Happy path only, or flows missing error paths | None |
@@ -14,6 +14,6 @@
14
14
  > **Deep Dive audit note**: When auditing dimension 7, read each deep dive file directly — do not infer its completeness from the parent shard's reference to it. A parent shard that links to a deep dive scores ⚠️ (not ✅) if the deep dive file itself is still a skeleton. Score ✅ only when the deep dive file contains exhaustive subsystem detail that an implementer could work from without asking questions.
15
15
 
16
16
  > **Dimension 1 audit procedure**:
17
- > 1. Read `docs/plans/ideation/ideation-index.md` and the relevant ideation domain files (use Domain Documents table for correct paths — files may be in `domains/` or `surfaces/{name}/`) to extract the authoritative list of Level-1 sub-features per domain.
17
+ > 1. Read `docs/plans/ideation/ideation-index.md` and the relevant ideation domain folders (use Structure Map for correct paths — folders are under `domains/` or `surfaces/{name}/`). For each domain, read the folder's `*-index.md` for the children table, then each child feature file to extract the authoritative list of Level-1 sub-features per domain.
18
18
  > 2. For each shard, open `docs/plans/ia/[NN-domain-name].md` and confirm every sub-feature from step 1 appears in the `## Features` section. Score ❌ if Must Have sub-features are missing entirely.
19
19
  > 3. For each sub-feature listed in `## Features`, verify it is represented in at least one section body (User Interactions, Data Model, Access Control, or Edge Cases). A sub-feature that appears only as a headline in `## Features` but has no corresponding detail in any section body scores ⚠️ — headline only = warning, not pass.
@@ -21,7 +21,7 @@ Write all cross-layer findings to a `## Cross-Layer Consistency` section in the
21
21
 
22
22
  | Layer | Documents to load |
23
23
  |-------|-------------------|
24
- | Ideation | `docs/plans/ideation/ideation-index.md` + domain files |
24
+ | Ideation | `docs/plans/ideation/ideation-index.md` + `ideation-cx.md` + all `*-index.md`, `*-cx.md`, and feature `.md` files recursively under `domains/` (and `surfaces/` for multi-product projects) |
25
25
  | Architecture | `docs/plans/*-architecture-design.md`, `docs/plans/ENGINEERING-STANDARDS.md` |
26
26
  | IA | `docs/plans/ia/index.md` + each shard listed + `docs/plans/ia/deep-dives/*.md` (list directory; include all files present) |
27
27
  | BE | `docs/plans/be/index.md` + each spec listed |
@@ -1,4 +1,4 @@
1
- # Vision Rubric (7 dimensions)
1
+ # Vision Rubric (8 dimensions)
2
2
 
3
3
  | # | Dimension | ✅ (must meet ALL criteria) | ⚠️ | ❌ |
4
4
  |---|---|---|---|---|
@@ -9,3 +9,4 @@
9
9
  | 5 | Success Measurability | Every metric is a number with a unit and a timeframe (e.g., "p95 < 500ms at launch"). No metric uses "fast", "good", or "acceptable". | Directional only | Missing |
10
10
  | 6 | Competitive Positioning | ≥3 named competitors. Differentiation is a specific capability gap. Moat is a defensible mechanism. | Vague positioning or <3 competitors | Not addressed |
11
11
  | 7 | Open Question Resolution | Every open question has: owner + deadline + what decision it blocks. No question is listed without an owner. | Questions listed, no owners or deadlines | No questions section |
12
+ | 8 | Structural Compliance | Every domain folder has `*-index.md` + `*-cx.md`. Role Matrix populated in every domain index. Feature files have Role Lens. Structure Map in `ideation-index.md` matches actual folder tree. No Classification Gate violations (no folders with 1 child, no flat features with ≥3 sub-features). | Structure exists but some folders missing CX or Role Matrix is partially empty | No fractal structure, or flat files used instead of folders |
@@ -52,12 +52,12 @@ Run this procedure when filling the `## Features` section of each shard skeleton
52
52
 
53
53
  ### Source
54
54
 
55
- Read `docs/plans/ideation/ideation-index.md` — specifically the `## Structural Classification` and `## Domain Documents` sections.
55
+ Read `docs/plans/ideation/ideation-index.md` — specifically the `## Structural Classification` and `## Structure Map` sections.
56
56
 
57
- - **Single-surface projects**: Locate the relevant domain file in `docs/plans/ideation/domains/` for each shard's domain.
58
- - **Multi-product projects**: Use the path from the Domain Documents table in `ideation-index.md`. Domain files may be in `docs/plans/ideation/surfaces/{surface-name}/` (surface-exclusive) or `docs/plans/ideation/domains/` (shared).
57
+ - **All project shapes**: Use the Structure Map to find the correct domain **folder** path. Each domain is a folder containing `*-index.md` (children table + Role Matrix), `*-cx.md` (cross-cuts), and child feature `.md` files.
58
+ - **Multi-product projects**: Domain folders may be under `docs/plans/ideation/surfaces/{surface-name}/` (surface-exclusive) or `docs/plans/ideation/domains/` (shared).
59
59
 
60
- Match each shard to its ideation domain by name. If the ideation structure is `surfaces/`, the shard's decomposition surface (from `decompose-architecture`) tells you which surface subfolder to look in.
60
+ Match each shard to its ideation domain by name. Walk the domain's fractal tree: read the domain index for the children list, then read each child feature file to extract sub-features. If the domain has sub-domain folders, recurse into them.
61
61
 
62
62
  ### Actor + Goal Format Rule
63
63
 
@@ -73,12 +73,12 @@ List sub-features as bullet points in the `## Features` section. Group by functi
73
73
 
74
74
  ### `[THIN — review with user]` Fallback Rule
75
75
 
76
- If a shard's domain has no corresponding ideation domain file (the domain was introduced during architecture design, not ideation — check the `ideation-index.md` Domain Documents table for both `domains/` and `surfaces/` paths), mark the skeleton with `[THIN — review with user]` at the top of `## Features` and seed from the architecture design description instead.
76
+ If a shard's domain has no corresponding ideation domain folder (the domain was introduced during architecture design, not ideation — check the `ideation-index.md` Structure Map for paths under `domains/` and `surfaces/`), mark the skeleton with `[THIN — review with user]` at the top of `## Features` and seed from the architecture design description instead.
77
77
 
78
78
  At the validation step, the user must confirm whether to:
79
79
  - Keep the shard separate
80
80
  - Merge it into an adjacent shard
81
- - Add missing sub-features from ideation
81
+ - Add missing sub-features from ideation (create a domain folder if needed)
82
82
 
83
83
  ### Directory Example
84
84
 
@@ -88,8 +88,8 @@ Seeded skeletons live in the `docs/plans/ia/` directory (or per-surface director
88
88
  ```
89
89
  docs/plans/ia/
90
90
  ├── 00-infrastructure.md
91
- ├── 01-user-accounts.md ← ## Features seeded from ideation/domains/user-accounts.md
92
- ├── 02-content-library.md ← ## Features seeded from ideation/domains/content-library.md
91
+ ├── 01-user-accounts.md ← ## Features seeded from ideation/domains/01-user-accounts/ (index + feature files)
92
+ ├── 02-content-library.md ← ## Features seeded from ideation/domains/02-content-library/ (index + feature files)
93
93
  ├── ...
94
94
  ```
95
95
 
@@ -97,9 +97,9 @@ docs/plans/ia/
97
97
  ```
98
98
  docs/plans/desktop/ia/
99
99
  ├── 00-infrastructure.md
100
- ├── 01-operations.md ← ## Features seeded from ideation/surfaces/desktop/operations.md
101
- ├── 02-inventory.md ← ## Features seeded from ideation/surfaces/desktop/inventory.md
100
+ ├── 01-operations.md ← ## Features seeded from ideation/surfaces/desktop/01-operations/ (index + feature files)
101
+ ├── 02-inventory.md ← ## Features seeded from ideation/surfaces/desktop/02-inventory/ (index + feature files)
102
102
 
103
103
  docs/plans/shared/ia/
104
- ├── 01-device-history.md ← ## Features seeded from ideation/domains/device-history.md
104
+ ├── 01-device-history.md ← ## Features seeded from ideation/domains/01-device-history/ (index + feature files)
105
105
  ```
@@ -18,7 +18,7 @@ For each shard, create at `docs/plans/ia/[NN-domain-name].md`:
18
18
  [1-2 sentence description of this domain's scope]
19
19
 
20
20
  ## Features
21
- [Level-1 sub-features from the relevant ideation domain file for this domain. Check `ideation-index.md` Domain Documents table for the correct path — files may be in `domains/` or `surfaces/{name}/` depending on structural classification. NOT architecture-level headlines. See /decompose-architecture-structure Step 5 for seeding instructions.]
21
+ [Level-1 sub-features from the relevant ideation domain folder for this domain. Check `ideation-index.md` Structure Map for the correct folder path — folders are under `domains/` or `surfaces/{name}/`. Read the folder's `*-index.md` for the children table, then each child feature file. NOT architecture-level headlines. See /decompose-architecture-structure Step 5 for seeding instructions.]
22
22
 
23
23
  ## User Interactions
24
24
  [To be filled during /write-architecture-spec]
@@ -102,9 +102,11 @@ Use this template when creating `docs/plans/ENGINEERING-STANDARDS.md`. Fill in c
102
102
 
103
103
  ## Security
104
104
  - Dependency audit: [e.g., npm audit on every CI run]
105
+ - Dependency audit enforcement: [e.g., Fail on HIGH/CRITICAL, Warn on MODERATE]
105
106
  - Secret scanning: [tool/approach]
106
107
  - CSP policy: [strict/relaxed + details] (web surfaces)
107
108
  - Code signing: [signing certificate strategy] (desktop/mobile surfaces)
109
+ - Security testing tool: [e.g., OWASP ZAP for web, MobSF for mobile, or none] (surface-specific dynamic security scan)
108
110
 
109
111
  ## Code Quality
110
112
  - Max file length: [e.g., 300 lines]
@@ -0,0 +1,58 @@
1
+ # {Node Name} — Cross-Cuts
2
+
3
+ > **Level**: {surface | domain | sub-domain}
4
+ > **Scope**: Connections between children of [{parent}](../{parent}-index.md)
5
+
6
+ ## Cross-Cut Map
7
+
8
+ | # | Source | Target | Relationship | Roles Affected | Confidence | Evidence |
9
+ |---|--------|--------|--------------|----------------|------------|----------|
10
+ | CX-01 | [child-A](./path) | [child-B](./path) | _what the interaction is_ | Tech, Owner | High | _specific evidence from exploration_ |
11
+ | CX-02 | [child-C](./path) | [{external-node}](../../path) | _cross-level interaction_ | Tech | Medium | _evidence_ |
12
+
13
+ > **Confidence levels:** High (confirmed with evidence), Medium (strong signal, needs validation), Low (hypothesis)
14
+ >
15
+ > **Cross-level references:** When a cross-cut spans levels (e.g., a feature in one surface touches a domain in another), record it here at the HIGHER level with a link path to the specific lower-level item. The detail of HOW they interact lives in the LOWER-level CX file.
16
+ >
17
+ > **Cross-references:** When referencing a CX entry from another file, use format `{filename}#CX-NN` (e.g., `ai-assistant-cx.md#CX-03`)
18
+
19
+ ---
20
+
21
+ ## Cross-Cut Details
22
+
23
+ ### CX-01: {Source} ↔ {Target}
24
+
25
+ **Relationship**: _Detailed description of how these two children interact. What data flows between them? What triggers what?_
26
+
27
+ **Role scoping**:
28
+ - **{Role 1}**: _what this role experiences at this intersection_
29
+ - **{Role 2}**: _what this role experiences_
30
+ - **{Role 3}**: _not affected / no visibility_
31
+
32
+ **Synthesis questions answered**:
33
+ 1. **Shared state conflict**: _Who owns the entity? What's the merge strategy if both sides modify it?_
34
+ 2. **Trigger chain**: _Does A trigger B? What happens if B fails — rollback? Compensating action? Is it sync or async?_
35
+ 3. **Permission intersection**: _Does a permission in A affect what you can do in B?_
36
+ 4. **Notification fan-out**: _Does an event in A notify actors in B?_
37
+ 5. **State transition conflict**: _Can A and B race? What's the consistency impact?_
38
+
39
+ ---
40
+
41
+ _Repeat the Cross-Cut Details section for each CX entry in the map._
42
+
43
+ ---
44
+
45
+ ## Rejected Pairs
46
+
47
+ | # | Source | Target | Reason for Rejection |
48
+ |---|--------|--------|---------------------|
49
+ | R-01 | _{child-A}_ | _{child-B}_ | _No shared state, no trigger dependency, independent lifecycles_ |
50
+
51
+ > **Notes for agents:**
52
+ > - This template is used at EVERY folder level in the fractal structure
53
+ > - CX files ONLY connect children at their own level — a surface CX connects domains, a domain CX connects sub-domains, a sub-domain CX connects features
54
+ > - CX entries use sequential `CX-NN` numbering within each file, starting at CX-01
55
+ > - Always include role scoping — every cross-cut affects specific roles, not all roles equally
56
+ > - Rejected pairs are valuable — they show the agent considered the interaction and dismissed it with reasoning
57
+ > - The 5 synthesis questions should be answered for EVERY confirmed cross-cut (CX entries with High confidence)
58
+ > - For Medium/Low confidence entries, the synthesis questions can be deferred to later drilling passes
@@ -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_ |
@@ -18,20 +18,29 @@
18
18
 
19
19
  ## Structural Classification
20
20
 
21
- - **Project Shape**: [single-surface | multi-surface-shared | multi-product]
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]
22
23
  - **Surfaces**: [list of identified surfaces, e.g., "Web (Astro/React), Desktop (Rust/Tauri), Mobile (React Native)" — or "N/A" for single-surface]
23
24
  - **Classification Basis**: [how this was determined — "detected from document", "user interview", "inferred from one-liner"]
24
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
+
25
32
  ## Progress Summary
26
33
 
27
34
  | Metric | Value |
28
35
  |--------|-------|
36
+ | Total surfaces | _N_ |
29
37
  | Total domains | _N_ |
30
- | SURFACE | _N_ |
31
- | BREADTH | _N_ |
32
- | DEEP | _N_ |
33
- | EXHAUSTED | _N_ |
34
- | 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_ |
35
44
  | Deep Think hypotheses confirmed | _N_ |
36
45
  | Deep Think hypotheses rejected | _N_ |
37
46
 
@@ -48,72 +57,55 @@
48
57
  | Competitive Landscape | [competitive-landscape.md](meta/competitive-landscape.md) | _status_ |
49
58
  | Constraints | [constraints.md](meta/constraints.md) | _status_ |
50
59
 
51
- ### Domain Documents
52
-
53
- > **Path convention:** For single-surface projects, domains live in `domains/NN-slug.md`.
54
- > For multi-product projects, surface-exclusive domains live in `surfaces/{surface}/NN-slug.md`
55
- > and shared domains live in `domains/NN-slug.md`.
56
-
57
- | # | Domain | Surface | Path | Status | Sub-areas | Deep Think |
58
- |---|--------|---------|------|--------|-----------|------------|
59
- | 01 | _Domain Name_ | _surface or shared_ | [01-domain-slug.md](domains/01-domain-slug.md) | `[SURFACE]` | _N_ sub-areas | _N_ hypotheses |
60
-
61
- _For multi-product projects, group domains by surface:_
62
-
63
- #### Surface: _Surface Name_
64
-
65
- | # | Domain | Path | Status | Sub-areas | Deep Think |
66
- |---|--------|------|--------|-----------|------------|
67
- | 01 | _Domain Name_ | [01-slug.md](surfaces/{surface}/01-slug.md) | `[SURFACE]` | _N_ | _N_ |
60
+ ### Global Cross-Cuts
68
61
 
69
- #### Shared Domains
62
+ | Document | Path |
63
+ |----------|------|
64
+ | Global Cross-Cuts | [ideation-cx.md](ideation-cx.md) |
70
65
 
71
- | # | Domain | Consumed By | Path | Status | Sub-areas | Deep Think |
72
- |---|--------|-------------|------|--------|-----------|------------|
73
- | 01 | _Domain Name_ | _surface list_ | [01-slug.md](domains/01-slug.md) | `[SURFACE]` | _N_ | _N_ |
66
+ ### Structure Map
74
67
 
75
- ### Cross-Cut Ledger
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.
76
71
 
77
- | Document | Path |
78
- |----------|------|
79
- | Cross-Cut Ledger | [cross-cut-ledger.md](cross-cuts/cross-cut-ledger.md) |
72
+ #### _{Surface Name or "Top-Level Domains" for single-surface}_
80
73
 
81
- ## Domain Map
74
+ | # | Domain | Path | Status | Children | Depth | Deep Think |
75
+ |---|--------|------|--------|----------|-------|------------|
76
+ | 01 | _Domain Name_ | [01-slug/](./01-slug/) | `[SURFACE]` | _N children_ | _N levels_ | _N hypotheses_ |
82
77
 
83
- Visual status of all domains with sub-area breakdowns:
78
+ _Repeat surface sections for multi-product projects._
84
79
 
85
- ```
86
- Domain 01: [Domain Name] [STATUS]
87
- ├── Sub-area A [STATUS] — N sub-topics
88
- ├── Sub-area B [STATUS] — N sub-topics
89
- └── Sub-area C [STATUS] — N sub-topics
80
+ #### Hub-Owned Shared Domains _(hub-and-spoke only)_
90
81
 
91
- Domain 02: [Domain Name] [STATUS]
92
- ├── ...
93
- └── ...
94
- ```
82
+ _Shared domains live inside the hub surface's domain tree. Listed here for visibility._
95
83
 
96
- Status markers: `[SURFACE]` `[BREADTH]` `[DEEP]` `[EXHAUSTED]`
84
+ | # | Domain | Hub Path | Consumed By | Status |
85
+ |---|--------|----------|-------------|--------|
86
+ | NN | _Domain Name_ | [web/NN-slug/](surfaces/web/NN-slug/) | Desktop, Mobile | `[SURFACE]` |
97
87
 
98
88
  ## Decision Log
99
89
 
100
- Numbered decisions with source references. Each decision links to the domain file where it was made.
90
+ Numbered decisions with source references.
101
91
 
102
92
  | # | Decision | Source | Domain |
103
93
  |---|----------|--------|--------|
104
- | 1 | _Decision description_ | _Discussion context_ | [domain-file.md](domains/NN-domain.md) |
94
+ | D-01 | _Decision description_ | _Discussion context_ | [domain-index.md](./path) |
105
95
 
106
96
  ## MoSCoW Summary
107
97
 
98
+ > Features reference their fractal path. Path format: `{surface}/{domain}.{sub-domain}.{feature}`
99
+
108
100
  ### Must Have
109
- - _Feature 1_ → Domain NN
110
- - _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))
111
103
 
112
104
  ### Should Have
113
- - _Feature 3_ → Domain NN
105
+ - _Feature 3_ → `web/02.01` ([link](./path))
114
106
 
115
107
  ### Could Have
116
- - _Feature 4_ → Domain NN
108
+ - _Feature 4_ → `desktop/01.03.02.04` ([link](./path))
117
109
 
118
110
  ### Won't Have (Now)
119
111
  - _Feature 5_ — Reason for exclusion
@@ -18,4 +18,12 @@ Non-FE slices skip this block.
18
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
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
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
+
21
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.
@@ -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 ideation domain files (paths in `ideation-index.md` Domain Documents table).
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.]
@@ -50,7 +50,7 @@ If these files contain `{{PLACEHOLDER}}` values, the information hasn't been dec
50
50
  **Check second — the pipeline's own output**
51
51
 
52
52
  The answer may already exist in a document written by an earlier pipeline stage:
53
- - `docs/plans/ideation/ideation-index.md` + domain files — Problem, personas, features, constraints, domain map
53
+ - `docs/plans/ideation/ideation-index.md` + fractal domain tree (folder `*-index.md`, `*-cx.md`, and feature files) — Problem, personas, features, constraints, domain map
54
54
  - `docs/plans/*-architecture-design.md` — Tech stack, system design, security model
55
55
  - `docs/plans/ENGINEERING-STANDARDS.md` — Quality thresholds, performance budgets
56
56
  - `docs/plans/ia/*.md` — IA shards (features, data models, access control, edge cases)