You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Root cause: AI agents executing /product.implement skipped Step 3.4 (PDR
Lifecycle Management), leaving Accepted PDRs only in drafts with no copy
in memory/. The Final Completion Verification was too weak to catch this.
Fixes:
- Step 3.4: Added DO NOT SKIP warning with gate failure consequences
- Step 3.4: Added Step 4 (update state.json) and Step 5 (report)
- State schema: Added pdr_lifecycle object (pdrs_promoted, memory_pdr_written,
memory_pdr_location, drafts_retained, drafts_reason)
- State schema version: 1.1.0 -> 1.2.0 (DAG includes business section slugs)
- Final gate: 7 -> 9 checks (self-contained, memory written, lifecycle object)
- Check 6 flagged as most commonly skipped
Copy file name to clipboardExpand all lines: extensions/product/commands/implement.md
+58-24Lines changed: 58 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
description: Generate full Product Requirements Document (PRD) from PDRs using multi-agent DAG orchestration with mandatory checkpoint after Requirements
### Step 3.4: PDR Lifecycle Management (MANDATORY — DO NOT SKIP)
785
+
786
+
> **⚠️ THIS STEP IS MANDATORY.** The implement command CANNOT be marked "completed" without executing PDR lifecycle management. Skipping this step means the Final Completion Verification (checks 5 and 6) will FAIL, and `state.json` phase MUST NOT be set to "completed".
785
787
786
788
**Step 1: Filter Accepted PDRs**
787
-
- Identify PDRs with status "Accepted"
788
-
- Skip Discovered/Proposed PDRs
789
+
- Read `{REPO_ROOT}/.specify/drafts/pdr.md`
790
+
- Count PDRs with status "Accepted"
791
+
- Count PDRs with status "Proposed" or "Discovered"
789
792
790
-
**Step 2: Copy to Canonical Location**
793
+
**Step 2: Copy Accepted PDRs to Memory (MANDATORY)**
791
794
- Write Accepted PDRs to `{REPO_ROOT}/.specify/memory/pdr.md`
792
-
- Merge with existing content
795
+
- If `memory/pdr.md` already exists, merge (append new PDRs, update existing)
796
+
-**Verify file was written**: `ls -la {REPO_ROOT}/.specify/memory/pdr.md`
797
+
-**If write fails → STOP and report error**
793
798
794
799
**Step 3: Clean Up Drafts**
795
-
- Remove promoted PDRs from drafts
796
-
- If no PDRs remain → DELETE drafts file
800
+
- If ALL PDRs are Accepted → drafts file may be retained for cross-reference analysis
801
+
- If some PDRs remain Proposed/Discovered → keep only those in drafts
802
+
- Set `pdr_lifecycle.drafts_retained` and `pdr_lifecycle.drafts_reason` in state.json
803
+
804
+
**Step 4: Update state.json with Lifecycle Fields**
805
+
```json
806
+
"pdr_lifecycle": {
807
+
"pdrs_promoted": [N],
808
+
"memory_pdr_written": true,
809
+
"memory_pdr_location": ".specify/memory/pdr.md",
810
+
"drafts_retained": true|false,
811
+
"drafts_reason": "[reason if retained]"
812
+
}
813
+
```
797
814
798
-
**Step 4: Report Lifecycle Changes**
815
+
**Step 5: Report Lifecycle Changes**
799
816
```
800
817
📋 PDR Lifecycle Summary:
801
818
├── Promoted to memory: [N] Accepted PDRs
819
+
├── Memory file: .specify/memory/pdr.md ✓
802
820
├── Remaining in drafts: [M] PDRs (Proposed/Discovered)
803
821
└── Cleanup verified: ✓
804
822
```
805
823
824
+
**Failure Mode**: If Step 2 (copy to memory) is not executed, the Final Completion Verification checks 5 and 6 will fail, blocking the "completed" state.
825
+
806
826
### Step 3.5: Generate Final Report
807
827
808
828
```markdown
@@ -842,31 +862,36 @@ If Mermaid rendering fails, ASCII diagrams are available in the full visual file
842
862
4. Begin feature development with `/spec.specify`
843
863
```
844
864
845
-
## Final Completion Verification (MANDATORY)
865
+
## Final Completion Verification (MANDATORY — ALL CHECKS MUST PASS)
866
+
867
+
> **⚠️ DO NOT set `phase: "completed"` until ALL checks pass.** This is a hard gate.
846
868
847
869
**Before marking state.json phase as "completed", verify:**
848
870
849
-
| Check | Expected | Verification | Status |
850
-
|-------|----------|--------------|--------|
851
-
| 1. Section files on disk | N files | List sections directory | ☐ |
@@ -891,12 +916,21 @@ If Mermaid rendering fails, ASCII diagrams are available in the full visual file
891
916
}
892
917
}
893
918
],
919
+
"pdr_lifecycle": {
920
+
"pdrs_promoted": 0,
921
+
"memory_pdr_written": false,
922
+
"memory_pdr_location": ".specify/memory/pdr.md",
923
+
"drafts_retained": false,
924
+
"drafts_reason": ""
925
+
},
894
926
"conflicts_detected": [],
895
927
"conflicts_resolved": [],
896
928
"output_file": "PRD.md"
897
929
}
898
930
```
899
931
932
+
> **IMPORTANT**: The `pdr_lifecycle` object is MANDATORY. The Final Completion Verification checks `memory_pdr_written === true` before allowing phase "completed". If this field is `false`, the gate MUST fail.
Copy file name to clipboardExpand all lines: extensions/product/extension.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ schema_version: "1.0"
3
3
extension:
4
4
id: "product"
5
5
name: "Product - PRD & PDR Management"
6
-
version: "1.5.4"
6
+
version: "1.5.5"
7
7
description: "Create and manage Product Requirements Documents (PRD) and Product Decision Records (PDR) using multi-agent feature-area analysis with cross-area pattern detection, business stakeholder sections (Executive Summary, Market Opportunity, Investment, GTM), and self-contained PRD generation"
0 commit comments