cfsa-antigravity 2.7.0 → 2.8.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 (50) hide show
  1. package/package.json +1 -1
  2. package/template/.agent/kit-sync.md +3 -3
  3. package/template/.agent/skills/prd-templates/references/architecture-completeness-checklist.md +28 -0
  4. package/template/.agent/skills/prd-templates/references/be-spec-classification.md +41 -0
  5. package/template/.agent/skills/prd-templates/references/bootstrap-verification-protocol.md +50 -0
  6. package/template/.agent/skills/prd-templates/references/constraint-exploration.md +41 -0
  7. package/template/.agent/skills/prd-templates/references/decision-confirmation-protocol.md +68 -0
  8. package/template/.agent/skills/prd-templates/references/decision-propagation.md +121 -0
  9. package/template/.agent/skills/prd-templates/references/domain-exhaustion-criteria.md +37 -0
  10. package/template/.agent/skills/prd-templates/references/engagement-tier-protocol.md +58 -0
  11. package/template/.agent/skills/prd-templates/references/evolution-layer-guidance.md +91 -0
  12. package/template/.agent/skills/prd-templates/references/expansion-modes.md +27 -0
  13. package/template/.agent/skills/prd-templates/references/folder-seeding-protocol.md +77 -0
  14. package/template/.agent/skills/prd-templates/references/input-classification.md +23 -0
  15. package/template/.agent/skills/prd-templates/references/map-guard-protocol.md +44 -0
  16. package/template/.agent/skills/prd-templates/references/persona-completeness-gate.md +20 -0
  17. package/template/.agent/skills/prd-templates/references/shard-boundary-analysis.md +76 -0
  18. package/template/.agent/skills/prd-templates/references/write-verification-protocol.md +57 -0
  19. package/template/.agent/workflows/create-prd-architecture.md +17 -23
  20. package/template/.agent/workflows/create-prd-compile.md +31 -22
  21. package/template/.agent/workflows/create-prd-design-system.md +18 -14
  22. package/template/.agent/workflows/create-prd-security.md +22 -24
  23. package/template/.agent/workflows/create-prd-stack.md +20 -11
  24. package/template/.agent/workflows/create-prd.md +27 -99
  25. package/template/.agent/workflows/decompose-architecture-structure.md +14 -4
  26. package/template/.agent/workflows/decompose-architecture-validate.md +29 -80
  27. package/template/.agent/workflows/decompose-architecture.md +27 -60
  28. package/template/.agent/workflows/evolve-contract.md +7 -2
  29. package/template/.agent/workflows/evolve-feature-cascade.md +34 -78
  30. package/template/.agent/workflows/evolve-feature-classify.md +22 -56
  31. package/template/.agent/workflows/ideate-discover.md +89 -100
  32. package/template/.agent/workflows/ideate-extract.md +42 -138
  33. package/template/.agent/workflows/ideate-validate.md +57 -133
  34. package/template/.agent/workflows/ideate.md +32 -19
  35. package/template/.agent/workflows/implement-slice-setup.md +15 -5
  36. package/template/.agent/workflows/implement-slice-tdd.md +21 -5
  37. package/template/.agent/workflows/plan-phase-write.md +30 -1
  38. package/template/.agent/workflows/propagate-decision-apply.md +23 -90
  39. package/template/.agent/workflows/propagate-decision-scan.md +20 -91
  40. package/template/.agent/workflows/remediate-pipeline-execute.md +6 -1
  41. package/template/.agent/workflows/validate-phase-quality.md +14 -3
  42. package/template/.agent/workflows/validate-phase-readiness.md +1 -1
  43. package/template/.agent/workflows/verify-infrastructure.md +2 -0
  44. package/template/.agent/workflows/write-architecture-spec-deepen.md +8 -2
  45. package/template/.agent/workflows/write-architecture-spec-design.md +11 -14
  46. package/template/.agent/workflows/write-be-spec-classify.md +26 -104
  47. package/template/.agent/workflows/write-be-spec-write.md +49 -3
  48. package/template/.agent/workflows/write-be-spec.md +1 -1
  49. package/template/.agent/workflows/write-fe-spec-write.md +62 -3
  50. package/template/.agent/workflows/write-fe-spec.md +1 -1
@@ -0,0 +1,23 @@
1
+ # Input Classification Table
2
+
3
+ Classify user-provided input to determine which mode the `idea-extraction` skill operates in.
4
+
5
+ | Input Type | Detection Criteria | Extraction Mode |
6
+ |---|---|---|
7
+ | **Rich document** | >5KB, detailed docs, design conversations, prior specs | Extraction |
8
+ | **Thin document** | <5KB, structured but shallow (bullet list, rough PRD) | Expansion |
9
+ | **Conversational dump** | Chat logs, unstructured conversation transcripts | Extraction (with noise filtering) |
10
+ | **Verbal / one-liner** | User describes idea in chat, no files | Interview |
11
+ | **Nothing** | "I want to build an app" or similar zero-context input | Interview (deep) |
12
+
13
+ ## Mode References
14
+
15
+ Each mode's full process is defined in `.agent/skills/idea-extraction/SKILL.md`:
16
+
17
+ - **Extraction Mode** → `## Input-Adaptive Modes → Extraction Mode — Rich Input`
18
+ - **Expansion Mode** → `## Input-Adaptive Modes → Expansion Mode — Thin Input`
19
+ - **Interview Mode** → `## Input-Adaptive Modes → Interview Mode — No Input / One-Liner`
20
+
21
+ ## Proportionality Rule (Extraction Mode only)
22
+
23
+ If source input > 50KB, total ideation output must be ≥ 30% of source line count.
@@ -0,0 +1,44 @@
1
+ # Map Guard Protocol
2
+
3
+ **Purpose**: Enforce strict surface stack map verification before any workflow step that depends on tech stack decisions. No timing fallbacks. No conversation-confirmed values.
4
+
5
+ ---
6
+
7
+ ## Procedure
8
+
9
+ ### 1. Read the Map
10
+
11
+ Read the surface stack map from `.agent/instructions/tech-stack.md`.
12
+
13
+ ### 2. Check Required Cells
14
+
15
+ For the current workflow, verify that every cell the workflow depends on is filled (non-empty, no `{{PLACEHOLDER}}` literal).
16
+
17
+ Required cells vary by workflow — check the `requires_placeholders` frontmatter of the current workflow file, or the specific cells referenced in the workflow steps.
18
+
19
+ ### 3. Hard Gate
20
+
21
+ **If ANY required cell is empty:**
22
+
23
+ > **HARD STOP** — The surface stack map has empty cells required by this workflow.
24
+ >
25
+ > | Empty Cell | Recovery |
26
+ > |---|---|
27
+ > | Languages / Databases / Frameworks | Run `/create-prd-stack` |
28
+ > | Auth / Security | Run `/create-prd-security` |
29
+ > | CI/CD / Hosting | Run `/create-prd-stack` (dev tooling axis) |
30
+ > | Commands section | Run `/bootstrap-agents` |
31
+ > | `structure.md` | Run `/create-prd-compile` Step 9.5 |
32
+ > | `patterns.md` | Run `/bootstrap-agents-provision` |
33
+ >
34
+ > Do NOT proceed. Do NOT use conversation-confirmed values. Do NOT apply timing fallbacks. If the cell should have been filled by a previous workflow step, the previous step has a bug — surface it.
35
+
36
+ ---
37
+
38
+ ## What This Replaces
39
+
40
+ This protocol replaces all instances of the timing fallback pattern:
41
+
42
+ > ~~"If a cell is empty but the value was just confirmed in the current conversation... proceed using the conversation-confirmed value"~~
43
+
44
+ That pattern is **permanently banned**. It creates an escape hatch that allows agents to bypass map guards entirely. If a cell is empty, the upstream workflow that should have filled it has a bug. Surface the bug, don't work around it.
@@ -0,0 +1,20 @@
1
+ # Persona Completeness Gate
2
+
3
+ Applies to every persona in `meta/personas.md` during ideation.
4
+
5
+ ## Required Fields (6)
6
+
7
+ Every persona must have all 6 fields populated before proceeding past persona exploration:
8
+
9
+ 1. **Name + specific role** — not generic ("Shop Owner" not "User")
10
+ 2. **Specific pain point** — the problem this product solves for them
11
+ 3. **Current workaround** — how they solve it today without this product
12
+ 4. **Success criteria** — what "solved" looks like for them (measurable)
13
+ 5. **Switching trigger** — what event would make them adopt this product
14
+ 6. **Edge case or constraint** — at least one thing unique to this persona (regulatory, workflow, scale)
15
+
16
+ ## Enforcement
17
+
18
+ If any field is absent for any persona → probe the user before proceeding.
19
+
20
+ Reference: `.agent/skills/pipeline-rubrics/references/ideation-rubric.md` Dimension 2.
@@ -0,0 +1,76 @@
1
+ # Shard Boundary Analysis
2
+
3
+ Reference data for the decompose-architecture workflow — shard boundary heuristics, load thresholds, classification types, and split proposal format.
4
+
5
+ ## Fractal Tree Signals for Shard Boundaries
6
+
7
+ | Signal | What It Means for Sharding |
8
+ |--------|---------------------------|
9
+ | Deep fractal tree (3+ levels) | Domain is complex enough for its own shard |
10
+ | Many children (5+ features) | Consider splitting into multiple shards |
11
+ | Dense CX file (5+ cross-cuts) | High coupling — keep together in one shard, or isolate carefully |
12
+ | Rich Role Matrix (3+ roles with access) | Shard needs multi-role IA spec coverage |
13
+ | Hub-and-spoke shared domains | Shared domains often become `00-*` cross-cutting shards |
14
+ | Leaf features marked `[EXHAUSTED]` | Most confident for shard scoping — behavior is fully defined |
15
+
16
+ ## Standard Boundary Heuristics
17
+
18
+ - Features that share the same data models belong together
19
+ - Features that can be developed/deployed independently are candidates for separation
20
+ - Features that share the same access control model may belong together
21
+ - Cross-cutting concerns (auth, API conventions, error handling) become `00-*` shards
22
+
23
+ ## Shard Load Thresholds (Pre-check from Ideation)
24
+
25
+ | Ideation Sub-Areas | Pre-Check Action |
26
+ |---|---|
27
+ | ≤6 | ✅ No concern — proceed |
28
+ | 7–9 | ⚠️ **Pre-flag for split review** — note in the shard skeleton |
29
+ | ≥10 | 🚩 **Proactive split proposal** — present to user NOW before calibration gate |
30
+
31
+ ## Sub-feature Count Thresholds (Calibration Gate)
32
+
33
+ Count sub-features using the **bullet/named-item rule**: count every bullet or named item under `## Features`, excluding group headers that introduce a group but are not themselves a concrete capability. Sub-bullets count independently. Test: "Would a product manager list this as a separate line item in a release note?"
34
+
35
+ | Sub-feature Count | Action |
36
+ |-------------------|--------|
37
+ | **≤6** | ✅ OK — proceed |
38
+ | **7–9** | ⚠️ Flag for user review — present sub-feature list and ask: "Keep as-is, or split?" |
39
+ | **≥10** | 🛑 **Hard stop** — present mandatory split proposal. No shard may exit with ≥10 sub-features. |
40
+
41
+ ## Shard Document Type Classification
42
+
43
+ | Classification | Expected BE Specs |
44
+ |---------------|-------------------|
45
+ | **Feature domain** | 1 |
46
+ | **Multi-domain** | N (split along sub-feature boundaries) |
47
+ | **Cross-cutting** | 1 (`00-*`) |
48
+ | **Structural reference** | 0 |
49
+
50
+ Annotation format for shard skeletons:
51
+ ```markdown
52
+ > **Document Type** (preliminary): Feature domain | Multi-domain | Cross-cutting | Structural reference
53
+ ```
54
+
55
+ ## Split Proposal Format
56
+
57
+ When a shard exceeds the ≥10 threshold:
58
+
59
+ ```
60
+ Shard [NN] — [domain name] has [N] sub-features (threshold: ≥10 → mandatory split)
61
+
62
+ Current sub-features:
63
+ 1. [sub-feature]
64
+ 2. [sub-feature]
65
+ ...
66
+
67
+ Proposed split:
68
+ [NN]a — [new domain name] → file: docs/plans/ia/[NN]a-[domain].md
69
+ Sub-features: 1, 3, 5
70
+ [NN]b — [new domain name] → file: docs/plans/ia/[NN]b-[domain].md
71
+ Sub-features: 2, 4, 6
72
+
73
+ Split rationale: [why these groups are independent]
74
+ ```
75
+
76
+ **After any split**: Update `docs/plans/ia/decomposition-plan.md` with the revised table and re-run the Must Have coverage gate.
@@ -0,0 +1,57 @@
1
+ # Write Verification Protocol
2
+
3
+ **Purpose**: Every file write MUST be verified by reading the file back. This protocol eliminates the ~18 instances of "write the completed section" without verification.
4
+
5
+ ---
6
+
7
+ ## Procedure
8
+
9
+ ### 1. Write
10
+
11
+ Write the content to the target file at the specified section.
12
+
13
+ ### 2. Read Back
14
+
15
+ Immediately after writing, read the target file. Locate the section header that was just written.
16
+
17
+ ### 3. Verify
18
+
19
+ Check ALL of these conditions:
20
+
21
+ - [ ] The section header exists in the file
22
+ - [ ] The section content is non-empty (not just a header with no body)
23
+ - [ ] The content matches what was intended (key fields present, no truncation)
24
+
25
+ ### 4. Handle Failure
26
+
27
+ **If ANY check fails:**
28
+
29
+ 1. Log: "Write verification failed for `[file]` section `[section]`."
30
+ 2. Retry the write once.
31
+ 3. Read back again and re-verify.
32
+ 4. If second attempt fails → **STOP**: "Unable to write `[section]` to `[file]` after 2 attempts. Investigate before proceeding."
33
+
34
+ ### 5. Confirm
35
+
36
+ After successful verification, log: `Write verified: [file] § [section]`
37
+
38
+ ---
39
+
40
+ ## When to Use
41
+
42
+ Any workflow step that says:
43
+ - "Write the completed [section]"
44
+ - "Write [content] to [file]"
45
+ - "Update [file] with [content]"
46
+ - "Append [content] to [file]"
47
+
48
+ MUST follow this protocol. There are no exceptions. A write instruction without read-back verification is an enforcement failure.
49
+
50
+ ---
51
+
52
+ ## Scope
53
+
54
+ This protocol applies to **spec and instruction file writes** — the documents that drive downstream pipeline behavior. It does NOT apply to:
55
+ - Progress tracking file writes (those have their own verification in the completion checklist)
56
+ - Temporary/scratch files
57
+ - Audit report writes (those are progressive and self-verifying)
@@ -24,23 +24,17 @@ Design the high-level system architecture and data strategy. Create the data pla
24
24
 
25
25
  ## 0. Map guard
26
26
 
27
- Read the surface stack map from `.agent/instructions/tech-stack.md`. Check the following columns/categories for filled values:
27
+ Follow the map guard protocol (`.agent/skills/prd-templates/references/map-guard-protocol.md`). Required cells for this shard:
28
28
 
29
- | Map Location | Column/Category | Recovery | Why this matters |
30
- |---|---|---|---|
31
- | Cross-Cutting | Hosting | Run `/create-prd-stack` to confirm hosting provider, then bootstrap. | Deployment topology (Step 4.3) needs hosting-specific conventions. |
32
- | Per-Surface (shared) | ORMs | Run `/create-prd-stack` to confirm ORM, then bootstrap. | Migration strategy (Step 5.4) needs ORM-specific schema conventions. |
33
- | Per-Surface (shared) | Databases | Run `/create-prd-stack` to confirm database(s), then bootstrap. | Data strategy (Step 5) needs database-specific schema design patterns. |
29
+ | Map Location | Column/Category | Why this matters |
30
+ |---|---|---|
31
+ | Cross-Cutting | Hosting | Deployment topology (Step 4.3) needs hosting-specific conventions. |
32
+ | Per-Surface (shared) | ORMs | Migration strategy (Step 5.4) needs ORM-specific schema conventions. |
33
+ | Per-Surface (shared) | Databases | Data strategy (Step 5) needs database-specific schema design patterns. |
34
34
 
35
- > **Timing fallback**: During `/create-prd`, the map may be partially populated. If a cell is empty but the value was just confirmed in the current conversation (from `/create-prd-stack`), proceed using the conversation-confirmed value. Bootstrap will fill the map after `/create-prd` completes.
35
+ **HARD GATE** If ANY required cell is empty STOP. No timing fallbacks. No conversation-confirmed values. See map guard protocol for recovery.
36
36
 
37
- If cells are empty AND the value hasn't been confirmed in conversation → **HARD STOP**: tell the user to run `/create-prd-stack` first.
38
-
39
- Read `## Engagement Tier` from `docs/plans/ideation/ideation-index.md`.
40
-
41
- **Tier behavior for architecture decisions:**
42
- - 🤖 **Auto**: Agent designs system architecture + data strategy via Deep Think. Writes reasoning. Marks decisions `[AUTO-CONFIRMED]`. User reviews at end of shard.
43
- - 🤝 **Hybrid** / 💬 **Interactive**: Present each major section, walk through, wait for user confirmation (current behavior).
37
+ Read the engagement tier protocol (`.agent/skills/prd-templates/references/engagement-tier-protocol.md`) apply the tier behavior for architecture decisions.
44
38
 
45
39
  ---
46
40
 
@@ -76,9 +70,9 @@ For each component, also define:
76
70
  - "Are there failure modes I haven't accounted for?"
77
71
  - For multi-surface: "What happens if the sync layer goes down? Can each surface degrade gracefully?"
78
72
 
79
- Refine based on discussion before proceeding.
73
+ Follow the decision confirmation protocol (`.agent/skills/prd-templates/references/decision-confirmation-protocol.md`) — do not write until explicitly confirmed.
80
74
 
81
- Write the completed `## System Architecture` section to `docs/plans/architecture-draft.md` (create the file if it does not exist). Do not wait until the end — write this section as soon as it is completed and confirmed by the user.
75
+ Write the completed `## System Architecture` section to `docs/plans/architecture-draft.md` (create the file if it does not exist). Do not wait until the end — write this section as soon as it is completed and confirmed by the user. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
82
76
 
83
77
  > **Decision recording**: For each non-trivial architecture decision (technology choices, deployment topology, API style, failure handling strategy), read `.agent/skills/session-continuity/protocols/06-decision-analysis.md` and follow the **Decision Effect Analysis Protocol**. Architecture decisions have the highest downstream impact in the pipeline — record them to `memory/decisions.md` with the Philosopher + Devil's Advocate deliberation.
84
78
 
@@ -88,7 +82,7 @@ Write the completed `## System Architecture` section to `docs/plans/architecture
88
82
 
89
83
  Read `.agent/skills/error-handling-patterns/SKILL.md` and follow its Error Architecture Interview methodology. All 5 decisions must receive explicit user confirmation before proceeding to Data Strategy. This step is a hard gate — do not proceed until all five decisions are confirmed.
90
84
 
91
- Write the completed decisions to `docs/plans/architecture-draft.md` under a new top-level `## Error Architecture` section (between `## System Architecture` and `## Data Strategy`). The section must contain five sub-sections matching the five decisions above (`### Global Error Envelope`, `### Error Propagation Chain`, `### Unhandled Exception Strategy`, `### Client Fallback Contract`, `### Error Boundary Strategy`), with the locked canonical JSON example included verbatim under `### Global Error Envelope`.
85
+ Write the completed decisions to `docs/plans/architecture-draft.md` under a new top-level `## Error Architecture` section (between `## System Architecture` and `## Data Strategy`). The section must contain five sub-sections matching the five decisions above (`### Global Error Envelope`, `### Error Propagation Chain`, `### Unhandled Exception Strategy`, `### Client Fallback Contract`, `### Error Boundary Strategy`), with the locked canonical JSON example included verbatim under `### Global Error Envelope`. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
92
86
 
93
87
  ## 5. Data strategy
94
88
 
@@ -111,22 +105,22 @@ For multi-surface projects, additionally define:
111
105
  - "Does every entity have a clear owner?"
112
106
  - "Are there query patterns I'm missing that could become hot paths?"
113
107
 
114
- Refine based on discussion before proceeding.
108
+ Follow the decision confirmation protocol (`.agent/skills/prd-templates/references/decision-confirmation-protocol.md`) — do not write until explicitly confirmed.
115
109
 
116
- Write the completed `## Data Strategy` section to `docs/plans/architecture-draft.md`.
110
+ Write the completed `## Data Strategy` section to `docs/plans/architecture-draft.md`. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
117
111
 
118
112
  ### 5.5. Cross-Store Entity Consistency
119
113
 
120
114
  Read .agent/skills/database-schema-design/SKILL.md and follow its Cross-Store Entity Consistency Protocol for every entity that spans more than one store.
121
115
 
122
- Write the completed cross-store consistency table to `docs/plans/architecture-draft.md` as part of the `## Data Strategy` section.
116
+ Write the completed cross-store consistency table to `docs/plans/architecture-draft.md` as part of the `## Data Strategy` section. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
123
117
 
124
118
  ### Data placement strategy document
125
119
 
126
120
  Read `.agent/skills/prd-templates/references/data-placement-template.md` for the template structure. Create `docs/plans/data-placement-strategy.md` using the template, filling each section with the data decisions confirmed above.
127
121
 
128
- ### Propose next step
122
+ ### Next step
129
123
 
130
- System architecture and data placement strategy are complete. Next: Run `/create-prd-security` to define the security model, compliance escalation, and integration points.
124
+ **STOP** do NOT proceed to any other workflow. The only valid next step is `/create-prd-security`.
131
125
 
132
- > If this shard was invoked standalone (not from `/create-prd`), surface this via `notify_user`.
126
+ > If invoked standalone, surface via `notify_user` and wait for user confirmation.
@@ -20,29 +20,25 @@ requires_map_columns: [Unit Tests, E2E Tests, CI/CD]
20
20
 
21
21
  Document the development methodology and phasing strategy. Compile the architecture design document and engineering standards.
22
22
 
23
- **Prerequisite**: Security model and integration points must be defined (from `/create-prd-security`). All tech stack decisions, system architecture, data strategy, and security model must be complete.
23
+ **Prerequisite**: Security model and integration points must be defined (from `/create-prd-security`).
24
+
25
+ Verify `docs/plans/architecture-draft.md` exists. If it does not → **STOP**: "architecture-draft.md is missing. Previous shards should have created it. Run `/create-prd-architecture` first."
24
26
 
25
27
  ---
26
28
 
27
29
  ## 0. Map guard
28
30
 
29
- Read the surface stack map from `.agent/instructions/tech-stack.md`. Check the following columns/categories for filled values:
30
-
31
- | Map Location | Column/Category | Recovery | Why this matters |
32
- |---|---|---|---|
33
- | Per-Surface (any) | Unit Tests | Run `/create-prd-stack` to confirm unit testing framework, then bootstrap. | Development methodology (Step 8) needs framework-specific TDD patterns. |
34
- | Per-Surface (any) | E2E Tests | Run `/create-prd-stack` to confirm E2E testing framework, then bootstrap. | Development methodology (Step 8) needs E2E-specific test conventions. |
35
- | Cross-Cutting | CI/CD | Run `/create-prd-stack` to confirm CI/CD platform, then bootstrap. | Phasing strategy (Step 9) needs platform-specific pipeline patterns. |
31
+ Follow the map guard protocol (`.agent/skills/prd-templates/references/map-guard-protocol.md`). Required cells for this shard:
36
32
 
37
- > **Timing fallback**: During `/create-prd`, the map may be partially populated. If a cell is empty but the value was just confirmed in the current conversation (from `/create-prd-stack`), proceed using the conversation-confirmed value. Bootstrap will fill the map after `/create-prd` completes.
33
+ | Map Location | Column/Category | Why this matters |
34
+ |---|---|---|
35
+ | Per-Surface (any) | Unit Tests | Development methodology (Step 8) needs framework-specific TDD patterns. |
36
+ | Per-Surface (any) | E2E Tests | Development methodology (Step 8) needs E2E-specific test conventions. |
37
+ | Cross-Cutting | CI/CD | Phasing strategy (Step 9) needs platform-specific pipeline patterns. |
38
38
 
39
- If cells are empty AND the value hasn't been confirmed in conversation **HARD STOP**: tell the user to run `/create-prd-stack` first.
39
+ **HARD GATE** If ANY required cell is empty STOP. No timing fallbacks. No conversation-confirmed values. See map guard protocol for recovery.
40
40
 
41
- Read `## Engagement Tier` from `docs/plans/ideation/ideation-index.md`.
42
-
43
- **Tier behavior for compile decisions:**
44
- - 🤖 **Auto**: Agent selects methodology, phasing, and performance budgets via Deep Think. Writes reasoning. Marks `[AUTO-CONFIRMED]`. User reviews compiled documents.
45
- - 🤝 **Hybrid** / 💬 **Interactive**: Present each decision, wait for user confirmation (current behavior).
41
+ Read the engagement tier protocol (`.agent/skills/prd-templates/references/engagement-tier-protocol.md`) — apply the tier behavior for compile decisions.
46
42
 
47
43
  ---
48
44
 
@@ -59,7 +55,7 @@ Document the agreed approach:
59
55
  4. **Spec layers** — IA → BE → FE pipeline
60
56
  5. **Quality gates** — What must pass before merge
61
57
 
62
- Write the completed `## Development Methodology` section to `docs/plans/architecture-draft.md` immediately after user confirmation.
58
+ Write the completed `## Development Methodology` section to `docs/plans/architecture-draft.md` immediately after user confirmation. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
63
59
 
64
60
  ## 9. Phasing strategy
65
61
 
@@ -83,9 +79,9 @@ Each phase should have a rough timeline estimate and must pass the full validati
83
79
  - "Are there features in Phase 2 that actually depend on something not in Phase 1?"
84
80
  - "Is the Phase 1 scope achievable without cutting quality?"
85
81
 
86
- Refine based on discussion before proceeding.
82
+ Follow the decision confirmation protocol (`.agent/skills/prd-templates/references/decision-confirmation-protocol.md`) — do not write until explicitly confirmed.
87
83
 
88
- Write the completed `## Phasing Strategy` section to `docs/plans/architecture-draft.md` immediately after user confirmation.
84
+ Write the completed `## Phasing Strategy` section to `docs/plans/architecture-draft.md` immediately after user confirmation. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
89
85
 
90
86
  ## 9.5. Lock project directory structure
91
87
 
@@ -95,7 +91,7 @@ Based on the locked tech stack, generate a canonical directory tree.
95
91
  2. Present the tree to the user with one-line descriptions per top-level directory. Adapt the tree to the actual stack — e.g., a CLI project won't have `components/`, a monorepo will have `apps/` and `packages/`
96
92
  3. Build an architecture separation table mapping each concern to its directory and runtime
97
93
  4. **Present to user**: Show the directory tree and architecture table. Ask: "Does this structure match your expectations?" **Do not proceed until explicit approval.**
98
- 5. After approval, fire bootstrap with: `PROJECT_STRUCTURE`, `ARCHITECTURE_TABLE`, `CONTRACTS_DIR`, `BUILD_OUTPUT_DIR`
94
+ 5. After approval, fire bootstrap with: `PROJECT_STRUCTURE`, `ARCHITECTURE_TABLE`, `CONTRACTS_DIR`, `BUILD_OUTPUT_DIR`. **HARD GATE**: Follow the bootstrap verification protocol (`.agent/skills/prd-templates/references/bootstrap-verification-protocol.md`) — verify all 4 keys.
99
95
  6. Append a `## Directory Structure` section to `docs/plans/architecture-draft.md`
100
96
 
101
97
  > If invoked standalone, surface via `notify_user`.
@@ -106,7 +102,18 @@ Read .agent/skills/technical-writer/SKILL.md and follow its methodology.
106
102
 
107
103
  Read .agent/skills/technical-writer/SKILL.md and apply its clarity and structure standards throughout document compilation.
108
104
 
109
- Read `docs/plans/architecture-draft.md` as the authoritative source. Read `.agent/skills/prd-templates/references/architecture-design-template.md` for the document structure. Compile it into `docs/plans/YYYY-MM-DD-architecture-design.md` (use today's date).
105
+ Read `docs/plans/architecture-draft.md` as the authoritative source.
106
+
107
+ **Section validation**: Before compiling, verify these sections exist in architecture-draft.md:
108
+ - `## System Architecture`
109
+ - `## Error Architecture`
110
+ - `## Data Strategy`
111
+ - `## Security Model`
112
+ - `## Integration Points` (or explicit "no integrations" note)
113
+
114
+ If any required section is missing → **STOP**: "architecture-draft.md is missing `[section]`. This section should have been written by a previous shard. Run the relevant shard: architecture → `/create-prd-architecture`, security → `/create-prd-security`."
115
+
116
+ Read `.agent/skills/prd-templates/references/architecture-design-template.md` for the document structure. Compile it into `docs/plans/YYYY-MM-DD-architecture-design.md` (use today's date).
110
117
 
111
118
  > **Depth rule**: Each section must contain the full detail gathered during steps 3-9. If a section is under 200 words, it's almost certainly too shallow. Apply the two-implementer test.
112
119
 
@@ -142,6 +149,8 @@ Call `notify_user` presenting:
142
149
 
143
150
  > **Both documents must be approved before proceeding. Do NOT proceed until the user sends a message explicitly approving this output.**
144
151
 
145
- ### Proposed next steps
152
+ ### Next step
153
+
154
+ **STOP** — do NOT propose `/decompose-architecture` or any other pipeline workflow. The only valid next step is:
146
155
 
147
- **Hard gate**: Run `/audit-ambiguity architecture`. This is unconditionally mandatory the self-check above cannot replace it.
156
+ - `/audit-ambiguity architecture` unconditionally mandatory. The self-check above cannot replace an independent audit.
@@ -31,9 +31,7 @@ Establish the structural UI architecture — navigation paradigm, layout grid, p
31
31
 
32
32
  Read `## Engagement Tier` from `docs/plans/ideation/ideation-index.md`.
33
33
 
34
- **Tier behavior for design system decisions** (all 7 decisions are product decisions):
35
- - 🤖 **Auto**: Agent selects based on design direction + constraints via Deep Think. Writes reasoning. Marks `[AUTO-CONFIRMED]`. User reviews compiled `design-system.md` at Step 9.
36
- - 🤝 **Hybrid** / 💬 **Interactive**: Present options, wait for explicit confirmation per decision (current behavior).
34
+ Read the engagement tier protocol (`.agent/skills/prd-templates/references/engagement-tier-protocol.md`) — apply the tier behavior for design system decisions (all 7 decisions are product decisions).
37
35
 
38
36
  1. Read `docs/plans/ideation/meta/constraints.md` — extract the **Project Surfaces** section. Read `docs/plans/ideation/ideation-index.md` — extract the feature inventory from the MoSCoW Summary.
39
37
  2. Read `.agent/skills/brand-guidelines/SKILL.md` — extract the confirmed `DESIGN_DIRECTION`.
@@ -50,9 +48,13 @@ Present surface-appropriate options from the **Navigation Paradigm Options** sec
50
48
 
51
49
  > **Decision prompt**: "Which navigation pattern fits your app's usage pattern and audience?"
52
50
 
53
- **Wait for explicit user confirmation before proceeding.**
51
+ **Tier-aware confirmation** *(applies to all 7 decisions in this shard)*:
52
+ - **Interactive/Hybrid** → "Wait for explicit user confirmation" means present and wait.
53
+ - **Auto** → auto-confirm with Deep Think reasoning. Write the decision with `[AUTO-CONFIRMED]` tag. The Auto Tier Review Checkpoint in `/ideate-validate` or the review in Step 9 is where the user can override.
54
+
55
+ **Wait for explicit user confirmation before proceeding** *(Interactive/Hybrid)* or auto-confirm with Deep Think *(Auto)*.
54
56
 
55
- On confirmation, write the `## Navigation Paradigm` section to `docs/plans/design-system.md` immediately.
57
+ On confirmation, write the `## Navigation Paradigm` section to `docs/plans/design-system.md` immediately. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
56
58
 
57
59
  ---
58
60
 
@@ -67,7 +69,7 @@ Provide a **default recommendation** based on the confirmed design direction:
67
69
 
68
70
  **Wait for explicit user confirmation before proceeding.**
69
71
 
70
- On confirmation, write the `## Layout Grid` table to `docs/plans/design-system.md`.
72
+ On confirmation, write the `## Layout Grid` table to `docs/plans/design-system.md`. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
71
73
 
72
74
  ---
73
75
 
@@ -77,7 +79,7 @@ Based on the feature inventory from `ideation-index.md`, propose a named archety
77
79
 
78
80
  Present the proposed archetypes to the user. Ask whether any are missing or should be renamed. **Wait for explicit user confirmation before proceeding.**
79
81
 
80
- On confirmation, write the `## Page Archetypes` section to `docs/plans/design-system.md`.
82
+ On confirmation, write the `## Page Archetypes` section to `docs/plans/design-system.md`. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
81
83
 
82
84
  ---
83
85
 
@@ -89,7 +91,7 @@ Present the derived list. Ask: (1) Are any components missing? (2) Should any be
89
91
 
90
92
  **Wait for explicit user confirmation before proceeding.**
91
93
 
92
- On confirmation, write the `## Global Component Inventory` section to `docs/plans/design-system.md`. This serves as the **Component Inventory Seed** — all FE specs must consume (not re-invent) these global components.
94
+ On confirmation, write the `## Global Component Inventory` section to `docs/plans/design-system.md`. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`). This serves as the **Component Inventory Seed** — all FE specs must consume (not re-invent) these global components.
93
95
 
94
96
  ---
95
97
 
@@ -97,7 +99,7 @@ On confirmation, write the `## Global Component Inventory` section to `docs/plan
97
99
 
98
100
  Present the options from the **Motion Language Options** in `design-system-decisions.md`. Present a recommendation based on the confirmed design direction. **Wait for explicit user confirmation before proceeding.**
99
101
 
100
- On confirmation, write the `## Motion Language` section to `docs/plans/design-system.md`.
102
+ On confirmation, write the `## Motion Language` section to `docs/plans/design-system.md`. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
101
103
 
102
104
  ---
103
105
 
@@ -105,7 +107,7 @@ On confirmation, write the `## Motion Language` section to `docs/plans/design-sy
105
107
 
106
108
  Present the options from the **Data Density Options** in `design-system-decisions.md`. If **Hybrid** is selected, ask the user to define per-archetype density rules. **Wait for explicit user confirmation before proceeding.**
107
109
 
108
- On confirmation, write the `## Data Density Philosophy` section to `docs/plans/design-system.md`.
110
+ On confirmation, write the `## Data Density Philosophy` section to `docs/plans/design-system.md`. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
109
111
 
110
112
  ---
111
113
 
@@ -113,7 +115,7 @@ On confirmation, write the `## Data Density Philosophy` section to `docs/plans/d
113
115
 
114
116
  Two-part decision. Present the loading state, error state, and empty state options from the **Global State Design Language Options** in `design-system-decisions.md`. Present recommendations based on the confirmed design direction. **Wait for explicit user confirmation before proceeding.**
115
117
 
116
- On confirmation, write the `## Global State Design Language` section to `docs/plans/design-system.md`.
118
+ On confirmation, write the `## Global State Design Language` section to `docs/plans/design-system.md`. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
117
119
 
118
120
  ---
119
121
 
@@ -128,10 +130,12 @@ Verify:
128
130
 
129
131
  If any section is incomplete, loop back to the relevant decision step and resolve with the user.
130
132
 
133
+ **Completeness loop guard**: If the same section fails completeness 2 times → **STOP**: present the incomplete section to the user with what's missing and ask: "Provide the missing content directly, or accept this section as-is with a note?"
134
+
131
135
  ---
132
136
 
133
- ### Propose next step
137
+ ### Next step
134
138
 
135
- Design system decisions are locked. Next: Run `/create-prd-architecture` to design the system architecture and data strategy.
139
+ **STOP** do NOT proceed to any other workflow. The only valid next step is `/create-prd-architecture`.
136
140
 
137
- > If this shard was invoked standalone (not from `/create-prd`), surface this via `notify_user`.
141
+ > If invoked standalone, surface via `notify_user` and wait for user confirmation.
@@ -26,22 +26,16 @@ Define the security model with full compliance escalation, and document all inte
26
26
 
27
27
  ## 0. Map guard
28
28
 
29
- Read the surface stack map from `.agent/instructions/tech-stack.md`. Check the following cross-cutting categories for filled values:
29
+ Follow the map guard protocol (`.agent/skills/prd-templates/references/map-guard-protocol.md`). Required cells for this shard:
30
30
 
31
- | Map Location | Category | Recovery | Why this matters |
32
- |---|---|---|---|
33
- | Cross-Cutting | Security | Run `/create-prd-stack` to confirm security framework, then bootstrap. | Security model (Step 6) needs stack-specific threat analysis patterns. |
34
- | Cross-Cutting | Auth | Run `/create-prd-stack` to confirm auth provider, then bootstrap. | Authentication design (Step 6.1) needs provider-specific auth flow patterns. |
31
+ | Map Location | Category | Why this matters |
32
+ |---|---|---|
33
+ | Cross-Cutting | Security | Security model (Step 6) needs stack-specific threat analysis patterns. |
34
+ | Cross-Cutting | Auth | Authentication design (Step 6.1) needs provider-specific auth flow patterns. |
35
35
 
36
- > **Timing fallback**: During `/create-prd`, the map may be partially populated. If a cell is empty but the value was just confirmed in the current conversation (from `/create-prd-stack`), proceed using the conversation-confirmed value. Bootstrap will fill the map after `/create-prd` completes.
36
+ **HARD GATE** If ANY required cell is empty STOP. No timing fallbacks. No conversation-confirmed values. See map guard protocol for recovery.
37
37
 
38
- If cells are empty AND the value hasn't been confirmed in conversation → **HARD STOP**: tell the user to run `/create-prd-stack` first.
39
-
40
- Read `## Engagement Tier` from `docs/plans/ideation/ideation-index.md`.
41
-
42
- **Tier behavior for security decisions:**
43
- - 🤖 **Auto**: Agent designs security model + attack surface + integrations via Deep Think. Writes reasoning. Marks `[AUTO-CONFIRMED]`. User reviews at end of shard.
44
- - 🤝 **Hybrid** / 💬 **Interactive**: Present each section, walk through, wait for user confirmation (current behavior).
38
+ Read the engagement tier protocol (`.agent/skills/prd-templates/references/engagement-tier-protocol.md`) apply the tier behavior for security decisions.
45
39
 
46
40
  ---
47
41
 
@@ -52,6 +46,9 @@ Read .agent/skills/security-scanning-security-hardening/SKILL.md and follow its
52
46
  Load the Auth and Security skill(s) from the cross-cutting section per the skill loading protocol (`.agent/skills/prd-templates/references/skill-loading-protocol.md`).
53
47
 
54
48
  1. **Authentication** — How do users prove identity?
49
+
50
+ **No-auth project detection**: If the ideation output indicates no user accounts, no login, and no personalized data (e.g., a static content site, CLI tool, or public API) → skip items 1-2 and 5. Write a `## Security Model` section that documents WHY auth is not needed, and cover only items 3-4 and 6-8. If the project has partial auth (e.g., admin-only auth, API keys but no user accounts), scope items 1-2 to the applicable auth surface only.
51
+
55
52
  2. **Authorization** — RBAC vs ABAC? Permission model?
56
53
  3. **Data protection** — PII handling, encryption at rest/transit
57
54
  4. **Input validation** — Where and how? (Zod recommended for TypeScript)
@@ -76,13 +73,13 @@ Read .agent/skills/resolve-ambiguity/SKILL.md and follow its methodology.
76
73
  - "Can you think of a way to bypass any of these controls?"
77
74
  - "Are there edge cases in the age/payment/compliance flows I haven't covered?"
78
75
 
79
- Refine based on discussion before proceeding.
76
+ Follow the decision confirmation protocol (`.agent/skills/prd-templates/references/decision-confirmation-protocol.md`) — do not write until explicitly confirmed.
80
77
 
81
78
  **Bootstrap fire — security decision confirmed**
82
79
 
83
- If the security model confirmed a specific security framework or compliance approach (e.g., crypto patterns, custom HSM approach), read `.agent/workflows/bootstrap-agents.md` and invoke `/bootstrap-agents SECURITY=[confirmed value]` to provision additional skills. Note: surface-triggered security skills (`owasp-web-security`, `csp-cors-headers`, `input-sanitization`, `api-security-checklist`, `dependency-auditing`, `desktop-security-sandboxing`) are provisioned automatically by bootstrap when surfaces are confirmed in `/create-prd-stack` — no manual fire needed for those.
80
+ If the security model confirmed a specific security framework or compliance approach (e.g., crypto patterns, custom HSM approach), read `.agent/workflows/bootstrap-agents.md` and invoke `/bootstrap-agents SECURITY=[confirmed value]` to provision additional skills. **HARD GATE**: Follow the bootstrap verification protocol (`.agent/skills/prd-templates/references/bootstrap-verification-protocol.md`). Note: surface-triggered security skills (`owasp-web-security`, `csp-cors-headers`, `input-sanitization`, `api-security-checklist`, `dependency-auditing`, `desktop-security-sandboxing`) are provisioned automatically by bootstrap when surfaces are confirmed in `/create-prd-stack` — no manual fire needed for those.
84
81
 
85
- Write the completed `## Security Model` section to `docs/plans/architecture-draft.md` immediately after user confirmation. Do not wait for later steps.
82
+ Write the completed `## Security Model` section to `docs/plans/architecture-draft.md` immediately after user confirmation. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`). Do not wait for later steps.
86
83
 
87
84
  ## 6.5. Attack Surface Review
88
85
 
@@ -92,10 +89,12 @@ Read .agent/skills/security-scanning-security-hardening/SKILL.md and follow its
92
89
  - "Are there any attack vectors I've missed for your specific domain?"
93
90
  - "Do the OWASP mechanisms look correct, or are any of them actually handled differently?"
94
91
 
95
- Write the completed `## Security — Attack Surface` section to `docs/plans/architecture-draft.md` immediately after user confirmation.
92
+ Write the completed `## Security — Attack Surface` section to `docs/plans/architecture-draft.md` immediately after user confirmation. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
96
93
 
97
94
  ## 7. Integration points
98
95
 
96
+ **0-integrations check**: Scan the ideation output and architecture for external service dependencies. If there are genuinely 0 external integrations (no auth provider, no email service, no payment processor, no analytics, no CDN) → write a brief `## Integration Points` section stating: "No external service integrations identified. All functionality is self-contained." Skip the per-service framework below.
97
+
99
98
  For each external service:
100
99
 
101
100
  1. **What it provides** — Specific features used
@@ -103,21 +102,20 @@ For each external service:
103
102
  3. **Fallback strategy** — Graceful degradation plan
104
103
  4. **Cost model** — Pricing tier, expected usage
105
104
 
106
- Write the completed `## Integration Points` section to `docs/plans/architecture-draft.md` immediately after user confirmation.
105
+ Write the completed `## Integration Points` section to `docs/plans/architecture-draft.md` immediately after user confirmation. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
107
106
 
108
107
  ## 7.5. Observability Architecture
109
108
 
110
- Read .agent/skills/logging-best-practices/SKILL.md and follow its Observability Architecture Interview — all 5 decisions (logging, tracing, alerting, dashboards, retention) must be confirmed. Fire bootstrap per the skill's instructions for each confirmed tool.
109
+ Read .agent/skills/logging-best-practices/SKILL.md and follow its Observability Architecture Interview — all 5 decisions (logging, tracing, alerting, dashboards, retention) must be confirmed. Fire bootstrap per the skill's instructions for each confirmed tool. **HARD GATE**: Follow the bootstrap verification protocol (`.agent/skills/prd-templates/references/bootstrap-verification-protocol.md`).
111
110
 
112
111
  **Present to user**: Show the observability architecture decisions. Ask:
113
112
  - "Are these logging levels and PII exclusions correct for your compliance requirements?"
114
113
  - "Are the alerting thresholds appropriate for your expected traffic?"
115
114
 
116
- Write the completed `## Observability Architecture` section to `docs/plans/architecture-draft.md` immediately after user confirmation.
117
-
118
- ### Propose next step
115
+ Write the completed `## Observability Architecture` section to `docs/plans/architecture-draft.md` immediately after user confirmation. Follow the write verification protocol (`.agent/skills/prd-templates/references/write-verification-protocol.md`).
119
116
 
120
- Security model and integration points are defined. Next: Run `/create-prd-compile` to document the development methodology, phasing strategy, and compile the final architecture design document and Engineering Standards.
117
+ ### Next step
121
118
 
122
- > If this shard was invoked standalone (not from `/create-prd`), surface this via `notify_user`.
119
+ **STOP** do NOT proceed to any other workflow. The only valid next step is `/create-prd-compile`.
123
120
 
121
+ > If invoked standalone, surface via `notify_user` and wait for user confirmation.