Learn the workflow orchestration approach by working through a real example.
- How to plan before executing
- When to delegate to subagents
- How to verify your work
- How to capture lessons
- Claude Code or compatible AI agent installed
- The workflow-orchestration skill installed
- A project to work on
Let's say you receive this task:
"Add a dark mode toggle to the settings page"
Before jumping in, apply the Plan Mode Default practice.
Ask yourself: Does this task have 3+ steps or architectural decisions?
Yes - it involves:
- Understanding current theme system
- Adding toggle UI component
- Implementing theme switching logic
- Persisting user preference
- Testing the feature
Create tasks/todo.md:
# Task: Add dark mode toggle to settings page
## Plan
- [ ] Research existing theme/styling patterns in codebase
- [ ] Design approach for theme state management
- [ ] Implement toggle component on settings page
- [ ] Add theme switching logic
- [ ] Persist preference to localStorage/database
- [ ] Test light/dark switching
- [ ] Verification: Manual test + visual regression check
## Progress Notes
## ReviewThe first step is research. This is perfect for a subagent—it keeps your main context clean.
Delegate:
"Search this codebase for existing theme, color, or styling patterns. Look for CSS variables, theme contexts, or color scheme utilities. Report back what you find."
Wait for results before proceeding.
As you work through each step, update tasks/todo.md:
## Progress Notes
10:00 - Subagent found existing CSS variables in styles/theme.css
10:15 - Using CSS custom properties approach, no React context needed
10:30 - Toggle component added to SettingsPage.tsx
10:45 - Theme switching working via data-theme attributeMark items complete as you finish them.
Before marking the task complete, verify:
- Does the toggle actually switch themes?
- Does the preference persist on refresh?
- Are all UI elements properly themed?
- Would a staff engineer approve this code?
Run through each check. If something fails, fix it before proceeding.
Update your todo with the review:
## Review
Added dark mode toggle using CSS custom properties approach.
Toggle persists to localStorage. All existing components
properly inherit theme colors. No new dependencies added.Did anything unexpected happen? Did you make a mistake the user corrected?
If yes, add to tasks/lessons.md:
## 2024-01-15 - Architecture
**Mistake**: Initially tried to use React context for theme, but codebase already had CSS variables
**Pattern**: Jumping to familiar solutions without checking existing patterns
**Rule**: Always search for existing patterns before introducing new architecture
**Applied**: Any feature that could use existing infrastructureYou've now completed an orchestrated task:
- Planned before executing
- Delegated research to a subagent
- Tracked progress in todo.md
- Verified before marking complete
- Captured lessons for future improvement
Repeat this process for every non-trivial task, and your execution quality will continuously improve.
- Read the How-To Guides for specific scenarios
- Check the Reference for decision criteria
- Review Explanation to understand why these practices work