5-phase-workflow 1.1.2 → 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.
@@ -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
@@ -57,7 +57,7 @@ It handles three distinct tasks, invoked with different parameters per component
57
57
  "type": null
58
58
  }
59
59
  },
60
- "reviewTool": "coderabbit" or "none"
60
+ "reviewTool": "claude" or "coderabbit" or "none"
61
61
  }
62
62
  ```
63
63
 
@@ -0,0 +1,83 @@
1
+ # Feature: {TICKET-ID} - {Title}
2
+
3
+ ## Ticket ID
4
+ {TICKET-ID}
5
+
6
+ ## Summary
7
+ {1-2 sentence overview of what will be implemented}
8
+
9
+ ## Problem Statement
10
+ {Why is this feature needed? What problem does it solve?}
11
+
12
+ ## Requirements
13
+
14
+ ### Functional Requirements
15
+ - {Requirement 1}
16
+ - {Requirement 2}
17
+ - ...
18
+
19
+ ### Non-Functional Requirements
20
+ - {Performance requirements}
21
+ - {Compatibility requirements}
22
+ - ...
23
+
24
+ ## Constraints
25
+ - {Business constraints}
26
+ - {Technical constraints}
27
+ - {Time/resource constraints}
28
+
29
+ ## Affected Components
30
+ - **{component/module-1}** - {What changes here}
31
+ - **{component/module-2}** - {What changes here}
32
+ - **{component/module-3}** - {What changes here}
33
+ - ...
34
+
35
+ ## Entity/Component Definitions
36
+
37
+ ### {EntityName} (if applicable)
38
+ | Field | Type | Required | Description |
39
+ |-------|------|----------|-------------|
40
+ | id | {Entity}Id | Yes | Unique identifier |
41
+ | name | String | Yes | Entity name |
42
+ | ... | ... | ... | ... |
43
+
44
+ ### Business Rules
45
+ - {Rule 1}
46
+ - {Rule 2}
47
+ - ...
48
+
49
+ ## Acceptance Criteria
50
+ - [ ] {Criterion 1 - how to verify success}
51
+ - [ ] {Criterion 2}
52
+ - [ ] {Criterion 3}
53
+ - ...
54
+
55
+ ## Alternatives Considered
56
+
57
+ ### Option 1: {Alternative approach}
58
+ **Pros:** {Benefits}
59
+ **Cons:** {Drawbacks}
60
+ **Decision:** Rejected because {reason}
61
+
62
+ ### Option 2: {Another alternative}
63
+ **Pros:** {Benefits}
64
+ **Cons:** {Drawbacks}
65
+ **Decision:** Rejected because {reason}
66
+
67
+ ### Chosen Approach: {Selected approach}
68
+ **Rationale:** {Why this approach was chosen}
69
+
70
+ ## Questions & Answers
71
+
72
+ ### Q1: {Question from collaboration phase}
73
+ **A:** {Answer from developer}
74
+
75
+ ### Q2: {Question}
76
+ **A:** {Answer}
77
+
78
+ ...
79
+
80
+ ## Next Steps
81
+ After approval:
82
+ 1. Run `/clear` to reset context
83
+ 2. Run `/5:plan-implementation {TICKET-ID}-{description}`
@@ -0,0 +1,55 @@
1
+ # Fix Plan: {TICKET-ID}
2
+
3
+ **Feature:** {feature-name}
4
+ **Generated:** {timestamp}
5
+ **Verification Status:** PARTIAL | FAILED
6
+
7
+ ---
8
+
9
+ ## Infrastructure Fixes
10
+
11
+ {If no infrastructure issues: "No infrastructure issues found."}
12
+
13
+ | # | File | Issue | Fix | Complexity |
14
+ |---|------|-------|-----|------------|
15
+ | 1 | {path} | {description} | {what to do} | simple / moderate / complex |
16
+
17
+ ## Feature Gap Fixes
18
+
19
+ {If no feature gaps or Layer 2 was skipped: "No feature gaps found." or "Skipped — no feature.md available."}
20
+
21
+ | # | File | Issue | Fix | Complexity |
22
+ |---|------|-------|-----|------------|
23
+ | 1 | {path} | {criterion or requirement not met} | {what to change} | simple / moderate / complex |
24
+
25
+ ## Quality Fixes
26
+
27
+ {If no quality issues: "No quality issues found."}
28
+
29
+ | # | File | Issue | Fix | Complexity |
30
+ |---|------|-------|-----|------------|
31
+ | 1 | {test-file-path} | No test file for {component} | Create test file | simple / moderate |
32
+
33
+ ---
34
+
35
+ ## Summary
36
+
37
+ | Category | Count |
38
+ |----------|-------|
39
+ | Infrastructure | {N} |
40
+ | Feature Gaps | {N} |
41
+ | Quality | {N} |
42
+ | **Total** | **{N}** |
43
+
44
+ ---
45
+
46
+ ## Results
47
+
48
+ {Populated after fixes are applied}
49
+
50
+ | # | File | Fix | Status |
51
+ |---|------|----|--------|
52
+ | 1 | {path} | {description} | APPLIED / FAILED |
53
+
54
+ **Build after fixes:** {status}
55
+ **Tests after fixes:** {status}
@@ -0,0 +1,30 @@
1
+ ---
2
+ ticket: {TICKET-ID}
3
+ feature: {feature-name}
4
+ created: {ISO-timestamp}
5
+ ---
6
+
7
+ # Implementation Plan: {TICKET-ID}
8
+
9
+ {One sentence summary of what this plan builds}
10
+
11
+ ## Components
12
+
13
+ | Step | Component | Action | File | Description | Complexity |
14
+ |------|-----------|--------|------|-------------|------------|
15
+ | 1 | {name} | create | {path} | {what it does} | simple |
16
+ | 1 | {name} | create | {path} | {what it does} | simple |
17
+ | 2 | {name} | create | {path} | {what it does} | moderate |
18
+ | 2 | {name} | modify | {path} | {what to change} | moderate |
19
+ | 3 | {name} | create | {path} | {what it does} | complex |
20
+
21
+ ## Implementation Notes
22
+
23
+ - Follow the pattern from {existing-file} for {component-type}
24
+ - {Key business rule to remember}
25
+ - {Integration point to wire up}
26
+
27
+ ## Verification
28
+
29
+ - Build: {command or "auto"}
30
+ - Test: {command or "auto"}
@@ -0,0 +1,17 @@
1
+ # Quick Implementation: {TICKET-ID}
2
+
3
+ ## Task
4
+ {DESCRIPTION}
5
+
6
+ ## Components
7
+
8
+ | # | Type | Name | Skill | Module |
9
+ |---|------|------|-------|--------|
10
+ | 1 | {type} | {name} | {skill} | {module} |
11
+
12
+ ## Affected Modules
13
+ - {module-1}
14
+ - {module-2}
15
+
16
+ ## Execution
17
+ {parallel | sequential | direct}
@@ -0,0 +1,58 @@
1
+ # Code Review Findings
2
+
3
+ **Generated:** {ISO-timestamp}
4
+ **Scope:** {what was reviewed}
5
+ **Total Findings:** {N}
6
+
7
+ ---
8
+
9
+ ## How to Use This File
10
+
11
+ 1. Review each finding below
12
+ 2. For each finding, choose an action:
13
+ - `[FIX]` - Apply this fix automatically (leave as-is)
14
+ - `[SKIP]` - Don't apply this fix (change FIX to SKIP)
15
+ - `[MANUAL]` - Custom instructions (change FIX to MANUAL and add instructions)
16
+ 3. Save this file
17
+ 4. Run: `/review-code apply`
18
+
19
+ The apply command will read your annotations and apply marked fixes.
20
+
21
+ ---
22
+
23
+ ## Finding {N}/{total}
24
+
25
+ **File:** {file-path}
26
+ **Line:** {line-number}
27
+ **Category:** {Fixable|Question|Manual}
28
+ **Severity:** {error|warning|suggestion}
29
+
30
+ **Description:**
31
+ {what the reviewer found}
32
+
33
+ **Suggested Fix:**
34
+ {how to fix it - can be multi-line}
35
+
36
+ **Original Reviewer Message:**
37
+ ```
38
+ {raw output from reviewer}
39
+ ```
40
+
41
+ **Action:** [FIX]
42
+
43
+ **Custom Instructions:** (only if you selected [MANUAL])
44
+ <!-- Add detailed instructions here if you want a custom fix -->
45
+
46
+
47
+ ---
48
+
49
+ ## Summary
50
+
51
+ - Total: {N}
52
+ - Fixable: {N}
53
+ - Questions: {N}
54
+ - Manual Review: {N}
55
+
56
+ **Next Steps:**
57
+ 1. Edit this file to mark which findings to fix
58
+ 2. Run: `/review-code apply`
@@ -0,0 +1,35 @@
1
+ # Code Review Summary
2
+
3
+ **Reviewed:** {scope}
4
+ **Timestamp:** {ISO-timestamp}
5
+ **User Decisions:** {summary of user choices}
6
+
7
+ ## Summary
8
+
9
+ - **Total Issues:** {N}
10
+ - **Applied with User Approval:** {N}
11
+ - **User-Resolved Questions:** {N}
12
+ - **Manual Review Needed:** {N}
13
+ - **Skipped by User:** {N}
14
+
15
+ ## Applied Fixes (User Approved)
16
+
17
+ - `{file-path}:{line}` - {description of fix}
18
+ - `{file-path}:{line}` - {description of fix}
19
+
20
+ ## User-Resolved Questions
21
+
22
+ - `{file-path}:{line}` - {description} (user answered: {answer})
23
+
24
+ ## Manual Review Needed
25
+
26
+ - `{file-path}:{line}` - {description}
27
+
28
+ ## Skipped Issues
29
+
30
+ - `{file-path}:{line}` - User chose not to apply
31
+
32
+ ## Files Modified
33
+
34
+ - {file-path} ({N} fixes applied)
35
+ - {file-path} ({N} fixes applied)
@@ -0,0 +1,9 @@
1
+ {
2
+ "ticket": "{TICKET-ID}",
3
+ "feature": "{feature-name}",
4
+ "status": "in-progress",
5
+ "currentStep": 1,
6
+ "completed": [],
7
+ "failed": [],
8
+ "startedAt": "{ISO-timestamp}"
9
+ }
@@ -0,0 +1,95 @@
1
+ # Verification Report: {TICKET-ID}
2
+
3
+ **Feature:** {feature-name}
4
+ **Status:** PASSED | PARTIAL | FAILED
5
+ **Verified:** {timestamp}
6
+
7
+ ---
8
+
9
+ ## Layer 1: Infrastructure
10
+
11
+ ### Files
12
+
13
+ - [x] {path} — exists
14
+ - [ ] {path} — MISSING
15
+
16
+ **Result:** {N}/{M} files exist
17
+
18
+ ### Build
19
+
20
+ **Command:** `{build-command}`
21
+ **Status:** SUCCESS | FAILED
22
+
23
+ {build errors if any}
24
+
25
+ ### Tests
26
+
27
+ **Command:** `{test-command}`
28
+ **Status:** SUCCESS | FAILED
29
+ **Total:** {N} | **Passed:** {N} | **Failed:** {N}
30
+
31
+ {test failure details if any}
32
+
33
+ **Layer 1 Result:** PASSED | FAILED
34
+
35
+ ---
36
+
37
+ ## Layer 2: Feature Completeness
38
+
39
+ {If feature.md was not found: "Skipped — no feature.md available (normal for quick-implement workflows)"}
40
+
41
+ ### Acceptance Criteria
42
+
43
+ | # | Criterion | Status | Evidence |
44
+ |---|-----------|--------|----------|
45
+ | 1 | {criterion text} | SATISFIED | {file:line} |
46
+ | 2 | {criterion text} | NOT SATISFIED | — |
47
+
48
+ **Result:** {N}/{M} criteria satisfied
49
+
50
+ ### Functional Requirements
51
+
52
+ | # | Requirement | Status | Evidence |
53
+ |---|-------------|--------|----------|
54
+ | 1 | {requirement text} | IMPLEMENTED | {file:line} |
55
+ | 2 | {requirement text} | NOT IMPLEMENTED | — |
56
+
57
+ **Result:** {N}/{M} requirements implemented
58
+
59
+ ### Component Completeness
60
+
61
+ | Component | File | Status | Notes |
62
+ |-----------|------|--------|-------|
63
+ | {name} | {path} | COMPLETE | — |
64
+ | {name} | {path} | PARTIAL | {what's missing} |
65
+
66
+ **Result:** {N}/{M} components complete
67
+
68
+ **Layer 2 Result:** PASSED | PARTIAL | SKIPPED
69
+
70
+ ---
71
+
72
+ ## Layer 3: Quality
73
+
74
+ ### Test Coverage for New Files
75
+
76
+ | New File | Test File | Status |
77
+ |----------|-----------|--------|
78
+ | {src/path/File.ts} | {src/path/File.test.ts} | HAS TEST |
79
+ | {src/path/Other.ts} | — | NO TEST |
80
+
81
+ **Result:** {N}/{M} new files have tests
82
+
83
+ **Layer 3 Result:** PASSED | PARTIAL
84
+
85
+ ---
86
+
87
+ ## Summary
88
+
89
+ | Layer | Result | Details |
90
+ |-------|--------|---------|
91
+ | Infrastructure | PASSED / FAILED | {N}/{M} files, build {status}, tests {status} |
92
+ | Feature Completeness | PASSED / PARTIAL / SKIPPED | {N}/{M} criteria, {N}/{M} requirements |
93
+ | Quality | PASSED / PARTIAL | {N}/{M} new files have tests |
94
+
95
+ **Overall:** PASSED | PARTIAL | FAILED