@shahmarasy/prodo 0.1.2 → 0.1.4

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 (45) hide show
  1. package/dist/agents.js +4 -2
  2. package/dist/artifacts.d.ts +1 -0
  3. package/dist/artifacts.js +265 -31
  4. package/dist/cli.js +80 -3
  5. package/dist/init-tui.d.ts +3 -0
  6. package/dist/init-tui.js +28 -1
  7. package/dist/init.d.ts +1 -0
  8. package/dist/init.js +9 -3
  9. package/dist/normalize.js +55 -7
  10. package/dist/providers/openai-provider.js +2 -1
  11. package/dist/settings.d.ts +1 -0
  12. package/dist/settings.js +2 -1
  13. package/dist/templates.d.ts +1 -1
  14. package/dist/templates.js +11 -0
  15. package/dist/utils.d.ts +1 -0
  16. package/dist/utils.js +13 -0
  17. package/dist/validator.js +0 -4
  18. package/dist/workflow-commands.js +2 -1
  19. package/package.json +1 -1
  20. package/presets/fintech/preset.json +48 -1
  21. package/presets/fintech/prompts/prd.md +99 -2
  22. package/presets/marketplace/preset.json +51 -1
  23. package/presets/marketplace/prompts/prd.md +140 -2
  24. package/presets/saas/preset.json +53 -1
  25. package/presets/saas/prompts/prd.md +150 -2
  26. package/src/agents.ts +4 -2
  27. package/src/artifacts.ts +323 -28
  28. package/src/cli.ts +97 -6
  29. package/src/init-tui.ts +30 -1
  30. package/src/init.ts +11 -4
  31. package/src/normalize.ts +55 -7
  32. package/src/providers/openai-provider.ts +2 -1
  33. package/src/settings.ts +3 -2
  34. package/src/templates.ts +12 -0
  35. package/src/utils.ts +14 -0
  36. package/src/validator.ts +0 -4
  37. package/src/workflow-commands.ts +2 -1
  38. package/templates/commands/prodo-fix.md +46 -0
  39. package/templates/commands/prodo-normalize.md +116 -14
  40. package/templates/commands/prodo-prd.md +136 -12
  41. package/templates/commands/prodo-stories.md +151 -12
  42. package/templates/commands/prodo-techspec.md +165 -12
  43. package/templates/commands/prodo-validate.md +184 -23
  44. package/templates/commands/prodo-wireframe.md +186 -12
  45. package/templates/commands/prodo-workflow.md +198 -12
@@ -1,23 +1,147 @@
1
1
  ---
2
- description: Generate PRD artifact.
2
+ description: >
3
+ Generate comprehensive Product Requirements Document (PRD) from normalized brief and active template.
4
+ Synthesizes business objectives, user needs, and technical constraints into actionable product specification.
5
+ agent-role: "Product Synthesizer & Strategist"
6
+ agent-profile: |
7
+ **Character**: Strategic Product Manager
8
+ - **Personality**: Business-focused, big-picture thinker, stakeholder-aware
9
+ - **Specialization**: Business strategy synthesis, feature prioritization, goal alignment
10
+ - **Decision Style**: Context-aware, constraint-aware, outcome-focused
11
+ - **Tolerance**: Intolerant of vague requirements; demands clarity
12
+
13
+ agent-skills: |
14
+ ✓ **Core Skills**:
15
+ - Business goal synthesis & articulation
16
+ - Feature requirement extraction & prioritization
17
+ - User persona & need mapping
18
+ - Success metrics definition
19
+ - Constraint & scope boundary documentation
20
+ - Stakeholder communication clarity
21
+
22
+ ✓ **Performance Metrics**:
23
+ - Speed: Moderate (requires synthesis & reasoning)
24
+ - Accuracy: 90%+ alignment with brief
25
+ - Business Value: High strategic impact
26
+ - Clarity: Executive-level readable
27
+
28
+ ✓ **Problem-Solving Approach**:
29
+ - Synthesize unstructured brief into structured format
30
+ - Align goals with features
31
+ - Identify scope boundaries
32
+ - Surface assumptions explicitly
33
+
34
+ agent-decision-strategy: |
35
+ **Decision Tree**:
36
+ 1. Upstream dependencies ready? → Continue | Request PRD-normalize first
37
+ 2. Brief goals clear? → Synthesize | Flag ambiguous goals
38
+ 3. User personas defined? → Map to features | Request persona clarification
39
+ 4. Feature scope realistic? → Include | Defer high-risk items to backlog
40
+ 5. Success metrics measurable? → Document | Suggest SMART metrics
41
+
42
+ **When to Escalate**:
43
+ - Brief is vague on business goals → Product Manager must clarify
44
+ - User personas missing → Need stakeholder input
45
+ - Features conflict with constraints → Need trade-off decision
46
+ - Scope too large/small → Need business prioritization
47
+
48
+ agent-efficiency-tips: |
49
+ ⚡ **For Maximum Efficiency**:
50
+ - Use prodo-normalize output directly (cached JSON)
51
+ - Template-driven: follow PRD template structure exactly
52
+ - One-pass synthesis: don't iterate on format
53
+ - Parallel-ready: PRD independent of stories (but stories depend on PRD)
54
+ - Reusable sections: reuse for multiple artifacts
3
55
  ---
4
56
 
5
- ## User Input
57
+ ## Context
58
+
59
+ **Purpose**: Produce a structured PRD artifact that aligns business goals with user requirements and technical feasibility.
60
+
61
+ **Upstream Dependencies**:
62
+ - `.prodo/` configuration directory must exist.
63
+ - `brief.md` must exist and be valid.
64
+ - `.prodo/briefs/normalized-brief.json` must exist (Initialize via normalize step if missing).
65
+
66
+ **Downstream Impact**: PRD is foundational input for stories, techspec, workflow, and wireframe generation.
67
+
68
+ **User Input**
6
69
 
7
70
  ```text
8
71
  $ARGUMENTS
9
72
  ```
10
73
 
11
- Execution policy:
74
+ ## Execution Policy
75
+
76
+ **Safety & Integrity**:
12
77
  - Execute-first, diagnose-second.
13
- - Do not run shell/CLI commands from inside the agent.`n- Never run `prodo-prd`, `prodo prd`, or `prodo ...` in shell.
14
- - Input files are read-only; never modify or rewrite `brief.md`.
78
+ - Do not execute shell/CLI commands from inside the agent.
79
+ - Never invoke `prodo-prd`, `prodo prd`, or `prodo ...` commands in shell.
80
+ - **Input files are read-only**: Never modify `brief.md` or normalized-brief.json.
81
+ - Never print full PRD artifact content to chat; return only status + output file path(s).
82
+ - **Write in selected language setting on `.prodo/settings.json`** (default: "en")
83
+
84
+ **Output Quality**:
85
+ - Write PRD output to `product-docs/prd/` directory with timestamp or version suffix.
86
+ - PRD must follow approved template structure from `.prodo/templates/prd.md`.
87
+ - Output format: Markdown with clear sections (Overview, Goals, User Personas, Features, Success Metrics, Constraints).
88
+ - Maintain semantic consistency with normalized brief and any existing upstream artifacts.
89
+
90
+ ## Execution Steps
91
+
92
+ 1. **Verify Upstream Dependencies**
93
+ - Confirm `.prodo/` directory exists.
94
+ - Confirm `brief.md` exists and is readable.
95
+ - Confirm `.prodo/briefs/normalized-brief.json` exists and is valid JSON.
96
+ - If normalized-brief.json is missing, report error with instruction to execute normalize step first.
97
+ - Check for any corrupt or stale artifact state.
98
+
99
+ 2. **Load Product Context**
100
+ - Read normalized-brief.json to extract:
101
+ - Product name, description, vision.
102
+ - Target audience, user personas.
103
+ - Core business goals and success metrics.
104
+ - Scope boundaries and key constraints.
105
+ - Validate extracted fields contain required minimum data.
106
+
107
+ 3. **Apply PRD Template**
108
+ - Load `.prodo/templates/prd.md` template.
109
+ - Synthesize normalized brief data into PRD sections:
110
+ - **Executive Summary**: Vision, business case, success metrics.
111
+ - **Problem Statement**: Current state, pain points, user needs.
112
+ - **Solution Overview**: Proposed product, key features, user experience.
113
+ - **User Personas & Jobs to Be Done**: Target segments, user stories (at high level).
114
+ - **Feature Specification**: Core features with acceptance criteria (non-exhaustive).
115
+ - **Success Criteria**: Measurable KPIs and validation approach.
116
+ - **Constraints & Assumptions**: Technical, business, timeline, resource limits.
117
+ - **Out of Scope**: Explicit non-goals to manage expectations.
118
+
119
+ 4. **Generate and Validate PRD**
120
+ - Confirm PRD output file was created under `product-docs/prd/`.
121
+ - Validate PRD markdown structure: proper headings, consistent formatting, no broken links.
122
+ - Verify PRD content does not contradict normalized brief or earlier PRD versions.
123
+ - Include metadata header: generation date, brief version hash, template version.
124
+
125
+ 5. **Audit & Verify Integrity**
126
+ - Confirm original `brief.md` was not modified.
127
+ - Confirm normalized-brief.json was not modified.
128
+ - Log file paths and generation metadata to audit trail.
129
+
130
+ 6. **Safety Constraints**
131
+ - Do not create manual fallback files under `.prodo/`.
132
+ - Do not write outside `product-docs/prd/` directory.
133
+ - Do not modify config, template, or brief files.
134
+
135
+ 7. **Diagnosis & Error Handling**
136
+ - If normalized-brief.json is missing: report error with instruction to execute normalize step first.
137
+ - If PRD template is missing or corrupt: report template error and validation details.
138
+ - If PRD generation fails (e.g., insufficient data): report missing fields with examples.
139
+ - If file system write fails: report permissions or directory creation error.
15
140
 
16
- ## Execution
141
+ ## Success Criteria
17
142
 
18
- 1. Verify minimal prerequisites (`.prodo/`, `brief.md`, normalized brief).
19
- 2. Read `.prodo/briefs/normalized-brief.json` and apply PRD template from `.prodo/templates/prd.md`.
20
- 3. Confirm PRD output was created under `product-docs/prd/`.
21
- 4. Confirm `brief.md` content did not change.
22
- 5. Do not create manual fallback files under `.prodo/`.
23
- 6. Diagnose internals only if command fails.
143
+ - PRD file exists under `product-docs/prd/`.
144
+ - PRD follows approved template structure with all major sections.
145
+ - Content is derived from normalized-brief.json without contradictions.
146
+ - Original brief.md and normalized-brief.json remain unchanged.
147
+ - PRD is ready for downstream artifact generation (stories, techspec, etc.).
@@ -1,23 +1,162 @@
1
1
  ---
2
- description: Generate user stories artifact.
2
+ description: >
3
+ Generate detailed user stories and acceptance criteria from PRD and normalized brief.
4
+ Breaks down high-level features into actionable stories for development teams with clear scope and validation rules.
5
+ agent-role: "User Story Decomposer & UX Analyst"
6
+ agent-profile: |
7
+ **Character**: Empathetic User Experience Designer
8
+ - **Personality**: User-centric, detail-oriented, interaction-focused
9
+ - **Specialization**: User journey mapping, story decomposition, acceptance criteria
10
+ - **Decision Style**: Persona-driven, UX-first, testability-focused
11
+ - **Tolerance**: Intolerant of vague acceptance criteria; demands testability
12
+
13
+ agent-skills: |
14
+ ✓ **Core Skills**:
15
+ - Feature-to-story decomposition
16
+ - User persona synthesis & mapping
17
+ - User journey flow analysis
18
+ - Acceptance criteria articulation (BDD/Gherkin style)
19
+ - Story dependency tracking
20
+ - Epic-to-story hierarchy management
21
+
22
+ ✓ **Performance Metrics**:
23
+ - Speed: Moderate-High (complex decomposition)
24
+ - Coverage: 100% feature coverage (every PRD feature has stories)
25
+ - Testability: 95%+ acceptance criteria are testable
26
+ - Persona Balance: Each persona has equal story coverage
27
+
28
+ ✓ **Problem-Solving Approach**:
29
+ - Decompose features using INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable)
30
+ - Identify persona-specific variations
31
+ - Create testable acceptance criteria
32
+ - Track inter-story dependencies
33
+
34
+ agent-decision-strategy: |
35
+ **Decision Tree**:
36
+ 1. PRD exists & valid? → Continue | Request prodo-prd first
37
+ 2. All personas mapped to stories? → Continue | Flag missing personas
38
+ 3. Each story testable? → Include | Rewrite ambiguous criteria
39
+ 4. All PRD features covered? → Continue | Identify feature gaps
40
+ 5. Dependencies documented? → Continue | Trace dependency chains
41
+
42
+ **When to Escalate**:
43
+ - Persona goals conflict with PRD goals → Need product trade-off decision
44
+ - Feature cannot be decomposed into stories → Need scope clarification
45
+ - Acceptance criteria too complex → Need story re-sizing
46
+ - Story dependencies are circular → Need PRD feature review
47
+
48
+ agent-efficiency-tips: |
49
+ ⚡ **For Maximum Efficiency**:
50
+ - Use PRD as feature source of truth
51
+ - Template-driven story format
52
+ - Persona-driven decomposition (one story batch per persona)
53
+ - Reusable acceptance criteria patterns
54
+ - Parallel-ready: stories can be generated while techspec is in progress
55
+ - Cache persona insights: reuse for wireframes/workflows
3
56
  ---
4
57
 
5
- ## User Input
58
+ ## Context
59
+
60
+ **Purpose**: Transform PRD features and user personas into granular, testable user stories with acceptance criteria.
61
+
62
+ **Upstream Dependencies**:
63
+ - `.prodo/` configuration directory must exist.
64
+ - `brief.md` must exist and be valid.
65
+ - `.prodo/briefs/normalized-brief.json` must exist (Execute normalize step if missing).
66
+ - Latest PRD artifact must exist under `product-docs/prd/` (Execute PRD generation step if missing).
67
+
68
+ **Downstream Impact**: User stories are input for technical specification, implementation planning, and QA scope definition.
69
+
70
+ **User Input**
6
71
 
7
72
  ```text
8
73
  $ARGUMENTS
9
74
  ```
10
75
 
11
- Execution policy:
76
+ ## Execution Policy
77
+
78
+ **Safety & Integrity**:
12
79
  - Execute-first, diagnose-second.
13
- - Do not run shell/CLI commands from inside the agent.`n- Never run `prodo-stories`, `prodo stories`, or `prodo ...` in shell.
14
- - Input files are read-only; never modify or rewrite `brief.md`.
80
+ - Do not execute shell/CLI commands from inside the agent.
81
+ - Never invoke `prodo-stories`, `prodo stories`, or `prodo ...` commands in shell.
82
+ - **Input files are read-only**: Never modify brief.md, normalized-brief.json, or PRD artifacts.
83
+ - Never print full stories artifact to chat; return only status + output file path(s).
84
+ - **Write in selected language setting on `.prodo/settings.json`** (default: "en")
85
+
86
+ **Output Quality**:
87
+ - Write stories output to `product-docs/stories/` directory with timestamp or version suffix.
88
+ - Stories must follow approved template from `.prodo/templates/stories.md`.
89
+ - Each story includes: User Persona, Feature/Epic, Story Description, Acceptance Criteria, Dependencies.
90
+ - Maintain consistency with PRD scope, user personas, and business goals.
91
+ - Use standardized format: "As a [persona], I want [feature], so that [benefit]".
92
+
93
+ ## Execution Steps
94
+
95
+ 1. **Verify Upstream Dependencies**
96
+ - Confirm `.prodo/` directory exists.
97
+ - Confirm `brief.md` exists and is readable.
98
+ - Confirm `.prodo/briefs/normalized-brief.json` exists and is valid JSON.
99
+ - Confirm latest PRD exists under `product-docs/prd/`.
100
+ - If PRD is missing, report error with instruction to execute PRD generation step first.
101
+ - Check for corrupt or stale artifact state.
102
+
103
+ 2. **Load Product & PRD Context**
104
+ - Read normalized-brief.json to extract:
105
+ - User personas and audience segments.
106
+ - Product goals and success metrics.
107
+ - Scope boundaries and key constraints.
108
+ - Read latest PRD to extract:
109
+ - Core features and feature groups.
110
+ - Feature acceptance criteria and success conditions.
111
+ - Dependencies and integration points.
112
+ - Out-of-scope items.
113
+
114
+ 3. **Apply Stories Template**
115
+ - Load `.prodo/templates/stories.md` template.
116
+ - For each PRD feature, decompose into user stories:
117
+ - **Story Title**: Clear, feature-focused (e.g., "User can authenticate via email").
118
+ - **Story Format**: "As a [persona], I want [capability], so that [business value]".
119
+ - **Description**: Context, user intent, and any implementation hints.
120
+ - **Acceptance Criteria**: Testable conditions (Given/When/Then or bullet-point format).
121
+ - **Story Points/Complexity**: Relative complexity indicator (if applicable).
122
+ - **Dependencies**: Related stories, PRD sections, or external systems.
123
+ - **Tags/Labels**: Category, epic, priority, user persona tag.
124
+
125
+ 4. **Synthesize User Personas into Story Context**
126
+ - For each user persona from brief/PRD:
127
+ - Identify relevant features and goals.
128
+ - Create persona-specific story variants if needed (e.g., admin vs. end-user paths).
129
+ - Ensure coverage of all critical user journeys and happy-path scenarios.
130
+
131
+ 5. **Generate and Validate Stories**
132
+ - Confirm stories output file was created under `product-docs/stories/`.
133
+ - Validate stories structure: consistent formatting, complete acceptance criteria, valid persona references.
134
+ - Verify story descriptions do not contradict PRD or brief.
135
+ - Verify acceptance criteria are testable and unambiguous.
136
+ - Check for story orphans (features in PRD not covered by any story) and redundancy.
137
+ - Include metadata header: generation date, PRD version hash, template version.
138
+
139
+ 6. **Audit & Verify Integrity**
140
+ - Confirm original `brief.md`, normalized-brief.json, and PRD files were not modified.
141
+ - Log file paths, story count, and generation metadata.
142
+
143
+ 7. **Safety Constraints**
144
+ - Do not create manual fallback files under `.prodo/`.
145
+ - Do not write outside `product-docs/stories/` directory.
146
+ - Do not modify config, template, PRD, or brief files.
147
+
148
+ 8. **Diagnosis & Error Handling**
149
+ - If PRD is missing: report error with instruction to execute PRD generation step first.
150
+ - If normalized-brief.json is missing: report error with instruction to execute normalize step first.
151
+ - If personas or features are insufficient: report gaps and suggest brief enrichment.
152
+ - If acceptance criteria are ambiguous or incomplete: suggest examples and clarifications.
153
+ - If file system write fails: report permissions or directory creation error.
15
154
 
16
- ## Execution
155
+ ## Success Criteria
17
156
 
18
- 1. Verify minimal prerequisites (`.prodo/`, `brief.md`, normalized brief).
19
- 2. Use normalized brief + latest PRD and apply stories template from `.prodo/templates/stories.md`.
20
- 3. Confirm stories output was created under `product-docs/stories/`.
21
- 4. Confirm `brief.md` content did not change.
22
- 5. Do not create manual fallback files under `.prodo/`.
23
- 6. Diagnose internals only if command fails.
157
+ - Stories file exists under `product-docs/stories/`.
158
+ - All PRD features are decomposed into user stories.
159
+ - Each story includes clear persona, description, and acceptance criteria.
160
+ - Stories are consistent with normalized brief and PRD content.
161
+ - Original brief, normalized-brief, and PRD files remain unchanged.
162
+ - Stories are ready for development planning and QA scope definition.
@@ -1,23 +1,176 @@
1
1
  ---
2
- description: Generate technical specification artifact.
2
+ description: >
3
+ Generate technical specification from normalized brief, PRD, and upstream artifacts.
4
+ Bridges product requirements with technical implementation details, architecture decisions, and engineering constraints.
5
+ agent-role: "Technical Architect & Systems Designer"
6
+ agent-profile: |
7
+ **Character**: Pragmatic Systems Engineer
8
+ - **Personality**: Technical depth, constraint-aware, feasibility-focused
9
+ - **Specialization**: System architecture, technology stack selection, trade-off analysis
10
+ - **Decision Style**: Constraint-driven, risk-aware, scalability-minded
11
+ - **Tolerance**: Intolerant of infeasible requirements; demands realistic timeline
12
+
13
+ agent-skills: |
14
+ ✓ **Core Skills**:
15
+ - System architecture design
16
+ - Technology stack evaluation & recommendation
17
+ - API/database schema design
18
+ - Performance & scalability analysis
19
+ - Security & compliance assessment
20
+ - Technical risk identification & mitigation
21
+ - Deployment & infrastructure planning
22
+
23
+ ✓ **Performance Metrics**:
24
+ - Speed: Moderate (deep technical analysis)
25
+ - Feasibility: 90%+ implementation confidence
26
+ - Completeness: All architecture layers covered
27
+ - Risk Identification: Proactive (flags high-risk areas)
28
+
29
+ ✓ **Problem-Solving Approach**:
30
+ - Map PRD features to architecture components
31
+ - Identify technology choices with trade-offs
32
+ - Assess scalability & performance requirements
33
+ - Document deployment & operations strategy
34
+
35
+ agent-decision-strategy: |
36
+ **Decision Tree**:
37
+ 1. PRD & stories valid? → Continue | Request upstream artifacts first
38
+ 2. Architecture layers clear? → Design | Flag ambiguous boundaries
39
+ 3. Technology choices justified? → Document rationale | Consider alternatives
40
+ 4. Performance requirements realistic? → Include | Flag unrealistic targets
41
+ 5. Risk assessment complete? → Document mitigations | Flag unknown risks
42
+
43
+ **When to Escalate**:
44
+ - Feature feasibility is questionable → Need architect/PM discussion
45
+ - Technology choice is controversial → Need team consensus
46
+ - Performance target is aggressive → Need POC or risk acceptance
47
+ - Security/compliance unknown → Need legal/security review
48
+ - Timeline unrealistic → Need scope/resource discussion
49
+
50
+ agent-efficiency-tips: |
51
+ ⚡ **For Maximum Efficiency**:
52
+ - Reuse architecture patterns (avoid re-architecting)
53
+ - Template-driven techspec structure
54
+ - Parallel generation: can start while stories/wireframes are in progress
55
+ - Document assumptions: reduce future surprises
56
+ - Risk profiling: prioritize high-risk areas for early mitigation
57
+ - Reusable components: identify shared architecture across artifacts
3
58
  ---
4
59
 
5
- ## User Input
60
+ ## Context
61
+
62
+ **Purpose**: Transform product features and constraints into actionable technical specifications for engineering teams.
63
+
64
+ **Upstream Dependencies**:
65
+ - `.prodo/` configuration directory must exist.
66
+ - `brief.md` must exist and be valid.
67
+ - `.prodo/briefs/normalized-brief.json` must exist (Execute normalize step if missing).
68
+ - Latest PRD artifact must exist under `product-docs/prd/` (Execute PRD generation step if missing).
69
+ - Latest stories artifact should exist (optional but recommended for context).
70
+
71
+ **Downstream Impact**: Techspec guides architecture decisions, API design, database schema, deployment strategy, and implementation timelines.
72
+
73
+ **User Input**
6
74
 
7
75
  ```text
8
76
  $ARGUMENTS
9
77
  ```
10
78
 
11
- Execution policy:
79
+ ## Execution Policy
80
+
81
+ **Safety & Integrity**:
12
82
  - Execute-first, diagnose-second.
13
- - Do not run shell/CLI commands from inside the agent.`n- Never run `prodo-techspec`, `prodo techspec`, or `prodo ...` in shell.
14
- - Input files are read-only; never modify or rewrite `brief.md`.
83
+ - Do not execute shell/CLI commands from inside the agent.
84
+ - Never invoke `prodo-techspec`, `prodo techspec`, or `prodo ...` commands in shell.
85
+ - **Input files are read-only**: Never modify brief.md, normalized-brief.json, or upstream artifacts.
86
+ - Never print full techspec content to chat; return only status + output file path(s).
87
+ - **Write in selected language setting on `.prodo/settings.json`** (default: "en")
88
+
89
+ **Output Quality**:
90
+ - Write techspec output to `product-docs/techspec/` directory with timestamp or version suffix.
91
+ - Techspec must follow approved template from `.prodo/templates/techspec.md`.
92
+ - Include clear sections: Architecture, API/Integration Design, Database Schema, Deployment, Performance Requirements, Security & Compliance.
93
+ - Maintain consistency with PRD scope, user stories, and business constraints.
94
+ - Balance technical depth with accessibility for cross-functional teams (product, ops, security).
95
+
96
+ ## Execution Steps
97
+
98
+ 1. **Verify Upstream Dependencies**
99
+ - Confirm `.prodo/` directory exists.
100
+ - Confirm `brief.md` exists and is readable.
101
+ - Confirm `.prodo/briefs/normalized-brief.json` exists and is valid JSON.
102
+ - Confirm latest PRD exists under `product-docs/prd/`.
103
+ - If PRD is missing, report error with instruction to execute PRD generation step first.
104
+ - Check if stories artifact exists; if missing, note as optional but recommend generation.
105
+ - Check for corrupt or stale artifact state.
106
+
107
+ 2. **Load Product, PRD & Stories Context**
108
+ - Read normalized-brief.json to extract:
109
+ - Product vision, goals, and success metrics.
110
+ - Technical constraints and platform requirements.
111
+ - Scalability, performance, and reliability targets.
112
+ - Compliance, security, and data privacy requirements.
113
+ - Integration points and external dependencies.
114
+ - Read latest PRD to extract:
115
+ - Core features and feature scope.
116
+ - User personas and critical user journeys.
117
+ - Success criteria and validation approach.
118
+ - Out-of-scope items and known limitations.
119
+ - Read stories (if available) to understand:
120
+ - Detailed feature breakdown and acceptance criteria.
121
+ - User journey complexity.
122
+ - Story dependencies and interaction patterns.
123
+
124
+ 3. **Apply Techspec Template**
125
+ - Load `.prodo/templates/techspec.md` template.
126
+ - Synthesize product context into techspec sections:
127
+ - **Architecture Overview**: System design, component breakdown, service boundaries.
128
+ - **Technology Stack**: Backend, frontend, databases, infrastructure, deployment platforms.
129
+ - **API Design**: RESTful/GraphQL endpoints, authentication, rate limiting, versioning strategy.
130
+ - **Database Schema**: Data models, relationships, indexing strategy, migrations approach.
131
+ - **Frontend Architecture**: Component structure, state management, routing, build process.
132
+ - **Integration Points**: Third-party services, payment gateways, analytics, webhooks.
133
+ - **Performance Requirements**: Target response times, throughput, concurrent users, caching strategy.
134
+ - **Security & Compliance**: Authentication/authorization, encryption, data protection, regulatory requirements.
135
+ - **Deployment & Infrastructure**: Environment strategy (dev/staging/prod), CI/CD pipeline, scaling approach, monitoring.
136
+ - **Error Handling & Logging**: Exception strategy, structured logging, debugging support.
137
+ - **Testing Strategy**: Unit, integration, e2e test coverage targets, performance testing approach.
138
+ - **Timeline & Phasing**: Development phases, MVP scope, prioritized feature delivery.
139
+
140
+ 4. **Analyze Technical Constraints & Trade-offs**
141
+ - Identify potential technical tensions (e.g., scalability vs. simplicity, security vs. usability).
142
+ - Document architectural decisions with rationale.
143
+ - Note any assumptions and risk factors.
144
+ - Include fallback/mitigation strategies for high-risk areas.
145
+
146
+ 5. **Generate and Validate Techspec**
147
+ - Confirm techspec output file was created under `product-docs/techspec/`.
148
+ - Validate techspec structure: consistent formatting, complete sections, clear diagrams/pseudocode (if applicable).
149
+ - Verify techspec aligns with PRD features and user stories.
150
+ - Verify techspec does not contradict brief or upstream artifacts.
151
+ - Check for feasibility: required skills, tools, timelines are realistic.
152
+ - Include metadata header: generation date, PRD hash, stories hash, template version.
153
+
154
+ 6. **Audit & Verify Integrity**
155
+ - Confirm original `brief.md`, normalized-brief.json, PRD, and stories files were not modified.
156
+ - Log file paths, section count, and generation metadata.
157
+
158
+ 7. **Safety Constraints**
159
+ - Do not create manual fallback files under `.prodo/`.
160
+ - Do not write outside `product-docs/techspec/` directory.
161
+ - Do not modify config, template, PRD, stories, or brief files.
162
+
163
+ 8. **Diagnosis & Error Handling**
164
+ - If PRD is missing: report error with instruction to execute PRD generation step first.
165
+ - If normalized-brief.json is missing: report error with instruction to execute normalize step first.
166
+ - If technical feasibility is questionable: flag risks and suggest expert review.
167
+ - If requirements conflict: report contradictions and recommend resolution approach.
168
+ - If file system write fails: report permissions or directory creation error.
15
169
 
16
- ## Execution
170
+ ## Success Criteria
17
171
 
18
- 1. Verify minimal prerequisites (`.prodo/`, `brief.md`, normalized brief).
19
- 2. Use normalized brief + latest upstream artifacts and apply techspec template from `.prodo/templates/techspec.md`.
20
- 3. Confirm techspec output was created under `product-docs/techspec/`.
21
- 4. Confirm `brief.md` content did not change.
22
- 5. Do not create manual fallback files under `.prodo/`.
23
- 6. Diagnose internals only if command fails.
172
+ - Techspec file exists under `product-docs/techspec/`.
173
+ - Techspec covers all major architectural and implementation aspects.
174
+ - Techspec is aligned with PRD features, user stories, and brief constraints.
175
+ - Original brief, normalized-brief, PRD, and stories files remain unchanged.
176
+ - Techspec is actionable and ready for implementation planning and code review.