worktree-lifecycle
Skill15 starsChanged 33 days agoMITView on GitHub
Run every task as ticket → its own git worktree + branch on its own ports → PR → merge → teardown, with nanoflow. Use when starting, continuing, opening a PR for, or finishing any code task in a repo that has .claude/nanoflow.json or the nanoflow CLI.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- rafaelob/pragmatic-agent-skillstheir own version, first seen Nov 1, 2026
- martinappberg/chimaeratheir own version, first seen Sep 28, 2026
- YoniChechik/claude-code-configtheir own version, first seen Sep 18, 2026
- ArcanEdge-AI/coding-agent-playbook-codextheir own version, first seen Aug 17, 2026
- ArcanEdge-AI/coding-agent-playbook-claude-codetheir own version, first seen Jul 8, 2026
- psw7205/skillstheir own version, first seen May 26, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- rafaelob/pragmatic-agent-skills★ 24same name
- martinappberg/chimaera★ 7same name
- ArcanEdge-AI/coding-agent-playbook-codex★ 3same name
- psw7205/skills★ 1same name
- ArcanEdge-AI/coding-agent-playbook-claude-code★ 0same name
- YoniChechik/claude-code-config★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- fix-bugSkill
- pr-screenshotsSkill
- wrap-up-summarySkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Every task gets its own ticket, git worktree, branch and PR.
- Distinctive: line 25
Never edit in the main checkout, and never commit to the main branch.
- Very specific: line 37
Commit with Conventional Commits (feat(scope): subject).
- Distinctive: line 64
Never on a general "done", never for a worktree with an open PR or unpushed work.
- Distinctive: line 66
After a yes, from the main checkout:
- Distinctive: line 78
delete the screenshots and recordings you saved locally (only your own files).
- Very specific: line 84
If a ritual has no command, run the raw git/gh once, then suggest adding a command.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Worktree lifecycle
Every task gets its own ticket, git worktree, branch and PR. The main checkout stays on the main branch,
so several tasks (and several agent sessions) can run side by side, each on its own ports, sharing one
database and one set of secrets. nanoflow (alias nf) does each step as one command, so you never
hand-roll a gh/git sequence.
1. Kick off: before reading or editing code
nf task start <issue#> # claim an existing issue
nf task start --new "<plain title>" # or create it first (--type bug, --definition "…")
nf task start ED-712 --type fix # tickets in Jira (ticket.tracker: "jira"; once: install acli, nf jira login)One command: issue → board In progress → worktree ../<repo>-<ticket>-<slug> on branch
feat/<ticket>-<slug>, on the next free port slot → session + terminal title #<ticket> · <branch> · <short>
→ an opening comment on the issue. Then cd into the printed worktree and do all the work there.
Never edit in the main checkout, and never commit to the main branch.
2. Work
| Need | Command |
| This worktree's ports and URLs | nf env |
| Start the app on those ports, wait until it answers | nf up --bg |
| Is it up? Its logs? Stop it | nf status, nf logs <service> --grep error, nf kill |
| Run the repo's checks (one line each; only failures print) | nf check / nf check typecheck test |
| Every worktree, its ticket, PR and CI, at a glance | nf flow |
Commit with Conventional Commits (feat(scope): subject). Commit to the task branch only.
3. Open the PR
nf check
nf pr create --body-file pr.md [--shots before.png after.png]It pushes, opens the PR with a valid title (type(scope): subject (#N)) and Closes #N, attaches the
screenshots, sets the board to In review and adds · PR #n to the title. Then:
nf ci --watch --failed-log # wait for CI without a poll loop; read only the failing steps
nf pr comments # unresolved review threads; reply with --reply <id> --body "…"4. Merged
nf task done # board → Done, title gets ✓5. Teardown: always ask first
A merged (or abandoned) worktree costs disk, holds a port slot, and piles up. Teardown deletes things, so
ask the user every time: "PR #N is merged. Tear down <worktree> (deletes the dir + local branch)?"
Never on a general "done", never for a worktree with an open PR or unpushed work.
After a yes, from the main checkout:
nf wt remove <name> --delete-branch # one worktree; stops its processes first
nf wt clean --yes # every worktree whose PR is merged/closedremove refuses uncommitted or unpushed work unless --force (line-ending-only changes, like npm rewriting a
bin shim, don't count). It returns in about a second: the worktree is renamed into ../.<repo>-trash and
deleted in the background. Then do what the CLI can't:
- close any browser you opened for verification (Playwright MCP:
browser_close); - delete the screenshots and recordings you saved locally (only your own files).
Ground rules
--dryfirst for anything that writes;--yesonly after the user approved.--jsonwhen you need to parse a result.- If a ritual has no command, run the raw
git/ghonce, then suggest adding a command.
<sub>Part of nanoflow by nanosite.ai.</sub>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

