framework/web_development/.opencode/skills/microtask-decomposition/SKILL.md
Level 2+ task decomposition. Use when a single task from tasks.md is STILL too complex (affects 3+ files or requires multiple logic blocks). Breaks tasks into MICROTASKS (1 file/function each) for granular implementation. NOT for initial task breakdown - OpenSpec already does that.
npx skillsauth add b4san/ac-framework microtask-decompositionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Level 2+ Decomposition: From Tasks to Microtasks
Divide complex tasks from tasks.md into atomic, single-file microtasks for granular tracking and implementation.
tasks.md affects 3+ filesopenspec-new-change or openspec-ff-change)Change (openspec-new-change)
└─> Tasks (tasks.md) - Level 1
└─> Microtasks (this skill) - Level 2+
└─> Implementation
Select ONE task from tasks.md that meets decomposition criteria:
Example complex task:
- [ ] Implement user authentication with login, signup, password reset, and email verification
→ This affects multiple files and operations = DECOMPOSE
Break down the task into its atomic operations:
Each microtask must be:
Microtask format:
microtask:
id: "mt-[number]"
parent_task: "task-id-from-tasks.md"
name: "Brief descriptive name"
description: "What this microtask accomplishes"
files:
- path/to/single-file.ext
dependencies:
- "mt-[prerequisite]"
estimated_time: "30min"
acceptance_criteria:
- "Criterion 1"
- "Criterion 2"
Create a dependency graph:
mt-1: Database schema
└─> mt-2: User model
├─> mt-3: Login endpoint
├─> mt-4: Signup endpoint
└─> mt-5: Password reset service
└─> mt-6: Email verification
└─> mt-7: Integration tests
Group microtasks into execution phases:
Phase 1 (Foundation - Sequential):
Phase 2 (Core Features - Parallel):
Phase 3 (Extended Features - Sequential):
Phase 4 (Integration):
## Microtask Decomposition Summary
**Parent Task**: [task description from tasks.md]
**Task ID**: [task identifier]
**Total Microtasks**: [N]
**Estimated Total Time**: [X hours]
**Execution Phases**: [N phases]
---
### Microtask List
#### Phase 1: Foundation
**mt-1: [Name]**
- **Files**: `file.ext`
- **Description**: What to implement
- **Dependencies**: None
- **Estimated**: 30min
- **Acceptance Criteria**:
- [ ] Criterion 1
- [ ] Criterion 2
**mt-2: [Name]**
- **Files**: `file.ext`
- **Description**: What to implement
- **Dependencies**: mt-1
- **Estimated**: 45min
- **Acceptance Criteria**:
- [ ] Criterion 1
#### Phase 2: Core Features (Parallel)
**mt-3: [Name]**
- **Files**: `file.ext`
- **Description**: What to implement
- **Dependencies**: mt-2
- **Estimated**: 30min
- **Acceptance Criteria**:
- [ ] Criterion 1
[Continue for all phases...]
---
### Dependency Graph
[ASCII art showing dependency relationships]
---
### Execution Plan
**Phase 1** (Foundation - Do first):
- [ ] mt-1
- [ ] mt-2
**Phase 2** (Core - Parallelizable):
- [ ] mt-3 (depends: mt-2)
- [ ] mt-4 (depends: mt-2)
**Phase 3** (Extended - Sequential):
- [ ] mt-5 (depends: mt-3, mt-4)
**Phase 4** (Final):
- [ ] mt-6 (depends: mt-5)
- [ ] mt-7 (depends: mt-6)
---
### Parent Task Update
After decomposition, update the parent task in `tasks.md`:
```markdown
- [ ] Implement user authentication [DECOMPOSED INTO MICROTASKS]
- [ ] Phase 1: Foundation
- [ ] mt-1: Database schema
- [ ] mt-2: User model
- [ ] Phase 2: Core Features
- [ ] mt-3: Login endpoint
- [ ] mt-4: Signup endpoint
- [ ] Phase 3: Extended Features
- [ ] mt-5: Password reset service
- [ ] mt-6: Email verification
- [ ] Phase 4: Integration
- [ ] mt-7: Integration tests
---
## Example
### Parent Task (from tasks.md):
```markdown
- [ ] Build complete authentication system with login, signup, password reset, email verification, and session management
## Microtask Decomposition Summary
**Parent Task**: Build complete authentication system
**Total Microtasks**: 9
**Estimated Total Time**: 6 hours
**Execution Phases**: 4
---
### Microtask List
#### Phase 1: Data Layer
**mt-1: User Database Schema**
- **Files**: `database/migrations/001_users.sql`
- **Description**: Create users table with fields: id, email, password_hash, verified, created_at
- **Dependencies**: None
- **Estimated**: 20min
- **Acceptance**: Migration runs, schema matches requirements
**mt-2: User Model/Entity**
- **Files**: `src/models/User.js`
- **Description**: User class with methods: create(), findByEmail(), verify(), updatePassword()
- **Dependencies**: mt-1
- **Estimated**: 30min
- **Acceptance**: All CRUD operations work, password hashing implemented
#### Phase 2: Core Auth Endpoints (Parallel)
**mt-3: Login Endpoint**
- **Files**: `src/routes/auth/login.js`
- **Description**: POST /api/auth/login - validate credentials, create session/JWT
- **Dependencies**: mt-2
- **Estimated**: 30min
- **Acceptance**: Returns token on success, proper error on failure
**mt-4: Signup Endpoint**
- **Files**: `src/routes/auth/signup.js`
- **Description**: POST /api/auth/signup - validate email, hash password, create user
- **Dependencies**: mt-2
- **Estimated**: 30min
- **Acceptance**: Creates user, sends verification email
#### Phase 3: Extended Features
**mt-5: Password Reset Service**
- **Files**: `src/services/passwordReset.js`, `src/routes/auth/reset.js`
- **Description**: Generate reset tokens, send emails, validate tokens
- **Dependencies**: mt-3, mt-4
- **Estimated**: 45min
- **Acceptance**: Token generation, email sending, token validation work
**mt-6: Email Verification**
- **Files**: `src/services/verification.js`, `src/routes/auth/verify.js`
- **Description**: Send verification emails, verify tokens, update user status
- **Dependencies**: mt-5
- **Estimated**: 30min
- **Acceptance**: Email sent, token verified, user marked verified
**mt-7: Session Management**
- **Files**: `src/middleware/session.js`, `src/services/session.js`
- **Description**: Validate sessions/JWT, refresh tokens, logout
- **Dependencies**: mt-3
- **Estimated**: 40min
- **Acceptance**: Sessions validated, refresh works, logout clears session
#### Phase 4: UI & Integration
**mt-8: Auth UI Components**
- **Files**: `src/components/LoginForm.jsx`, `src/components/SignupForm.jsx`
- **Description**: Forms with validation, error handling, loading states
- **Dependencies**: mt-3, mt-4
- **Estimated**: 60min
- **Acceptance**: Forms work, validation feedback, API integration
**mt-9: Auth Integration Tests**
- **Files**: `tests/integration/auth.test.js`
- **Description**: End-to-end tests for all auth flows
- **Dependencies**: mt-6, mt-7, mt-8
- **Estimated**: 45min
- **Acceptance**: All flows tested, edge cases covered
tasks.md with microtask breakdownopenspec-apply-change per microtask:
For each microtask:
- Focus on single file
- Implement
- Test
- Mark complete
1. openspec-new-change → Creates tasks.md
2. Identify complex task → Use microtask-decomposition
3. Update tasks.md with microtasks
4. openspec-apply-change → Implement each microtask
5. Mark parent task complete when all microtasks done
| Situation | Use | Don't Use |
|-----------|-----|-----------|
| Initial task breakdown | openspec-new-change / openspec-ff-change | microtask-decomposition |
| Task affects 1-2 files | Direct implementation | microtask-decomposition |
| Task affects 3+ files, complex | microtask-decomposition | Direct implementation |
| Need parallel execution | microtask-decomposition | Sequential approach |
| Simple CRUD operation | Direct in tasks.md | microtask-decomposition |
openspec-new-change - Create parent changeopenspec-continue-change - Work on decomposed artifactsopenspec-apply-change - Implement each microtaskspec-analysis - Verify consistency after decompositiondevelopment
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
Automate the generation and maintenance of unit, integration, and end-to-end tests, as well as test data generation and debugging. Use when writing tests for new features, maintaining existing tests after API/UI changes, generating synthetic test data, or debugging test failures. Essential for ensuring code quality and preventing regressions.
testing
Generate comprehensive test suites ensuring requirements are met. Strategies for Unit, Integration, and E2E testing.
development
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes