Skip to content

Commit f71d034

Browse files
committed
feat: teach ce:work to consume decision-first plans
- Surface deferred implementation questions and scope boundaries - Use per-unit Patterns and Verification fields for task execution - Add execution strategy: inline, serial subagents, or parallel - Reframe Swarm Mode as Agent Teams with opt-in requirement - Make tool references platform-agnostic - Remove plan checkbox editing during execution
1 parent 845224e commit f71d034

1 file changed

Lines changed: 64 additions & 70 deletions

File tree

  • plugins/compound-engineering/skills/ce-work

plugins/compound-engineering/skills/ce-work/SKILL.md

Lines changed: 64 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ This command takes a work document (plan, specification, or todo file) and execu
2323
1. **Read Plan and Clarify**
2424

2525
- Read the work document completely
26+
- Treat the plan as a decision artifact, not an execution script
27+
- If the plan includes sections such as `Implementation Units`, `Work Breakdown`, `Requirements Trace`, `Files`, `Test Scenarios`, or `Verification`, use those as the primary source material for execution
28+
- Check for a `Deferred to Implementation` or `Implementation-Time Unknowns` section — these are questions the planner intentionally left for you to resolve during execution. Note them before starting so they inform your approach rather than surprising you mid-task
29+
- Check for a `Scope Boundaries` section — these are explicit non-goals. Refer back to them if implementation starts pulling you toward adjacent work
2630
- Review any references or links provided in the plan
2731
- If anything is unclear or ambiguous, ask clarifying questions now
2832
- Get user approval to proceed
@@ -73,12 +77,35 @@ This command takes a work document (plan, specification, or todo file) and execu
7377
- You plan to switch between branches frequently
7478

7579
3. **Create Todo List**
76-
- Use TodoWrite to break plan into actionable tasks
80+
- Use your available task tracking tool (e.g., TodoWrite, task lists) to break the plan into actionable tasks
81+
- Derive tasks from the plan's implementation units, dependencies, files, test targets, and verification criteria
82+
- For each unit, read the `Patterns to follow` field before implementing — these point to specific files or conventions to mirror
83+
- Use each unit's `Verification` field as the primary "done" signal for that task
84+
- Do not expect the plan to contain implementation code, micro-step TDD instructions, or exact shell commands
7785
- Include dependencies between tasks
7886
- Prioritize based on what needs to be done first
7987
- Include testing and quality check tasks
8088
- Keep tasks specific and completable
8189

90+
4. **Choose Execution Strategy**
91+
92+
After creating the task list, decide how to execute based on the plan's size and dependency structure:
93+
94+
| Strategy | When to use |
95+
|----------|-------------|
96+
| **Inline** | 1-2 small tasks, or tasks needing user interaction mid-flight |
97+
| **Serial subagents** | 3+ tasks with dependencies between them. Each subagent gets a fresh context window focused on one unit — prevents context degradation across many tasks |
98+
| **Parallel subagents** | 3+ tasks where some units have no shared dependencies and touch non-overlapping files. Dispatch independent units simultaneously, run dependent units after their prerequisites complete |
99+
100+
**Subagent dispatch** uses your available subagent or task spawning mechanism. For each unit, give the subagent:
101+
- The full plan file path (for overall context)
102+
- The specific unit's Goal, Files, Approach, Patterns, Test scenarios, and Verification
103+
- Any resolved deferred questions relevant to that unit
104+
105+
After each subagent completes, update the plan checkboxes and task list before dispatching the next dependent unit.
106+
107+
For genuinely large plans needing persistent inter-agent communication (agents challenging each other's approaches, shared coordination across 10+ tasks), see Swarm Mode below which uses Agent Teams.
108+
82109
### Phase 2: Execute
83110

84111
1. **Task Execution Loop**
@@ -87,15 +114,14 @@ This command takes a work document (plan, specification, or todo file) and execu
87114

88115
```
89116
while (tasks remain):
90-
- Mark task as in_progress in TodoWrite
117+
- Mark task as in-progress
91118
- Read any referenced files from the plan
92119
- Look for similar patterns in codebase
93120
- Implement following existing conventions
94121
- Write tests for new functionality
95122
- Run System-Wide Test Check (see below)
96123
- Run tests after changes
97-
- Mark task as completed in TodoWrite
98-
- Mark off the corresponding checkbox in the plan file ([ ] → [x])
124+
- Mark task as completed
99125
- Evaluate for incremental commit (see below)
100126
```
101127

@@ -113,7 +139,6 @@ This command takes a work document (plan, specification, or todo file) and execu
113139

114140
**When this matters most:** Any change that touches models with callbacks, error handling with fallback/retry, or functionality exposed through multiple interfaces.
115141

116-
**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.
117142

118143
2. **Incremental Commits**
119144

@@ -128,6 +153,8 @@ This command takes a work document (plan, specification, or todo file) and execu
128153

129154
**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."
130155

156+
If the plan has Implementation Units, use them as a starting guide for commit boundaries — but adapt based on what you find during implementation. A unit might need multiple commits if it's larger than expected, or small related units might land together. Use each unit's Goal to inform the commit message.
157+
131158
**Commit workflow:**
132159
```bash
133160
# 1. Verify tests pass (use project's test command)
@@ -160,7 +187,15 @@ This command takes a work document (plan, specification, or todo file) and execu
160187
- Add new tests for new functionality
161188
- **Unit tests with mocks prove logic in isolation. Integration tests with real objects prove the layers work together.** If your change touches callbacks, middleware, or error handling — you need both.
162189

163-
5. **Figma Design Sync** (if applicable)
190+
5. **Simplify as You Go**
191+
192+
After completing a cluster of related implementation units (or every 2-3 units), review recently changed files for simplification opportunities — consolidate duplicated patterns, extract shared helpers, and improve code reuse and efficiency. This is especially valuable when using subagents, since each agent works with isolated context and can't see patterns emerging across units.
193+
194+
Don't simplify after every single unit — early patterns may look duplicated but diverge intentionally in later units. Wait for a natural phase boundary or when you notice accumulated complexity.
195+
196+
If a `/simplify` skill or equivalent is available, use it. Otherwise, review the changed files yourself for reuse and consolidation opportunities.
197+
198+
6. **Figma Design Sync** (if applicable)
164199

165200
For UI work with Figma designs:
166201

@@ -170,7 +205,7 @@ This command takes a work document (plan, specification, or todo file) and execu
170205
- Repeat until implementation matches design
171206

172207
6. **Track Progress**
173-
- Keep TodoWrite updated as you complete tasks
208+
- Keep the task list updated as you complete tasks
174209
- Note any blockers or unexpected discoveries
175210
- Create new tasks if scope expands
176211
- Keep user informed of major milestones
@@ -196,12 +231,14 @@ This command takes a work document (plan, specification, or todo file) and execu
196231
Run configured agents in parallel with Task tool. Present findings and address critical issues.
197232

198233
3. **Final Validation**
199-
- All TodoWrite tasks marked completed
234+
- All tasks marked completed
200235
- All tests pass
201236
- Linting passes
202237
- Code follows existing patterns
203238
- Figma designs match (if applicable)
204239
- No console errors or warnings
240+
- If the plan has a `Requirements Trace`, verify each requirement is satisfied by the completed work
241+
- If any `Deferred to Implementation` questions were noted, confirm they were resolved during execution
205242

206243
4. **Prepare Operational Validation Plan** (REQUIRED)
207244
- Add a `## Post-Deploy Monitoring & Validation` section to the PR description for every change.
@@ -328,73 +365,30 @@ This command takes a work document (plan, specification, or todo file) and execu
328365
329366
---
330367
331-
## Swarm Mode (Optional)
332-
333-
For complex plans with multiple independent workstreams, enable swarm mode for parallel execution with coordinated agents.
334-
335-
### When to Use Swarm Mode
368+
## Swarm Mode with Agent Teams (Optional)
336369
337-
| Use Swarm Mode when... | Use Standard Mode when... |
338-
|------------------------|---------------------------|
339-
| Plan has 5+ independent tasks | Plan is linear/sequential |
340-
| Multiple specialists needed (review + test + implement) | Single-focus work |
341-
| Want maximum parallelism | Simpler mental model preferred |
342-
| Large feature with clear phases | Small feature or bug fix |
370+
For genuinely large plans where agents need to communicate with each other, challenge approaches, or coordinate across 10+ tasks with persistent specialized roles, use agent team capabilities if available (e.g., Agent Teams in Claude Code, multi-agent workflows in Codex).
343371
344-
### Enabling Swarm Mode
372+
**Agent teams are typically experimental and require opt-in.** Do not attempt to use agent teams unless the user explicitly requests swarm mode or agent teams, and the platform supports it.
345373
346-
To trigger swarm execution, say:
374+
### When to Use Agent Teams vs Subagents
347375
348-
> "Make a Task list and launch an army of agent swarm subagents to build the plan"
376+
| Agent Teams | Subagents (standard mode) |
377+
|-------------|---------------------------|
378+
| Agents need to discuss and challenge each other's approaches | Each task is independent — only the result matters |
379+
| Persistent specialized roles (e.g., dedicated tester running continuously) | Workers report back and finish |
380+
| 10+ tasks with complex cross-cutting coordination | 3-8 tasks with clear dependency chains |
381+
| User explicitly requests "swarm mode" or "agent teams" | Default for most plans |
349382
350-
Or explicitly request: "Use swarm mode for this work"
383+
Most plans should use subagent dispatch from standard mode. Agent teams add significant token cost and coordination overhead — use them when the inter-agent communication genuinely improves the outcome.
351384
352-
### Swarm Workflow
353-
354-
When swarm mode is enabled, the workflow changes:
355-
356-
1. **Create Team**
357-
```
358-
Teammate({ operation: "spawnTeam", team_name: "work-{timestamp}" })
359-
```
360-
361-
2. **Create Task List with Dependencies**
362-
- Parse plan into TaskCreate items
363-
- Set up blockedBy relationships for sequential dependencies
364-
- Independent tasks have no blockers (can run in parallel)
365-
366-
3. **Spawn Specialized Teammates**
367-
```
368-
Task({
369-
team_name: "work-{timestamp}",
370-
name: "implementer",
371-
subagent_type: "general-purpose",
372-
prompt: "Claim implementation tasks, execute, mark complete",
373-
run_in_background: true
374-
})
375-
376-
Task({
377-
team_name: "work-{timestamp}",
378-
name: "tester",
379-
subagent_type: "general-purpose",
380-
prompt: "Claim testing tasks, run tests, mark complete",
381-
run_in_background: true
382-
})
383-
```
384-
385-
4. **Coordinate and Monitor**
386-
- Team lead monitors task completion
387-
- Spawn additional workers as phases unblock
388-
- Handle plan approval if required
389-
390-
5. **Cleanup**
391-
```
392-
Teammate({ operation: "requestShutdown", target_agent_id: "implementer" })
393-
Teammate({ operation: "requestShutdown", target_agent_id: "tester" })
394-
Teammate({ operation: "cleanup" })
395-
```
385+
### Agent Teams Workflow
396386
397-
See the `orchestrating-swarms` skill for detailed swarm patterns and best practices.
387+
1. **Create team** — use your available team creation mechanism
388+
2. **Create task list** — parse Implementation Units into tasks with dependency relationships
389+
3. **Spawn teammates** — assign specialized roles (implementer, tester, reviewer) based on the plan's needs. Give each teammate the plan file path and their specific task assignments
390+
4. **Coordinate** — the lead monitors task completion, reassigns work if someone gets stuck, and spawns additional workers as phases unblock
391+
5. **Cleanup** — shut down all teammates, then clean up the team resources
398392
399393
---
400394
@@ -436,7 +430,7 @@ See the `orchestrating-swarms` skill for detailed swarm patterns and best practi
436430
Before creating PR, verify:
437431
438432
- [ ] All clarifying questions asked and answered
439-
- [ ] All TodoWrite tasks marked completed
433+
- [ ] All tasks marked completed
440434
- [ ] Tests pass (run project's test command)
441435
- [ ] Linting passes (use linting-agent)
442436
- [ ] Code follows existing patterns
@@ -465,6 +459,6 @@ For most features: tests + linting + following patterns is sufficient.
465459
- **Skipping clarifying questions** - Ask now, not after building wrong thing
466460
- **Ignoring plan references** - The plan has links for a reason
467461
- **Testing at the end** - Test continuously or suffer later
468-
- **Forgetting TodoWrite** - Track progress or lose track of what's done
462+
- **Forgetting to track progress** - Update task status as you go or lose track of what's done
469463
- **80% done syndrome** - Finish the feature, don't move on early
470464
- **Over-reviewing simple changes** - Save reviewer agents for complex work

0 commit comments

Comments
 (0)