graphite-cli
This skill should be used to answer questions and guide workflows related to the Graphite CLI. It assists with creating, managing, submitting, and synchronizing stacked code changes (diffs).
Best use case
graphite-cli is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. This skill should be used to answer questions and guide workflows related to the Graphite CLI. It assists with creating, managing, submitting, and synchronizing stacked code changes (diffs).
This skill should be used to answer questions and guide workflows related to the Graphite CLI. It assists with creating, managing, submitting, and synchronizing stacked code changes (diffs).
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "graphite-cli" skill to help with this workflow task. Context: This skill should be used to answer questions and guide workflows related to the Graphite CLI. It assists with creating, managing, submitting, and synchronizing stacked code changes (diffs).
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/graphite-cli/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How graphite-cli Compares
| Feature / Agent | graphite-cli | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
This skill should be used to answer questions and guide workflows related to the Graphite CLI. It assists with creating, managing, submitting, and synchronizing stacked code changes (diffs).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Graphite CLI Guide This skill provides procedural knowledge for working with the Graphite command-line interface (CLI). It covers the entire lifecycle of creating and managing stacked pull requests, from initial setup to advanced stack manipulation. ## When to Use This Skill Activate this skill when a user's request involves using the `gt` command, managing stacked pull requests, or inquiring about the Graphite workflow. It is designed to handle tasks such as creating branches, submitting PRs, synchronizing with the trunk branch, and modifying the structure of a stack. ## Core Concepts - **Stack:** A series of small, incremental, and dependent branches. Each branch is a distinct PR, building on the previous one. - **Trunk:** The primary branch of the repository (usually `main` or `master`) from which all stacks originate and into which they are eventually merged. --- ## I. Initial Setup To begin using Graphite in a git repository, it must be initialized. 1. **Authenticate:** Run `gt auth` to connect the CLI to your GitHub account via an auth token. 2. **Initialize Repository:** Navigate to the repository root and run `gt init`. This command will prompt to select the trunk branch. --- ## II. Core Workflow: Creating & Submitting Changes This workflow covers the fundamental loop of creating, submitting, and updating branches. ### Step 1: Create a Branch To create a new branch and commit changes, use `gt create`. This command replaces `git add`, `git commit`, and `git checkout -b`. The new branch will be stacked on the currently checked-out branch. | Command | Alias/Flags | Description | | :--- | :--- | :--- | | `gt create` | `gt c` | Creates a new branch and commits staged changes. | | `gt create -m <MSG>` | `gt c -m` | Creates a branch with a specific commit message. | | `gt create -a` | `gt c -a` | Stages all unstaged changes before committing. | | `gt create -am <MSG>` | `gt c -am` | Combines staging all changes and adding a message. | **Example:** To create a branch from `main` with all current file changes and a commit message: 1. Checkout the trunk: `gt checkout main` 2. Make code edits. 3. Create the branch: `gt create -am "feat: Add new user model"` ### Step 2: Submit for Review To push a branch (or a stack of branches) and open pull requests on GitHub, use `gt submit`. | Command | Alias/Flags | Description | | :--- | :--- | :--- | | `gt submit` | | Pushes the current branch, creating or updating its PR. | | `gt submit --stack` | `gt ss` | Pushes all branches in the current stack, from trunk up to the current branch, creating/updating a distinct PR for each. | | `gt submit -d` | | Submits the PR as a draft. | | `gt pr` | | Opens the GitHub PR page for the current branch in a browser. | **Example:** To submit an entire 3-part stack for review: 1. Navigate to the top branch of the stack (`part-3`). 2. Run `gt submit --stack --reviewers alice,bob` ### Step 3: Modify and Update To update a branch with feedback, edit the code and use `gt modify` to amend the commit. | Command | Alias/Flags | Description | | :--- | :--- | :--- | | `gt modify` | `gt m` | Amends the commit on the current branch with staged changes. | | `gt modify -a` | `gt m -a` | Amends the commit with all staged and unstaged changes. **This is the most common update command.** | **Example:** To apply a requested change to a PR: 1. Edit the relevant files. 2. Run `gt modify -a` to amend the commit with your changes. 3. Run `gt submit` to update the remote PR. --- ## III. Stack Management & Navigation ### Visualizing the Stack To see the dependency structure of your branches, use `gt log short`. | Command | Alias | Description | | :--- | :--- | :--- | | `gt log short` | `gt ls` | Displays all tracked branches and their dependency relationships in a compact tree format. | ### Navigating the Stack Use these commands to move efficiently between branches in a stack. | Command | Alias | Function | | :--- | :--- | :--- | | `gt up` | `gt u` | Switches to the child branch (upstack). | | `gt down` | `gt d` | Switches to the parent branch (downstack). | | `gt top` | `gt t` | Switches to the highest branch (tip) of the current stack. | | `gt bottom` | `gt b` | Switches to the lowest branch of the current stack. | | `gt checkout` | `gt co` | Opens an interactive selector to choose any tracked branch. | --- ## IV. Synchronization & Conflict Resolution ### Keeping the Stack Up-to-Date To update your stack with the latest changes from the trunk, use `gt sync`. **Actions performed by `gt sync`:** 1. Fetches the latest remote state. 2. Pulls the latest changes into the trunk branch (`main`). 3. **Restacks** (rebases) all of your open branches onto the updated trunk. 4. Prompts to delete any local branches that have been merged or closed remotely. ### Resolving Conflicts If `gt sync` or `gt modify` pauses due to a merge conflict, follow these steps: 1. **Resolve Conflicts:** Open the files listed in the error message and resolve the conflicts manually. 2. **Stage Changes:** Mark the conflicts as resolved by running `git add .`. 3. **Continue:** Run `gt continue` to allow Graphite to complete the original `sync` or `modify` operation. --- ## V. Advanced Stack Manipulation These commands are used to restructure a stack. | Command | Description | | :--- | :--- | | `gt move` | Rebases the current branch and its children onto a new parent. Use this to change a branch's dependency (e.g., `gt move --onto main`). | | `gt fold` | Combines (squashes) the current branch's changes into its parent branch and deletes the current branch. | | `gt split` | Splits the current branch into two or more new branches, either by commit or by interactively selecting file hunks. | | `gt create --insert` | Creates and inserts a new branch between the current branch and its parent. | | `gt absorb` | Automatically applies unstaged changes to the most relevant downstack commits. Useful for distributing feedback fixes across multiple PRs at once. | --- ## Bundled Resources - **`references/graphite_cli_guide.md`**: The complete and unabridged guide for the Graphite CLI. Consult this file for detailed explanations of every command and workflow, including collaboration (`gt get`, `gt freeze`) and multi-trunk support.
Related Skills
azure-quotas
Check/manage Azure quotas and usage across providers. For deployment planning, capacity validation, region selection. WHEN: "check quotas", "service limits", "current usage", "request quota increase", "quota exceeded", "validate capacity", "regional availability", "provisioning limits", "vCPU limit", "how many vCPUs available in my subscription".
raindrop-io
Manage Raindrop.io bookmarks with AI assistance. Save and organize bookmarks, search your collection, manage reading lists, and organize research materials. Use when working with bookmarks, web research, reading lists, or when user mentions Raindrop.io.
zlibrary-to-notebooklm
自动从 Z-Library 下载书籍并上传到 Google NotebookLM。支持 PDF/EPUB 格式,自动转换,一键创建知识库。
discover-skills
当你发现当前可用的技能都不够合适(或用户明确要求你寻找技能)时使用。本技能会基于任务目标和约束,给出一份精简的候选技能清单,帮助你选出最适配当前任务的技能。
web-performance-seo
Fix PageSpeed Insights/Lighthouse accessibility "!" errors caused by contrast audit failures (CSS filters, OKLCH/OKLAB, low opacity, gradient text, image backgrounds). Use for accessibility-driven SEO/performance debugging and remediation.
project-to-obsidian
将代码项目转换为 Obsidian 知识库。当用户提到 obsidian、项目文档、知识库、分析项目、转换项目 时激活。 【激活后必须执行】: 1. 先完整阅读本 SKILL.md 文件 2. 理解 AI 写入规则(默认到 00_Inbox/AI/、追加式、统一 Schema) 3. 执行 STEP 0: 使用 AskUserQuestion 询问用户确认 4. 用户确认后才开始 STEP 1 项目扫描 5. 严格按 STEP 0 → 1 → 2 → 3 → 4 顺序执行 【禁止行为】: - 禁止不读 SKILL.md 就开始分析项目 - 禁止跳过 STEP 0 用户确认 - 禁止直接在 30_Resources 创建(先到 00_Inbox/AI/) - 禁止自作主张决定输出位置
obsidian-helper
Obsidian 智能笔记助手。当用户提到 obsidian、日记、笔记、知识库、capture、review 时激活。 【激活后必须执行】: 1. 先完整阅读本 SKILL.md 文件 2. 理解 AI 写入三条硬规矩(00_Inbox/AI/、追加式、白名单字段) 3. 按 STEP 0 → STEP 1 → ... 顺序执行 4. 不要跳过任何步骤,不要自作主张 【禁止行为】: - 禁止不读 SKILL.md 就开始工作 - 禁止跳过用户确认步骤 - 禁止在非 00_Inbox/AI/ 位置创建新笔记(除非用户明确指定)
internationalizing-websites
Adds multi-language support to Next.js websites with proper SEO configuration including hreflang tags, localized sitemaps, and language-specific content. Use when adding new languages, setting up i18n, optimizing for international SEO, or when user mentions localization, translation, multi-language, or specific languages like Japanese, Korean, Chinese.
google-official-seo-guide
Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation
github-release-assistant
Generate bilingual GitHub release documentation (README.md + README.zh.md) from repo metadata and user input, and guide release prep with git add/commit/push. Use when the user asks to write or polish README files, create bilingual docs, prepare a GitHub release, or mentions release assistant/README generation.
doc-sync-tool
自动同步项目中的 Agents.md、claude.md 和 gemini.md 文件,保持内容一致性。支持自动监听和手动触发。
deploying-to-production
Automate creating a GitHub repository and deploying a web project to Vercel. Use when the user asks to deploy a website/app to production, publish a project, or set up GitHub + Vercel deployment.