devforgeai 1.0.9 → 1.0.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devforgeai",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "DevForgeAI is a spec-driven development framework designed to enable AI-assisted software development with zero technical debt through automated validation, architectural constraints enforcement, and test-driven development workflows.",
5
5
  "keywords": [
6
6
  "ai",
@@ -1,6 +1,17 @@
1
1
  #!/bin/bash
2
2
  # Wrapper script for devforgeai_cli phase commands
3
3
  # Usage: ./devforgeai-validate phase-init STORY-XXX --project-root=.
4
+ # Usage: devforgeai-validate phase-init STORY-XXX --project-root=.
4
5
 
5
6
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
- PYTHONPATH="$SCRIPT_DIR" python3 -m devforgeai_cli.cli "$@"
7
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
8
+
9
+ # Prefer project venv Python if available (avoids PEP 668 issues)
10
+ VENV_PYTHON="$PROJECT_ROOT/.venv/bin/python3"
11
+ if [ -x "$VENV_PYTHON" ]; then
12
+ PYTHON="$VENV_PYTHON"
13
+ else
14
+ PYTHON="python3"
15
+ fi
16
+
17
+ PYTHONPATH="$SCRIPT_DIR" "$PYTHON" -m devforgeai_cli.cli "$@"
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: customer-discovery-workflow
3
+ description: Customer discovery workflow reference for interview loading, synthesis, and milestone tracking with EPIC-074 integration
4
+ story: STORY-542
5
+ epic: EPIC-075
6
+ ---
7
+
8
+ # Customer Discovery Workflow
9
+
10
+ Reference for the customer discovery skill. Guides interview loading, synthesis, and milestone tracking integrated with EPIC-074 market research outputs.
11
+
12
+ ---
13
+
14
+ ## Phase 1: Load Interview Questions from EPIC-074
15
+
16
+ Load interview questions from EPIC-074 market research outputs. Import the structured question sets generated during market research.
17
+
18
+ Check for EPIC-074 output files at the expected path. If files exist, load and parse the interview question sets organized by theme.
19
+
20
+ ### Question Themes
21
+
22
+ Organize interview questions into 3 themes:
23
+
24
+ 1. **Problem Validation** — Questions that validate whether the target customer actually experiences the problem your product solves.
25
+ 2. **Solution Fit** — Questions that assess whether your proposed solution addresses the customer's needs effectively.
26
+ 3. **Pricing** — Questions that explore willingness to pay, budget constraints, and perceived value.
27
+
28
+ ### Customer Segments
29
+
30
+ Prompt the user to define target customer segments for interview outreach.
31
+
32
+ - Require at least 3 customer segments to ensure adequate coverage.
33
+ - Enforce a maximum of 10 customer segments to maintain focus (BR-004).
34
+ - Each segment must have a clear description and target interview count.
35
+
36
+ ---
37
+
38
+ ## Phase 2: Fallback Interview Templates (BR-001)
39
+
40
+ When EPIC-074 outputs are unavailable, apply graceful degradation. Do not HALT. Instead, proceed with default fallback templates.
41
+
42
+ Display warning message:
43
+
44
+ > Market research outputs not found
45
+
46
+ Continue the workflow using 5 fallback topics as default templates:
47
+
48
+ 1. **Core Problem** — What is the biggest challenge you face in [domain]?
49
+ 2. **Current Solutions** — How do you currently solve this problem?
50
+ 3. **Pain Points** — What frustrates you about existing solutions?
51
+ 4. **Ideal Outcome** — What would a perfect solution look like?
52
+ 5. **Budget and Priority** — How much do you spend on this problem today?
53
+
54
+ Graceful degradation: workflow proceeds without blocking on missing EPIC-074 data.
55
+
56
+ ---
57
+
58
+ ## Phase 3: Conduct Interviews and Record Feedback
59
+
60
+ Guide the user through conducting interviews and recording structured feedback for each session.
61
+
62
+ ### Interview Recording Fields
63
+
64
+ For each interview, capture:
65
+
66
+ - Interviewee name/identifier and customer segment
67
+ - Date conducted (YYYY-MM-DD format)
68
+ - Responses organized by theme (problem validation, solution fit, pricing)
69
+ - Key quotes and observations
70
+ - Assumptions validated or invalidated
71
+
72
+ ---
73
+
74
+ ## Phase 4: Feedback Synthesis
75
+
76
+ Synthesize interview feedback into 4 categories:
77
+
78
+ 1. **Validated Assumptions** — Assumptions confirmed by interview evidence across multiple segments.
79
+ 2. **Invalidated Assumptions** — Assumptions disproven or contradicted by interview data.
80
+ 3. **Recurring Pain Points** — Problems mentioned independently by multiple interviewees.
81
+ 4. **Surprising Insights** — Unexpected findings not anticipated in the original hypothesis.
82
+
83
+ ### Minimum Interview Requirement (BR-002)
84
+
85
+ At least 1 interview must be conducted before synthesis can proceed. Zero interviews cannot block the workflow silently — if no interviews have been conducted, the workflow must prevent synthesis and redirect the user back to outreach planning.
86
+
87
+ When zero interviews are detected, return to the outreach phase and display a message explaining that at minimum 1 interview is required before synthesis.
88
+
89
+ ### Business Plan Integration
90
+
91
+ Write the synthesis summary to the business plan document. Append the results under the Customer Discovery milestone section. Add the following structured data:
92
+
93
+ - Summary of validated assumptions
94
+ - Summary of invalidated assumptions
95
+ - Key recurring pain points
96
+ - Notable surprising insights
97
+ - Recommended next steps
98
+
99
+ ---
100
+
101
+ ## Phase 5: Milestone Tracking
102
+
103
+ Write a Customer Discovery milestone entry to the business plan.
104
+
105
+ ### Milestone Fields
106
+
107
+ Each milestone entry contains:
108
+
109
+ | Field | Format | Description |
110
+ |-------|--------|-------------|
111
+ | Completion Date | YYYY-MM-DD | Date the discovery round completed |
112
+ | Interviews Conducted | Integer count | Number of interviews conducted |
113
+ | Top 3 Validated Assumptions | Ranked list | Three highest-confidence validated assumptions |
114
+ | Top 3 Invalidated Assumptions | Ranked list | Three most significant invalidated assumptions |
115
+ | Confidence Score | Percentage (%) | Overall discovery confidence score |
116
+
117
+ ### Confidence Score Calculation
118
+
119
+ Calculate the confidence score from the validated/total ratio:
120
+
121
+ ```
122
+ confidence = (validated_count / total_assumptions_tested) * 100
123
+ ```
124
+
125
+ Result: confidence percentage between 0% and 100% based on validated/total ratio.
126
+
127
+ ### Duplicate Milestone Detection (BR-003)
128
+
129
+ Before writing, check if a Customer Discovery milestone already exists in the business plan. If a duplicate milestone is detected, prompt the user to choose one of 3 options:
130
+
131
+ 1. **Append** — Add the new milestone alongside the existing one (preserves history).
132
+ 2. **Replace** — Overwrite the existing milestone with new data.
133
+ 3. **Cancel** — Abort the milestone write operation.
134
+
135
+ Never silently overwrite an existing milestone. Always ask the user to choose their preferred action.
136
+
137
+ ---
138
+
139
+ ## Phase 6: Partial Progress Persistence
140
+
141
+ ### State File Management
142
+
143
+ Save workflow progress to a discovery-state file after each phase completes. On exit or partial completion, save the current state so progress is not lost.
144
+
145
+ State file location: `tmp/{story-id}/discovery-state.json`
146
+
147
+ ### State Detection on Re-invocation
148
+
149
+ When the workflow is invoked, check if an existing discovery-state file exists. Detect partial progress by reading the state file and determining which phases have been completed.
150
+
151
+ If a partial state is detected, offer the user two options:
152
+
153
+ 1. **Resume** — Continue from the last completed step.
154
+ 2. **Restart** — Start over with a fresh workflow from the beginning.
155
+
156
+ ### Corrupted State Handling (NFR-001)
157
+
158
+ If the discovery-state file is corrupt (malformed JSON, missing required fields), log a warning message indicating the corruption was detected. Fall back to a clean fresh start rather than crashing. The warning should inform the user that their previous progress could not be recovered.
@@ -1,4 +1,6 @@
1
1
  const path = require('path');
2
+ const fs = require('fs');
3
+ const fsp = fs.promises;
2
4
  const { OutputFormatter } = require('../wizard/output-formatter');
3
5
  const { ProgressService } = require('../wizard/progress-service');
4
6
  const { SignalHandler } = require('../wizard/signal-handler');
@@ -176,13 +178,28 @@ async function action(directory, opts) {
176
178
  }
177
179
  }
178
180
 
179
- // Python CLI pip install
181
+ // Python CLI pip install (uses venv to avoid PEP 668 externally-managed errors)
180
182
  if (selectedComponents.includes('python-cli')) {
181
183
  progress.updateSpinnerText('Installing Python CLI...');
182
184
  try {
183
185
  const { execSync } = require('child_process');
184
186
  const scriptsDir = path.join(installDir, '.claude', 'scripts');
185
- execSync(`pip install -e "${scriptsDir}"`, { stdio: 'pipe', cwd: installDir });
187
+ const venvDir = path.join(installDir, '.venv');
188
+
189
+ // Create venv if it doesn't exist
190
+ try {
191
+ await fsp.access(path.join(venvDir, 'bin', 'pip'));
192
+ } catch {
193
+ execSync(`python3 -m venv "${venvDir}"`, { stdio: 'pipe', cwd: installDir });
194
+ }
195
+
196
+ // Install into venv
197
+ const venvPip = path.join(venvDir, 'bin', 'pip');
198
+ execSync(`"${venvPip}" install -e "${scriptsDir}"`, { stdio: 'pipe', cwd: installDir });
199
+
200
+ if (!opts.quiet) {
201
+ formatter.info('Python CLI installed in .venv/ — activate with: source .venv/bin/activate');
202
+ }
186
203
  } catch (e) {
187
204
  formatter.warning(`Python CLI install failed: ${e.message}`);
188
205
  }
@@ -225,9 +242,9 @@ async function action(directory, opts) {
225
242
  console.log(` Dirs: ${stats.directoriesCreated}`);
226
243
  console.log('');
227
244
  formatter.info('Next steps:');
228
- console.log(' 1. Review and customize context files in devforgeai/specs/context/');
245
+ console.log(' 1. Run /create-context to generate your project context files');
229
246
  console.log(' 2. Run /brainstorm to start your first project');
230
- console.log(' 3. See README.md for full documentation');
247
+ console.log(' 3. See docs/ for guides and documentation');
231
248
  console.log('');
232
249
  }
233
250
  } catch (error) {