5-phase-workflow 1.0.1 → 1.1.0

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.
@@ -24,17 +24,32 @@ This skill provides comprehensive verification of a completed feature implementa
24
24
 
25
25
  ### Step 1: Load Implementation Plan
26
26
 
27
- Read the implementation plan from `.5/{feature-name}/plan.md` where `{feature-name}` is the argument provided by the user.
27
+ Read the implementation plan from `.5/{feature-name}/plan/` where `{feature-name}` is the argument provided by the user.
28
28
 
29
- **Error Handling:** If the plan file is missing or unreadable:
29
+ **Error Handling:** If the plan directory is missing:
30
30
  - Return fail status immediately
31
- - Display clear error message: "Error: Implementation plan not found at `.5/{feature-name}/plan.md`. Please run /plan-implementation first."
31
+ - Display clear error message: "Error: Implementation plan not found at `.5/{feature-name}/plan/`. Please run /5:plan-implementation first."
32
32
  - Do not proceed to Step 2
33
33
 
34
- Extract:
35
- - Component checklist (all expected files)
36
- - Affected modules
37
- - Test modules
34
+ **Load metadata:**
35
+ - Read `.5/{feature-name}/plan/meta.md`
36
+ - Parse YAML frontmatter for basic plan info
37
+
38
+ **Load verification config:**
39
+ - Read `.5/{feature-name}/plan/verification.md`
40
+ - Extract:
41
+ - `build_command`
42
+ - `test_command`
43
+ - Expected New Files list
44
+ - Expected Modified Files list
45
+ - Build Targets list
46
+ - Test Modules list
47
+
48
+ **Load component checklist (aggregate from all step files):**
49
+ - For each step (1 to total_steps from meta.md):
50
+ - Read `.5/{feature-name}/plan/step-{N}.md`
51
+ - Extract "Expected Outputs" section (files created/modified)
52
+ - Build comprehensive expected files list to pass to verification-agent
38
53
 
39
54
  ### Step 2: Spawn verification-agent
40
55
 
@@ -52,15 +67,20 @@ Task tool call:
52
67
  ## Your Task
53
68
 
54
69
  Feature Name: {feature-name}
55
- Implementation Plan Path: .5/{feature-name}/plan.md
70
+ Implementation Plan Path: .5/{feature-name}/plan/
56
71
  Expected Files:
57
72
  - {path/to/file1.ext}
58
73
  - {path/to/file2.ext}
74
+ (aggregated from all step files in Step 1)
59
75
  Affected Modules:
60
76
  - {module-path-1}
61
77
  - {module-path-2}
78
+ (from verification.md)
62
79
  Test Modules:
63
80
  - {module-path-for-tests}
81
+ (from verification.md)
82
+ Build Command: {from verification.md}
83
+ Test Command: {from verification.md}
64
84
  ```
65
85
 
66
86
  ### Step 3: Process Agent Results
@@ -132,7 +152,10 @@ All checks completed successfully:
132
152
 
133
153
  Verification report: .5/{feature-name}/verification.md
134
154
 
135
- Ready to commit and create pull request!
155
+ Next steps:
156
+ 1. Commit your changes (recommended before code review)
157
+ 2. Run `/clear` to reset context
158
+ 3. Run `/5:review-code` for CodeRabbit review
136
159
  ```
137
160
 
138
161
  **If PASSED WITH WARNINGS:**
@@ -152,7 +175,10 @@ See warnings in verification report:
152
175
 
153
176
  You may address warnings before committing, but they don't block completion.
154
177
 
155
- Ready to commit!
178
+ Next steps:
179
+ 1. Commit your changes (recommended before code review)
180
+ 2. Run `/clear` to reset context
181
+ 3. Run `/5:review-code` for CodeRabbit review
156
182
  ```
157
183
 
158
184
  **If FAILED:**
@@ -191,9 +217,10 @@ It's recommended to commit changes before running CodeRabbit review (/review-cod
191
217
  - Create commit using the standard commit message format below
192
218
  - Stage all relevant files
193
219
  - Create commit with proper message format
220
+ - After committing, tell user: "Changes committed. Next steps: Run `/clear` followed by `/5:review-code` for CodeRabbit review."
194
221
 
195
222
  **If user selects "No":**
196
- - Tell user: "You can commit the changes manually when ready. After committing, run `/review-code` for CodeRabbit review."
223
+ - Tell user: "You can commit the changes manually when ready. After committing, run `/clear` followed by `/5:review-code` for CodeRabbit review."
197
224
 
198
225
  #### Commit Message Format
199
226
 
@@ -232,8 +259,11 @@ EOF
232
259
 
233
260
  ## Instructions Summary
234
261
 
235
- 1. **Load implementation plan** from `.5/{feature-name}/plan.md`
236
- 2. **Spawn verification-agent** with expected files, modules, and test modules
262
+ 1. **Load implementation plan** from `.5/{feature-name}/plan/`:
263
+ - Read meta.md for plan metadata
264
+ - Read verification.md for build/test config and targets
265
+ - Aggregate expected files from all step-N.md files
266
+ 2. **Spawn verification-agent** with aggregated expected files, modules, and test modules
237
267
  3. **Process agent results** - extract status, report, and structured data
238
268
  4. **Save verification report** to state directory
239
269
  5. **Update state file** with verification results
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ // Read stdin (Claude Code passes JSON)
7
+ let inputData = '';
8
+ process.stdin.on('data', (chunk) => {
9
+ inputData += chunk;
10
+ });
11
+
12
+ process.stdin.on('end', () => {
13
+ try {
14
+ // Parse hook input (contains workspace info)
15
+ const hookData = JSON.parse(inputData);
16
+ const workspaceDir = hookData.workingDirectory || process.cwd();
17
+
18
+ checkForUpdates(workspaceDir);
19
+ } catch (e) {
20
+ // Silent failure - don't block on errors
21
+ process.exit(0);
22
+ }
23
+ });
24
+
25
+ function checkForUpdates(workspaceDir) {
26
+ const versionFile = path.join(workspaceDir, '.claude', '.5', 'version.json');
27
+
28
+ // Check if version.json exists
29
+ if (!fs.existsSync(versionFile)) {
30
+ // Not installed or legacy install - skip
31
+ process.exit(0);
32
+ }
33
+
34
+ let versionData;
35
+ try {
36
+ versionData = JSON.parse(fs.readFileSync(versionFile, 'utf8'));
37
+ } catch (e) {
38
+ // Corrupted file - skip
39
+ process.exit(0);
40
+ }
41
+
42
+ // Check if we should run (daily frequency)
43
+ const now = Date.now();
44
+ const lastCheck = versionData.updateCheckLastRun
45
+ ? new Date(versionData.updateCheckLastRun).getTime()
46
+ : 0;
47
+ const frequency = (versionData.updateCheckFrequency || 86400) * 1000; // Convert to ms
48
+
49
+ if (now - lastCheck < frequency) {
50
+ // Checked recently, skip
51
+ process.exit(0);
52
+ }
53
+
54
+ // Update last check time
55
+ versionData.updateCheckLastRun = new Date().toISOString();
56
+ fs.writeFileSync(versionFile, JSON.stringify(versionData, null, 2));
57
+
58
+ // Compare versions
59
+ const installed = versionData.installedVersion;
60
+ const packageVersion = getPackageVersion(workspaceDir);
61
+
62
+ if (!packageVersion || installed === packageVersion) {
63
+ // No update available
64
+ process.exit(0);
65
+ }
66
+
67
+ // Check if update is available (installed < package)
68
+ if (compareVersions(installed, packageVersion) < 0) {
69
+ // Show update notification
70
+ console.log(`\n\x1b[34mℹ\x1b[0m Update available: ${installed} → ${packageVersion}`);
71
+ console.log(` Run: \x1b[1mnpx 5-phase-workflow --upgrade\x1b[0m\n`);
72
+ }
73
+
74
+ process.exit(0);
75
+ }
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;
92
+ }
93
+
94
+ // Compare semver versions
95
+ function compareVersions(v1, v2) {
96
+ const parts1 = v1.split('.').map(Number);
97
+ const parts2 = v2.split('.').map(Number);
98
+
99
+ for (let i = 0; i < 3; i++) {
100
+ if (parts1[i] > parts2[i]) return 1;
101
+ if (parts1[i] < parts2[i]) return -1;
102
+ }
103
+
104
+ return 0;
105
+ }
package/src/settings.json CHANGED
@@ -2,5 +2,8 @@
2
2
  "statusLine": {
3
3
  "type": "command",
4
4
  "command": "node .claude/hooks/statusline.js"
5
+ },
6
+ "hooks": {
7
+ "onCommandStart": "node .claude/hooks/check-updates.js"
5
8
  }
6
9
  }