worktrees:peer
Use for independent development with PR-based integration. Multiple Claude instances work autonomously, each creating PRs to main. Invoke with "/worktrees:peer <feature>" or when user mentions "peer workflow", "independent worktree", "autonomous development", "PR-based workflow", or "multi-instance development".
What this skill does
# Peer Workflow
Independent development with PR-based integration. Each instance works autonomously, creating PRs to main.
## Architecture
```
Instance A (worktree-a) Instance B (worktree-b)
├── Creates own worktree ├── Creates own worktree
├── Develops feature X ├── Develops feature Y
├── Creates PR to main ├── Creates PR to main
├── Gets PR merged ├── Gets PR merged
└── Cleans up worktree └── Cleans up worktree
↓ ↓
└──────── main ────────┘
(integration point)
```
## Key Principles
1. **Complete Autonomy** - Each instance operates independently
2. **Main as Integration** - All PRs target main
3. **Prevention Over Resolution** - Avoid conflicts by working in separate areas
## The Explore-Plan-Code-Commit Workflow
For safe, methodical development in your worktree:
### 1. Explore
Understand the codebase before making changes:
```bash
# Understand project structure
ls -la src/
git log --oneline -10
# Find related code
grep -r "related-pattern" src/
```
### 2. Plan
Use Plan Mode for complex changes:
- Start Claude in Plan Mode for safe exploration
- Review proposed changes before execution
- Particularly valuable when touching shared files
- Exit Plan Mode only when approach is clear
### 3. Code
Implement with focused, atomic changes:
- Work within defined scope
- Make small, testable changes
- Run tests frequently
- Commit atomically
### 4. Commit
Push regularly to maintain progress:
```bash
git add <specific-files>
git commit -m "feat(<scope>): <description>"
git push -u origin <branch>
```
## Procedure
### Step 1: Create Worktree
```bash
# Ensure .worktrees is gitignored (first time only)
grep -q "^\.worktrees" .gitignore 2>/dev/null || echo ".worktrees/" >> .gitignore
git add .gitignore && git commit -m "chore: add .worktrees to gitignore"
# Create uniquely named worktree
# Pattern: {instance-id}-{feature} or just {feature}
git worktree add -b feature/<id>-<feature> .worktrees/<id> main
cd .worktrees/<id>
```
**Naming options for `<id>`:**
- Instance ID: `inst-alpha`, `inst-42`, `agent-a`
- Timestamp: `$(date +%Y%m%d-%H%M)`
- UUID prefix: `$(uuidgen | cut -c1-6)`
### Step 2: Development
Work following the Explore-Plan-Code-Commit cycle:
```bash
# Make changes, commit atomically
git add src/feature/
git commit -m "feat(<scope>): add main functionality"
git add tests/feature/
git commit -m "test(<scope>): add unit tests"
# Push regularly
git push -u origin feature/<id>-<feature>
```
### Step 3: Create PR
```bash
# Ensure up to date with main
git fetch origin main
git rebase origin/main
git push --force-with-lease
# Create PR
gh pr create \
--base main \
--title "feat(<scope>): <description>" \
--body "## Summary
<What this accomplishes>
## Changes
- <Change 1>
- <Change 2>
## Affected Areas
- \`src/<area>/\` - <description>
## Does NOT Modify
- <Other areas untouched>
## Testing
\`\`\`bash
npm test src/<area>/
\`\`\`
## Instance Context
- Instance: <id>
- Worktree: .worktrees/<id>
- Independent feature, no coordination needed"
```
### Step 4: PR Lifecycle
```bash
# Monitor status
gh pr status
gh pr checks
# Respond to feedback
gh pr view --comments
# After approval
gh pr merge --squash --delete-branch
```
### Step 5: Cleanup
```bash
# Return to main project directory
cd ../.. # Exit .worktrees/<id> to project root
# Pull merged changes
git checkout main
git pull origin main
# Remove worktree
git worktree remove .worktrees/<id>
# Clean up
git branch -d feature/<id>-<feature> 2>/dev/null
git worktree prune
```
## Using Plan Mode
For complex changes or when touching shared areas:
1. **Start in Plan Mode** - Safe exploration without execution
2. **Analyze dependencies** - Understand what your changes affect
3. **Identify conflicts early** - Check if others are working nearby
4. **Review proposed changes** - Validate approach before coding
5. **Exit Plan Mode** - Execute with confidence
**When to use Plan Mode:**
- Modifying shared configuration files
- Refactoring that touches multiple files
- Changes with unclear scope
- First time working in unfamiliar area
## Conflict Avoidance
### Scope Communication
Use PR descriptions to communicate scope:
```markdown
## Affected Areas
- `src/payments/**` - New payment module
- `src/config/payments.ts` - Payment configuration
## Does NOT Modify
- User authentication
- API routing (new routes only)
- Existing database tables
```
### Area Ownership
Informally claim areas during active development:
| Area | Active Instance |
|------|-----------------|
| src/payments/ | Instance Alpha |
| src/dashboard/ | Instance Beta |
### Small, Fast PRs
- Keep PRs focused and small
- Merge promptly after approval
- Avoid long-running feature branches
- Split large features into incremental PRs
## Handling Conflicts
### Pre-PR Conflict Check
```bash
git fetch origin main
git rebase origin/main
# If conflicts, resolve:
# Edit conflicting files
git add <resolved-files>
git rebase --continue
git push --force-with-lease
```
### Post-Merge Conflicts
If another PR merged first:
```bash
git fetch origin main
git rebase origin/main
# Resolve conflicts
git add .
git rebase --continue
git push --force-with-lease
```
## Error Recovery
### Worktree Left Behind
```bash
git worktree list # Find orphaned worktree
git worktree remove .worktrees/<orphaned> --force
git worktree prune
git branch -D feature/<orphaned-branch>
git push origin --delete feature/<orphaned-branch>
```
### PR Abandoned
```bash
gh pr close <number> --comment "Cleaning up abandoned PR"
git push origin --delete feature/<abandoned-branch>
git worktree remove .worktrees/<abandoned> --force
```
## Checklist
### Startup
- [ ] `.worktrees/` is in `.gitignore`
- [ ] Unique instance identifier chosen
- [ ] Worktree created with descriptive naming
- [ ] Scope understood and communicated
### Development
- [ ] Following Explore-Plan-Code-Commit
- [ ] Working within defined scope
- [ ] Atomic commits with clear messages
- [ ] Regular pushes to remote
### PR Phase
- [ ] Rebased on latest main
- [ ] Descriptive PR with scope communication
- [ ] Tests passing
- [ ] Reviews requested
### Cleanup
- [ ] PR merged
- [ ] Worktree removed
- [ ] Branches deleted
- [ ] References pruned
## Example: Payment Integration
```bash
# Setup
git worktree add -b feature/inst-alpha-payments .worktrees/inst-alpha main
cd .worktrees/inst-alpha
# Development
mkdir -p src/payments tests/payments
# ... implement ...
git add src/payments/
git commit -m "feat(payments): add Stripe integration"
git push -u origin feature/inst-alpha-payments
# PR
gh pr create --base main --title "feat(payments): Add Stripe integration"
# After merge
cd ../..
git checkout main && git pull
git worktree remove .worktrees/inst-alpha
git worktree prune
```
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.