/feature
End-to-end pipeline: GitHub Issue → Spec → Worktree → Implementation → PR.
Input: #42, 42, issue URL, or free-text description.
Read .claude/models.yml for model routing.
phase 0: resume check
Schema verification — Run /sync-schema auto-verification:
- Read
.claude/stack.yml → schema section. Not configured → skip silently.
- If configured, check if
schema.md is stale (files in schema.paths newer than Last synced date).
- Stale or missing → run full
/sync-schema before continuing.
Parse input:
- Number or
#N → ISSUE = N
- URL
https://github.com/.../issues/N → extract N
- Free text → will create issue in Phase 1
Verify GitHub CLI auth:
gh auth status
- FAIL →
❌ Error: Run 'gh auth login' first.
If ISSUE exists, fetch it:
gh issue view ISSUE --json number,title,body,state,labels
- Issue not found →
❌ Error: Issue #ISSUE not found.
- Issue closed → print
⚠️ Issue #ISSUE is closed. Proceeding anyway. and continue
Derive identifiers:
SLUG = kebab-case of issue title, max 40 chars
BRANCH = feat/ISSUE-SLUG (e.g. feat/42-add-notifications)
REPO_ROOT = git rev-parse --show-toplevel
WT_ROOT = REPO_ROOT/../.worktrees/BRANCH
Check if worktree already exists:
git worktree list | grep BRANCH
- EXISTS → Read
WT_ROOT/.claude/memory/project-state.md → RESUME from pending phase
- NOT EXISTS → continue to Phase 1
phase 1: intake
Case A — Free-text description (no issue number):
gh issue create --title "TITLE" --body "BODY"
- Capture the returned ISSUE number
- Derive SLUG, BRANCH, WT_ROOT from the new issue
- Apply preliminary label based on content analysis (model: haiku):
- Defect/bug description →
gh issue edit ISSUE --add-label "bug"
- Documentation-focused →
gh issue edit ISSUE --add-label "documentation"
- Default →
gh issue edit ISSUE --add-label "enhancement"
Case B — Existing issue:
- Already have issue content from Phase 0
- If no labels exist, apply preliminary label as in Case A
Allowed labels (GitHub defaults only): bug, enhancement, documentation, good first issue, help wanted, question, duplicate, invalid, wontfix.
phase 2: spec
Invoke planner agent (model: opus) with context:
- Issue body (title + description)
.claude/memory/architecture.md
.claude/memory/decisions/DEC-*.md
.claude/project.yml
Planner produces structured spec:
- Scope: 1-3 sentences describing the change
- Acceptance Criteria: measurable conditions for done
- Invariants Affected: which invariants from project.yml are touched
- Tasks: decomposed into waves (ordered groups)
- Files: to create/modify
- Test strategy: what to test and how
- Recommended labels: additional labels based on analysis
Present plan to user and wait for approval — ONLY USER GATE IN THIS PIPELINE:
- Print the full spec: Scope, Acceptance Criteria, Invariants Affected, Tasks (all waves), Files, Test Strategy
- Print:
Proceed with implementation? (yes/no)
- YES → continue to step 4
- NO → print
❌ Cancelled by user. and STOP. Do NOT post GitHub comments or create worktree.
Apply labels from planner analysis (model: haiku):
gh issue edit ISSUE --add-label "label1,label2"
Post Comment 1 — Requirements (posted ONCE, NEVER edited):
gh issue comment ISSUE --body "## Requirements
**Branch:** \`feat/ISSUE-SLUG\`
### Scope
[scope from planner]
### Acceptance Criteria
[acceptance criteria from planner]
### Invariants Affected
[invariants from planner]
### Files
[files from planner]
### Test Strategy
[test strategy from planner]
"
Post Comment 2 — Execution Plan (living comment, edited throughout):
gh issue comment ISSUE --body "## Execution
### Wave 1: [Name]
- [ ] Task description
- [ ] Task description
### Wave 2: [Name]
- [ ] Task description
---
**Status:** Starting execution
"
Write tasks to project-state.md with metadata:
skill: feature
issue: #ISSUE
branch: BRANCH
phase: execution
phase 3: worktree setup
Sync local main with remote:
git fetch origin
git switch main && git merge --ff-only origin/main
- If merge fails (local has diverged) →
❌ Error: Local main has diverged from origin. Resolve manually.
Create worktree directory:
mkdir -p REPO_ROOT/../.worktrees
git worktree add WT_ROOT -b BRANCH origin/main
Copy state to worktree:
cp REPO_ROOT/.claude/memory/project-state.md WT_ROOT/.claude/memory/project-state.md
Initialize clean locks in worktree:
- Write empty
WT_ROOT/.claude/memory/locks.md
phase 4: execution (inside worktree)
isolation rule — mandatory
From this phase until Phase 5 completes:
- ALL reads and writes MUST use absolute paths under
WT_ROOT
- NEVER read from REPO_ROOT — the main checkout is off-limits
- NEVER write to REPO_ROOT — no copying files back to main
- NEVER
cd to REPO_ROOT — stay inside the worktree
- The worktree IS the project root. Treat
WT_ROOT as if REPO_ROOT does not exist.
If an agent or skill tries to reference a path outside WT_ROOT → STOP and fix the path.
execution
- Agents read config from:
WT_ROOT/.claude/stack.yml, WT_ROOT/.claude/memory/architecture.md
- Bash commands:
cd WT_ROOT && {command}
- State updates:
WT_ROOT/.claude/memory/project-state.md
For each task [ ] in WT_ROOT/.claude/memory/project-state.md:
- Builder agent (model: sonnet) implements + tests
- PASS → mark
[x], print ✅ [task_number] task_description
- FAIL → retry (max 2 retries). 3rd failure → post blocker to issue, STOP:
gh issue comment ISSUE --body "Blocked: [task description]. Error: [details]"
After EVERY completed wave, run these 3 steps in order — NO EXCEPTIONS:
Commit:
cd WT_ROOT && git add -A && git commit -m "feat(SLUG): wave N — [summary]"
Update Comment 2 (Execution Plan) via --edit-last:
gh issue comment ISSUE --edit-last --body "## Execution
### Wave 1: [Name]
- [x] Task description
- [x] Task description
### Wave 2: [Name]
- [ ] Task description
---
**Status:** Wave N complete — X/Y tasks done
"
If --edit-last fails (first wave, no previous comment by this actor), post a new comment:
gh issue comment ISSUE --body "## Execution
...
"
Every 3 tasks: compress context via /summarize-context (model: haiku)
phase 5: integration
Verify ALL tasks are [x] in WT_ROOT/.claude/memory/project-state.md
Run final validation (tests + build):
- Read
WT_ROOT/.claude/stack.yml for validate command and exec_prefix
- Execute:
cd WT_ROOT && {exec_prefix} {stack.commands.validate}
- If
validate not defined, run {stack.commands.test} then {stack.commands.build}
- Build step catches SSR/runtime errors (missing providers, import errors, type mismatches)
- FAIL → create fix tasks, return to Phase 4
Manual verification (if stack uses docker):
- Stop any running containers on the same port:
cd REPO_ROOT && docker compose down
- Start containers in worktree:
cd WT_ROOT && docker compose up -d
- Print:
ℹ️ App running at http://localhost:3001 — proceeding to push.
- Continue without waiting for user input.
Push branch:
cd WT_ROOT && git push -u origin BRANCH
- Push rejected →
cd WT_ROOT && git pull --rebase origin BRANCH, retry once
Create PR (model: haiku):
gh pr create --title "feat: ISSUE_TITLE" --body "Closes #ISSUE
## Summary
[spec scope from Phase 2]
## Changes
[list of files changed]
## Test plan
[test strategy from Phase 2]
" --head BRANCH --base main
Final update to Comment 2 (Execution Plan) via --edit-last:
gh issue comment ISSUE --edit-last --body "## Execution
### Wave 1: [Name]
- [x] Task description
...
---
**PR:** PR_URL
**Status:** Complete — Y/Y tasks done. Awaiting user merge.
"
phase 6: cleanup
Archive state (model: haiku):
mkdir -p REPO_ROOT/.claude/memory/archive/
cp WT_ROOT/.claude/memory/project-state.md REPO_ROOT/.claude/memory/archive/feature-ISSUE-$(date +%Y%m%d).md
DO NOT remove worktree — may need fixes post-review
Output: ✅ Feature #ISSUE delivered. PR: PR_URL — merge when ready.
(Merging is the user's responsibility.)
error handling
| Error |
Action |
gh auth status fails |
❌ Error: Run 'gh auth login' first. |
| Issue not found |
❌ Error: Issue #ISSUE not found. |
| Push rejected |
git pull --rebase origin BRANCH, retry once |
| Task fails 3x |
Post blocker comment to issue, STOP |
| Session interrupted |
Next /feature #ISSUE resumes automatically from pending phase |
| Worktree conflicts |
cd WT_ROOT && git rebase origin/main, resolve conflicts |
resumability
When /feature #N is invoked and a worktree for that issue already exists:
- Read
WT_ROOT/.claude/memory/project-state.md
- Parse metadata:
skill, issue, branch, phase
- Find first uncompleted task
[ ]
- Resume from the appropriate phase:
- All tasks
[ ] and no spec → Phase 2
- Tasks exist but no worktree work started → Phase 4
- Some tasks
[x], some [ ] → Phase 4 (continue)
- All tasks
[x] → Phase 5
conventions
- One feature = one issue = one worktree = one branch
- Branch naming:
feat/ISSUE-SLUG
- Worktree location:
REPO_ROOT/../.worktrees/feat/ISSUE-SLUG
- Commits inside worktree use conventional format:
feat(SLUG): description
- All GitHub communication via
gh CLI — no API tokens needed beyond gh auth
- 2 comments only: Comment 1 (Requirements — immutable), Comment 2 (Execution — living)
- Labels: GitHub defaults only (
bug, enhancement, documentation, good first issue, help wanted, question, duplicate, invalid, wontfix)
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: lvergro-claude-code-orquesta-feature3description: Lvergro Claude Code Orquesta Feature4---56# /feature78End-to-end pipeline: GitHub Issue → Spec → Worktree → Implementation → PR.910Input: `#42`, `42`, issue URL, or free-text description.1112Read `.claude/models.yml` for model routing.1314---1516## phase 0: resume check17181. **Schema verification** — Run `/sync-schema` auto-verification:19 - Read `.claude/stack.yml` → `schema` section. Not configured → skip silently.20 - If configured, check if `schema.md` is stale (files in `schema.paths` newer than `Last synced` date).21 - Stale or missing → run full `/sync-schema` before continuing.22232. Parse input:24 - Number or `#N` → ISSUE = N25 - URL `https://github.com/.../issues/N` → extract N26 - Free text → will create issue in Phase 127283. Verify GitHub CLI auth:29 ```30 gh auth status31 ```32 - FAIL → `❌ Error: Run 'gh auth login' first.`33344. If ISSUE exists, fetch it:35 ```36 gh issue view ISSUE --json number,title,body,state,labels37 ```38 - Issue not found → `❌ Error: Issue #ISSUE not found.`39 - Issue closed → print `⚠️ Issue #ISSUE is closed. Proceeding anyway.` and continue40415. Derive identifiers:42 - `SLUG` = kebab-case of issue title, max 40 chars43 - `BRANCH` = `feat/ISSUE-SLUG` (e.g. `feat/42-add-notifications`)44 - `REPO_ROOT` = `git rev-parse --show-toplevel`45 - `WT_ROOT` = `REPO_ROOT/../.worktrees/BRANCH`46476. Check if worktree already exists:48 ```49 git worktree list | grep BRANCH50 ```51 - **EXISTS** → Read `WT_ROOT/.claude/memory/project-state.md` → RESUME from pending phase52 - **NOT EXISTS** → continue to Phase 15354---5556## phase 1: intake5758**Case A — Free-text description (no issue number):**59```60gh issue create --title "TITLE" --body "BODY"61```62- Capture the returned ISSUE number63- Derive SLUG, BRANCH, WT_ROOT from the new issue64- Apply preliminary label based on content analysis (model: haiku):65 - Defect/bug description → `gh issue edit ISSUE --add-label "bug"`66 - Documentation-focused → `gh issue edit ISSUE --add-label "documentation"`67 - Default → `gh issue edit ISSUE --add-label "enhancement"`6869**Case B — Existing issue:**70- Already have issue content from Phase 071- If no labels exist, apply preliminary label as in Case A7273**Allowed labels** (GitHub defaults only): `bug`, `enhancement`, `documentation`, `good first issue`, `help wanted`, `question`, `duplicate`, `invalid`, `wontfix`.7475---7677## phase 2: spec78791. Invoke **planner agent** (model: opus) with context:80 - Issue body (title + description)81 - `.claude/memory/architecture.md`82 - `.claude/memory/decisions/DEC-*.md`83 - `.claude/project.yml`84852. Planner produces structured spec:86 - **Scope**: 1-3 sentences describing the change87 - **Acceptance Criteria**: measurable conditions for done88 - **Invariants Affected**: which invariants from project.yml are touched89 - **Tasks**: decomposed into waves (ordered groups)90 - **Files**: to create/modify91 - **Test strategy**: what to test and how92 - **Recommended labels**: additional labels based on analysis93943. **Present plan to user and wait for approval — ONLY USER GATE IN THIS PIPELINE:**95 - Print the full spec: Scope, Acceptance Criteria, Invariants Affected, Tasks (all waves), Files, Test Strategy96 - Print: `Proceed with implementation? (yes/no)`97 - **YES** → continue to step 498 - **NO** → print `❌ Cancelled by user.` and STOP. Do NOT post GitHub comments or create worktree.991004. Apply labels from planner analysis (model: haiku):101 ```102 gh issue edit ISSUE --add-label "label1,label2"103 ```1041055. Post **Comment 1 — Requirements** (posted ONCE, NEVER edited):106 ```107 gh issue comment ISSUE --body "## Requirements108 **Branch:** \`feat/ISSUE-SLUG\`109110 ### Scope111 [scope from planner]112113 ### Acceptance Criteria114 [acceptance criteria from planner]115116 ### Invariants Affected117 [invariants from planner]118119 ### Files120 [files from planner]121122 ### Test Strategy123 [test strategy from planner]124 "125 ```1261276. Post **Comment 2 — Execution Plan** (living comment, edited throughout):128 ```129 gh issue comment ISSUE --body "## Execution130131 ### Wave 1: [Name]132 - [ ] Task description133 - [ ] Task description134135 ### Wave 2: [Name]136 - [ ] Task description137138 ---139 **Status:** Starting execution140 "141 ```1421437. Write tasks to `project-state.md` with metadata:144 ```145 skill: feature146 issue: #ISSUE147 branch: BRANCH148 phase: execution149 ```150151---152153## phase 3: worktree setup1541551. Sync local main with remote:156 ```157 git fetch origin158 git switch main && git merge --ff-only origin/main159 ```160 - If merge fails (local has diverged) → `❌ Error: Local main has diverged from origin. Resolve manually.`1611622. Create worktree directory:163 ```164 mkdir -p REPO_ROOT/../.worktrees165 git worktree add WT_ROOT -b BRANCH origin/main166 ```1671683. Copy state to worktree:169 ```170 cp REPO_ROOT/.claude/memory/project-state.md WT_ROOT/.claude/memory/project-state.md171 ```1721734. Initialize clean locks in worktree:174 - Write empty `WT_ROOT/.claude/memory/locks.md`175176---177178## phase 4: execution (inside worktree)179180### isolation rule — mandatory181From this phase until Phase 5 completes:182- **ALL reads and writes MUST use absolute paths under `WT_ROOT`**183- **NEVER read from REPO_ROOT** — the main checkout is off-limits184- **NEVER write to REPO_ROOT** — no copying files back to main185- **NEVER `cd` to REPO_ROOT** — stay inside the worktree186- The worktree IS the project root. Treat `WT_ROOT` as if REPO_ROOT does not exist.187188If an agent or skill tries to reference a path outside WT_ROOT → STOP and fix the path.189190### execution191- Agents read config from: `WT_ROOT/.claude/stack.yml`, `WT_ROOT/.claude/memory/architecture.md`192- Bash commands: `cd WT_ROOT && {command}`193- State updates: `WT_ROOT/.claude/memory/project-state.md`194195**For each task `[ ]` in `WT_ROOT/.claude/memory/project-state.md`:**1961971. **Builder agent** (model: sonnet) implements + tests1982. **PASS** → mark `[x]`, print `✅ [task_number] task_description`1993. **FAIL** → retry (max 2 retries). 3rd failure → post blocker to issue, STOP:200 ```201 gh issue comment ISSUE --body "Blocked: [task description]. Error: [details]"202 ```203204**After EVERY completed wave, run these 3 steps in order — NO EXCEPTIONS:**2052061. **Commit:**207 ```208 cd WT_ROOT && git add -A && git commit -m "feat(SLUG): wave N — [summary]"209 ```2102112. **Update Comment 2 (Execution Plan) via `--edit-last`:**212 ```213 gh issue comment ISSUE --edit-last --body "## Execution214215 ### Wave 1: [Name]216 - [x] Task description217 - [x] Task description218219 ### Wave 2: [Name]220 - [ ] Task description221222 ---223 **Status:** Wave N complete — X/Y tasks done224 "225 ```226 If `--edit-last` fails (first wave, no previous comment by this actor), post a new comment:227 ```228 gh issue comment ISSUE --body "## Execution229 ...230 "231 ```2322333. **Every 3 tasks:** compress context via `/summarize-context` (model: haiku)234235---236237## phase 5: integration2382391. Verify ALL tasks are `[x]` in `WT_ROOT/.claude/memory/project-state.md`2402412. Run final validation (tests + build):242 - Read `WT_ROOT/.claude/stack.yml` for validate command and exec_prefix243 - Execute: `cd WT_ROOT && {exec_prefix} {stack.commands.validate}`244 - If `validate` not defined, run `{stack.commands.test}` then `{stack.commands.build}`245 - Build step catches SSR/runtime errors (missing providers, import errors, type mismatches)246 - **FAIL** → create fix tasks, return to Phase 42472483. Manual verification (if stack uses docker):249 - Stop any running containers on the same port: `cd REPO_ROOT && docker compose down`250 - Start containers in worktree: `cd WT_ROOT && docker compose up -d`251 - Print: `ℹ️ App running at http://localhost:3001 — proceeding to push.`252 - Continue without waiting for user input.2532544. Push branch:255 ```256 cd WT_ROOT && git push -u origin BRANCH257 ```258 - Push rejected → `cd WT_ROOT && git pull --rebase origin BRANCH`, retry once2592605. Create PR (model: haiku):261 ```262 gh pr create --title "feat: ISSUE_TITLE" --body "Closes #ISSUE263264 ## Summary265 [spec scope from Phase 2]266267 ## Changes268 [list of files changed]269270 ## Test plan271 [test strategy from Phase 2]272 " --head BRANCH --base main273 ```2742756. Final update to Comment 2 (Execution Plan) via `--edit-last`:276 ```277 gh issue comment ISSUE --edit-last --body "## Execution278279 ### Wave 1: [Name]280 - [x] Task description281 ...282283 ---284 **PR:** PR_URL285 **Status:** Complete — Y/Y tasks done. Awaiting user merge.286 "287 ```288289---290291## phase 6: cleanup2922931. Archive state (model: haiku):294 ```295 mkdir -p REPO_ROOT/.claude/memory/archive/296 cp WT_ROOT/.claude/memory/project-state.md REPO_ROOT/.claude/memory/archive/feature-ISSUE-$(date +%Y%m%d).md297 ```2982992. **DO NOT remove worktree** — may need fixes post-review3003013. Output: `✅ Feature #ISSUE delivered. PR: PR_URL — merge when ready.`302303*(Merging is the user's responsibility.)*304305---306307## error handling308309| Error | Action |310|-------|--------|311| `gh auth status` fails | `❌ Error: Run 'gh auth login' first.` |312| Issue not found | `❌ Error: Issue #ISSUE not found.` |313| Push rejected | `git pull --rebase origin BRANCH`, retry once |314| Task fails 3x | Post blocker comment to issue, STOP |315| Session interrupted | Next `/feature #ISSUE` resumes automatically from pending phase |316| Worktree conflicts | `cd WT_ROOT && git rebase origin/main`, resolve conflicts |317318---319320## resumability321322When `/feature #N` is invoked and a worktree for that issue already exists:3233241. Read `WT_ROOT/.claude/memory/project-state.md`3252. Parse metadata: `skill`, `issue`, `branch`, `phase`3263. Find first uncompleted task `[ ]`3274. Resume from the appropriate phase:328 - All tasks `[ ]` and no spec → Phase 2329 - Tasks exist but no worktree work started → Phase 4330 - Some tasks `[x]`, some `[ ]` → Phase 4 (continue)331 - All tasks `[x]` → Phase 5332333---334335## conventions336337- **One feature = one issue = one worktree = one branch**338- Branch naming: `feat/ISSUE-SLUG`339- Worktree location: `REPO_ROOT/../.worktrees/feat/ISSUE-SLUG`340- Commits inside worktree use conventional format: `feat(SLUG): description`341- All GitHub communication via `gh` CLI — no API tokens needed beyond `gh auth`342- **2 comments only**: Comment 1 (Requirements — immutable), Comment 2 (Execution — living)343- **Labels**: GitHub defaults only (`bug`, `enhancement`, `documentation`, `good first issue`, `help wanted`, `question`, `duplicate`, `invalid`, `wontfix`)344345---346> Converted and distributed by [TomeVault](https://tomevault.io/claim/lvergro) — claim your Tome and manage your conversions.347<!-- tomevault:4.0:skill_md:2026-04-14 -->