| name | feature-build |
| description | Complete feature development lifecycle from task selection through commit. Orchestrates component design, build loops with browser testing, PostHog analytics, and documentation updates. Use when building any new feature or enhancement. |
Feature Build Skill
Orchestrates the complete feature development lifecycle with clear phases, entry/exit criteria, and conversation loop patterns. This skill transforms feature requests into shipped, tested, and documented code.
Philosophy
Core Principles
-
Acceptance Criteria First โ Define what "done" looks like before writing code. Testable criteria prevent scope creep and enable verification.
-
Components Live in Style Guide โ Every UI component starts in the style-guide page. This ensures reusability, documents all states, and provides a living reference.
-
Test What You Build โ Use browser tools to verify each step. Don't wait until the end to discover issues.
-
KISS (Keep It Simple, Stupid) โ Implement the simplest solution that meets the criteria. Avoid over-engineering.
-
Loop Back, Don't Push Forward โ When something doesn't work, return to the appropriate phase rather than patching around issues.
Conversation Loop Model
Features are built through phases that can loop back when issues arise:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Task โโโโถโComponent โโโโถโ Build โโโโถโ Analytics โ โ
โ โSelection โ โ Design โ โ Loop โ โ Setup โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โฒ โ โ โ โ
โ โ โผ โผ โผ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ (loop back if criteria fail) โ
โ โ โ
โ โ โโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Commit & โโโโโ
โ (next feature) โ Document โ โ
โ โโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Relationship to Other Skills
- design-system โ Reference for UI patterns, component design principles, style-guide template
- feature-gating โ Use when building pro/freemium features with PostHog flags
- versioning โ Follow semantic versioning for releases
Phase 1: Task Selection
Entry Criteria
- Fresh conversation or user requests a feature
- TASKS.md exists in project
Actions
-
Read TASKS.md โ Identify the next item from Current Sprint
Read TASKS.md and identify the next unchecked item in Current Sprint
-
Confirm Scope โ Clarify with user what's included and excluded
- What exactly should this feature do?
- What should it NOT do?
- Are there edge cases to consider?
-
Break Down if Complex โ Split large features into sub-tasks
- Each sub-task should be completable in one conversation
- Sub-tasks should have clear dependencies
-
Define Acceptance Criteria โ Write testable criteria
Acceptance Criteria Format
### Feature: [Name]
**Acceptance Criteria:**
- [ ] User can [specific action]
- [ ] System [specific behavior] when [condition]
- [ ] Error case: [scenario] displays [message]
- [ ] Mobile: [behavior] works on viewport < 768px
Exit Criteria
Phase 2: Component Design
Entry Criteria
- Feature scope is clear
- Acceptance criteria are defined
Actions
-
Check Style Guide First โ Look for existing components that can be reused or extended
Navigate to /style-guide and snapshot to see existing components
-
Design in Style Guide โ Build new components in the style-guide page
- Components should be isolated and reusable
- Import from
components/ui/ barrel file
- Export new components from barrel file
-
Show All States โ Document every component state:
- Default/resting
- Hover/focus
- Loading/pending
- Success/complete
- Error/invalid
- Disabled
- Empty (if applicable)
-
Mobile Considerations โ Test responsive behavior
- Use PhoneFrame component for mobile mockups if available
- Consider touch targets (min 44px)
Style Guide Section Template
<section id="my-component">
<SectionHeader title="My Component" />
<div className="space-y-6">
<h4 className="text-xs font-medium text-muted-foreground uppercase tracking-wide">
Variants
</h4>
<div className="flex flex-wrap gap-3">
<MyComponent variant="default" />
<MyComponent variant="secondary" />
</div>
<h4 className="text-xs font-medium text-muted-foreground uppercase tracking-wide">
States
</h4>
<div className="flex flex-wrap gap-3">
<MyComponent loading />
<MyComponent disabled />
<MyComponent error="Error message" />
</div>
</div>
</section>
Exit Criteria
Phase 3: Build Loop
Entry Criteria
- Components designed and in style-guide
- Acceptance criteria ready for testing
Actions
3.1 Backend First
Build data layer and API before wiring to UI:
- Database schema โ Add migrations if needed
- Service layer โ Business logic functions
- API routes โ REST endpoints with Zod validation
- Test API โ Use browser network panel or curl to verify
3.2 Frontend Integration
Wire components to backend:
- State management โ Zustand store or React state
- API hooks โ Data fetching with proper loading/error states
- Component wiring โ Connect UI to state and actions
3.3 Browser Testing
Test at each step using Cursor browser tools:
1. Navigate to the page being tested
2. Snapshot to get element references
3. Interact with elements (click, type, etc.)
4. Re-snapshot after state changes
5. Verify expected behavior
6. Screenshot if visual verification needed
See references/testing-patterns.md for detailed testing scenarios.
Testing Checklist by Component Type
Forms:
Lists/Tables:
Modals/Dialogs:
Navigation:
Loop Back Triggers
Return to Phase 2 if:
- Component needs additional states not designed
- UI pattern isn't working as expected
- Need to refactor component API
Return to Phase 1 if:
- Scope is unclear or expanding
- Acceptance criteria need revision
- Feature should be split differently
Exit Criteria
Phase 4: Analytics Setup
Entry Criteria
- Feature is working in browser
- All acceptance criteria pass
Actions
-
Identify Tracking Needs โ What user actions matter?
| Feature Type | Typical Events |
|---|
| Form | {form}_submitted, {form}_error |
| Feature | {feature}_used, {feature}_completed |
| Navigation | {page}_viewed |
| Pro Feature | {feature}_attempted, {feature}_upgrade_shown |
-
Implement Events โ Add PostHog capture calls
posthog.capture('{feature}_{action}', {
feature: 'feature-name',
})
-
Create Dashboard (if appropriate) โ Use PostHog MCP tools
Use mcp_posthog-study-bible_dashboard-create for new dashboards
Use mcp_posthog-study-bible_insight-create-from-query for insights
-
Pro Features โ If feature is gated, follow feature-gating skill:
- Create PostHog feature flag
- Implement
useProFeature() hook
- Track
_attempted, _upgrade_shown, _upgrade_clicked events
Event Naming Convention
{feature}_{action}
Examples:
- notes_created
- notes_synced
- chat_message_sent
- upgrade_modal_shown
- model_changed
Exit Criteria
Phase 5: Commit & Document
Entry Criteria
- Feature complete and tested
- Analytics implemented
Actions
-
Update TASKS.md
- Move completed items to Completed section
- Add completion date
- Check off sub-tasks
- Add any new backlog items discovered
-
Update CHANGELOG.md
- Add entry under current version or "Unreleased"
- Summarize what was added/changed/fixed
- Reference any breaking changes
-
Stage and Commit
- Use conventional commit format
- Keep commits atomic (one logical change per commit)
Conventional Commit Format
<type>(<scope>): <subject>
Types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert
Commit Summary Block
Provide at end of feature for easy copy-paste:
### Done
**Summary**: [Brief description of what was built]
**Commits** (ohmyzsh):
gaa && gcmsg "feat(scope): add feature description"
gcmsg "fix(scope): fix related issue"
gp
TASKS.md Update Pattern
## Completed
- [x] Feature name (YYYY-MM-DD)
- [x] Sub-task 1 โ
- [x] Sub-task 2 โ
- [x] Sub-task 3 โ
Exit Criteria
Quick Reference
Phase Entry/Exit Summary
| Phase | Entry | Exit |
|---|
| 1. Task Selection | Feature request | Criteria defined |
| 2. Component Design | Criteria clear | Components in style-guide |
| 3. Build Loop | Components ready | All criteria pass |
| 4. Analytics | Feature working | Events instrumented |
| 5. Commit | Analytics done | Docs updated, committed |
Common Commands
npm run dev
rm -rf .next
npm rebuild better-sqlite3
gaa && gcmsg "feat(scope): description"
gp
Browser Testing Quick Reference
1. mcp_cursor-ide-browser_browser_navigate โ load page
2. mcp_cursor-ide-browser_browser_snapshot โ get elements
3. mcp_cursor-ide-browser_browser_click/type โ interact
4. mcp_cursor-ide-browser_browser_snapshot โ verify changes
5. mcp_cursor-ide-browser_browser_take_screenshot โ visual check