Arguments
[plan file, specification, or task 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 task 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 Task 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
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 AGENTS.md)
# Use linting-agent before pushing to origin
Consider Reviewer Agents (Optional)
Use for complex, risky, or large changes:
- review-code-simplicity: Check for unnecessary complexity
- analyze-performance: Check for performance issues
- review-security: Scan for security vulnerabilities
Run reviewers in parallel with Task tool:
Task(review-code-simplicity): "Review changes for simplicity"
Task(review-security): "Check for security issues"
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.
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 |
|--------|-------|
|  |  |
---
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 Skills
Don't use by default. Use reviewer skills 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 skills for complex work
1---2name: workflows-work-23description: Execute work plans efficiently while maintaining quality and finishing features4---5
6## Arguments
7[plan file, specification, or task file path]
8
9# Work Plan Execution Command
10
11Execute a work plan efficiently while maintaining quality and finishing features.
12
13## Introduction
14
15This command takes a work document (plan, specification, or task file) and executes it systematically. The focus is on **shipping complete features** by understanding requirements quickly, following existing patterns, and maintaining quality throughout.
16
17## Input Document
18
19<input_document> #$ARGUMENTS </input_document>
20
21## Execution Workflow
22
23### Phase 1: Quick Start
24
251. **Read Plan and Clarify**
26
27 - Read the work document completely
28 - Review any references or links provided in the plan
29 - If anything is unclear or ambiguous, ask clarifying questions now
30 - Get user approval to proceed
31 - **Do not skip this** - better to ask questions now than build the wrong thing
32
332. **Setup Environment**
34
35 First, check the current branch:
36
37 ```bash
38 current_branch=$(git branch --show-current)
39 default_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
40
41 # Fallback if remote HEAD isn't set
42 if [ -z "$default_branch" ]; then
43 default_branch=$(git rev-parse --verify origin/main >/dev/null 2>&1 && echo "main" || echo "master")
44 fi
45 ```
46
47 **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 3
50 - If creating new, follow Option A or B below
51
52 **If on the default branch**, choose how to proceed:
53
54 **Option A: Create a new branch**
55 ```bash
56 git pull origin [default_branch]
57 git checkout -b feature-branch-name
58 ```
59 Use a meaningful name based on the work (e.g., `feat/user-authentication`, `fix/email-validation`).
60
61 **Option B: Use a worktree (recommended for parallel development)**
62 ```bash
63 skill: git-worktree
64 # The skill will create a new branch from the default branch in an isolated worktree
65 ```
66
67 **Option C: Continue on the default branch**
68 - Requires explicit user confirmation
69 - Only proceed after user explicitly says "yes, commit to [default_branch]"
70 - Never commit directly to the default branch without explicit permission
71
72 **Recommendation**: Use worktree if:
73 - You want to work on multiple features simultaneously
74 - You want to keep the default branch clean while experimenting
75 - You plan to switch between branches frequently
76
773. **Create Task List**
78 - Use TodoWrite to break plan into actionable tasks
79 - Include dependencies between tasks
80 - Prioritize based on what needs to be done first
81 - Include testing and quality check tasks
82 - Keep tasks specific and completable
83
84### Phase 2: Execute
85
861. **Task Execution Loop**
87
88 For each task in priority order:
89
90 ```
91 while (tasks remain):
92 - Mark task as in_progress in TodoWrite
93 - Read any referenced files from the plan
94 - Look for similar patterns in codebase
95 - Implement following existing conventions
96 - Write tests for new functionality
97 - Run tests after changes
98 - Mark task as completed in TodoWrite
99 - Mark off the corresponding checkbox in the plan file ([ ] → [x])
100 - Evaluate for incremental commit (see below)
101 ```
102
103 **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.
104
1052. **Incremental Commits**
106
107 After completing each task, evaluate whether to create an incremental commit:
108
109 | 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 |
115
116 **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."
117
118 **Commit workflow:**
119 ```bash
120 # 1. Verify tests pass (use project's test command)
121 # Examples: bin/rails test, npm test, pytest, go test, etc.
122
123 # 2. Stage only files related to this logical unit (not `git add .`)
124 git add <files related to this logical unit>
125
126 # 3. Commit with conventional message
127 git commit -m "feat(scope): description of this unit"
128 ```
129
130 **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.
131
132 **Note:** Incremental commits use clean conventional messages without attribution footers. The final Phase 4 commit/PR includes the full attribution.
133
1343. **Follow Existing Patterns**
135
136 - The plan should reference similar code - read those files first
137 - Match naming conventions exactly
138 - Reuse existing components where possible
139 - Follow project coding standards (see CLAUDE.md)
140 - When in doubt, grep for similar implementations
141
1424. **Test Continuously**
143
144 - Run relevant tests after each significant change
145 - Don't wait until the end to test
146 - Fix failures immediately
147 - Add new tests for new functionality
148
1495. **Track Progress**
150 - Keep TodoWrite updated as you complete tasks
151 - Note any blockers or unexpected discoveries
152 - Create new tasks if scope expands
153 - Keep user informed of major milestones
154
155### Phase 3: Quality Check
156
1571. **Run Core Quality Checks**
158
159 Always run before submitting:
160
161 ```bash
162 # Run full test suite (use project's test command)
163 # Examples: bin/rails test, npm test, pytest, go test, etc.
164
165 # Run linting (per AGENTS.md)
166 # Use linting-agent before pushing to origin
167 ```
168
1692. **Consider Reviewer Agents** (Optional)
170
171 Use for complex, risky, or large changes:
172
173 - **review-code-simplicity**: Check for unnecessary complexity
174 - **analyze-performance**: Check for performance issues
175 - **review-security**: Scan for security vulnerabilities
176
177 Run reviewers in parallel with Task tool:
178
179 ```
180 Task(review-code-simplicity): "Review changes for simplicity"
181 Task(review-security): "Check for security issues"
182 ```
183
184 Present findings to user and address critical issues.
185
1863. **Final Validation**
187 - All TodoWrite tasks marked completed
188 - All tests pass
189 - Linting passes
190 - Code follows existing patterns
191 - Figma designs match (if applicable)
192 - No console errors or warnings
193
194### Phase 4: Ship It
195
1961. **Create Commit**
197
198 ```bash
199 git add .
200 git status # Review what's being committed
201 git diff --staged # Check the changes
202
203 # Commit with conventional format
204 git commit -m "$(cat <<'EOF'
205 feat(scope): description of what and why
206
207 Brief explanation if needed.
208
209 EOF
210 )"
211 ```
212
2132. **Capture and Upload Screenshots for UI Changes** (REQUIRED for any UI work)
214
215 For **any** design changes, new views, or UI modifications, you MUST capture and upload screenshots:
216
217 **Step 1: Start dev server** (if not running)
218 ```bash
219 bin/dev # Run in background
220 ```
221
222 **Step 2: Capture screenshots with agent-browser CLI**
223 ```bash
224 agent-browser open http://localhost:3000/[route]
225 agent-browser snapshot -i
226 agent-browser screenshot output.png
227 ```
228 See the `agent-browser` skill for detailed usage.
229
230 **Step 3: Upload using imgup skill**
231 ```bash
232 skill: imgup
233 # Then upload each screenshot:
234 imgup -h pixhost screenshot.png # pixhost works without API key
235 # Alternative hosts: catbox, imagebin, beeimg
236 ```
237
238 **What to capture:**
239 - **New screens**: Screenshot of the new UI
240 - **Modified screens**: Before AND after screenshots
241 - **Design implementation**: Screenshot showing Figma design match
242
243 **IMPORTANT**: Always include uploaded image URLs in PR description. This provides visual context for reviewers and documents the change.
244
2453. **Create Pull Request**
246
247 ```bash
248 git push -u origin feature-branch-name
249
250 gh pr create --title "Feature: [Description]" --body "$(cat <<'EOF'
251 ## Summary
252 - What was built
253 - Why it was needed
254 - Key decisions made
255
256 ## Testing
257 - Tests added/modified
258 - Manual testing performed
259
260 ## Before / After Screenshots
261 | Before | After |
262 |--------|-------|
263 |  |  |
264
265 ---
266 EOF
267 )"
268 ```
269
2704. **Notify User**
271 - Summarize what was completed
272 - Link to PR
273 - Note any follow-up work needed
274 - Suggest next steps if applicable
275
276---
277
278## Key Principles
279
280### Start Fast, Execute Faster
281
282- Get clarification once at the start, then execute
283- Don't wait for perfect understanding - ask questions and move
284- The goal is to **finish the feature**, not create perfect process
285
286### The Plan is Your Guide
287
288- Work documents should reference similar code and patterns
289- Load those references and follow them
290- Don't reinvent - match what exists
291
292### Test As You Go
293
294- Run tests after each change, not at the end
295- Fix failures immediately
296- Continuous testing prevents big surprises
297
298### Quality is Built In
299
300- Follow existing patterns
301- Write tests for new code
302- Run linting before pushing
303- Use reviewer agents for complex/risky changes only
304
305### Ship Complete Features
306
307- Mark all tasks completed before moving on
308- Don't leave features 80% done
309- A finished feature that ships beats a perfect feature that doesn't
310
311## Quality Checklist
312
313Before creating PR, verify:
314
315- [ ] All clarifying questions asked and answered
316- [ ] All TodoWrite tasks marked completed
317- [ ] Tests pass (run project's test command)
318- [ ] Linting passes (use linting-agent)
319- [ ] Code follows existing patterns
320- [ ] Figma designs match implementation (if applicable)
321- [ ] Before/after screenshots captured and uploaded (for UI changes)
322- [ ] Commit messages follow conventional format
323- [ ] PR description includes summary, testing notes, and screenshots
324- [ ] PR description includes Compound Engineered badge
325
326## When to Use Reviewer Skills
327
328**Don't use by default.** Use reviewer skills only when:
329
330- Large refactor affecting many files (10+)
331- Security-sensitive changes (authentication, permissions, data access)
332- Performance-critical code paths
333- Complex algorithms or business logic
334- User explicitly requests thorough review
335
336For most features: tests + linting + following patterns is sufficient.
337
338## Common Pitfalls to Avoid
339
340- **Analysis paralysis** - Don't overthink, read the plan and execute
341- **Skipping clarifying questions** - Ask now, not after building wrong thing
342- **Ignoring plan references** - The plan has links for a reason
343- **Testing at the end** - Test continuously or suffer later
344- **Forgetting TodoWrite** - Track progress or lose track of what's done
345- **80% done syndrome** - Finish the feature, don't move on early
346- **Over-reviewing simple changes** - Save reviewer skills for complex work