Loading...
Loading...
Create PRDs through the gather-criticize loop, sync existing PRDs, push amendments, and check PRD status.
npx skill4agent add matthew-plusprogramming/monorepo prd.claude/memory-bank/org-context.md.claude/prds/.claude/prds/
├── <prd-id>/
│ └── prd.md # The PRD document (D-034 format)
└── <another-prd-id>/
└── .../prd # Start new PRD with gather-criticize loop
/prd <prd-id> # Resume or refine existing PRD
/prd sync <prd-id> # Import existing PRD, extract requirements to spec group
/prd amend <prd-id> # Push implementation discoveries back to PRD
/prd status <prd-id> # Check PRD state, pass count, pending findingsauth-revampnotificationsmkdir -p .claude/prds/<prd-id>/Task: prd-writer
Prompt: |
<context>
Mode: discovery
PRD ID: <prd-id>
User request: <original user request>
Cold start context:
- tech.context.md: <contents>
- org-context.md: <contents>
- Existing PRDs: <list of .claude/prds/*/prd.md>
Template: .claude/templates/prd-phase1.template.md
</context>
Conduct a conversational discovery interview with the human.
Follow D-004 (13 context dimensions), D-005 (cold start), D-006 (conversational),
D-007 (front-loaded input, natural breakpoints).
After discovery completes, produce a PRD in D-034 format.
Save to .claude/prds/<prd-id>/prd.md.claude/prds/<prd-id>/prd.mdApplicability: MANDATORY for oneoff-spec workflows. SKIP for oneoff-vibe.
Task: explore
Prompt: |
Investigate the codebase for integration surfaces relevant to the PRD at .claude/prds/<prd-id>/prd.md.
Search for:
1. Existing API endpoints, routes, or service interfaces that the proposal touches or extends
2. Shared database tables, schemas, or data models referenced
3. Configuration and environment variables involved (e.g., in .env files, config modules)
4. Event systems at boundaries (SSE, WebSocket, pub/sub, message queues)
5. Import/export relationships with modules the feature touches
Return a structured Integration Surface Report with:
- Touched Systems: list of existing systems/services with how they are touched
- Existing Contracts: API specs, type definitions, schemas already in place
- Potential Conflicts: areas where the proposed feature may conflict with existing behavior
- Configuration Dependencies: env vars, feature flags, config files involved
- Cross-Cutting Concerns: shared state, caching, event systems, logging pipelines
Return structured findings, not raw code.Task: prd-writer
Prompt: |
<context>
Mode: amendment
PRD path: .claude/prds/<prd-id>/prd.md
Pass number: 0 (pre-critique integration surface population)
Integration Surface Report:
<structured findings from Explore subagent>
</context>
Add the exploration findings to the "Integration Surface" section of the PRD.
Populate: Touched Systems table, New Boundaries Created, Configuration Dependencies,
and Cross-Cutting Concerns subsections.
Do NOT modify any other section of the PRD.
Save the complete amended PRD to disk.Applicability: Optional for all workflows. Human chooses whether to provide TAD input. Purpose: Allow humans to front-load architectural decisions before spec authoring, reducing investigation findings downstream.
Would you like to provide technical architecture input before critique begins?
This optional TAD (Technical Architecture Design) phase lets you specify:
- Key architectural decisions (e.g., database choice, API style, auth strategy)
- System design constraints (e.g., latency requirements, scaling targets)
- Technology choices (e.g., framework, language, infrastructure)
- Integration patterns (e.g., sync vs async, event-driven vs request-response)
This input will be available to the spec-author agent as context, potentially
reducing downstream investigation findings.
[Provide TAD input / Skip TAD]## Technical Architecture DesignTask: prd-writer
Prompt: |
<context>
Mode: amendment
PRD path: .claude/prds/<prd-id>/prd.md
Pass number: 0 (TAD integration)
TAD Input:
<human's technical architecture input>
</context>
Add the TAD input to the "Technical Architecture Design" section of the PRD.
Integrate architectural decisions with existing Integration Surface findings.
Do NOT modify any other section of the PRD.
Save the complete amended PRD to disk./specTrigger: Runs after the gather-criticize loop exits (after Phase 1.5, before Phase 2). Purpose: Generate preliminary visual artifacts from PRD content.
# Generate all diagrams from structured YAML docs
node .claude/scripts/docs-generate.mjsarchitecture.yamlgenerateComponentMmd()flows/*.yamlgenerateFlowMmd()security.yamlgenerateSecurityMmd().mmd.claude/docs/structured/generated/.mmd%% source-hash:## Visual Report
### Phase 1 Diagrams (Preliminary)
- Architecture Overview: .claude/docs/structured/generated/component-c4.mmd
- User Flow Sequences: .claude/docs/structured/generated/flow-\*.mmd
- Security Boundaries: .claude/docs/structured/generated/security.mmdpass = 1# Dispatch all four in parallel -- DO NOT serialize
Task: prd-critic (perspective: business)
Task: prd-critic (perspective: technical)
Task: prd-critic (perspective: security)
Task: prd-critic (perspective: edge-case)
Each critic receives ONLY:
(1) Current PRD document (read from .claude/prds/<prd-id>/prd.md)
(2) The Decisions Log section from the PRD
(3) Calibration set from .claude/templates/critic-calibration.md
(4) Its perspective parameter
DO NOT include findings from any other critic.Task: prd-writer
Prompt: |
<context>
Mode: amendment
PRD path: .claude/prds/<prd-id>/prd.md
Pass number: <pass>
Resolutions:
<list of finding_id, resolution, rationale for each resolved finding>
</context>
Amend the PRD with all resolutions.
Update the Decisions Log with structured entries for each finding.
Save the complete amended PRD to disk.pass += 1pass += 1pass >= 5.claude/memory-bank/org-context.md.claude/specs/groups/sg-<prd-id>/manifest.jsonrequirements.mdPRD complete: .claude/prds/<prd-id>/prd.md
Passes: <N>
Findings resolved: <count>
Decisions Log entries: <count>
Next steps:
1. Review PRD: .claude/prds/<prd-id>/prd.md
2. Create spec group: /prd sync <prd-id> (if not already created)
3. Author spec: /spec sg-<prd-id>.claude/prds/<prd-id>/prd.md<!-- RESUME POINT: ... -->/prd.claude/prds/<prd-id>/prd.mdprd-readerTask: prd-reader
Prompt: |
Read PRD from .claude/prds/<prd-id>/prd.md
Extract requirements, constraints, assumptions, success criteria
Convert to EARS format
Create spec group with requirements.md.claude/specs/groups/sg-<prd-id>/manifest.jsonrequirements.mdprd_versionprd_content_hashprd_versionprd_content_hash---review_state: DRAFT/prd syncrequirements.md.claude/prds/<prd-id>/prd.mdrequirements.mdprd_versionprd_content_hashPRD synced: .claude/prds/<prd-id>/prd.md
Created spec group: sg-<prd-id>
- N requirements extracted
- requirements.md generated
- prd_version: <version>
- prd_content_hash: <8-char hash>
Next steps:
1. Review requirements: .claude/specs/groups/sg-<prd-id>/requirements.md
2. Run /spec sg-<prd-id> to create spec/prd push.claude/prds/<prd-id>/prd.mdprd-amenderTask: prd-amender
Prompt: |
PRD path: .claude/prds/<prd-id>/prd.md
Spec group: <linked spec group if any>
Identify implementation discoveries:
- New requirements discovered
- Assumptions invalidated
- Constraints discovered
Update PRD with amendments
Update Amendment Log with D-028 format entriesrequirements.mdprd_pathprd_versionrequirements.md"Spec group sg-XXX requirements.md is based on PRD vX but PRD is now vY. Runto re-extract requirements."/prd sync
.claude/prds/<prd-id>/prd.mdPRD Status: <prd-id>
Title: <title from frontmatter>
Version: <version>
State: <state>
Decisions Log: <N> entries
Last Updated: <date>
Linked Spec Groups:
- sg-<id> (review_state: <state>)/prd <prd-id>## Critique Pass <N> Results
### Critical Findings (individual confirmation required)
**TECH-001** (Critical): Accept -- add error response schema
Impact: Without this, Dev and QA will assume different formats, causing integration failures.
Finding: No error response format specified for API endpoints.
Detail: The PRD describes 5 API endpoints but does not specify the error response shape.
**SEC-001** (Critical): Accept -- define auth token rotation policy
Impact: Stale tokens could be reused indefinitely, creating a session hijacking vector.
Finding: Token expiration policy not specified.
### High Findings (individual confirmation required)
**BIZ-001** (High): Accept -- add rollback success criteria
Impact: Feature launch without rollback criteria risks unrecoverable state.
Finding: No rollback plan defined for the migration.
### Medium Findings (batch shortcut available)
**EDGE-001** (Medium): Accept -- document retry behavior
Impact: Users may see inconsistent behavior on transient failures.
Finding: Retry policy not specified for external API calls.
> **Batch shortcut**: "Accept all Medium findings" (excludes security-tagged findings)
### Low Findings (grouped)
4 Low findings across all critics:
- TECH-003: <one-line summary>
- BIZ-002: <one-line summary>
- SEC-002: <one-line summary>
- EDGE-003: <one-line summary>
---
For each Critical/High finding, please provide:
- **accept**: Amend the PRD to address this
- **reject**: Not a real gap (provide rationale)
- **defer**: Acknowledged but out of scope for this PRD
For Medium findings: use batch shortcut or provide individual decisions.
Security-tagged findings at any severity are surfaced separately and require individual confirmation./prd| Agent | Purpose | Used By |
|---|---|---|
| Conducts discovery interviews and drafts/amends PRDs in D-034 format | |
| Evaluates PRDs from one of four perspectives with severity ratings | |
| Extracts requirements from existing PRDs into EARS format | |
| Pushes implementation discoveries back to PRDs | |
User invokes /prd
↓
Cold start: load tech.context, org-context, existing PRDs
↓
PRD Writer: conversational discovery interview
↓
PRD draft saved to .claude/prds/<prd-id>/prd.md
↓
[Phase 1.5] Explore codebase for integration surfaces (oneoff-spec only)
↓
PRD Writer amends Integration Surface section with exploration findings
↓
Loop: 4 critics evaluate in parallel
↓
Findings presented by severity (Critical > High > Medium > Low summary)
↓
Human resolves findings
↓
PRD Writer amends PRD + updates Decisions Log
↓
Loop continues until all findings are Low + human confirms
↓
Org-context updated with new stable facts
↓
Optional: create spec group
↓
/spec → implementationPRD exists at .claude/prds/<prd-id>/prd.md
↓
/prd sync <prd-id>
↓
prd-reader extracts requirements
↓
Spec group created with requirements.md
↓
/spec → implementationDuring implementation, new requirements discovered
↓
/prd amend <prd-id>
↓
prd-amender updates PRD + Amendment Log
↓
PRD version incremented.claude/prds/<prd-id>/prd.mdversion: 1.0state: draftstate: reviewedreview_state: DRAFTdraftError: PRD '<prd-id>' not found
Expected path: .claude/prds/<prd-id>/prd.md
Available PRDs:
- <list from .claude/prds/*/prd.md>
To create a new PRD, run: /prdNo PRDs found in .claude/prds/
To create a new PRD, run: /prd
To sync an existing document, place it at .claude/prds/<prd-id>/prd.md and run: /prd sync <prd-id>