Skip to content

Commit dca1c96

Browse files
rysweetUbuntuclaude
authored
refactor: Major restructuring of DEFAULT_WORKFLOW.md for documentation-first development (#1591)
* refactor: Major restructuring of DEFAULT_WORKFLOW.md for documentation-first development This commit introduces revolutionary changes to the default workflow, shifting from a numbered step-based approach to a more flexible, documentation-first methodology. ## Key Structural Changes ### 1. Documentation-First Approach (NEW) - Added "Retcon Documentation Writing" step - documentation is written BEFORE implementation - Documentation acts as specification for the feature "as it should be" - Architect reviews documentation to align with vision before coding begins ### 2. True Test-Driven Development - Separated TDD into dedicated step AFTER documentation - Tests written based on documentation, before implementation - Clearer separation between design, testing, and implementation phases ### 3. Early Review Integration - Added "Review pass before commit" - review happens BEFORE committing - Added "Incorporate any review feedback" - immediate feedback loop before commit - Shifted from post-PR review to pre-commit review for earlier quality gates ### 4. Flexible Step Structure - Removed rigid step numbering (Step 1, Step 2, etc.) from headers - Headers now use descriptive names only - Allows for easier customization and step insertion ### 5. Enhanced Agent Orchestration - Added zen-architect agent consultation for philosophy alignment - Added documentation-writer agent for retcon documentation - Emphasized use of Skills() tool throughout workflow - More explicit handoffs between agents ### 6. Outside-In Testing Emphasis - Added explicit guidance: "Test like a user would use the feature - outside-in" - Emphasis on end-to-end testing, not just unit tests - Test results documented for PR description ### 7. Workflow Timing Simplification - Removed specific timing requirements ("Within 24 hours", "Within 48 hours") - More autonomous, trust-based approach - Focus on quality over arbitrary deadlines ## Process Flow Changes **Old Flow:** 1. Requirements → 2. Issue → 3. Worktree → 4. Design+TDD → 5. Implement → 6. Refactor → 7. Tests → 8. Local Test → 9. Commit → 10. Draft PR → 11. Review PR → 12. Feedback → 13. Philosophy Check → 14. Ready → 15. Mergeable → 16. Cleanup **New Flow:** Prepare Workspace → Requirements → Issue → Worktree → Research & Design → **Retcon Documentation** → **TDD Tests** → Implement → Refactor → **Review Before Commit** → **Incorporate Feedback** → Tests & Pre-commit → Local Testing → Commit → Draft PR → Review PR → Implement Feedback → Philosophy Check → **Cleanup** → Ready → Mergeable ## Philosophical Improvements 1. **Documentation as Specification**: Documentation written before code provides clear target and prevents implementation drift 2. **Earlier Quality Gates**: Review before commit catches issues earlier in the development cycle 3. **True TDD**: Separating test writing from design makes TDD process clearer and more deliberate 4. **Flexibility**: Removing numbered steps makes workflow more adaptable to different project needs 5. **Agent Specialization**: More explicit agent roles and handoffs improve clarity and effectiveness ## Breaking Changes - Step numbers removed from workflow headers (affects TodoWrite formatting) - New steps added (Retcon Documentation, Review Before Commit) - Workflow now requires documentation-writer agent - Success criteria updated from "All 15 steps" to "All steps" ## Migration Notes Existing workflows referencing specific step numbers may need updates. The TodoWrite best practices section still references step numbers for tracking purposes, but the actual workflow headers use descriptive names only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor: Re-number workflow steps and remove hardcoded step counts This commit adds explicit step numbering (Steps 1-21) to all workflow section headers and removes hardcoded step counts from documentation to prevent drift. ## Changes Made ### 1. DEFAULT_WORKFLOW.md - Complete Re-numbering - Added "Step N:" prefix to ALL workflow section headers (1-21) - Updated frontmatter: `steps: 15` → `steps: 21` - Fixed inconsistent numbering (old Steps 2-4 were actually steps 3-5) - Removed example hardcoded count: "Step X of 15" → generic "which step is active" **New Section Headers:** - Step 1: Prepare the Workspace - Step 2: Rewrite and Clarify Requirements - Step 3: Create GitHub Issue - Step 4: Setup Worktree and Branch - Step 5: Research and Design - Step 6: Retcon Documentation Writing (NEW section user added) - Step 7: Test Driven Development - Writing Tests First (NEW section user added) - Step 8: Implement the Solution - Step 9: Refactor and Simplify - Step 10: Review Pass Before Commit (NEW section user added) - Step 11: Incorporate Any Review Feedback (NEW section user added) - Step 12: Run Tests and Pre-commit Hooks - Step 13: Mandatory Local Testing - Step 14: Commit and Push - Step 15: Open Pull Request as Draft - Step 16: Review the PR - Step 17: Implement Review Feedback - Step 18: Philosophy Compliance Check - Step 19: Final Cleanup and Verification - Step 20: Convert PR to Ready for Review - Step 21: Ensure PR is Mergeable ### 2. Removed Hardcoded Step Counts (Multiple Files) To prevent documentation drift as workflow evolves, removed specific step counts from references where not critical: **Files Updated:** - `.claude/commands/amplihack/ultrathink.md` - Removed "(15 steps)" references (3 instances) - `.claude/skills/default-workflow/SKILL.md` - Removed "15-step" and "(Step X of 15)" (3 instances) - `.claude/skills/ultrathink-orchestrator/SKILL.md` - Removed "(15 steps)" references (2 instances) - `.claude/skills/ultrathink-orchestrator/README.md` - Removed "(15 steps)" and "(6 phases)" (4 instances) - `.claude/workflow/CONSENSUS_WORKFLOW.md` - Updated to 21 steps, removed "15-Step" header - `docs/commands/COMMAND_SELECTION_GUIDE.md` - Removed "(15 steps)" references (2 instances) ### 3. CONSENSUS_WORKFLOW.md Updates - Updated frontmatter: `steps: 15` → `steps: 21` - Updated description: "Enhanced 15-step workflow" → "Enhanced workflow" - Updated success criteria: "All 15 steps" → "All steps" - Renamed header: "The 15-Step Consensus-Augmented Workflow" → "The Consensus-Augmented Workflow" ## Why These Changes ### Problem 1: Ambiguous Ordering Without Numbers The workflow had inconsistent numbering: - First 2 sections had NO numbers - Next 3 sections had WRONG numbers (Steps 2-4 were actually 3-5) - Remaining 16 sections had NO numbers - Total: 21 sections but only 3 were numbered This created ambiguity about sequential order and could confuse AI models about whether steps can be reordered. ### Problem 2: Documentation Drift Hardcoded step counts ("15 steps", "16 steps") throughout documentation become stale when workflow evolves. Examples: - Workflow grew from 15→16→21 steps over time - Each growth required hunting down all hardcoded references - Easy to miss references, creating inconsistencies ### Solution: Explicit Numbering + Generic References 1. **Explicit step numbers in headers** make sequential order crystal clear 2. **Remove counts from docs** prevents drift (workflow file is source of truth) 3. **Only keep counts in frontmatter** where they're programmatically useful ## Breaking Changes None. This is purely clarification - the workflow steps and their order haven't changed, just how they're labeled. ## Migration Notes - TodoWrite examples still reference step numbers as before - Agents can now reliably parse "Step N:" from headers - Workflow file remains single source of truth for step count 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Ubuntu <azureuser@amplihack2.yb0a3bvkdghunmsjr4s3fnfhra.phxx.internal.cloudapp.net> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 84d0b33 commit dca1c96

File tree

7 files changed

+159
-148
lines changed

7 files changed

+159
-148
lines changed

.claude/commands/amplihack/ultrathink.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ When this command is invoked, you MUST:
3636
- **Investigation keywords**: investigate, explain, understand, how does, why does, analyze, research, explore, examine, study
3737
- **Development keywords**: implement, build, create, add feature, fix, refactor, deploy
3838
- **If both types detected**: Use hybrid workflow (investigation first, then development)
39-
- If only investigation keywords found: Use INVESTIGATION_WORKFLOW.md (6 phases)
40-
- If only development keywords found: Use DEFAULT_WORKFLOW.md (15 steps)
39+
- If only investigation keywords found: Use INVESTIGATION_WORKFLOW.md
40+
- If only development keywords found: Use DEFAULT_WORKFLOW.md
4141
2. **Invoke the appropriate workflow skill** using the Skill tool:
4242
- Investigation: `Skill(skill="investigation-workflow")`
4343
- Development: `Skill(skill="default-workflow")`
@@ -63,8 +63,8 @@ Execute this exact sequence for the task: `{TASK_DESCRIPTION}`
6363
1. **Initialize**:
6464
- Detect task type (investigation vs. development)
6565
- Select appropriate workflow:
66-
- Investigation: investigation-workflow skill (6 phases)
67-
- Development: default-workflow skill (15 steps)
66+
- Investigation: investigation-workflow skill
67+
- Development: default-workflow skill
6868
- Inform user which workflow is being used
6969
- Try to invoke the selected workflow skill using Skill tool
7070
- **FALLBACK**: If skill not found, read the markdown workflow file using Read tool:
@@ -154,7 +154,7 @@ Always use TodoWrite to:
154154
User: "/ultrathink implement JWT authentication"
155155
156156
1. Detect: Development task (contains "implement")
157-
2. Select: default-workflow skill (15 steps)
157+
2. Select: default-workflow skill
158158
3. Try: Skill(skill="default-workflow")
159159
4. Fallback if needed: Read `.claude/workflow/DEFAULT_WORKFLOW.md`
160160
5. Begin executing workflow steps with deep analysis

.claude/skills/default-workflow/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: default-workflow
33
version: 1.0.0
4-
description: 15-step development workflow for features, bugs, refactoring. Auto-activates for multi-file implementations.
4+
description: Development workflow for features, bugs, refactoring. Auto-activates for multi-file implementations.
55
auto_activates:
66
- "implement feature spanning multiple files"
77
- "complex integration across components"
@@ -30,7 +30,7 @@ This is a thin wrapper that references the complete workflow definition stored i
3030

3131
**Source**: `.claude/workflow/DEFAULT_WORKFLOW.md` (471+ lines)
3232

33-
The canonical workflow contains the complete 15-step development process with all details, agent specifications, and execution guidance.
33+
The canonical workflow contains the complete development process with all details, agent specifications, and execution guidance.
3434

3535
## Execution Instructions
3636

@@ -44,12 +44,12 @@ When this skill is activated, you MUST:
4444

4545
Note: Path is relative to project root. Claude Code resolves this automatically.
4646

47-
2. **Follow all 15 steps** exactly as specified in the canonical workflow
47+
2. **Follow all steps** exactly as specified in the canonical workflow
4848

4949
3. **Use TodoWrite** to track progress through workflow steps with format:
5050
- `Step N: [Step Name] - [Specific Action]`
5151
- Example: `Step 1: Rewrite and Clarify Requirements - Use prompt-writer agent`
52-
- This helps users track exactly which workflow step is active (Step X of 15)
52+
- This helps users track exactly which workflow step is active
5353

5454
4. **Invoke specialized agents** as specified in each workflow step:
5555
- Step 1: prompt-writer, analyzer, ambiguity agents

.claude/skills/ultrathink-orchestrator/README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,24 @@ Provide default orchestration for non-trivial development tasks by automatically
1818
3. Estimates task complexity (simple/moderate/complex)
1919
4. Asks user for confirmation before proceeding
2020
5. Invokes the appropriate workflow skill:
21-
- **Investigation**: `investigation-workflow` skill (6 phases)
22-
- **Development**: `default-workflow` skill (15 steps)
21+
- **Investigation**: `investigation-workflow` skill
22+
- **Development**: `default-workflow` skill
2323
- **Hybrid**: Both workflows sequentially
2424

2525
## Task Type Detection
2626

2727
**Investigation Tasks**:
28+
2829
- Keywords: investigate, explain, understand, how does, why does, analyze, research, explore, examine, study
2930
- Examples: "Investigate authentication", "Explain routing", "Understand database schema"
3031

3132
**Development Tasks**:
33+
3234
- Keywords: implement, build, create, add feature, fix, refactor, deploy
3335
- Examples: "Implement JWT auth", "Add user registration", "Fix login bug"
3436

3537
**Hybrid Tasks**:
38+
3639
- Contains both investigation and development keywords
3740
- Examples: "Investigate auth system, then add OAuth support"
3841

@@ -51,12 +54,13 @@ Provide default orchestration for non-trivial development tasks by automatically
5154
**User**: "Add user authentication to the API"
5255

5356
**Skill Response**:
57+
5458
```
5559
I detected a MODERATE development request: "Add user authentication to the API"
5660
5761
Would you like me to use /ultrathink to orchestrate this work?
58-
- Workflow: default-workflow (15 steps)
59-
- Estimated scope: 6-8 files, 8 steps
62+
- Workflow: default-workflow
63+
- Estimated scope: 6-8 files
6064
- Time estimate: 45-60 minutes
6165
6266
[Yes] [No] [Custom]
@@ -67,11 +71,12 @@ Would you like me to use /ultrathink to orchestrate this work?
6771
**User**: "Investigate how the reflection system works"
6872

6973
**Skill Response**:
74+
7075
```
7176
I detected a MODERATE investigation request: "Investigate how the reflection system works"
7277
7378
Would you like me to use /ultrathink to orchestrate this work?
74-
- Workflow: investigation-workflow (6 phases)
79+
- Workflow: investigation-workflow
7580
- Estimated scope: 10-15 files, deep analysis
7681
- Time estimate: 30-40 minutes
7782
@@ -83,11 +88,12 @@ Would you like me to use /ultrathink to orchestrate this work?
8388
**User**: "Investigate auth system, then add OAuth support"
8489

8590
**Skill Response**:
91+
8692
```
8793
I detected a COMPLEX hybrid request: "Investigate auth system, then add OAuth support"
8894
8995
Would you like me to use /ultrathink to orchestrate this work?
90-
- Workflow: investigation-workflow (6 phases) → default-workflow (15 steps)
96+
- Workflow: investigation-workflow → default-workflow
9197
- Estimated scope: 15+ files, comprehensive work
9298
- Time estimate: 90-120 minutes
9399
@@ -97,11 +103,13 @@ Would you like me to use /ultrathink to orchestrate this work?
97103
## Workflow Integration
98104

99105
**Preferred Approach** (workflow skills):
106+
100107
- Uses `Skill(skill="default-workflow")` for development tasks
101108
- Uses `Skill(skill="investigation-workflow")` for investigation tasks
102109
- Automatic task type detection from keywords
103110

104111
**Fallback** (if skills not available):
112+
105113
- Reads `.claude/workflow/DEFAULT_WORKFLOW.md`
106114
- Reads `.claude/workflow/INVESTIGATION_WORKFLOW.md`
107115
- Provides same functionality via markdown workflows

.claude/skills/ultrathink-orchestrator/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ triggers:
2121

2222
This skill provides automatic orchestration for development and investigation tasks. It detects the task type from keywords and delegates to the appropriate workflow skill (investigation-workflow or default-workflow).
2323

24-
Auto-activation priority is LOW (5) to allow more specific skills to match first. When activated, this orchestrator selects between investigation-workflow (6 phases) and default-workflow (15 steps) based on the user's request keywords.
24+
Auto-activation priority is LOW (5) to allow more specific skills to match first. When activated, this orchestrator selects between investigation-workflow and default-workflow based on the user's request keywords.
2525

2626
This skill acts as a thin wrapper around the canonical ultrathink command, following the amplihack pattern of single-source-of-truth for command logic.
2727

@@ -31,8 +31,8 @@ This skill acts as a thin wrapper around the canonical ultrathink command, follo
3131

3232
- **Primary Command**: `.claude/commands/amplihack/ultrathink.md` (278 lines)
3333
- **Workflow Sources**:
34-
- Development: `.claude/workflow/DEFAULT_WORKFLOW.md` (15 steps)
35-
- Investigation: `.claude/workflow/INVESTIGATION_WORKFLOW.md` (6 phases)
34+
- Development: `.claude/workflow/DEFAULT_WORKFLOW.md`
35+
- Investigation: `.claude/workflow/INVESTIGATION_WORKFLOW.md`
3636

3737
The canonical command contains complete task detection logic, complexity estimation, and orchestration patterns for both investigation and development workflows.
3838

.claude/workflow/CONSENSUS_WORKFLOW.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
name: CONSENSUS_WORKFLOW
33
version: 1.0.0
4-
description: Enhanced 15-step workflow with multi-agent consensus at critical decision points
5-
steps: 15
4+
description: Enhanced workflow with multi-agent consensus at critical decision points
5+
steps: 21
66
phases:
77
- requirements-with-debate
88
- design-with-consensus
@@ -11,7 +11,7 @@ phases:
1111
- expert-panel-review
1212
- final-consensus-validation
1313
success_criteria:
14-
- "All 15 steps completed with consensus validation"
14+
- "All steps completed with consensus validation"
1515
- "Multi-agent debate for ambiguous requirements"
1616
- "Expert panel approval at critical gates"
1717
- "N-version programming for critical code"
@@ -37,7 +37,6 @@ This workflow enhances the default coding workflow with consensus mechanisms at
3737

3838
> **DEPRECATION WARNING**: Markdown workflows deprecated. See `docs/WORKFLOW_TO_SKILLS_MIGRATION.md`
3939
40-
4140
- Requirements are ambiguous or complex
4241
- Design decisions have significant architectural impact
4342
- Multiple valid implementation approaches exist
@@ -71,7 +70,7 @@ Use this workflow for:
7170
- Performance-critical components
7271
- Public APIs with long-term commitments
7372

74-
## The 15-Step Consensus-Augmented Workflow
73+
## The Consensus-Augmented Workflow
7574

7675
### Step 1: Rewrite and Clarify Requirements with Consensus
7776

0 commit comments

Comments
 (0)