with one click
feature
// Full-cycle feature development: PRD creation, implementation, testing, and PR creation in an isolated worktree.
// Full-cycle feature development: PRD creation, implementation, testing, and PR creation in an isolated worktree.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | feature |
| description | Full-cycle feature development: PRD creation, implementation, testing, and PR creation in an isolated worktree. |
Full-cycle feature development: PRD creation, implementation, testing, and PR creation in an isolated worktree.
/feature <feature_name> [options]
feature_name: Name of the feature in kebab-case (e.g., user-authentication, payment-processing)| Flag | Description |
|---|---|
--prd-only | Only create the PRD, don't implement |
--skip-prd | Skip PRD creation if one already exists |
--scaffold | Generate CRUD scaffolding (routes, models, services) |
--with-db | Include database model (requires --scaffold) |
--link-prd <number> | Link to existing PRD branch instead of creating new |
--brainstorm | Run /brainstorm before PRD creation to explore requirements |
--compound | Run /compound after PR creation to capture learnings |
This skill orchestrates the complete feature development lifecycle:
--brainstorm flag is set--compound flag is setWhen this skill is invoked:
Autonomy:
Context Awareness:
prd/00_technology.md for technology-specific commands and patternsprd/ to understand project scopeQuality:
Only runs if --brainstorm flag is set.
Invoke the /brainstorm skill with the feature name to explore requirements before creating the PRD. This separates WHAT from HOW and ensures the right problem is being solved.
/brainstorm {feature_name}
Once requirements are confirmed, continue to Phase 1 with the brainstorm output as input for PRD creation.
# Ensure feature name is kebab-case
# Check it doesn't conflict with existing features
ls src/{project}/
git branch -a | grep -i {feature_name}
# Create worktree for isolated development
WORKTREE_PATH="../$(basename $(pwd))-{feature_name}"
# If --link-prd specified, branch from PRD branch
if [ -n "$LINK_PRD" ]; then
PRD_BRANCH=$(git branch -a | grep "prd/${LINK_PRD}-" | head -1 | xargs)
git worktree add "$WORKTREE_PATH" -b feature/{feature_name} "$PRD_BRANCH"
else
git worktree add "$WORKTREE_PATH" -b feature/{feature_name} main
fi
cd "$WORKTREE_PATH"
# Initialize the worktree (see prd/00_technology.md for commands)
{package_manager} install
{db_generate} # If applicable
Important: All subsequent work happens in the worktree, not the main repository.
Skip this phase if --skip-prd or --link-prd is specified.
Before writing the PRD, understand the project context. Read these files in parallel:
prd/00_index.md - Project overviewprd/_prd_template.md - Template structureprd/00_technology.md - Technology patternsCLAUDE.md - Code standards# Find next available PRD number
ls prd/*.md | grep -E "^prd/[0-9]{2}_" | sort -r | head -1
# Increment by 1 for new PRD
Create prd/{number}_{Feature_name}.md following the template:
---
prd_version: "0.1"
status: "Draft"
last_updated: "YYYY-MM-DD"
owner: "@owner"
---
# {PRD_NUMBER} - {Feature Name}
## 1. Purpose
[Concise description - 2-3 sentences max]
## 2. Functional Requirements
### FR{X}.1 - [Requirement Name]
[Keep it DRY - reference existing docs where possible]
## 3. Technical Implementation
### 3.1 Architecture
[Implementation approach - API client, CRUD service, etc.]
### 3.2 Database Schema
[Only if schema changes required]
### 3.3 Configuration
[Environment variables needed]
## 4. Error Handling
[Error scenarios and handling]
## 5. Testing Strategy
[Key test scenarios]
## 6. References
- [Link to API documentation]
- [Related PRDs]
PRD Best Practices:
Present a concise summary to the user:
PRD Summary: {Feature Name}
Purpose: [1-2 sentences]
Key Requirements:
1. [Requirement 1]
2. [Requirement 2]
3. [Requirement 3]
Technical Approach:
- [Key technical decision 1]
- [Key technical decision 2]
Files to Create/Modify:
- src/{project}/api/{feature} (new)
- src/{project}/services/{feature} (new)
- src/{project}/models/{feature} (new)
- tests/unit/test_{feature} (new)
Questions/Clarifications Needed:
- [Any open questions]
Ask the user to confirm:
If modifications needed: Update PRD and re-confirm.
If approved: Proceed to Phase 4.
Read existing implementations in parallel to understand patterns:
src/{project}/api/src/{project}/services/src/{project}/configsrc/{project}/models/--scaffold)Create standard CRUD structure:
API Routes (src/{project}/api/{feature}):
Models (src/{project}/models/{feature}):
Service (src/{project}/services/{feature}):
Create client structure:
Client (src/{project}/services/clients/{feature}):
Configuration:
.env.exampleIntegration:
--with-db)Add to database schema:
{db_generate} and {db_migrate}Create tests/unit/test_{feature}:
For CRUD features:
For API clients:
Create tests/integration/test_{feature} for:
# Run all tests (see prd/00_technology.md for exact commands)
{test_command} tests/ -v
# If failures, run specific failing tests
{test_command} tests/unit/test_{feature} -v --tb=long
For each failure:
Iterate until all tests pass.
{test_with_coverage} tests/unit/test_{feature} \
--cov=src/{project}/{feature_path}
{lint_fix} src/ tests/
{format_command} src/ tests/
{type_check} src/
{security_scan}
{pre_commit} run --all-files
Fix any issues until all checks pass.
git add .
git status # Review changes
git commit -m "$(cat <<'EOF'
feat({feature}): implement {feature}
- Add {feature} with [routes/client/service]
- Add comprehensive unit tests
- [Other notable changes]
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EOF
)"
git push -u origin feature/{feature_name}
# Determine base branch
if [ -n "$LINK_PRD" ]; then
BASE_BRANCH="prd/${LINK_PRD}-*"
else
BASE_BRANCH="main"
fi
gh pr create --base "$BASE_BRANCH" \
--title "feat({feature}): implement {feature}" \
--body "$(cat <<'EOF'
## Summary
- [Key change 1]
- [Key change 2]
- Includes comprehensive unit tests
## Changes
- `src/{project}/...` - [Description]
- `tests/unit/test_{feature}` - Unit tests
## Test Plan
- [x] All unit tests pass
- [x] Coverage target met
- [x] Linting passes
- [x] Type checking passes
---
Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
gh pr checks
gh run watch
For each CI failure:
gh run view --log-failedgit add .
git commit -m "fix: address CI failure in {component}"
git push
Iterate until CI passes.
Only runs if --compound flag is set.
After the PR is created and CI passes, invoke /compound to capture any non-trivial knowledge gained during implementation. This is especially valuable when:
/compound
main ─────────────────────────────────────────────►
│ ▲
│ create prd branch │ merge PRD PR
▼ │
prd/{n}-{name} ──────────────────────►│
│ ▲ │
│ create feature │ merge feat │
▼ │ │
feature/{name} ────────►│ │
--link-prd)main directlyBefore marking complete, verify:
/feature user-authentication
Creates complete feature with new PRD, implementation, tests, and PR.
/feature user-profile --scaffold --with-db --link-prd 04
Creates CRUD scaffolding linked to existing PRD #04.
/feature payment-processing --prd-only
Creates only the PRD for later implementation.
/feature api-client --skip-prd --link-prd 05
Implements feature using existing PRD #05 without creating a new one.
| Phase | Key Actions | Commands |
|---|---|---|
| 1. Worktree | Create isolated env | git worktree add, {package_manager} install |
| 2. PRD | Create requirements | Read template, create PRD |
| 3. Confirm | Get approval | Present summary |
| 4. Build | Implement feature | Follow existing patterns |
| 5. Tests | Write tests | {test_command} |
| 6. Fix | Debug failures | {test_command} -v --tb=long |
| 7. Quality | Lint & scan | {lint_fix}, {type_check} |
| 8. PR | Create PR | gh pr create |
| 9. CI | Debug CI | gh pr checks, gh run watch |