mit einem Klick
work-stacked
// Execute a list of tasks as a stack of PRs using Graphite (`gt`). Each task becomes one branch, one commit, one PR. Use when the project uses stacked PRs via Graphite and you have multiple tasks to ship.
// Execute a list of tasks as a stack of PRs using Graphite (`gt`). Each task becomes one branch, one commit, one PR. Use when the project uses stacked PRs via Graphite and you have multiple tasks to ship.
Stacked PRs with Graphite CLI (gt)
Expert guidance on Neovim configuration, plugin management, lazy.nvim, LSP setup, and editor workflow optimization
Walk a Graphite stack bottom-to-top, fixing PR review comments on each branch
Stacked PRs with Charcoal CLI (charcoal)
Distribute uncommitted changes across a Graphite stack using a backup branch
Generate feature documentation — PRDs, RFCs, ADRs, plans, technical docs, tasks, guides, testing docs, runbooks, and changelogs — individually or as a progressive pipeline covering a feature's full lifecycle
| name | work-stacked |
| description | Execute a list of tasks as a stack of PRs using Graphite (`gt`). Each task becomes one branch, one commit, one PR. Use when the project uses stacked PRs via Graphite and you have multiple tasks to ship. |
Execute a list of tasks as stacked PRs using Graphite. Each task becomes one branch, one commit, one PR — small, focused, and independently reviewable.
gt) installed and configuredCLAUDE.md with verification steps (e.g., mix precommit)main branch with clean working treegit checkout main
gt sync
Confirm clean state — no uncommitted changes, no stale branches.
For each task in the work plan:
Make the code changes for this single task. Keep it focused — one task = one PR.
Run the project's verification command. This is project-specific — check
CLAUDE.md or the /work command for the exact steps. Common examples:
mix precommit (compile + format + test)npm run lint && npm testcargo clippy && cargo testFix any issues before proceeding. The PR must compile and pass tests independently.
gt create --all --message "type(scope): description"
Follow conventional commits:
| Prefix | Use |
|---|---|
feat(x): | New feature |
fix(x): | Bug fix |
refactor(x): | Restructure without behavior change |
test(x): | Add or update tests |
docs(x): | Documentation only |
chore(x): | Maintenance tasks |
gt submit --stack --publish --ai
The --publish flag creates non-draft PRs. Without it, PRs may be created as
drafts in non-interactive contexts (CI, agents).
--stack ensures the full stack is pushed and PR dependencies are set
correctly.
Continue to the next task. The new branch stacks on top of the previous one.
gt log short
Confirm the stack looks correct — each task is a separate branch stacked in order.
When a reviewer requests changes on a specific PR:
gt checkout branch-name
# Make fixes...
gt modify --all
gt submit --stack --publish --ai
gt modify --all amends the branch's commit and automatically restacks all
branches above it.
After PRs are merged:
gt sync
This pulls trunk, rebases remaining stacks, and deletes merged branches.
--stack --ai with gt submit to keep the full stack in sync--publish to avoid draft mode in non-interactive contextsIf a single task produces > 800 lines of changes, split it:
gt create -am "feat(scope): part 1 — description"gt create -am "feat(scope): part 2 — description"gt submit --stack --publish --aiEach chunk should compile and pass tests on its own.
When tasks are independent (don't touch the same files), run them in parallel using git worktrees. Each agent gets its own worktree with an isolated database and dev server port — no contention.
Requires the
worktreeskill. See it for full setup/teardown details.
SCRIPTS=~/.local/share/chezmoi/agents/skills/worktree/scripts
# 1. Create a worktree per independent task group
$SCRIPTS/worktree-manager.sh create task-api
$SCRIPTS/elixir-worktree-setup.sh setup .worktrees/task-api task-api
$SCRIPTS/worktree-manager.sh create task-ui
$SCRIPTS/elixir-worktree-setup.sh setup .worktrees/task-ui task-ui
Each agent works in its own worktree:
# Agent 1 — in .worktrees/task-api/
cd .worktrees/task-api
# implement API changes...
mix precommit
gt create -am "feat(api): add endpoint"
gt submit --stack --publish --ai
# Agent 2 — in .worktrees/task-ui/
cd .worktrees/task-ui
# implement UI changes...
mix precommit
gt create -am "feat(web): update landing page"
gt submit --stack --publish --ai
Each worktree produces its own independent PR stack. After PRs merge:
# Back in main worktree
gt sync
# Teardown worktrees
$SCRIPTS/elixir-worktree-setup.sh teardown .worktrees/task-api
$SCRIPTS/elixir-worktree-setup.sh teardown .worktrees/task-ui
$SCRIPTS/worktree-manager.sh cleanup
When orchestrating multiple agents (e.g., via Claude Code's Task tool):