5-phase-workflow 1.0.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.
Files changed (33) hide show
  1. package/README.md +332 -0
  2. package/bin/install.js +408 -0
  3. package/docs/workflow-guide.md +1024 -0
  4. package/package.json +34 -0
  5. package/src/agents/integration-agent.md +219 -0
  6. package/src/agents/review-processor.md +160 -0
  7. package/src/agents/step-executor.md +108 -0
  8. package/src/agents/step-fixer.md +132 -0
  9. package/src/agents/step-verifier.md +125 -0
  10. package/src/agents/verification-agent.md +411 -0
  11. package/src/commands/5/configure.md +309 -0
  12. package/src/commands/5/discuss-feature.md +393 -0
  13. package/src/commands/5/implement-feature.md +502 -0
  14. package/src/commands/5/plan-feature.md +285 -0
  15. package/src/commands/5/plan-implementation.md +376 -0
  16. package/src/commands/5/quick-implement.md +263 -0
  17. package/src/commands/5/review-code.md +583 -0
  18. package/src/commands/5/verify-implementation.md +277 -0
  19. package/src/hooks/statusline.js +53 -0
  20. package/src/settings.json +6 -0
  21. package/src/skills/build-project/SKILL.md +277 -0
  22. package/src/skills/configure-project/SKILL.md +355 -0
  23. package/src/skills/generate-readme/EXAMPLES.md +168 -0
  24. package/src/skills/generate-readme/SKILL.md +123 -0
  25. package/src/skills/generate-readme/TEMPLATE.md +141 -0
  26. package/src/skills/run-tests/SKILL.md +365 -0
  27. package/src/templates/ARCHITECTURE.md +64 -0
  28. package/src/templates/CONCERNS.md +75 -0
  29. package/src/templates/CONVENTIONS.md +75 -0
  30. package/src/templates/INTEGRATIONS.md +65 -0
  31. package/src/templates/STACK.md +60 -0
  32. package/src/templates/STRUCTURE.md +60 -0
  33. package/src/templates/TESTING.md +107 -0
@@ -0,0 +1,277 @@
1
+ ---
2
+ name: 5:verify-implementation
3
+ description: Verifies completed feature implementation by delegating checks to verification-agent. Runs in forked context to minimize main context usage.
4
+ allowed-tools: Read, Glob, Write, AskUserQuestion, Bash, Task, mcp__jetbrains__*
5
+ context: fork
6
+ user-invocable: true
7
+ ---
8
+
9
+ # Verify Implementation (Phase 4)
10
+
11
+ ## Overview
12
+
13
+ This skill provides comprehensive verification of a completed feature implementation. It is typically invoked:
14
+ 1. Automatically by `/implement-feature` at the end of Wave 7
15
+ 2. Manually by the developer to verify a feature
16
+ 3. After fixing issues to re-verify
17
+
18
+ **Architecture:** `Command -> Agent -> Tools`
19
+ - This command runs in forked context to minimize main context usage
20
+ - Delegates verification work to the verification-agent (also forked context)
21
+ - Handles reporting, state updates, and user interaction within the forked context
22
+
23
+ ## Verification Process
24
+
25
+ ### Step 1: Load Implementation Plan
26
+
27
+ Read the implementation plan from `.5/{feature-name}/plan.md` where `{feature-name}` is the argument provided by the user.
28
+
29
+ **Error Handling:** If the plan file is missing or unreadable:
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."
32
+ - Do not proceed to Step 2
33
+
34
+ Extract:
35
+ - Component checklist (all expected files)
36
+ - Affected modules
37
+ - Test modules
38
+
39
+ ### Step 2: Spawn verification-agent
40
+
41
+ Read `.claude/agents/verification-agent.md` for agent instructions, then spawn via Task tool:
42
+
43
+ ```
44
+ Task tool call:
45
+ subagent_type: general-purpose
46
+ description: "Verify {feature-name}"
47
+ prompt: |
48
+ {Contents of verification-agent.md}
49
+
50
+ ---
51
+
52
+ ## Your Task
53
+
54
+ Feature Name: {feature-name}
55
+ Implementation Plan Path: .5/{feature-name}/plan.md
56
+ Expected Files:
57
+ - {path/to/file1.ext}
58
+ - {path/to/file2.ext}
59
+ Affected Modules:
60
+ - {module-path-1}
61
+ - {module-path-2}
62
+ Test Modules:
63
+ - {module-path-for-tests}
64
+ ```
65
+
66
+ ### Step 3: Process Agent Results
67
+
68
+ Receive the structured results from verification-agent:
69
+ - Overall status (passed/passed-with-warnings/failed)
70
+ - Implementation completeness results (tasks, method signatures, test coverage, acceptance criteria)
71
+ - File existence results
72
+ - Problem detection results (errors vs warnings)
73
+ - Compilation results
74
+ - Test results
75
+ - Generated verification report (Markdown)
76
+
77
+ ### Step 4: Save Verification Report
78
+
79
+ Write the verification report from the agent to:
80
+ `.5/{feature-name}/verification.md`
81
+
82
+ ### Step 5: Update State File
83
+
84
+ Update `.5/{feature-name}/state.json` with verification results:
85
+
86
+ ```json
87
+ {
88
+ "verificationResults": {
89
+ "status": "passed | passed-with-warnings | failed",
90
+ "timestamp": "{ISO timestamp}",
91
+ "implementationCompleteness": {
92
+ "tasksTotal": N,
93
+ "tasksCompleted": N,
94
+ "tasksPartial": N,
95
+ "tasksMissing": N
96
+ },
97
+ "filesChecked": N,
98
+ "filesExist": N,
99
+ "compilationStatus": "success | failed",
100
+ "testStatus": "passed | failed",
101
+ "testsTotal": N,
102
+ "testsPassed": N,
103
+ "testsFailed": N,
104
+ "errorsFound": N,
105
+ "warningsFound": N,
106
+ "reportPath": ".5/{feature-name}/verification.md"
107
+ }
108
+ }
109
+ ```
110
+
111
+ If status is "passed" or "passed-with-warnings", also update:
112
+ ```json
113
+ {
114
+ "status": "completed",
115
+ "completedAt": "{ISO timestamp}"
116
+ }
117
+ ```
118
+
119
+ ### Step 6: Inform Developer
120
+
121
+ **If PASSED:**
122
+ ```
123
+ Verification PASSED!
124
+
125
+ All checks completed successfully:
126
+ - Implementation: {N}/{N} tasks completed
127
+ - Files: {N}/{N} exist
128
+ - Compilation: Success
129
+ - Tests: All passing ({N} tests)
130
+ - Errors: 0
131
+ - Warnings: {N}
132
+
133
+ Verification report: .5/{feature-name}/verification.md
134
+
135
+ Ready to commit and create pull request!
136
+ ```
137
+
138
+ **If PASSED WITH WARNINGS:**
139
+ ```
140
+ Verification PASSED with warnings
141
+
142
+ All critical checks passed, but warnings were found:
143
+ - Implementation: {N}/{N} tasks completed ({N} partial or minor deviations)
144
+ - Files: {N}/{N} exist
145
+ - Compilation: Success
146
+ - Tests: All passing ({N} tests)
147
+ - Errors: 0
148
+ - Warnings: {N}
149
+
150
+ See warnings in verification report:
151
+ .5/{feature-name}/verification.md
152
+
153
+ You may address warnings before committing, but they don't block completion.
154
+
155
+ Ready to commit!
156
+ ```
157
+
158
+ **If FAILED:**
159
+ ```
160
+ Verification FAILED
161
+
162
+ Issues found:
163
+ - Implementation: {N}/{N} tasks incomplete
164
+ - Files missing: {N}
165
+ - Compilation: Failed
166
+ - Tests: {N} failures
167
+ - Errors: {N}
168
+
169
+ See detailed errors in verification report:
170
+ .5/{feature-name}/verification.md
171
+
172
+ Please fix the errors and complete missing tasks, then re-run /verify-implementation {feature-name}
173
+ ```
174
+
175
+ ### Step 7: Prompt for Commit
176
+
177
+ **Only if verification PASSED or PASSED WITH WARNINGS**, use AskUserQuestion to ask if the user wants to commit the changes:
178
+
179
+ **Question:**
180
+ ```
181
+ Would you like to commit these changes now?
182
+
183
+ It's recommended to commit changes before running CodeRabbit review (/review-code).
184
+ ```
185
+
186
+ **Options:**
187
+ 1. "Yes - Create commit now (Recommended)"
188
+ 2. "No - I'll commit manually later"
189
+
190
+ **If user selects "Yes":**
191
+ - Create commit using the standard commit message format below
192
+ - Stage all relevant files
193
+ - Create commit with proper message format
194
+
195
+ **If user selects "No":**
196
+ - Tell user: "You can commit the changes manually when ready. After committing, run `/review-code` for CodeRabbit review."
197
+
198
+ #### Commit Message Format
199
+
200
+ **CRITICAL:** Follow this exact format when creating commits:
201
+
202
+ ```
203
+ {TICKET-ID} Short description of what is done (~50 chars)
204
+
205
+ - What changed and why (important points only)
206
+ - Another change and reason
207
+ - Keep it concise, no verbose descriptions
208
+ - No emojis
209
+ ```
210
+
211
+ **Guidelines:**
212
+ - First line: `{TICKET-ID}` + space + short description (~50 characters max)
213
+ - Blank line after first line
214
+ - Bullet points for changes (what changed and why)
215
+ - Only important points, no verbose descriptions
216
+ - No emojis
217
+ - No AI attribution or Co-Authored-By lines
218
+
219
+ **Implementation:**
220
+ When creating the commit, use HEREDOC format:
221
+
222
+ ```bash
223
+ git add [relevant files]
224
+ git commit -m "$(cat <<'EOF'
225
+ PROJ-1234 Short description here
226
+
227
+ - Change 1 and reason
228
+ - Change 2 and reason
229
+ EOF
230
+ )"
231
+ ```
232
+
233
+ ## Instructions Summary
234
+
235
+ 1. **Load implementation plan** from `.5/{feature-name}/plan.md`
236
+ 2. **Spawn verification-agent** with expected files, modules, and test modules
237
+ 3. **Process agent results** - extract status, report, and structured data
238
+ 4. **Save verification report** to state directory
239
+ 5. **Update state file** with verification results
240
+ 6. **Inform developer** with clear status
241
+ 7. **Prompt for commit** (if PASSED or PASSED WITH WARNINGS) - Recommended before CodeRabbit review
242
+
243
+ ## Key Principles
244
+
245
+ 1. **Thin orchestrator** - Delegate verification work to agent, keep interactive parts in main context
246
+ 2. **Comprehensive** - Agent checks everything (files, problems, compilation, tests)
247
+ 3. **Categorized** - Separate errors (block) from warnings (report)
248
+ 4. **Actionable** - Clear report of what needs fixing
249
+ 5. **Persistent** - Save report for reference
250
+ 6. **Resumable** - Can be re-run after fixes
251
+ 7. **Commit ready** - Prompt for commit after successful verification
252
+
253
+ ## DO NOT
254
+
255
+ - DO NOT run compilation or tests directly (agent handles this)
256
+ - DO NOT run problem detection directly (agent handles this)
257
+ - DO NOT block on warnings (only errors block)
258
+ - DO NOT skip state file update
259
+ - DO NOT skip saving verification report
260
+ - DO NOT skip asking about commit if verification passed
261
+ - DO NOT automatically create commits without user approval
262
+ - DO NOT use emojis in commit messages
263
+ - DO NOT include AI attribution or Co-Authored-By lines in commit messages
264
+
265
+ ## Error Handling
266
+
267
+ If the verification-agent fails to return results:
268
+ 1. Record the failure in the state file
269
+ 2. Mark overall verification as FAILED
270
+ 3. Include diagnostic information in report
271
+ 4. Suggest re-running verification
272
+
273
+ ## Related Documentation
274
+
275
+ - [Agent: verification-agent](../agents/verification-agent.md)
276
+ - [/implement-feature command](implement-feature.md)
277
+ - [/plan-implementation command](plan-implementation.md)
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ // Claude Code Statusline
3
+ // Shows: model | directory | context usage
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const os = require('os');
8
+
9
+ // Read JSON from stdin
10
+ let input = '';
11
+ process.stdin.setEncoding('utf8');
12
+ process.stdin.on('data', chunk => input += chunk);
13
+ process.stdin.on('end', () => {
14
+ try {
15
+ const data = JSON.parse(input);
16
+ const model = data.model?.display_name || 'Claude';
17
+ const dir = data.workspace?.current_dir || process.cwd();
18
+ const session = data.session_id || '';
19
+ const remaining = data.context_window?.remaining_percentage;
20
+
21
+ // Context window display (shows USED percentage)
22
+ let ctx = '';
23
+ if (remaining != null) {
24
+ const rem = Math.round(remaining);
25
+ const used = Math.max(0, Math.min(100, 100 - rem));
26
+
27
+ // Build progress bar (10 segments)
28
+ const filled = Math.floor(used / 10);
29
+ const bar = '█'.repeat(filled) + '░'.repeat(10 - filled);
30
+
31
+ // Color based on usage
32
+ if (used < 50) {
33
+ ctx = ` \x1b[32m${bar} ${used}%\x1b[0m`;
34
+ } else if (used < 65) {
35
+ ctx = ` \x1b[33m${bar} ${used}%\x1b[0m`;
36
+ } else if (used < 80) {
37
+ ctx = ` \x1b[38;5;208m${bar} ${used}%\x1b[0m`;
38
+ } else {
39
+ ctx = ` \x1b[5;31m💀 ${bar} ${used}%\x1b[0m`;
40
+ }
41
+ }
42
+
43
+ // Shorten directory path for display
44
+ const shortDir = dir.replace(os.homedir(), '~');
45
+
46
+ // Build and output statusline: model | directory | context
47
+ const statusline = `\x1b[36m${model}\x1b[0m | \x1b[90m${shortDir}\x1b[0m${ctx}`;
48
+ process.stdout.write(statusline);
49
+
50
+ } catch (e) {
51
+ // Silent fail - don't break statusline on parse errors
52
+ }
53
+ });
@@ -0,0 +1,6 @@
1
+ {
2
+ "statusLine": {
3
+ "type": "command",
4
+ "command": "node .claude/hooks/statusline.js"
5
+ }
6
+ }
@@ -0,0 +1,277 @@
1
+ ---
2
+ name: build-project
3
+ description: Builds the project using auto-detected or configured build system. Supports npm, gradle, cargo, go, maven, make, and more. Use when compiling, building, or verifying project build status.
4
+ allowed-tools: Bash, Read, Grep
5
+ model: sonnet
6
+ context: fork
7
+ user-invocable: true
8
+ ---
9
+
10
+ # Build Project
11
+
12
+ ## Overview
13
+
14
+ This skill executes build tasks with auto-detection of the build system and sufficient timeout for long-running builds. It provides structured error reporting and actionable suggestions when builds fail.
15
+
16
+ ## Build System Detection
17
+
18
+ The skill automatically detects the build system using:
19
+
20
+ 1. **Config file** (`.claude/.5/config.json`) - if `build.command` is specified
21
+ 2. **Auto-detection** - by examining project files:
22
+ - `package.json` → npm/yarn/pnpm
23
+ - `build.gradle` or `build.gradle.kts` → Gradle
24
+ - `pom.xml` → Maven
25
+ - `Cargo.toml` → Cargo (Rust)
26
+ - `go.mod` → Go
27
+ - `Makefile` → Make
28
+ - `setup.py` or `pyproject.toml` → Python
29
+
30
+ ## Build Targets
31
+
32
+ | Target | Use Case |
33
+ |--------|----------|
34
+ | `compile` | Fast compilation check (no tests, no packaging) |
35
+ | `build` | Full build (may include tests depending on tool) |
36
+ | `clean` | Clean build (removes previous artifacts first) |
37
+
38
+ ## Parameters
39
+
40
+ When invoked, the skill expects:
41
+
42
+ - **target** (optional, default: `build`): One of `compile`, `build`, `clean`
43
+ - **module** (optional): Specific module to build (for monorepos)
44
+
45
+ ## Execution Process
46
+
47
+ ### 1. Load Configuration
48
+
49
+ Read `.claude/.5/config.json` if it exists:
50
+
51
+ ```json
52
+ {
53
+ "build": {
54
+ "command": "npm run build",
55
+ "compileCommand": "npm run compile",
56
+ "cleanCommand": "npm run clean"
57
+ }
58
+ }
59
+ ```
60
+
61
+ If commands are specified, use them. Otherwise, auto-detect.
62
+
63
+ ### 2. Detect Build System
64
+
65
+ If no config, examine project files to detect build system:
66
+
67
+ ```bash
68
+ # Check for package.json
69
+ if [ -f "package.json" ]; then
70
+ # Check for lock files to determine package manager
71
+ if [ -f "pnpm-lock.yaml" ]; then
72
+ BUILD_TOOL="pnpm"
73
+ elif [ -f "yarn.lock" ]; then
74
+ BUILD_TOOL="yarn"
75
+ else
76
+ BUILD_TOOL="npm"
77
+ fi
78
+ fi
79
+
80
+ # Check for Gradle
81
+ if [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]; then
82
+ BUILD_TOOL="gradle"
83
+ fi
84
+
85
+ # Check for Maven
86
+ if [ -f "pom.xml" ]; then
87
+ BUILD_TOOL="mvn"
88
+ fi
89
+
90
+ # Check for Cargo
91
+ if [ -f "Cargo.toml" ]; then
92
+ BUILD_TOOL="cargo"
93
+ fi
94
+
95
+ # Check for Go
96
+ if [ -f "go.mod" ]; then
97
+ BUILD_TOOL="go"
98
+ fi
99
+
100
+ # Check for Make
101
+ if [ -f "Makefile" ]; then
102
+ BUILD_TOOL="make"
103
+ fi
104
+ ```
105
+
106
+ ### 3. Determine Build Command
107
+
108
+ Based on detected tool and target:
109
+
110
+ | Tool | compile | build | clean |
111
+ |------|---------|-------|-------|
112
+ | npm | `npm run build` | `npm run build` | `rm -rf dist node_modules && npm install` |
113
+ | yarn | `yarn build` | `yarn build` | `yarn clean` or `rm -rf dist` |
114
+ | pnpm | `pnpm build` | `pnpm build` | `pnpm clean` or `rm -rf dist` |
115
+ | gradle | `./gradlew compileJava -x test --offline` | `./gradlew build -x test --offline` | `./gradlew clean build` |
116
+ | mvn | `mvn compile` | `mvn package -DskipTests` | `mvn clean package` |
117
+ | cargo | `cargo check` | `cargo build` | `cargo clean && cargo build` |
118
+ | go | `go build ./...` | `go build ./...` | `go clean && go build ./...` |
119
+ | make | `make` | `make` | `make clean` |
120
+
121
+ ### 4. Execute Build with Proper Timeout
122
+
123
+ **IMPORTANT**: Builds can take several minutes. Use generous timeout:
124
+
125
+ ```bash
126
+ # Timeout based on target
127
+ # - compile: 2 minutes (120000ms)
128
+ # - build: 10 minutes (600000ms)
129
+ # - clean: 15 minutes (900000ms)
130
+ ```
131
+
132
+ Execute the command and capture output.
133
+
134
+ ### 5. Parse Build Output
135
+
136
+ Analyze output to identify:
137
+
138
+ #### Success Indicators
139
+
140
+ Tool-specific success patterns:
141
+ - npm/yarn/pnpm: No error messages, process exits with 0
142
+ - Gradle: `BUILD SUCCESSFUL`
143
+ - Maven: `BUILD SUCCESS`
144
+ - Cargo: `Finished` or `Compiling`
145
+ - Go: No error output
146
+ - Make: No error messages
147
+
148
+ #### Error Types
149
+
150
+ **Compilation Errors**:
151
+ ```
152
+ /path/to/file.ext:42: error: ...
153
+ ```
154
+ Extract: file path, line number, error message
155
+
156
+ **Dependency Issues**:
157
+ ```
158
+ Could not resolve dependencies
159
+ Module not found
160
+ ```
161
+ Suggest: `npm install`, `./gradlew --refresh-dependencies`, etc.
162
+
163
+ **Out of Memory**:
164
+ ```
165
+ JavaScript heap out of memory
166
+ Java heap space
167
+ ```
168
+ Suggest: Increase memory allocation
169
+
170
+ **Tool Not Found**:
171
+ ```
172
+ command not found: npm
173
+ ```
174
+ Suggest: Install the build tool
175
+
176
+ ### 6. Format Output
177
+
178
+ Provide structured response:
179
+
180
+ ```
181
+ BUILD STATUS: ✓ SUCCESS | ✗ FAILED
182
+ DURATION: 2m 34s
183
+ TOOL: {detected-tool}
184
+ TARGET: {target}
185
+ MODULE: {module or "all"}
186
+
187
+ SUMMARY:
188
+ - Build completed successfully
189
+ OR
190
+ - Build failed with X errors
191
+
192
+ ERRORS: (if any)
193
+ File: path/to/file.ext:42
194
+ Error: {error message}
195
+
196
+ File: path/to/another.ext:15
197
+ Error: {error message}
198
+
199
+ SUGGESTIONS:
200
+ - {actionable suggestion based on error type}
201
+ ```
202
+
203
+ ## Common Build Scenarios
204
+
205
+ ### First-Time Build
206
+
207
+ May fail with dependency issues. Suggestions:
208
+ - npm: `npm install`
209
+ - gradle: Remove `--offline` flag temporarily
210
+ - cargo: `cargo fetch`
211
+
212
+ ### Incremental Build Issues
213
+
214
+ Stale cache or artifacts. Suggestions:
215
+ - Try `clean` target
216
+ - Clear cache manually
217
+
218
+ ### Memory Issues
219
+
220
+ Build runs out of memory. Suggestions:
221
+ - npm: `export NODE_OPTIONS="--max-old-space-size=4096"`
222
+ - gradle: Add `org.gradle.jvmargs=-Xmx4g` to `gradle.properties`
223
+ - maven: `export MAVEN_OPTS="-Xmx4g"`
224
+
225
+ ## Error Handling
226
+
227
+ - If build tool cannot be detected, return error with list of checked locations
228
+ - If command times out, report timeout with suggestion to increase timeout or optimize build
229
+ - If build fails, extract and format all errors for user
230
+ - Always include the raw command that was executed for reproducibility
231
+
232
+ ## DO NOT
233
+
234
+ - DO NOT modify source files
235
+ - DO NOT install dependencies (unless explicitly part of clean target)
236
+ - DO NOT run tests (use `/run-tests` skill for that)
237
+ - DO NOT assume a specific build system - always detect or use config
238
+ - DO NOT use overly short timeouts (builds can be slow)
239
+
240
+ ## Examples
241
+
242
+ ### Example 1: Auto-detect npm and build
243
+
244
+ ```
245
+ User: /build-project
246
+
247
+ Skill: [Detects package.json, uses npm]
248
+ Skill: [Runs: npm run build]
249
+ Skill: [Reports success with duration]
250
+ ```
251
+
252
+ ### Example 2: Gradle with module
253
+
254
+ ```
255
+ User: /build-project module=user-service
256
+
257
+ Skill: [Detects build.gradle]
258
+ Skill: [Runs: ./gradlew :user-service:build -x test --offline]
259
+ Skill: [Reports success]
260
+ ```
261
+
262
+ ### Example 3: Build failure
263
+
264
+ ```
265
+ User: /build-project
266
+
267
+ Skill: [Detects Cargo.toml]
268
+ Skill: [Runs: cargo build]
269
+ Skill: [Detects compilation error]
270
+ Skill: [Reports: File src/main.rs:42, Error: mismatched types]
271
+ Skill: [Suggests: Fix type error in src/main.rs:42]
272
+ ```
273
+
274
+ ## Related Documentation
275
+
276
+ - [5-Phase Workflow Guide](../../docs/workflow-guide.md)
277
+ - [/run-tests skill](../run-tests/SKILL.md)