5-phase-workflow 1.2.0 → 1.2.1

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": "5-phase-workflow",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "A 5-phase feature development workflow for Claude Code",
5
5
  "bin": {
6
6
  "5-phase-workflow": "bin/install.js"
@@ -101,9 +101,14 @@ Use Task tool with subagent_type=Explore for complex exploration.
101
101
 
102
102
  **Goal:** Understand what already exists so you can ask informed questions.
103
103
 
104
- ### Step 4: Intensive Collaboration (5-10 Questions)
104
+ ### Step 4: Intensive Collaboration (5-10 Questions, ONE AT A TIME)
105
105
 
106
- **CRITICAL:** After exploring the codebase, engage in intensive Q&A using the AskUserQuestion tool. Ask 5-10 clarifying questions based on your findings. This is NOT optional.
106
+ **CRITICAL:** After exploring the codebase, engage in intensive Q&A. This is NOT optional.
107
+
108
+ - Ask 5-10 clarifying questions using AskUserQuestion
109
+ - **ONE question at a time** - wait for answer before next question
110
+ - Do NOT list multiple questions in one message
111
+ - Do NOT skip to creating feature.md before asking at least 5 questions
107
112
 
108
113
  **Question categories to explore:**
109
114
 
@@ -154,7 +159,7 @@ Use Task tool with subagent_type=Explore for complex exploration.
154
159
  - "Could we use existing Z component instead?"
155
160
  - "Is a full factory needed or just simple creation?"
156
161
 
157
- Use AskUserQuestion to present options and trade-offs. Multiple questions can be asked in batches.
162
+ **Ask questions ONE AT A TIME.** Use AskUserQuestion for each question. For clarifying questions, provide 2-4 options where meaningful. Wait for the user's answer before asking the next question. Open questions (like feature description) can use free text.
158
163
 
159
164
  ### Step 5: Determine Feature Name
160
165
 
@@ -39,7 +39,9 @@ Understand the project structure:
39
39
 
40
40
  This is a quick scan, not deep analysis. The executor agent will do detailed pattern matching.
41
41
 
42
- ### Step 3: Ask 2-3 Technical Questions
42
+ ### Step 3: Ask 2-3 Technical Questions (ONE AT A TIME)
43
+
44
+ **CRITICAL:** Ask questions ONE AT A TIME. Wait for the user's answer before asking the next question.
43
45
 
44
46
  Use AskUserQuestion to clarify:
45
47
  - Data layer decisions (if applicable)
@@ -48,7 +50,11 @@ Use AskUserQuestion to clarify:
48
50
  - Software Architecture
49
51
  - Testing behaviour
50
52
 
51
- Keep it brief. Don't over-question. Don't ask feature questions already answered in the plan-feature phase.
53
+ Keep it brief. Don't over-question. Don't ask feature questions already answered in the plan-feature phase.
54
+
55
+ - **ONE question at a time** - wait for answer before next question
56
+ - Do NOT list multiple questions in one message
57
+ - Do NOT skip to creating plan.md before asking your questions
52
58
 
53
59
  ### Step 4: Design Components
54
60
 
@@ -212,3 +218,5 @@ Components in the same step run in parallel. Structure your plan accordingly:
212
218
  - Don't over-analyze the codebase - the executor will do detailed pattern matching
213
219
  - Don't ask more than 3 questions
214
220
  - Don't create unnecessary sequential steps - group independent work together
221
+ - **Don't skip to implementation** - This command ONLY creates the plan
222
+ - **Don't batch questions** - Ask one question at a time
@@ -84,6 +84,8 @@ feature_name="${TICKET_ID}-${slug}"
84
84
  - Which existing patterns to follow?
85
85
  - Any edge cases to handle?
86
86
 
87
+ **Ask questions ONE AT A TIME.** Wait for the user's answer before asking the next question. Do NOT list multiple questions in one message.
88
+
87
89
  ### Step 5: Create Plan
88
90
 
89
91
  Write plan to `.5/${feature_name}/plan.md` using the template structure.
@@ -9,20 +9,20 @@ process.stdin.on('data', (chunk) => {
9
9
  inputData += chunk;
10
10
  });
11
11
 
12
- process.stdin.on('end', () => {
12
+ process.stdin.on('end', async () => {
13
13
  try {
14
14
  // Parse hook input (contains workspace info)
15
15
  const hookData = JSON.parse(inputData);
16
16
  const workspaceDir = hookData.workingDirectory || process.cwd();
17
17
 
18
- checkForUpdates(workspaceDir);
18
+ await checkForUpdates(workspaceDir);
19
19
  } catch (e) {
20
20
  // Silent failure - don't block on errors
21
21
  process.exit(0);
22
22
  }
23
23
  });
24
24
 
25
- function checkForUpdates(workspaceDir) {
25
+ async function checkForUpdates(workspaceDir) {
26
26
  const versionFile = path.join(workspaceDir, '.claude', '.5', 'version.json');
27
27
 
28
28
  // Check if version.json exists
@@ -57,38 +57,53 @@ function checkForUpdates(workspaceDir) {
57
57
 
58
58
  // Compare versions
59
59
  const installed = versionData.installedVersion;
60
- const packageVersion = getPackageVersion(workspaceDir);
60
+ const latestVersion = await getLatestVersion();
61
61
 
62
- if (!packageVersion || installed === packageVersion) {
62
+ if (!latestVersion || installed === latestVersion) {
63
63
  // No update available
64
64
  process.exit(0);
65
65
  }
66
66
 
67
- // Check if update is available (installed < package)
68
- if (compareVersions(installed, packageVersion) < 0) {
67
+ // Check if update is available (installed < latest)
68
+ if (compareVersions(installed, latestVersion) < 0) {
69
69
  // Show update notification
70
- console.log(`\n\x1b[34mℹ\x1b[0m Update available: ${installed} → ${packageVersion}`);
70
+ console.log(`\n\x1b[34mℹ\x1b[0m Update available: ${installed} → ${latestVersion}`);
71
71
  console.log(` Run: \x1b[1mnpx 5-phase-workflow --upgrade\x1b[0m\n`);
72
72
  }
73
73
 
74
74
  process.exit(0);
75
75
  }
76
76
 
77
- // Get package version from local package.json
78
- function getPackageVersion(workspaceDir) {
79
- // Try to find package.json in node_modules/5-phase-workflow
80
- const pkgPath = path.join(workspaceDir, 'node_modules', '5-phase-workflow', 'package.json');
81
-
82
- if (fs.existsSync(pkgPath)) {
83
- try {
84
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
85
- return pkg.version;
86
- } catch (e) {
87
- return null;
88
- }
89
- }
90
-
91
- return null;
77
+ // Get latest version from npm registry
78
+ async function getLatestVersion() {
79
+ return new Promise((resolve) => {
80
+ const https = require('https');
81
+ const req = https.get(
82
+ 'https://registry.npmjs.org/5-phase-workflow/latest',
83
+ { timeout: 3000 },
84
+ (res) => {
85
+ if (res.statusCode !== 200) {
86
+ resolve(null);
87
+ return;
88
+ }
89
+ let data = '';
90
+ res.on('data', (chunk) => (data += chunk));
91
+ res.on('end', () => {
92
+ try {
93
+ const pkg = JSON.parse(data);
94
+ resolve(pkg.version);
95
+ } catch (e) {
96
+ resolve(null);
97
+ }
98
+ });
99
+ }
100
+ );
101
+ req.on('error', () => resolve(null));
102
+ req.on('timeout', () => {
103
+ req.destroy();
104
+ resolve(null);
105
+ });
106
+ });
92
107
  }
93
108
 
94
109
  // Compare semver versions