| name | task-decomposition |
| description | Guide for breaking features into atomic, implementable tasks |
Task Decomposition Skill
This skill helps break down complex features into atomic, independently implementable tasks.
Core Principles
1. Right-Sized Tasks
Each task should be:
- Completable in 1-4 hours of focused work
- Independently testable
- Shippable on its own (even if feature is incomplete)
- Clear enough that someone else could pick it up
2. Vertical Slices
Prefer vertical slices over horizontal layers:
Good (Vertical):
- "Add login button that shows login modal"
- "Implement password validation on login form"
- "Add remember me checkbox to login"
Avoid (Horizontal):
- "Create all auth UI components"
- "Write all auth business logic"
- "Add all auth tests"
3. Dependency Minimization
Order tasks to minimize blocking:
- Foundation tasks (types, interfaces, infrastructure)
- Core functionality (main features)
- Enhancements (polish, edge cases)
- Integration (connecting pieces)
Decomposition Patterns
Pattern: Feature -> Tasks
Feature: "Dark mode support"
Decomposition:
- Define color tokens (CSS variables)
- Create theme context
- Add theme toggle component
- Update navigation to use theme colors
- Update cards to use theme colors
- Update modals to use theme colors
- Persist theme preference
- Detect system preference
Pattern: CRUD -> Tasks
Feature: "Task comments"
Decomposition:
- Add comments field to task entity
- Create comment repository
- Add create comment command
- Add list comments command
- Create comment list component
- Create comment input component
- Integrate comments into task detail view
Pattern: Integration -> Tasks
Feature: "Connect to external API"
Decomposition:
- Define API response types
- Create API client module
- Implement authentication
- Add fetch method for resource
- Create loading states
- Add error handling
- Implement retry logic
- Add caching layer
Pattern: Targeted Testing
Every plan decomposition MUST include a testing strategy that scales with the implementation — not blanket full-suite runs at every gate.
Rules:
- Each implementation task's steps MUST include a test identification step — the worker identifies which test files are affected by the changes in that task before running tests.
- The identification method is tech-stack dependent; workers choose the appropriate approach:
- JS/TS/Python: grep import statements and module references to find test files that import changed modules
- Rust: check
mod tests blocks within changed files and the tests/ directory for integration tests matching changed module names; examine test file naming conventions
- Other stacks: examine test file naming conventions and directory structure
- If targeted identification yields no results, fall back to a path-scoped suite (e.g., tests for the directory or crate containing the changed files) rather than the full suite.
- Do not manufacture a standalone broad regression task; each implementation task follows the target project's local validation policy, while any broader gate stays with the target project's existing automation unless the user explicitly requests otherwise.
- Non-code tasks (docs updates, config-only changes) are exempt from the test identification step.
Example decomposition with targeted testing:
| Task | Type | Test Step |
|---|
| Add comment repository | feature | Identify test files importing comment_repository → run those tests |
| Add comment API endpoint | feature | Identify test files importing comment handler → run those tests |
| Add comment UI component | feature | Identify test files importing CommentInput → run those tests |
Decomposition Questions
Ask these to guide decomposition:
- Data first: What data structures are needed?
- Backend/Frontend split: What needs API vs UI?
- Dependencies: What must exist before this works?
- Testing: How will this be verified?
- Incremental value: Can users benefit before it's complete?
Task Title Conventions
Good titles are action-oriented and specific:
| Good | Bad |
|---|
| "Add save button to form" | "Save functionality" |
| "Validate email format on blur" | "Form validation" |
| "Show loading spinner during fetch" | "Loading states" |
| "Redirect to dashboard after login" | "Auth flow" |
Acceptance Criteria
Each task should have 2-5 acceptance criteria:
Task: Add save button to form
Acceptance Criteria:
- [ ] Save button visible at bottom of form
- [ ] Button disabled when form is invalid
- [ ] Button shows loading state during save
- [ ] Success message appears after save
- [ ] Error message shown if save fails
Red Flags
Signs a task needs more decomposition:
- Description uses "and" multiple times
- Estimated at more than 4 hours
- Requires changes across many files
- Depends on multiple incomplete tasks
- Acceptance criteria exceed 5 items
- Multiple developers would step on each other
Example Decomposition Session
User: "I need user authentication"
Thinking:
- This is too big - auth has many parts
- What are the core pieces?
- User entity
- Login UI
- Registration UI
- Token management
- Protected routes
- Session persistence
- What's the minimum viable auth?
- What can wait?
- Registration, OAuth, password reset
Proposed Tasks:
- Create User entity with email/password
- Add login API endpoint
- Create login form component
- Implement JWT token storage
- Add auth context for session state
- Create protected route wrapper
- Add logout functionality
- Persist session across page refresh
Each task is ~2-3 hours, independently testable, and builds toward complete auth.