@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,184 @@
1
- ---
2
- description: Validate artifact set.
3
- ---
4
-
5
- ## User Input
6
-
7
- ```text
8
- $ARGUMENTS
9
- ```
10
-
11
- Execution policy:
12
- - Execute-first, diagnose-second.
13
- - Do not run shell/CLI commands from inside the agent.`n- Never run `prodo-validate`, `prodo validate`, or `prodo ...` in shell.
14
- - Input files are read-only; never modify or rewrite `brief.md`.
15
-
16
- ## Execution
17
-
18
- 1. Verify minimal prerequisites (`.prodo/`, `brief.md`, normalized brief).
19
- 2. Validate latest artifacts under `product-docs/` for schema + cross-artifact consistency.
20
- 3. Confirm validation report exists under `product-docs/reports/` and status is clear.
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.
1
+ ---
2
+ description: >
3
+ Validate artifact set for alignment with brief.md (Source of Truth), cross-artifact consistency, and logical coherence.
4
+ Ensures all product documentation maintains contextual alignment and internal consistency with the original brief.
5
+ agent-role: "Quality Assurance Officer & Brief-Alignment Validator"
6
+ agent-profile: |
7
+ **Character**: Rigorous Brief-Centric Quality Guardian
8
+ - **Personality**: Brief-focused, consistency-obsessed, contextually-aware
9
+ - **Specialization**: Brief alignment verification, cross-artifact consistency, contextual coherence
10
+ - **Decision Style**: Brief-centric, deviation-intolerant, source-of-truth driven
11
+ - **Tolerance**: Intolerant of misalignment with brief; blocks until resolved
12
+
13
+ agent-skills: |
14
+ **Core Skills**:
15
+ - Brief alignment verification (Source of Truth validation)
16
+ - Cross-artifact consistency analysis
17
+ - Contextual coherence validation
18
+ - Deviation detection & reporting
19
+ - Missing requirement identification
20
+ - Severity classification (error/warning/info)
21
+ - Audit trail & traceability
22
+
23
+ **Performance Metrics**:
24
+ - Speed: High (efficient comparison engine)
25
+ - Sensitivity: Catches 95%+ deviations from brief
26
+ - Precision: Low false positive rate
27
+ - Coverage: 100% artifact validation
28
+
29
+ agent-decision-strategy: |
30
+ **Decision Tree**:
31
+ 1. Prerequisites valid (`.prodo/`, `brief.md`, normalized-brief.json)?
32
+ → Continue | Report missing prerequisites
33
+ 2. Read language setting from `.prodo/settings.json`?
34
+ → Use specified language | Use default "en"
35
+ 3. Artifacts exist in `product-docs/`?
36
+ → Validate | Report "nothing to validate"
37
+ 4. Brief context loaded and artifacts checked?
38
+ → Cross-validate all | Flag deviations
39
+ 5. Contextual alignment verified?
40
+ → Check consistency | Report brief misalignments
41
+ 6. Generate comprehensive validation report?
42
+ → Pass/Warn/Fail | Include remediation paths
43
+
44
+ agent-efficiency-tips: |
45
+ ⚡ **For Maximum Efficiency**:
46
+ - Run LAST in pipeline (after all artifacts generated)
47
+ - Use brief.md as single source of truth reference
48
+ - Parallel validation: alignment + consistency checks simultaneously
49
+ - Cache brief context: reuse throughout validation run
50
+ - Focus on deviations: report gaps vs. brief requirements
51
+ - Brief-centric output: tie all findings back to brief sections
52
+ ---
53
+
54
+ ## Context
55
+
56
+ **Purpose**: Validate all generated artifacts against `brief.md` (Source of Truth) for contextual alignment, logical coherence, and cross-artifact consistency.
57
+
58
+ **Upstream Dependencies**:
59
+ - `.prodo/` configuration directory must exist.
60
+ - `brief.md` must exist and is valid (Source of Truth).
61
+ - `.prodo/briefs/normalized-brief.json` must exist (Execute normalize step if missing).
62
+ - `.prodo/settings.json` may exist (for output language preference).
63
+ - At least one artifact (PRD, stories, techspec, wireframe, workflow) must exist in `product-docs/`.
64
+
65
+ **Validation Scope**:
66
+ - Source of Truth Alignment: All artifacts align with `brief.md` context and requirements.
67
+ - Contextual Coherence: Each artifact makes logical sense in product context.
68
+ - Cross-Artifact Consistency: No contradictions between artifacts.
69
+ - Missing Requirements: Identify gaps vs. brief requirements.
70
+ - Logical Flow: Verify narrative and process flow coherence.
71
+
72
+ **Downstream Impact**: Validation report guides artifact refinement and identifies areas needing correction to align with brief.
73
+
74
+ **User Input**
75
+
76
+ ```text
77
+ $ARGUMENTS
78
+ ```
79
+
80
+ ## Execution Policy
81
+
82
+ **Safety & Integrity**:
83
+ - Execute-first, diagnose-second.
84
+ - Do not execute shell/CLI commands from inside the agent.
85
+ - Never invoke `prodo-validate`, `prodo validate`, or `prodo ...` commands in shell.
86
+ - **Input files are read-only**: Do not modify any artifacts, brief, or config files during validation.
87
+ - Never print raw validation payload to chat; return only report summary + report file path.
88
+ - **Read output language from `.prodo/settings.json`** and write report in that language (default: "en").
89
+
90
+ **Output Quality**:
91
+ - Write validation report to `product-docs/reports/validation-report.md` with clear status and findings.
92
+ - Report must be written in language specified in `.prodo/settings.json`.
93
+ - Report includes: validation status (pass/warn/fail), findings count by severity, detailed issues with brief references.
94
+ - Report format: Markdown for readability with structured sections.
95
+ - **Validation failure blocks pipeline**: Critical issues (deviations from brief, contradictions) must be resolved before proceeding.
96
+
97
+ ## Execution
98
+
99
+ 1. **Verify prerequisites: `.prodo/`, `brief.md`, and `normalized-brief.json`.**
100
+ - Confirm `.prodo/` directory exists.
101
+ - Confirm `brief.md` exists and is readable (Source of Truth).
102
+ - Confirm `.prodo/briefs/normalized-brief.json` exists and is valid JSON.
103
+ - Read `.prodo/settings.json` for output language preference (default: "en").
104
+ - Check for corrupt or stale artifact state.
105
+
106
+ 2. **Cross-validate all artifacts in `product-docs/` against `brief.md` (Source of Truth):**
107
+ - Load `brief.md` content (product vision, goals, personas, scope, constraints).
108
+ - Load `normalized-brief.json` for structured reference data.
109
+ - Enumerate all artifacts under `product-docs/` (PRD, stories, techspec, wireframes, workflows).
110
+ - **Check for contextual alignment with the original brief:**
111
+ - Does artifact content align with brief context and intent?
112
+ - Are brief goals reflected in artifact features/stories/specifications?
113
+ - Are brief personas properly represented across artifacts?
114
+ - Does artifact respect brief scope boundaries?
115
+ - Does artifact comply with brief constraints?
116
+ - **Ensure logical flow and cross-artifact consistency:**
117
+ - Feature consistency: PRD features → Stories → Techspec alignment.
118
+ - Persona journey: Brief personas → Stories → Workflow coverage.
119
+ - Goal tracing: Brief goals → PRD goals → Story goals → Success metrics.
120
+ - Scope respect: No features beyond brief scope.
121
+ - No contradictions: Consistent requirements across artifacts.
122
+ - **Flag any deviations or missing requirements from the brief:**
123
+ - Deviations: Features not in brief, personas not mentioned, goals not addressed.
124
+ - Missing requirements: What should be in artifact but isn't.
125
+ - Contextual gaps: Unclear flow, missing connections to brief intent.
126
+
127
+ 3. **Write/update `product-docs/reports/validation-report.md` (or .json):**
128
+ - Create/update report in language specified in `.prodo/settings.json`.
129
+ - Report structure:
130
+ - **Header**: Validation date, language, brief version, overall status (pass/warn/fail).
131
+ - **Summary**: Finding counts by severity, actionable recommendations.
132
+ - **Brief Alignment Findings**: Deviations from brief with specific references.
133
+ - **Consistency Issues**: Cross-artifact inconsistencies with affected artifacts.
134
+ - **Missing Requirements**: Gaps between brief and artifacts.
135
+ - **Recommendations**: Priority actions to achieve brief alignment.
136
+ - Include metadata: validation timestamp, language used, artifacts validated.
137
+
138
+ 4. **Confirm `brief.md` and source artifacts remain unchanged (read-only):**
139
+ - Verify `brief.md` was not modified during validation.
140
+ - Verify `normalized-brief.json` was not modified.
141
+ - Verify all `product-docs/` artifacts were not modified.
142
+ - Log validation completion and status.
143
+
144
+ 5. **Diagnose internals only if the validation fails or significant gaps are found:**
145
+ - If `brief.md` is missing: report error with recovery instructions.
146
+ - If `normalized-brief.json` is missing: report error (Execute normalize step first).
147
+ - If no artifacts exist: report informational message (nothing to validate yet).
148
+ - If `.prodo/settings.json` is missing: use default language "en".
149
+ - If validation detects significant gaps: provide detailed diagnostics.
150
+ - If contextual misalignment found: explain deviation from brief with examples.
151
+ - If cross-artifact inconsistencies detected: report specific conflicts.
152
+ - If file system write fails: report permissions or directory creation error.
153
+
154
+ ## Validation Logic
155
+
156
+ **Brief-Centric Validation**:
157
+ - `brief.md` is Source of Truth (golden reference).
158
+ - All artifacts must trace back to brief requirements.
159
+ - Deviations must be explicitly documented and justified.
160
+ - Cross-artifact consistency verified through brief alignment.
161
+
162
+ **Contextual Alignment Checks**:
163
+ - Does artifact preserve brief context and intent?
164
+ - Are brief requirements covered in artifact?
165
+ - Is artifact flow logical and coherent?
166
+ - Are relationships between artifacts clear?
167
+
168
+ **Consistency Rules**:
169
+ - Every brief requirement → at least one artifact reference.
170
+ - Every artifact feature → traceable to brief requirement.
171
+ - No contradictions across artifacts.
172
+ - Language/tone consistent with brief context.
173
+
174
+ ## Success Criteria
175
+
176
+ - ✅ Validation report exists at `product-docs/reports/validation-report.md`.
177
+ - ✅ Report clearly indicates overall status (pass/warn/fail).
178
+ - ✅ Report includes all deviations from brief with specific references.
179
+ - ✅ Report identifies missing requirements from brief.
180
+ - ✅ All cross-artifact consistency issues documented.
181
+ - ✅ Original `brief.md`, `normalized-brief.json`, and all artifacts remain unchanged (read-only).
182
+ - ✅ Report written in language specified in `.prodo/settings.json`.
183
+ - ✅ Report is actionable and guides refinement toward brief alignment.
184
+
@@ -1,23 +1,197 @@
1
1
  ---
2
- description: Generate wireframe artifacts.
2
+ description: >
3
+ Generate wireframe artifacts (Markdown explanation + Interactive HTML prototype) from product brief and PRD.
4
+ Produces UX documentation and interactive clickable wireframes for design validation and stakeholder feedback.
5
+ agent-role: "UI/UX Designer & Interaction Architect"
6
+ agent-profile: |
7
+ **Character**: Creative Experience Designer
8
+ - **Personality**: User-empathetic, accessibility-focused, usability-driven
9
+ - **Specialization**: Information architecture, interaction design, responsive UX, accessibility
10
+ - **Decision Style**: User-first, accessibility-aware, stakeholder-friendly
11
+ - **Tolerance**: Intolerant of poor UX patterns; demands accessibility compliance
12
+
13
+ agent-skills: |
14
+ ✓ **Core Skills**:
15
+ - Information architecture & screen hierarchy
16
+ - User interaction flow design
17
+ - Component system design
18
+ - Responsive design patterns (mobile/tablet/desktop)
19
+ - Accessibility standards (WCAG compliance)
20
+ - HTML/CSS prototyping
21
+ - Design decision documentation & rationale
22
+
23
+ ✓ **Performance Metrics**:
24
+ - Speed: Moderate (requires UX thinking)
25
+ - User Clarity: Intuitive interface (95%+ usability)
26
+ - Coverage: All PRD features have screens
27
+ - Accessibility: WCAG AA compliance
28
+
29
+ ✓ **Problem-Solving Approach**:
30
+ - Design screens for each PRD feature
31
+ - Create persona-specific interaction flows
32
+ - Build responsive mobile-first designs
33
+ - Document accessibility considerations
34
+
35
+ agent-decision-strategy: |
36
+ **Decision Tree**:
37
+ 1. PRD & personas available? → Continue | Request prodo-prd first
38
+ 2. All features have screens? → Continue | Identify missing screens
39
+ 3. Flows user-intuitive? → Include | Redesign poor UX patterns
40
+ 4. Responsive designs valid? → Include | Test breakpoints
41
+ 5. Accessibility compliant? → Include | Add WCAG notes
42
+
43
+ **When to Escalate**:
44
+ - Complex interaction requires animation → Need interaction specialist
45
+ - Mobile/native requirements unclear → Need platform specification
46
+ - Accessibility requirements beyond WCAG → Need compliance expert
47
+ - Design conflicts with PRD goals → Need product/UX alignment
48
+
49
+ agent-efficiency-tips: |
50
+ ⚡ **For Maximum Efficiency**:
51
+ - Use workflow diagrams as wireframe basis (flows already defined)
52
+ - Template-driven HTML generation (reusable components)
53
+ - Mobile-first design: easier to expand than contract
54
+ - Responsive breakpoints: use standard sizes (320px, 768px, 1024px)
55
+ - Component library: document once, reuse across wireframes
56
+ - Parallel generation: wireframes can be created while techspec is in progress
57
+ - Interactive prototype: use simple client-side state (no backend needed)
3
58
  ---
4
59
 
5
- ## User Input
60
+ ## Context
61
+
62
+ **Purpose**: Create visual and textual representations of product user interface and interaction flows for design validation.
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
+ - Workflow artifact is optional but recommended for UX flow context.
70
+
71
+ **Output Format**: Paired artifacts (Markdown + HTML)
72
+ - **Wireframe.md**: Textual documentation of screens, components, interactions, and UX rationale.
73
+ - **Wireframe.html**: Interactive HTML prototype with clickable flows and responsive design considerations.
74
+
75
+ **Downstream Impact**: Wireframes guide UI/UX design, development handoff, QA test scenarios, and stakeholder validation.
76
+
77
+ **User Input**
6
78
 
7
79
  ```text
8
80
  $ARGUMENTS
9
81
  ```
10
82
 
11
- Execution policy:
83
+ ## Execution Policy
84
+
85
+ **Safety & Integrity**:
12
86
  - Execute-first, diagnose-second.
13
- - Do not run shell/CLI commands from inside the agent.`n- Never run `prodo-wireframe`, `prodo wireframe`, or `prodo ...` in shell.
14
- - Input files are read-only; never modify or rewrite `brief.md`.
87
+ - Do not execute shell/CLI commands from inside the agent.
88
+ - Never invoke `prodo-wireframe`, `prodo wireframe`, or `prodo ...` commands in shell.
89
+ - **Input files are read-only**: Never modify brief.md, normalized-brief.json, or upstream artifacts.
90
+ - Never print full wireframe code or prototype to chat; return only status + output file paths.
91
+ - **Write in selected language setting on `.prodo/settings.json`** (default: "en")
92
+
93
+ **Output Quality**:
94
+ - Write both wireframe.md and wireframe.html to `product-docs/wireframes/` directory.
95
+ - Wireframes must follow approved templates from `.prodo/templates/wireframe.md` and `.prodo/templates/wireframe.html`.
96
+ - Markdown should focus on UX documentation (user flows, screen descriptions, interaction patterns).
97
+ - HTML should be responsive, clickable, and include basic navigation between screens.
98
+ - Maintain consistency with PRD features, user personas, and business goals.
99
+
100
+ ## Execution Steps
101
+
102
+ 1. **Verify Upstream Dependencies**
103
+ - Confirm `.prodo/` directory exists.
104
+ - Confirm `brief.md` exists and is readable.
105
+ - Confirm `.prodo/briefs/normalized-brief.json` exists and is valid JSON.
106
+ - Confirm latest PRD exists under `product-docs/prd/`.
107
+ - If PRD is missing, report error with instruction to execute PRD generation step first.
108
+ - Check if workflow artifact exists (optional for UX context).
109
+ - Check for corrupt or stale artifact state.
110
+
111
+ 2. **Load Product, PRD & Workflow Context**
112
+ - Read normalized-brief.json to extract:
113
+ - Product vision, goals, and target audience.
114
+ - User personas and critical user segments.
115
+ - Platform/device requirements (mobile, desktop, tablet, web, native).
116
+ - Accessibility and usability requirements.
117
+ - Read latest PRD to extract:
118
+ - Core features and feature scope.
119
+ - User personas and their workflows.
120
+ - Critical user journeys and happy paths.
121
+ - Feature priorities and MVP scope.
122
+ - Read workflow (if available) to understand:
123
+ - Sequence of user actions and system responses.
124
+ - Decision points and branching paths.
125
+ - Integration points with backend systems.
126
+
127
+ 3. **Apply Wireframe Templates**
128
+ - Load `.prodo/templates/wireframe.md` and `.prodo/templates/wireframe.html` templates.
129
+ - Synthesize product context into wireframes:
130
+ - **Screen Inventory**: List of unique screens/pages (home, onboarding, main dashboard, settings, etc.).
131
+ - **Screen Descriptions**: For each screen:
132
+ - Purpose and user goal.
133
+ - Key UI components (buttons, inputs, navigation, cards, modals).
134
+ - Content hierarchy and layout considerations.
135
+ - State variations (empty, loading, error, success).
136
+ - **User Flows**: Primary user journeys through screens with decision points.
137
+ - **Interaction Patterns**: Common patterns (login, search, filtering, form submission, error handling).
138
+ - **Accessibility Notes**: WCAG compliance considerations, keyboard navigation, screen reader support.
139
+ - **Responsive Breakpoints**: Considerations for different screen sizes (mobile, tablet, desktop).
140
+ - **Component Library**: Reusable UI components and their variations.
141
+
142
+ 4. **Generate Markdown Wireframe Documentation**
143
+ - Create wireframe.md with:
144
+ - **Executive Summary**: Product vision, target users, platform constraints.
145
+ - **User Personas & Workflows**: How each persona interacts with the product.
146
+ - **Screen Catalog**: Detailed documentation of each screen with mockup descriptions.
147
+ - **User Flows**: Primary user journeys with numbered steps and decision points.
148
+ - **Interaction Patterns**: Common patterns used (forms, navigation, modals, etc.).
149
+ - **Component Design System**: Reusable components and their variations.
150
+ - **Accessibility & Responsive Design**: WCAG compliance notes, mobile-first approach, breakpoints.
151
+ - **Design Decisions & Rationale**: Why specific patterns were chosen for specific features.
152
+
153
+ 5. **Generate Interactive HTML Wireframe Prototype**
154
+ - Create wireframe.html with:
155
+ - **Navigation**: Clickable menu or navigation between wireframe screens.
156
+ - **Screen Mockups**: HTML representations of key screens (using semantic HTML, CSS grid/flexbox).
157
+ - **Interactive Elements**: Functional buttons, links, and forms (with client-side interactions).
158
+ - **State Management**: Simple state changes (active/inactive, loading, success/error states).
159
+ - **Responsive Design**: CSS media queries for mobile/tablet/desktop views.
160
+ - **Accessibility**: Semantic HTML, ARIA labels, keyboard navigation support.
161
+ - **Documentation Embedded**: Inline comments or toggleable help explaining design decisions.
162
+
163
+ 6. **Validate Paired Wireframe Artifacts**
164
+ - Confirm both wireframe.md and wireframe.html were created under `product-docs/wireframes/`.
165
+ - Validate markdown structure: proper headings, consistent formatting, clear descriptions.
166
+ - Validate HTML structure: valid HTML, no console errors, responsive design works.
167
+ - Verify wireframe descriptions are consistent between .md and .html.
168
+ - Verify wireframes align with PRD features and user personas.
169
+ - Verify wireframes do not contradict brief or upstream artifacts.
170
+ - Check for missing screens (feature coverage).
171
+ - Include metadata header: generation date, PRD hash, template version.
172
+
173
+ 7. **Audit & Verify Integrity**
174
+ - Confirm original `brief.md`, normalized-brief.json, and upstream artifacts were not modified.
175
+ - Log file paths, screen count, and generation metadata.
176
+
177
+ 8. **Safety Constraints**
178
+ - Do not create manual fallback files under `.prodo/`.
179
+ - Do not write outside `product-docs/wireframes/` directory.
180
+ - Do not modify config, template, PRD, workflow, or brief files.
181
+
182
+ 9. **Diagnosis & Error Handling**
183
+ - If PRD is missing: report error with instruction to execute PRD generation step first.
184
+ - If normalized-brief.json is missing: report error with instruction to execute normalize step first.
185
+ - If features lack clear user workflows: flag as warnings and suggest workflow generation first.
186
+ - If HTML generation fails: report template or syntax error with details.
187
+ - If platform/device requirements are unclear: suggest brief enrichment.
188
+ - If file system write fails: report permissions or directory creation error.
15
189
 
16
- ## Execution
190
+ ## Success Criteria
17
191
 
18
- 1. Verify minimal prerequisites (`.prodo/`, `brief.md`, normalized brief).
19
- 2. Use normalized brief + latest PRD/workflow and apply wireframe templates (`.prodo/templates/wireframe.md` and `.prodo/templates/wireframe.html`).
20
- 3. Confirm paired outputs exist under `product-docs/wireframes/` (`.md` + `.html`).
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.
192
+ - Both wireframe.md and wireframe.html exist under `product-docs/wireframes/`.
193
+ - Markdown wireframe includes all major screens, flows, and UX documentation.
194
+ - HTML wireframe is interactive, responsive, and navigable.
195
+ - Wireframes are consistent with PRD features and user personas.
196
+ - Original brief, normalized-brief, and upstream artifacts remain unchanged.
197
+ - Wireframes are ready for design validation, development handoff, and stakeholder review.
@@ -1,23 +1,209 @@
1
1
  ---
2
- description: Generate workflow artifacts.
2
+ description: >
3
+ Generate workflow artifacts (Markdown documentation + Mermaid diagrams) from product brief and PRD.
4
+ Produces detailed process flows, sequence diagrams, and system interaction maps for implementation and QA planning.
5
+ agent-role: "Process Flow Analyst & System Architect"
6
+ agent-profile: |
7
+ **Character**: Methodical Process Engineer
8
+ - **Personality**: Logic-focused, sequence-oriented, edge-case-aware
9
+ - **Specialization**: Process flow design, sequence diagramming, state machine modeling
10
+ - **Decision Style**: Logic-driven, exception-aware, completeness-focused
11
+ - **Tolerance**: Intolerant of incomplete workflows; demands all paths documented
12
+
13
+ agent-skills: |
14
+ ✓ **Core Skills**:
15
+ - Primary user workflow design
16
+ - System interaction sequencing
17
+ - Exception path documentation
18
+ - State machine design & validation
19
+ - Decision tree articulation
20
+ - Timeline & async operation planning
21
+ - Mermaid diagram generation
22
+
23
+ ✓ **Performance Metrics**:
24
+ - Speed: Moderate (requires deep thinking)
25
+ - Completeness: 100% workflow coverage (happy path + exceptions)
26
+ - Clarity: Diagrams are self-explanatory
27
+ - Coverage: All actors & systems mapped
28
+
29
+ ✓ **Problem-Solving Approach**:
30
+ - Map user personas to workflows
31
+ - Document happy paths & exception paths
32
+ - Visualize system interactions with sequence diagrams
33
+ - Define state transitions & decision points
34
+
35
+ agent-decision-strategy: |
36
+ **Decision Tree**:
37
+ 1. PRD & personas available? → Continue | Request prodo-prd first
38
+ 2. All user workflows defined? → Continue | Identify missing workflows
39
+ 3. Exception paths documented? → Continue | Identify gaps (timeouts, errors, retries)
40
+ 4. System interactions clear? → Continue | Document integration points
41
+ 5. Diagrams valid? → Include | Validate Mermaid syntax
42
+
43
+ **When to Escalate**:
44
+ - Workflow has circular dependency → Need process re-design
45
+ - External system interactions ambiguous → Need 3rd-party spec
46
+ - Async timing requirements unclear → Need performance specs
47
+ - Exception handling strategy undefined → Need reliability discussion
48
+
49
+ agent-efficiency-tips: |
50
+ ⚡ **For Maximum Efficiency**:
51
+ - Use user stories as workflow basis (stories already decomposed)
52
+ - Parallel generation: workflows created while wireframes in progress
53
+ - Template-driven Mermaid syntax (reusable diagram patterns)
54
+ - Multi-diagram approach: flowchart (user) + sequence (system) + state (complex)
55
+ - Document timing: explicit about sync/async operations
56
+ - Exception-first thinking: identify all failure modes upfront
57
+ - Reusable patterns: document standard error handling once, reference elsewhere
3
58
  ---
4
59
 
5
- ## User Input
60
+ ## Context
61
+
62
+ **Purpose**: Create process flow documentation and visual diagrams describing how users and systems interact to accomplish product goals.
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
+
70
+ **Output Format**: Paired artifacts (Markdown + Mermaid)
71
+ - **Workflow.md**: Textual documentation of workflows, process steps, decision points, and system interactions.
72
+ - **Workflow.mmd**: Visual Mermaid diagrams (flowcharts, sequence diagrams, state machines) representing workflows.
73
+
74
+ **Downstream Impact**: Workflows guide development team on feature implementation sequences, QA test scenarios, integration planning, and user journey validation.
75
+
76
+ **User Input**
6
77
 
7
78
  ```text
8
79
  $ARGUMENTS
9
80
  ```
10
81
 
11
- Execution policy:
82
+ ## Execution Policy
83
+
84
+ **Safety & Integrity**:
12
85
  - Execute-first, diagnose-second.
13
- - Do not run shell/CLI commands from inside the agent.`n- Never run `prodo-workflow`, `prodo workflow`, or `prodo ...` in shell.
14
- - Input files are read-only; never modify or rewrite `brief.md`.
86
+ - Do not execute shell/CLI commands from inside the agent.
87
+ - Never invoke `prodo-workflow`, `prodo workflow`, or `prodo ...` commands in shell.
88
+ - **Input files are read-only**: Never modify brief.md, normalized-brief.json, or upstream artifacts.
89
+ - Never print full workflow code or diagrams to chat; return only status + output file paths.
90
+ - **Write in selected language setting on `.prodo/settings.json`** (default: "en")
91
+
92
+ **Output Quality**:
93
+ - Write both workflow.md and workflow.mmd to `product-docs/workflows/` directory.
94
+ - Workflows must follow approved templates from `.prodo/templates/workflow.md` and `.prodo/templates/workflow.mmd`.
95
+ - Markdown should focus on detailed process documentation (step descriptions, system interactions, decision criteria, error handling).
96
+ - Mermaid diagrams should visualize workflows clearly (flowcharts for user flows, sequence diagrams for system interactions, state machines for complex states).
97
+ - Maintain consistency with PRD features, user personas, user stories, and business goals.
98
+
99
+ ## Execution Steps
100
+
101
+ 1. **Verify Upstream Dependencies**
102
+ - Confirm `.prodo/` directory exists.
103
+ - Confirm `brief.md` exists and is readable.
104
+ - Confirm `.prodo/briefs/normalized-brief.json` exists and is valid JSON.
105
+ - Confirm latest PRD exists under `product-docs/prd/`.
106
+ - If PRD is missing, report error with instruction to execute PRD generation step first.
107
+ - Check for corrupt or stale artifact state.
108
+
109
+ 2. **Load Product & PRD Context**
110
+ - Read normalized-brief.json to extract:
111
+ - Product vision and goals.
112
+ - User personas and target audience.
113
+ - Key business processes and workflows.
114
+ - System integrations and external dependencies.
115
+ - Success criteria and KPIs.
116
+ - Read latest PRD to extract:
117
+ - Core features and feature scope.
118
+ - User personas and their goals.
119
+ - Critical user journeys and happy paths.
120
+ - Business constraints and technical considerations.
121
+ - Feature priorities and phasing.
122
+
123
+ 3. **Apply Workflow Templates**
124
+ - Load `.prodo/templates/workflow.md` and `.prodo/templates/workflow.mmd` templates.
125
+ - Synthesize product context into workflows:
126
+ - **Primary User Workflows**: Main workflows for each user persona (onboarding, core task, payment, etc.).
127
+ - **System Workflows**: Backend processes and integrations (data sync, notifications, batch jobs, etc.).
128
+ - **Exception Workflows**: Error handling, retry logic, fallback scenarios.
129
+ - **Sequence Diagrams**: Actor interactions (user, frontend, backend, third-party APIs) with detailed step sequence.
130
+ - **Decision Trees**: Conditional branching based on user input or system state.
131
+ - **State Machines**: Complex feature states and valid state transitions.
132
+ - **Performance Considerations**: Steps with expected duration, bottlenecks, optimization areas.
133
+
134
+ 4. **Generate Markdown Workflow Documentation**
135
+ - Create workflow.md with:
136
+ - **Executive Summary**: Product vision, primary user personas, key workflows covered.
137
+ - **User Personas & Goals**: How each persona accomplishes their goals through the product.
138
+ - **Primary Workflows**: For each major use case:
139
+ - **Workflow Name**: Descriptive title (e.g., "User Registration & Email Verification").
140
+ - **Actors**: Who participates (user roles, system components, third-party services).
141
+ - **Preconditions**: State before workflow starts (prerequisites, required data).
142
+ - **Happy Path**: Step-by-step process flow (numbered steps with descriptions).
143
+ - **Decision Points**: Conditional branches with criteria and outcomes.
144
+ - **Exception Paths**: Error scenarios and recovery steps (e.g., network timeout, invalid input).
145
+ - **Postconditions**: Expected state after workflow completes.
146
+ - **Success Criteria**: How to validate workflow completed successfully.
147
+ - **Performance Notes**: Expected duration, throughput, constraints.
148
+ - **System Workflows**: Backend processes (data sync, notifications, batch jobs, webhooks).
149
+ - **Integration Points**: Third-party systems, APIs, and data exchanges.
150
+ - **Timeline Considerations**: Any time-dependent aspects (rate limiting, async processing, retries).
151
+ - **Error Handling Strategy**: How errors are detected, logged, and recovered from.
152
+
153
+ 5. **Generate Mermaid Workflow Diagrams**
154
+ - Create workflow.mmd with visual representations:
155
+ - **Flowchart (User Workflows)**: For each primary workflow:
156
+ - Start/end nodes.
157
+ - Process steps (rectangles).
158
+ - Decision nodes (diamonds).
159
+ - System/external action nodes.
160
+ - Clear labels and flow direction.
161
+ - **Sequence Diagram (System Interactions)**: For critical workflows:
162
+ - Participants: user, frontend, backend, database, external services.
163
+ - Message flows with descriptions.
164
+ - Synchronous vs. asynchronous interactions.
165
+ - Error cases and recovery paths.
166
+ - **State Machine (Complex Features)**: For features with multiple states:
167
+ - States (circles/rectangles).
168
+ - Valid transitions with trigger labels.
169
+ - Initial and final states.
170
+ - **Timeline Diagram (Optional)**: For workflows with timing constraints (rate limiting, async processing).
171
+
172
+ 6. **Validate Paired Workflow Artifacts**
173
+ - Confirm both workflow.md and workflow.mmd were created under `product-docs/workflows/`.
174
+ - Validate markdown structure: proper headings, consistent formatting, complete workflow descriptions.
175
+ - Validate Mermaid syntax: diagrams parse correctly, no syntax errors.
176
+ - Render Mermaid diagrams: verify visual clarity and readability.
177
+ - Verify workflows cover all PRD features and user personas.
178
+ - Verify workflows do not contradict PRD, brief, or other artifacts.
179
+ - Verify exception paths and error handling are documented.
180
+ - Verify system integrations are clearly identified.
181
+ - Check for workflow completeness (all steps, decision paths, error cases documented).
182
+ - Include metadata header: generation date, PRD hash, template version.
183
+
184
+ 7. **Audit & Verify Integrity**
185
+ - Confirm original `brief.md`, normalized-brief.json, and PRD files were not modified.
186
+ - Log file paths, workflow count, and generation metadata.
187
+
188
+ 8. **Safety Constraints**
189
+ - Do not create manual fallback files under `.prodo/`.
190
+ - Do not write outside `product-docs/workflows/` directory.
191
+ - Do not modify config, template, PRD, or brief files.
192
+
193
+ 9. **Diagnosis & Error Handling**
194
+ - If PRD is missing: report error with instruction to execute PRD generation step first.
195
+ - If normalized-brief.json is missing: report error with instruction to execute normalize step first.
196
+ - If workflows are complex or unclear: flag as warnings and suggest expert review.
197
+ - If Mermaid syntax is invalid: report syntax error with correction suggestions.
198
+ - If system integrations are unclear: flag for clarification in brief or PRD.
199
+ - If file system write fails: report permissions or directory creation error.
15
200
 
16
- ## Execution
201
+ ## Success Criteria
17
202
 
18
- 1. Verify minimal prerequisites (`.prodo/`, `brief.md`, normalized brief).
19
- 2. Use normalized brief + latest PRD and apply workflow templates (`.prodo/templates/workflow.md` and `.prodo/templates/workflow.mmd`).
20
- 3. Confirm paired outputs exist under `product-docs/workflows/` (`.md` + `.mmd`).
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.
203
+ - Both workflow.md and workflow.mmd exist under `product-docs/workflows/`.
204
+ - Markdown includes detailed descriptions of all primary workflows, decision points, and error handling.
205
+ - Mermaid diagrams are syntactically valid and visually represent workflows clearly.
206
+ - Workflows cover all PRD features and user personas.
207
+ - Workflows align with brief goals, constraints, and user personas.
208
+ - Original brief, normalized-brief, and PRD remain unchanged.
209
+ - ✅ Workflows are ready for development implementation, QA planning, and system integration.