agentleFS
p10ns11yp10ns11y/skills/gt-flow/SKILL.md

gt-flow

Skill2 starsChanged 40 days agoMITView on GitHub

Graphite (gt) stacking decision and execution: diagnose coupling, honestly recommend when gt is overkill (plain branches / split-to-prs / sequential), and when chosen enforce commit-in-generation + two-phase handoff + backup refs so code is never lost. Use for gt/graphite/stack/submit --stack, execute-plan assembly, concurrent agents, or PR planning.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Commit where code was written

    line 79
  2. Distinctive:

    Remove WT before rewriting that branch elsewhere

    line 82
  3. Very specific:

    Keep execute-plan/…-pr-N-… style escape branches

    line 86
  4. Distinctive:

    If any cannot be satisfied → simpler path + document why.

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

gt-flow

Load rule: Formal SoT. Long recipes → references/english-procedure.md only if needed.

// Tools
Git     ≔ history + branches
gt      ≔ stack graph + restack/submit UX
Worktree ≔ physical isolation (where)

// Compatible (gt ≥1.8.4+) but not seamless: branch checked out in ≤1 WT;
// gt refuses mutate branch owned by another WT; gt undo is per-WT.

// Axioms (zero-lost-code)
A1  Commit in generation env before teardown
A2  Push branches; record authoritative SHAs
A3  Tear down WT before mutating that branch ref elsewhere
A4  gt log before stack-wide commands
A5  Two-phase handoff: agent push → human primary shell gt/gh
A6  Backup refs before risky mutation
A7  Per-slice escape branches always exist
A8  Never cp from WT to integrate

Pair: git-worktrees · split-to-prs · agent-orchestrator.


Decision procedure (always first)

1. Intent → planned slices (files each)
2. Coupling: overlap + core files → High|Med|Low
3. Context: primary authenticated shell? agent WT? gt present+auth?
4. Declare one of:
   gt_recommended | gt_overkill | hybrid_handoff
VerdictWhenNext
gt_recommendedlow coupling · clean boundaries · human in primarysingle-WT gt recipe
gt_overkillhigh core overlap · agent-only auth mismatch · tiny scope · max recoverabilityplain PR / sequential / late gt split
hybrid_handoffagent gen + human land (default ambitious agentic)per-PR branches pushed → user fetch + gt/gh

State 1-sentence rationale (coupling or context). Confirm with user before mutating stacks.

Coupling score

  • High: heavy overlap on core (shared lib, central state, AGENTS, build configs) or >40% slices share 1–3 files
  • Medium: some shared surface, clear new-module boundaries
  • Low: clean functional splits

Mode cheat sheet

SituationChoice
independent PRs or high couplingplain git or linear then gt split
stacked PRs, one thing, primary shellgt single WT (sweet spot)
parallel independent + isolationgt + multi WT + gt log discipline
agents + human submithybrid
late coupling discoverygt fold or finish linear → gt split

Zero-lost-code contract (always)

  1. Commit where code was written
  2. Push (--force-with-lease on resume)
  3. Record commit_sha
  4. Remove WT before rewriting that branch elsewhere
  5. gt log before sync/restack/submit/modify/create-on
  6. Print Phase-1 agent cmds + Phase-2 primary cmds
  7. refs/backup/… or backup/… branches pre-risk
  8. Keep execute-plan/…-pr-N-… style escape branches
  9. State/transcript survives for resume
  10. Hygiene after (git-worktrees disk-hygiene)

If any cannot be satisfied → simpler path + document why.


Command anchors

gt log | gt ls          # ownership + stack — before stack-wide ops
gt create [-am] [--onto parent]
gt submit --stack | gt ss
gt sync · gt restack    # from each WT that owns part of stack
gt modify -a · gt fold · gt split -c|-f|-h
gt undo                 # this WT only
gt track | untrack
gt up/down/top/bottom/checkout

Anti-patterns

¬Do
gt during high coupling agent thrashhybrid or overkill path
assume agent shell has gt authhandoff to primary
mutate branch checked out elsewheregt log; work from owner WT or --onto
integrate via cpcommit+merge/cherry-pick
drop per-PR branches after linearkeep escape hatches

Done when: explicit verdict + rationale; if shipping — SHAs pushed; handoff text for human shell if hybrid.

Recipes/recovery: references/english-procedure.md.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.