README-SKILLS
Command**Objectif**: Savoir où tu en es après une interruption
Set up development environment (branch + worktree) for PRD
name: setup-prd description: Set up development environment (branch + worktree) for PRD category: PRD Management
Prepare development environment for a PRD by creating a feature branch, auto-assigning, and moving to Ready.
Create isolated development environment for PRD:
**ALWAYS use `worktrees/` subdirectory** for consistency:
# ✅ CORRECT (Standard as of 2025-11-02) git worktree add worktrees/prd-007-oauth2-integration feat/PRD-007-oauth2-integration # ❌ WRONG (Old pattern - deprecated) git worktree add ../watchora-prd-007 feat/PRD-007-oauth2-integration
**Rationale**:
**ALWAYS return to `main` branch after setup**:
# After creating worktree, ensure we're on main git checkout main
**Rationale**:
---
Scan PRD directories for available PRDs:
# Check these directories: - product/prds/01-draft/ - product/prds/02-ready/ - product/prds/03-in-progress/ (to show what's already being worked on)
Display table:
📋 **PRDs Available** **Draft** (Review later on feature branch): | # | PRD ID | Feature | Created | |---|--------|---------|---------| | 1 | PRD-007 | OAuth2 Integration | 2025-10-26 | | 2 | PRD-008 | Dark Mode Support | 2025-10-26 | **Approved** (Ready to code): | # | PRD ID | Feature | Grade | |---|--------|---------|-------| | 3 | PRD-003 | Design System | A- | | 4 | PRD-004 | Landing Page | B+ | **In Progress** (Already being developed): | # | PRD ID | Feature | Branch | |---|--------|---------|--------| | 5 | PRD-005 | API v2 | feature/PRD-005-api-v2 | Which PRD? (number, PRD-XXX, or filename)
If selected PRD is in draft:
⚠️ **PRD-007 is still in DRAFT** This PRD hasn't been reviewed or approved yet. **Recommended Workflow**: 1. Create feature branch now (parallel workflow) 2. Review and refine PRD on feature branch 3. Start coding after review **Benefits**: - Keeps your Main branch free - Can review in separate Cursor instance - Multiple PRDs can be prepped in parallel **Continue anyway?** (y/n or more info) > y ✅ Proceeding with draft PRD 💡 Remember to /review-prd PRD-007 on the feature branch!
If user says "no", cancel gracefully.
Read branch naming configuration from .claude/config.json or use defaults
Default pattern: feat/PRD-{ID}-{slug} (or feature/PRD-{ID}-{slug})
Examples:
Extract slug from PRD filename:
// From: PRD-007-oauth2-integration-v1.md
// Extract: oauth2-integration
const slug = filename.replace(/^PRD-\d+-/, '').replace(/-v\d+\.md$/, '').replace('.md', '');# Ensure on main and up to date git checkout main git pull origin main # Create branch git branch feat/PRD-007-oauth2-integration # Don't checkout yet (worktree will do that if enabled)
**Always create worktree in `worktrees/` subdirectory**:
# Worktree path based on config or default # Default: worktrees/prd-007-oauth2-integration/ git worktree add worktrees/prd-007-oauth2-integration feat/PRD-007-oauth2-integration ✅ Created worktree: worktrees/prd-007-oauth2-integration/
**ALWAYS return to main after worktree creation**:
# Ensure we're on main (worktree creation may have switched branches) git checkout main # Verify git branch --show-current # Should output: main
**Output**:
✅ Returned to main branch 💡 Your main window is free for other work
Detect GitHub username using cascade:
# Try 1: GitHub CLI
USERNAME=$(gh auth status 2>&1 | grep -oP 'Logged in to github.com as \K[^\s]+' || echo "")
# Try 2: Git config (fallback)
if [ -z "$USERNAME" ]; then
USERNAME=$(git config user.name || echo "")
fi
# Try 3: Check cached config
if [ -z "$USERNAME" ] && [ -f .prd-config.json ]; then
USERNAME=$(jq -r '.default_assignee // empty' .prd-config.json 2>/dev/null || echo "")
fi
# Try 4: Ask user and cache
if [ -z "$USERNAME" ]; then
echo "💬 What's your GitHub username?"
read USERNAME
# Cache for future use
echo "{\"default_assignee\": \"$USERNAME\"}" > .prd-config.json
echo "✅ Saved to .prd-config.json for future PRDs"
fiUpdate PRD metadata by adding/updating these fields:
**Assignee**: @$USERNAME **Assigned**: $(date +%Y-%m-%d)
**Important**: `/setup-prd` moves Draft → Ready (NOT In-Progress)
# Move from draft to ready mv product/prds/01-draft/PRD-007-oauth2-integration.md \ product/prds/02-ready/PRD-007-oauth2-integration.md
If PRD is already in Ready, skip the move (idempotent):
if [ -f product/prds/02-ready/PRD-007-oauth2-integration.md ]; then echo "ℹ️ PRD already in Ready, skipping move" fi
Update PRD status field:
**Status**: Ready for Development **Branch**: feat/PRD-007-oauth2-integration **Assignee**: @yassinello **Setup Date**: 2025-10-28
The complete Claude Code plugin for Product-Driven Development Transform PRDs from ideas to shipped features with AI-powered review, guided implementation, and automated quality gates. Never ship unclear requirements again.
**Objectif**: Savoir où tu en es après une interruption
4-phase Context Engineering workflow with guided implementation
Complete and close a PRD after PR is merged to production
Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.