用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill graphite命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | graphite |
| description | | Use when this capability is needed. |
IMPORTANT: This workflow applies ONLY to repositories with .git/.graphite_repo_config. For repositories without this file, use standard git commands (git commit, git push, etc.).
Check for .git/.graphite_repo_config to determine if a repo uses Graphite:
gt commands (this skill applies)git commands (this skill does NOT apply)When Graphite is detected, use gt commands instead of git for all commit and branch operations.
A Graphite MCP server may be available (check with /mcp). If the graphite MCP is connected, it provides tools to work with stacked PRs.
Before writing any code, present the stack structure and ask for confirmation.
When building a feature as a stack:
gt createPR Stack for [Feature]:
1. PR 1: [description] - [what it does]
2. PR 2: [description] - [what it does]
3. PR 3: [description] - [what it does]
IMPORTANT: Each PR must be atomic and pass CI independently. Verify this before committing.
Use these gt commands instead of their git equivalents:
| Instead of | Use | Purpose |
|---|---|---|
git commit | gt create -am "msg" | Create new branch/PR with changes |
git commit --amend | gt modify -a | Amend current PR |
git push | gt submit --no-interactive | Submit current + all downstack branches |
git pull | gt sync | Pull trunk, restack, clean merged |
git checkout | gt checkout <branch> | Switch branches |
git rebase | gt restack | Rebase stack (usually via gt sync) |
Use gt create -am "message" when:
Use gt modify -a when:
Use conventional commits with casual, concise descriptions:
feat:, fix:, chore:, docs:, refactor:, perf:, test:Write PR bodies that explain:
Keep descriptions casual, concise, and human-like. Avoid corporate speak or overly formal language. Don't wrap long lines with line breaks (unlike git commits). Line breaks are fine for separating paragraphs.
When returning the PR URL to the user, use the Graphite PR URL (e.g., https://app.graphite.dev/github/pr/...), not the GitHub PR URL.
Each PR in a stack must be:
Break large features into functional components:
Or use iterative stacking:
Move through the stack:
gt log # View full stack with PR status
gt ls # Abbreviated stack view
gt up # Move up one branch (toward tip)
gt down # Move down one branch (toward trunk)
gt top # Jump to top of stack
gt bottom # Jump to bottom of stack
gt checkout X # Switch to specific branch
Run gt sync regularly (at least daily) to:
When gt sync encounters conflicts, it pauses for resolution. See conflict resolution below.
Push changes with:
gt submit --no-interactive # Submit current + all downstack branches (recommended)
gt submit --stack # Submit current + all descendant branches
gt ss # Shorthand for --stack
Use --no-interactive to avoid prompts during submission.
When gt sync or gt restack hits conflicts:
gt log and review the changesAfter resolving:
gt continue -a # Stage all and continue restack
If stuck:
gt abort # Abandon restack, return to previous state
For detailed conflict resolution patterns, see references/conflict-resolution.md.
Adjust stack structure when needed:
gt move --onto <branch> # Move current branch to new parent
gt fold # Merge branch into its parent
gt split # Break branch into multiple
gt squash # Combine commits in branch to one
gt reorder # Interactively reorder branches
Work with others' stacks:
gt get <branch> # Fetch someone's stack locally
gt track <branch> # Start tracking existing git branch
See references/cheatsheet.md for a complete command reference.
gt sync # Get latest
gt create -am "feat: Add avatar upload API"
# ... verify it passes CI ...
gt create -am "feat: Add avatar display component"
# ... verify it passes CI ...
gt create -am "feat: Add avatar to user profile"
gt submit --no-interactive # Submit entire stack
gt checkout <branch-with-feedback>
# ... make fixes ...
gt modify -a # Amend changes
gt submit --no-interactive # Push updates (auto-restacks dependents)
gt sync # Pull, restack, clean
# Resolve any conflicts if prompted
gt continue -a # After resolving
Converted and distributed by TomeVault — claim your Tome and manage your conversions.