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
package/README.md ADDED
@@ -0,0 +1,332 @@
1
+ # 5-Phase Workflow
2
+
3
+ A systematic, AI-assisted feature development workflow for Claude Code that works with any tech stack.
4
+
5
+ ## What is This?
6
+
7
+ The **5-Phase Workflow** is a structured approach to feature development that breaks down the process into clear, manageable phases:
8
+
9
+ 1. **Feature Planning** - Understand requirements through intensive Q&A
10
+ 2. **Implementation Planning** - Map requirements to technical components
11
+ 3. **Orchestrated Implementation** - Execute with state tracking and parallel processing
12
+ 4. **Verify Implementation** - Automated verification of completeness and correctness
13
+ 5. **Code Review** - AI-powered review and quality improvements
14
+
15
+ ## Why Use It?
16
+
17
+ - **Systematic**: Clear phases prevent missing requirements or skipping validation
18
+ - **Efficient**: Parallel execution and smart agents minimize context usage
19
+ - **Resumable**: State tracking allows pausing and continuing work across sessions
20
+ - **Technology-Agnostic**: Works with JavaScript, Python, Java, Go, Rust, and more
21
+ - **Transparent**: Visible progress tracking and clear handoffs between phases
22
+
23
+ ## Installation
24
+
25
+ Install the workflow in your project using npx:
26
+
27
+ ```bash
28
+ # Install locally in current project
29
+ npx 5-phase-workflow
30
+
31
+ # Or install globally for all projects
32
+ npx 5-phase-workflow --global
33
+ ```
34
+
35
+ The installer will:
36
+ - Auto-detect your project type (JavaScript, Python, Java, etc.)
37
+ - Copy workflow commands, agents, and skills to `.claude/`
38
+ - Create a config file at `.claude/.5/config.json`
39
+ - Configure build and test commands for your project
40
+
41
+ ## Quick Start
42
+
43
+ After installation, configure the workflow for your project:
44
+
45
+ ```bash
46
+ # Open Claude Code in your project
47
+ # Run the configuration wizard
48
+ /5:configure
49
+ ```
50
+
51
+ Then start your first feature:
52
+
53
+ ```bash
54
+ # Phase 1: Plan the feature
55
+ /5:plan-feature
56
+
57
+ # Phase 2: Create implementation plan
58
+ /5:plan-implementation {ticket-id}-{description}
59
+
60
+ # Phase 3: Execute implementation
61
+ /5:implement-feature {ticket-id}-{description}
62
+
63
+ # Phase 4: Verify implementation
64
+ /5:verify-implementation
65
+
66
+ # Phase 5: Review code
67
+ /5:review-code
68
+ ```
69
+
70
+ ## Supported Tech Stacks
71
+
72
+ The workflow auto-detects and supports:
73
+
74
+ **JavaScript/TypeScript**:
75
+ - Node.js (npm, yarn, pnpm)
76
+ - Next.js
77
+ - NestJS
78
+ - Express
79
+ - React
80
+ - Vue
81
+
82
+ **Python**:
83
+ - Django
84
+ - Flask
85
+ - FastAPI
86
+ - Generic Python projects
87
+
88
+ **Java**:
89
+ - Gradle
90
+ - Maven
91
+ - Spring Boot
92
+
93
+ **Other**:
94
+ - Rust (Cargo)
95
+ - Go
96
+ - Ruby on Rails
97
+ - Custom projects (via manual config)
98
+
99
+ ## Available Commands
100
+
101
+ All commands are available under the `/5:` namespace:
102
+
103
+ | Command | Phase | Purpose |
104
+ |---------|-------|---------|
105
+ | `/5:configure` | Setup | Interactive project configuration |
106
+ | `/5:plan-feature` | 1 | Create feature specification with Q&A |
107
+ | `/5:discuss-feature` | 1 | Refine existing feature spec |
108
+ | `/5:plan-implementation` | 2 | Map feature to technical components |
109
+ | `/5:implement-feature` | 3 | Execute implementation with agents |
110
+ | `/5:verify-implementation` | 4 | Verify completeness and correctness |
111
+ | `/5:review-code` | 5 | AI-powered code review (CodeRabbit) |
112
+ | `/5:quick-implement` | Fast | Streamlined workflow for small tasks |
113
+
114
+ ## Configuration
115
+
116
+ The workflow is configured via `.claude/.5/config.json`. Here's an example:
117
+
118
+ ```json
119
+ {
120
+ "projectType": "nextjs",
121
+ "ticket": {
122
+ "pattern": "[A-Z]+-\\d+",
123
+ "extractFromBranch": true
124
+ },
125
+ "build": {
126
+ "command": "npm run build",
127
+ "testCommand": "npm test"
128
+ },
129
+ "steps": [
130
+ { "name": "foundation", "mode": "parallel" },
131
+ { "name": "logic", "mode": "sequential" },
132
+ { "name": "integration", "mode": "sequential" }
133
+ ],
134
+ "reviewTool": "coderabbit"
135
+ }
136
+ ```
137
+
138
+ ### Configuration Options
139
+
140
+ #### Required Fields
141
+
142
+ - **`projectType`**: Detected project type (e.g., `"nextjs"`, `"django"`, `"rust"`)
143
+ - **`build.command`**: Command to build the project
144
+ - **`build.testCommand`**: Command to run tests
145
+
146
+ #### Optional Fields
147
+
148
+ - **`ticket.pattern`**: Regex pattern for ticket IDs (e.g., `"PROJ-\\d+"`)
149
+ - **`ticket.extractFromBranch`**: Auto-extract ticket from branch name
150
+ - **`steps`**: Implementation step configuration
151
+ - **`framework`**: Framework-specific patterns (routes, models, etc.)
152
+ - **`integration`**: Integration point configuration
153
+ - **`tools`**: Available development tools (CodeRabbit, IDE, etc.)
154
+
155
+ Run `/5:configure` to set up or update your configuration.
156
+
157
+ ## How It Works
158
+
159
+ ### Phase 1: Feature Planning
160
+
161
+ Claude asks 5-10 clarifying questions to understand your requirements:
162
+
163
+ - What exactly should this feature do?
164
+ - What are the edge cases?
165
+ - How will we verify it works?
166
+ - Are there simpler alternatives?
167
+
168
+ The output is a comprehensive feature spec at `.claude/.features/{ticket-id}.md`.
169
+
170
+ ### Phase 2: Implementation Planning
171
+
172
+ Claude maps your feature to technical components:
173
+
174
+ - Analyzes your codebase structure
175
+ - Identifies affected modules
176
+ - Maps components to implementation steps
177
+ - Creates dependency graph
178
+
179
+ The output is a detailed plan at `.claude/.implementations/plans/{ticket-id}.md`.
180
+
181
+ ### Phase 3: Orchestrated Implementation
182
+
183
+ Claude executes the plan using specialized agents:
184
+
185
+ - **step-executor**: Creates each component using skills or direct file creation
186
+ - **step-verifier**: Compiles and checks for errors after each step
187
+ - **integration-agent**: Wires components and registers routes
188
+
189
+ State is tracked in `.claude/.implementations/state/{ticket-id}.json` for resumability.
190
+
191
+ ### Phase 4: Verify Implementation
192
+
193
+ An agent performs comprehensive verification:
194
+
195
+ - All planned files exist
196
+ - No compilation/build errors
197
+ - Tests pass
198
+ - IDE diagnostics clean
199
+
200
+ Results are saved to a verification report.
201
+
202
+ ### Phase 5: Code Review
203
+
204
+ Automated review using CodeRabbit (if installed):
205
+
206
+ - Finds code smells and potential issues
207
+ - Suggests improvements
208
+ - Applies approved fixes
209
+ - Re-verifies after changes
210
+
211
+ ## Project Structure
212
+
213
+ After installation, your `.claude/` directory will contain:
214
+
215
+ ```
216
+ .claude/
217
+ ├── .5/
218
+ │ └── config.json # Project configuration
219
+ ├── commands/5/ # Workflow commands
220
+ │ ├── plan-feature.md
221
+ │ ├── plan-implementation.md
222
+ │ ├── implement-feature.md
223
+ │ ├── verify-implementation.md
224
+ │ ├── review-code.md
225
+ │ ├── discuss-feature.md
226
+ │ ├── quick-implement.md
227
+ │ └── configure.md
228
+ ├── agents/ # Specialized agents
229
+ │ ├── step-executor.md
230
+ │ ├── step-verifier.md
231
+ │ ├── integration-agent.md
232
+ │ ├── verification-agent.md
233
+ │ └── review-processor.md
234
+ ├── skills/ # Atomic operations
235
+ │ ├── build-project/
236
+ │ ├── run-tests/
237
+ │ └── generate-readme/
238
+ ├── hooks/
239
+ │ └── statusline.js # Status line integration
240
+ └── settings.json # Claude Code settings
241
+ ```
242
+
243
+ ## Examples
244
+
245
+ ### Example 1: Adding a REST API endpoint
246
+
247
+ ```bash
248
+ /5:plan-feature
249
+ # Claude asks about the endpoint: path, methods, request/response format, validation, etc.
250
+ # Creates feature spec
251
+
252
+ /5:plan-implementation PROJ-1234-add-user-endpoint
253
+ # Claude maps to: route file, controller, service, tests
254
+ # Creates technical plan
255
+
256
+ /5:implement-feature PROJ-1234-add-user-endpoint
257
+ # Creates route, controller, service, tests
258
+ # Registers route in app
259
+ # Runs build and tests
260
+
261
+ /5:verify-implementation
262
+ # Verifies all files created
263
+ # Checks build passes
264
+ # Confirms tests pass
265
+ ```
266
+
267
+ ### Example 2: Small bug fix
268
+
269
+ ```bash
270
+ /5:quick-implement
271
+ # Describe the fix
272
+ # Claude implements, builds, tests in one step
273
+ ```
274
+
275
+ ## Troubleshooting
276
+
277
+ ### Build/Test commands not working
278
+
279
+ 1. Run `/5:configure` to verify configuration
280
+ 2. Test commands manually in terminal
281
+ 3. Update `.claude/.5/config.json` with correct commands
282
+
283
+ ### "Cannot find project type"
284
+
285
+ The auto-detection failed. Run `/5:configure` and manually select your project type.
286
+
287
+ ### State file issues
288
+
289
+ If implementation gets stuck:
290
+
291
+ 1. Check `.claude/.implementations/state/{ticket-id}.json`
292
+ 2. Note the `currentStep` value
293
+ 3. Run `/5:implement-feature` again - it will resume from that step
294
+
295
+ ### CodeRabbit not working
296
+
297
+ 1. Install: https://docs.coderabbit.ai/cli/installation
298
+ 2. Authenticate: `coderabbit auth login`
299
+ 3. Run `/5:configure` to update config
300
+
301
+ ## Updating
302
+
303
+ To upgrade to the latest version:
304
+
305
+ ```bash
306
+ # Uninstall current version
307
+ npx 5-phase-workflow --uninstall
308
+
309
+ # Reinstall latest
310
+ npx 5-phase-workflow
311
+ ```
312
+
313
+ Your configuration in `.claude/.5/config.json` will be preserved.
314
+
315
+ ## Contributing
316
+
317
+ Found a bug or have a suggestion? Please open an issue or PR at:
318
+ https://github.com/anthropics/claude-code/issues
319
+
320
+ ## License
321
+
322
+ MIT
323
+
324
+ ## Learn More
325
+
326
+ - [Full Workflow Guide](./docs/workflow-guide.md) - Detailed documentation
327
+ - [Claude Code Docs](https://docs.anthropic.com/claude/docs/claude-code) - Claude Code features
328
+ - [Examples](./docs/examples/) - Real-world usage examples
329
+
330
+ ## Credits
331
+
332
+ Built with [Claude Code](https://claude.com/claude-code) by Anthropic.