# Implement Feature Prompt (v2)
## π― Goal
Ship the feature per specs with clean, secure, performant code. **Consider alternative implementation approaches and choose the most appropriate one.**
## π₯ Context (ask if missing)
1. **Design Spec** β link/file for architecture & diagrams.
2. **Requirements** β user stories + acceptance criteria.
3. **Repo Access** β branch / directory path.
4. **Dev Environment** β setup quirks, build tools, secrets manager?
## π¦ Skip if
- Implementation already merged **or** change is trivial/config-only.
## π Checklist
- **Implementation Strategy**
- [ ] Use vertical slice approach: implement complete user scenarios end-to-end
- [ ] Prioritize working software over perfect layers
- [ ] Start with simplest valuable slice, then iterate
1. **Core Logic** β business rules first.
2. **Data Layer** β models, migrations, validation.
3. **API** β endpoints, request/response schema.
4. **Integrations** β external services, queues, webhooks.
5. **UI** β components, state mgmt, a11y.
6. **Cross-Cutting** β logging, monitoring, error handling, auth.
7. **Libraries & Dependencies** β when working with libraries, use MCP tools like Context7 for fresh docs or check latest documentation.
### Quality Gates
- [ ] Follows style guide & naming conventions.
- [ ] Inputs validated, secrets via env/manager.
- [ ] No hard-coded limits; efficient queries.
- [ ] Unit + integration tests pass (β₯ 90 % coverage for new code).
## π οΈ Common Patterns
Repository β’ Service β’ Factory β’ Middleware β’ Decorator β’ Observer
## π€ Output
1. Gather insights from the user directly
2. Fill in **File:** `docs/planning/[feature-name]-implementation-plan.md`
Sections:
1. **Summary** β feature scope & branch.
2. **Done Checklist** β items from the π Checklist with β
/ β.
3. **Security Notes** β validation, authZ, secret handling.
4. **Performance Notes** β known bottlenecks or caching.
5. **Test Coverage** β % + key scenarios covered.
6. **Next Steps** β remaining todos + owner.
## β‘οΈ Response Flow
```mermaid
flowchart LR
U[User] -->|specs ready| A[Implementation Engine]
A --> B{Need more context?}
B -- Yes --> C[Ask for spec / env]
B -- No --> D[Code + tests]
D --> E[Write implementation_plan.md]