Arguments
[plan file, specification, or todo file path]
Work Plan Execution Command
Execute a work plan efficiently while maintaining quality and finishing features.
Introduction
This command takes a work document (plan, specification, or todo file) and executes it systematically. The focus is on shipping complete features by understanding requirements quickly, following existing patterns, and maintaining quality throughout.
Input Document
#$ARGUMENTS
Execution Workflow
Phase 1: Quick Start
Read Plan and Clarify
- Read the work document completely
- Review any references or links provided in the plan
- If anything is unclear or ambiguous, ask clarifying questions now
- Get user approval to proceed
- Do not skip this - better to ask questions now than build the wrong thing
Setup Environment
First, check the current branch:
current_branch=$(git branch --show-current)
default_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
# Fallback if remote HEAD isn't set
if [ -z "$default_branch" ]; then
default_branch=$(git rev-parse --verify origin/main >/dev/null 2>&1 && echo "main" || echo "master")
fi
If already on a feature branch (not the default branch):
- Ask: "Continue working on
[current_branch], or create a new branch?"
- If continuing, proceed to step 3
- If creating new, follow Option A or B below
If on the default branch, choose how to proceed:
Option A: Create a new branch
git pull origin [default_branch]
git checkout -b feature-branch-name
Use a meaningful name based on the work (e.g., feat/user-authentication, fix/email-validation).
Option B: Use a worktree (recommended for parallel development)
skill: git-worktree
# The skill will create a new branch from the default branch in an isolated worktree
Option C: Continue on the default branch
- Requires explicit user confirmation
- Only proceed after user explicitly says "yes, commit to [default_branch]"
- Never commit directly to the default branch without explicit permission
Recommendation: Use worktree if:
- You want to work on multiple features simultaneously
- You want to keep the default branch clean while experimenting
- You plan to switch between branches frequently
Create Todo List
- Use TodoWrite to break plan into actionable tasks
- Include dependencies between tasks
- Prioritize based on what needs to be done first
- Include testing and quality check tasks
- Keep tasks specific and completable
Phase 2: Execute
Task Execution Loop
For each task in priority order:
while (tasks remain):
- Mark task as in_progress in TodoWrite
- Read any referenced files from the plan
- Look for similar patterns in codebase
- Implement following existing conventions
- Write tests for new functionality
- Run tests after changes
- Mark task as completed in TodoWrite
- Mark off the corresponding checkbox in the plan file ([ ] → [x])
- Evaluate for incremental commit (see below)
IMPORTANT: Always update the original plan document by checking off completed items. Use the Edit tool to change - [ ] to - [x] for each task you finish. This keeps the plan as a living document showing progress and ensures no checkboxes are left unchecked.
Incremental Commits
After completing each task, evaluate whether to create an incremental commit:
| Commit when... |
Don't commit when... |
| Logical unit complete (model, service, component) |
Small part of a larger unit |
| Tests pass + meaningful progress |
Tests failing |
| About to switch contexts (backend → frontend) |
Purely scaffolding with no behavior |
| About to attempt risky/uncertain changes |
Would need a "WIP" commit message |
Heuristic: "Can I write a commit message that describes a complete, valuable change? If yes, commit. If the message would be 'WIP' or 'partial X', wait."
Commit workflow:
# 1. Verify tests pass (use project's test command)
# Examples: bin/rails test, npm test, pytest, go test, etc.
# 2. Stage only files related to this logical unit (not `git add .`)
git add <files related to this logical unit>
# 3. Commit with conventional message
git commit -m "feat(scope): description of this unit"
Handling merge conflicts: If conflicts arise during rebasing or merging, resolve them immediately. Incremental commits make conflict resolution easier since each commit is small and focused.
Note: Incremental commits use clean conventional messages without attribution footers. The final Phase 4 commit/PR includes the full attribution.
Follow Existing Patterns
- The plan should reference similar code - read those files first
- Match naming conventions exactly
- Reuse existing components where possible
- Follow project coding standards (see CLAUDE.md)
- When in doubt, grep for similar implementations
Test Continuously
- Run relevant tests after each significant change
- Don't wait until the end to test
- Fix failures immediately
- Add new tests for new functionality
Figma Design Sync (if applicable)
For UI work with Figma designs:
- Implement components following design specs
- Use figma-design-sync agent iteratively to compare
- Fix visual differences identified
- Repeat until implementation matches design
Track Progress
- Keep TodoWrite updated as you complete tasks
- Note any blockers or unexpected discoveries
- Create new tasks if scope expands
- Keep user informed of major milestones
Phase 3: Quality Check
Run Core Quality Checks
Always run before submitting:
# Run full test suite (use project's test command)
# Examples: bin/rails test, npm test, pytest, go test, etc.
# Run linting (per CLAUDE.md)
# Use linting-agent before pushing to origin
Consider Reviewer Agents (Optional)
Use for complex, risky, or large changes:
- code-simplicity-reviewer: Check for unnecessary complexity
- kieran-rails-reviewer: Verify Rails conventions (Rails projects)
- performance-oracle: Check for performance issues
- security-sentinel: Scan for security vulnerabilities
- cora-test-reviewer: Review test quality (Rails projects with comprehensive test coverage)
Run reviewers in parallel with Task tool:
Task(code-simplicity-reviewer): "Review changes for simplicity"
Task(kieran-rails-reviewer): "Check Rails conventions"
Present findings to user and address critical issues.
Final Validation
- All TodoWrite tasks marked completed
- All tests pass
- Linting passes
- Code follows existing patterns
- Figma designs match (if applicable)
- No console errors or warnings
Phase 4: Ship It
Create Commit
git add .
git status # Review what's being committed
git diff --staged # Check the changes
# Commit with conventional format
git commit -m "$(cat <<'EOF'
feat(scope): description of what and why
Brief explanation if needed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
Capture and Upload Screenshots for UI Changes (REQUIRED for any UI work)
For any design changes, new views, or UI modifications, you MUST capture and upload screenshots:
Step 1: Start dev server (if not running)
bin/dev # Run in background
Step 2: Capture screenshots with agent-browser CLI
agent-browser open http://localhost:3000/[route]
agent-browser snapshot -i
agent-browser screenshot output.png
See the agent-browser skill for detailed usage.
Step 3: Upload using imgup skill
skill: imgup
# Then upload each screenshot:
imgup -h pixhost screenshot.png # pixhost works without API key
# Alternative hosts: catbox, imagebin, beeimg
What to capture:
- New screens: Screenshot of the new UI
- Modified screens: Before AND after screenshots
- Design implementation: Screenshot showing Figma design match
IMPORTANT: Always include uploaded image URLs in PR description. This provides visual context for reviewers and documents the change.
Create Pull Request
git push -u origin feature-branch-name
gh pr create --title "Feature: [Description]" --body "$(cat <<'EOF'
## Summary
- What was built
- Why it was needed
- Key decisions made
## Testing
- Tests added/modified
- Manual testing performed
## Before / After Screenshots
| Before | After |
|--------|-------|
|  |  |
## Figma Design
[Link if applicable]
---
[](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Notify User
- Summarize what was completed
- Link to PR
- Note any follow-up work needed
- Suggest next steps if applicable
Key Principles
Start Fast, Execute Faster
- Get clarification once at the start, then execute
- Don't wait for perfect understanding - ask questions and move
- The goal is to finish the feature, not create perfect process
The Plan is Your Guide
- Work documents should reference similar code and patterns
- Load those references and follow them
- Don't reinvent - match what exists
Test As You Go
- Run tests after each change, not at the end
- Fix failures immediately
- Continuous testing prevents big surprises
Quality is Built In
- Follow existing patterns
- Write tests for new code
- Run linting before pushing
- Use reviewer agents for complex/risky changes only
Ship Complete Features
- Mark all tasks completed before moving on
- Don't leave features 80% done
- A finished feature that ships beats a perfect feature that doesn't
Quality Checklist
Before creating PR, verify:
When to Use Reviewer Agents
Don't use by default. Use reviewer agents only when:
- Large refactor affecting many files (10+)
- Security-sensitive changes (authentication, permissions, data access)
- Performance-critical code paths
- Complex algorithms or business logic
- User explicitly requests thorough review
For most features: tests + linting + following patterns is sufficient.
Common Pitfalls to Avoid
- Analysis paralysis - Don't overthink, read the plan and execute
- Skipping clarifying questions - Ask now, not after building wrong thing
- Ignoring plan references - The plan has links for a reason
- Testing at the end - Test continuously or suffer later
- Forgetting TodoWrite - Track progress or lose track of what's done
- 80% done syndrome - Finish the feature, don't move on early
- Over-reviewing simple changes - Save reviewer agents for complex work
1---2name: workflows-work3description: Execute work plans efficiently while maintaining quality and finishing features4---56## Arguments7[plan file, specification, or todo file path]89# Work Plan Execution Command1011Execute a work plan efficiently while maintaining quality and finishing features.1213## Introduction1415This command takes a work document (plan, specification, or todo file) and executes it systematically. The focus is on **shipping complete features** by understanding requirements quickly, following existing patterns, and maintaining quality throughout.1617## Input Document1819<input_document> #$ARGUMENTS </input_document>2021## Execution Workflow2223### Phase 1: Quick Start24251. **Read Plan and Clarify**2627 - Read the work document completely28 - Review any references or links provided in the plan29 - If anything is unclear or ambiguous, ask clarifying questions now30 - Get user approval to proceed31 - **Do not skip this** - better to ask questions now than build the wrong thing32332. **Setup Environment**3435 First, check the current branch:3637 ```bash38 current_branch=$(git branch --show-current)39 default_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')4041 # Fallback if remote HEAD isn't set42 if [ -z "$default_branch" ]; then43 default_branch=$(git rev-parse --verify origin/main >/dev/null 2>&1 && echo "main" || echo "master")44 fi45 ```4647 **If already on a feature branch** (not the default branch):48 - Ask: "Continue working on `[current_branch]`, or create a new branch?"49 - If continuing, proceed to step 350 - If creating new, follow Option A or B below5152 **If on the default branch**, choose how to proceed:5354 **Option A: Create a new branch**55 ```bash56 git pull origin [default_branch]57 git checkout -b feature-branch-name58 ```59 Use a meaningful name based on the work (e.g., `feat/user-authentication`, `fix/email-validation`).6061 **Option B: Use a worktree (recommended for parallel development)**62 ```bash63 skill: git-worktree64 # The skill will create a new branch from the default branch in an isolated worktree65 ```6667 **Option C: Continue on the default branch**68 - Requires explicit user confirmation69 - Only proceed after user explicitly says "yes, commit to [default_branch]"70 - Never commit directly to the default branch without explicit permission7172 **Recommendation**: Use worktree if:73 - You want to work on multiple features simultaneously74 - You want to keep the default branch clean while experimenting75 - You plan to switch between branches frequently76773. **Create Todo List**78 - Use TodoWrite to break plan into actionable tasks79 - Include dependencies between tasks80 - Prioritize based on what needs to be done first81 - Include testing and quality check tasks82 - Keep tasks specific and completable8384### Phase 2: Execute85861. **Task Execution Loop**8788 For each task in priority order:8990 ```91 while (tasks remain):92 - Mark task as in_progress in TodoWrite93 - Read any referenced files from the plan94 - Look for similar patterns in codebase95 - Implement following existing conventions96 - Write tests for new functionality97 - Run tests after changes98 - Mark task as completed in TodoWrite99 - Mark off the corresponding checkbox in the plan file ([ ] → [x])100 - Evaluate for incremental commit (see below)101 ```102103 **IMPORTANT**: Always update the original plan document by checking off completed items. Use the Edit tool to change `- [ ]` to `- [x]` for each task you finish. This keeps the plan as a living document showing progress and ensures no checkboxes are left unchecked.1041052. **Incremental Commits**106107 After completing each task, evaluate whether to create an incremental commit:108109 | Commit when... | Don't commit when... |110 |----------------|---------------------|111 | Logical unit complete (model, service, component) | Small part of a larger unit |112 | Tests pass + meaningful progress | Tests failing |113 | About to switch contexts (backend → frontend) | Purely scaffolding with no behavior |114 | About to attempt risky/uncertain changes | Would need a "WIP" commit message |115116 **Heuristic:** "Can I write a commit message that describes a complete, valuable change? If yes, commit. If the message would be 'WIP' or 'partial X', wait."117118 **Commit workflow:**119 ```bash120 # 1. Verify tests pass (use project's test command)121 # Examples: bin/rails test, npm test, pytest, go test, etc.122123 # 2. Stage only files related to this logical unit (not `git add .`)124 git add <files related to this logical unit>125126 # 3. Commit with conventional message127 git commit -m "feat(scope): description of this unit"128 ```129130 **Handling merge conflicts:** If conflicts arise during rebasing or merging, resolve them immediately. Incremental commits make conflict resolution easier since each commit is small and focused.131132 **Note:** Incremental commits use clean conventional messages without attribution footers. The final Phase 4 commit/PR includes the full attribution.1331343. **Follow Existing Patterns**135136 - The plan should reference similar code - read those files first137 - Match naming conventions exactly138 - Reuse existing components where possible139 - Follow project coding standards (see CLAUDE.md)140 - When in doubt, grep for similar implementations1411424. **Test Continuously**143144 - Run relevant tests after each significant change145 - Don't wait until the end to test146 - Fix failures immediately147 - Add new tests for new functionality1481495. **Figma Design Sync** (if applicable)150151 For UI work with Figma designs:152153 - Implement components following design specs154 - Use figma-design-sync agent iteratively to compare155 - Fix visual differences identified156 - Repeat until implementation matches design1571586. **Track Progress**159 - Keep TodoWrite updated as you complete tasks160 - Note any blockers or unexpected discoveries161 - Create new tasks if scope expands162 - Keep user informed of major milestones163164### Phase 3: Quality Check1651661. **Run Core Quality Checks**167168 Always run before submitting:169170 ```bash171 # Run full test suite (use project's test command)172 # Examples: bin/rails test, npm test, pytest, go test, etc.173174 # Run linting (per CLAUDE.md)175 # Use linting-agent before pushing to origin176 ```1771782. **Consider Reviewer Agents** (Optional)179180 Use for complex, risky, or large changes:181182 - **code-simplicity-reviewer**: Check for unnecessary complexity183 - **kieran-rails-reviewer**: Verify Rails conventions (Rails projects)184 - **performance-oracle**: Check for performance issues185 - **security-sentinel**: Scan for security vulnerabilities186 - **cora-test-reviewer**: Review test quality (Rails projects with comprehensive test coverage)187188 Run reviewers in parallel with Task tool:189190 ```191 Task(code-simplicity-reviewer): "Review changes for simplicity"192 Task(kieran-rails-reviewer): "Check Rails conventions"193 ```194195 Present findings to user and address critical issues.1961973. **Final Validation**198 - All TodoWrite tasks marked completed199 - All tests pass200 - Linting passes201 - Code follows existing patterns202 - Figma designs match (if applicable)203 - No console errors or warnings204205### Phase 4: Ship It2062071. **Create Commit**208209 ```bash210 git add .211 git status # Review what's being committed212 git diff --staged # Check the changes213214 # Commit with conventional format215 git commit -m "$(cat <<'EOF'216 feat(scope): description of what and why217218 Brief explanation if needed.219220 🤖 Generated with [Claude Code](https://claude.com/claude-code)221222 Co-Authored-By: Claude <noreply@anthropic.com>223 EOF224 )"225 ```2262272. **Capture and Upload Screenshots for UI Changes** (REQUIRED for any UI work)228229 For **any** design changes, new views, or UI modifications, you MUST capture and upload screenshots:230231 **Step 1: Start dev server** (if not running)232 ```bash233 bin/dev # Run in background234 ```235236 **Step 2: Capture screenshots with agent-browser CLI**237 ```bash238 agent-browser open http://localhost:3000/[route]239 agent-browser snapshot -i240 agent-browser screenshot output.png241 ```242 See the `agent-browser` skill for detailed usage.243244 **Step 3: Upload using imgup skill**245 ```bash246 skill: imgup247 # Then upload each screenshot:248 imgup -h pixhost screenshot.png # pixhost works without API key249 # Alternative hosts: catbox, imagebin, beeimg250 ```251252 **What to capture:**253 - **New screens**: Screenshot of the new UI254 - **Modified screens**: Before AND after screenshots255 - **Design implementation**: Screenshot showing Figma design match256257 **IMPORTANT**: Always include uploaded image URLs in PR description. This provides visual context for reviewers and documents the change.2582593. **Create Pull Request**260261 ```bash262 git push -u origin feature-branch-name263264 gh pr create --title "Feature: [Description]" --body "$(cat <<'EOF'265 ## Summary266 - What was built267 - Why it was needed268 - Key decisions made269270 ## Testing271 - Tests added/modified272 - Manual testing performed273274 ## Before / After Screenshots275 | Before | After |276 |--------|-------|277 |  |  |278279 ## Figma Design280 [Link if applicable]281282 ---283284 [](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with [Claude Code](https://claude.com/claude-code)285 EOF286 )"287 ```2882894. **Notify User**290 - Summarize what was completed291 - Link to PR292 - Note any follow-up work needed293 - Suggest next steps if applicable294295---296297## Key Principles298299### Start Fast, Execute Faster300301- Get clarification once at the start, then execute302- Don't wait for perfect understanding - ask questions and move303- The goal is to **finish the feature**, not create perfect process304305### The Plan is Your Guide306307- Work documents should reference similar code and patterns308- Load those references and follow them309- Don't reinvent - match what exists310311### Test As You Go312313- Run tests after each change, not at the end314- Fix failures immediately315- Continuous testing prevents big surprises316317### Quality is Built In318319- Follow existing patterns320- Write tests for new code321- Run linting before pushing322- Use reviewer agents for complex/risky changes only323324### Ship Complete Features325326- Mark all tasks completed before moving on327- Don't leave features 80% done328- A finished feature that ships beats a perfect feature that doesn't329330## Quality Checklist331332Before creating PR, verify:333334- [ ] All clarifying questions asked and answered335- [ ] All TodoWrite tasks marked completed336- [ ] Tests pass (run project's test command)337- [ ] Linting passes (use linting-agent)338- [ ] Code follows existing patterns339- [ ] Figma designs match implementation (if applicable)340- [ ] Before/after screenshots captured and uploaded (for UI changes)341- [ ] Commit messages follow conventional format342- [ ] PR description includes summary, testing notes, and screenshots343- [ ] PR description includes Compound Engineered badge344345## When to Use Reviewer Agents346347**Don't use by default.** Use reviewer agents only when:348349- Large refactor affecting many files (10+)350- Security-sensitive changes (authentication, permissions, data access)351- Performance-critical code paths352- Complex algorithms or business logic353- User explicitly requests thorough review354355For most features: tests + linting + following patterns is sufficient.356357## Common Pitfalls to Avoid358359- **Analysis paralysis** - Don't overthink, read the plan and execute360- **Skipping clarifying questions** - Ask now, not after building wrong thing361- **Ignoring plan references** - The plan has links for a reason362- **Testing at the end** - Test continuously or suffer later363- **Forgetting TodoWrite** - Track progress or lose track of what's done364- **80% done syndrome** - Finish the feature, don't move on early365- **Over-reviewing simple changes** - Save reviewer agents for complex work