📦 deps(thirdparty): update snapshots
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# Graphite Plugin
|
||||
|
||||
Graphite stack workflows for trunk-based development with stacked PRs.
|
||||
|
||||
## Skills
|
||||
|
||||
### stacks
|
||||
|
||||
Complete Graphite workflow for managing stacked PRs. Use when creating branch stacks, navigating dependencies, submitting for review, or syncing with trunk.
|
||||
|
||||
**Triggers**: graphite, gt commands, stacked PRs, trunk-based development, gt create, gt submit
|
||||
|
||||
**Covers**:
|
||||
- Branch creation with `gt create`
|
||||
- Stack navigation (`gt up`, `gt down`, `gt top`, `gt bottom`)
|
||||
- Modifying branches with `gt modify` and `gt absorb`
|
||||
- Stack visualization (`gt status`, `gt log`, `gt ls`)
|
||||
- Submitting PRs with `gt submit`
|
||||
- Syncing and maintenance (`gt sync`, `gt restack`)
|
||||
- Recovery patterns (`gt undo`, `gt repo fix`)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
/plugin install gt@outfitter
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
- Graphite CLI (`gt`) installed and authenticated
|
||||
- Repository initialized with Graphite (`gt init`)
|
||||
@@ -0,0 +1 @@
|
||||
{"name": "gt", "version": "1.1.0", "private": true}
|
||||
@@ -0,0 +1,192 @@
|
||||
---
|
||||
name: graphite-stacks
|
||||
description: This skill should be used when the user asks to "create a stack", "submit stacked PRs", "gt submit", "gt create", "reorganize branches", "fix stack corruption", or mentions Graphite, stacked PRs, gt commands, or trunk-based development workflows.
|
||||
metadata:
|
||||
version: "1.0.0"
|
||||
author: outfitter
|
||||
category: version-control
|
||||
---
|
||||
|
||||
# Graphite Stacks
|
||||
|
||||
Trunk-based development with stacked PRs using Graphite CLI.
|
||||
|
||||
<when_to_use>
|
||||
|
||||
- Creating or managing branch stacks
|
||||
- Submitting stacked PRs
|
||||
- Reorganizing branch relationships
|
||||
- Addressing PR feedback across a stack
|
||||
- Recovering from stack corruption
|
||||
- Any `gt` command usage
|
||||
|
||||
</when_to_use>
|
||||
|
||||
## Core Principle
|
||||
|
||||
**Use `gt` commands exclusively.** Mixing `git` and `gt` causes sync issues and divergent stacks. The only exception: `git add` for staging (or use `-a` flags).
|
||||
|
||||
## This, Not That
|
||||
|
||||
| Task | This | Not That |
|
||||
| ---- | ---- | -------- |
|
||||
| Create branch | `gt create 'name' -am "msg"` | `git checkout -b name` |
|
||||
| Commit changes | `gt modify -acm "msg"` | `git commit -m "msg"` |
|
||||
| Push to remote | `gt submit` | `git push` |
|
||||
| Rebase stack | `gt restack` | `git rebase` |
|
||||
| View stack | `gt status` or `gt ls` | `git log --graph` |
|
||||
| Switch branches | `gt checkout` | `git checkout` |
|
||||
| Amend commit | `gt modify -a` | `git commit --amend` |
|
||||
| Multi-PR feedback | `gt top && gt absorb -a` | Cherry-pick commits manually |
|
||||
|
||||
## Stack Lifecycle
|
||||
|
||||
```
|
||||
Create stack → Implement features → Submit PRs → Address feedback → Merge
|
||||
│ │ │ │ │
|
||||
▼ ▼ ▼ ▼ ▼
|
||||
gt create gt modify -acm gt submit gt absorb gt sync
|
||||
```
|
||||
|
||||
## Creating Stacks
|
||||
|
||||
```bash
|
||||
# New branch with staged changes
|
||||
gt create 'feature/step-1' -am "feat: first step"
|
||||
|
||||
# Continue stacking
|
||||
gt create 'feature/step-2' -am "feat: second step"
|
||||
gt create 'feature/step-3' -am "feat: third step"
|
||||
|
||||
# Insert branch between current and child
|
||||
gt create 'feature/step-1.5' --insert -am "feat: inserted step"
|
||||
```
|
||||
|
||||
## Navigation
|
||||
|
||||
| Command | Action |
|
||||
| ------- | ------ |
|
||||
| `gt up` | Move up the stack (toward children) |
|
||||
| `gt down` | Move down the stack (toward parent) |
|
||||
| `gt top` | Jump to stack top |
|
||||
| `gt bottom` | Jump to stack bottom |
|
||||
| `gt checkout` | Interactive branch picker |
|
||||
|
||||
## Modifying Branches
|
||||
|
||||
```bash
|
||||
# Amend current branch (stages all)
|
||||
gt modify -a
|
||||
|
||||
# New commit within same branch
|
||||
gt modify -acm "fix: address review feedback"
|
||||
|
||||
# Commit to a different branch in the stack
|
||||
git add path/to/file.ts
|
||||
gt modify --into target-branch -m "feat: add file"
|
||||
```
|
||||
|
||||
<rules>
|
||||
|
||||
**ALWAYS:**
|
||||
- Use `gt create` for new branches
|
||||
- Use `gt modify` for commits
|
||||
- Use `gt submit` to push
|
||||
- Use `gt restack` after parent changes
|
||||
- Check `gt status` when uncertain
|
||||
|
||||
**NEVER:**
|
||||
- Mix `git commit/push/rebase` with `gt` workflows
|
||||
- Force push without understanding stack state
|
||||
- Use `git rebase -i` (breaks Graphite metadata)
|
||||
|
||||
</rules>
|
||||
|
||||
## Addressing Review Feedback
|
||||
|
||||
**Single PR**: Navigate to branch, modify directly
|
||||
|
||||
```bash
|
||||
gt checkout target-branch
|
||||
gt modify -acm "fix: address review comment"
|
||||
gt submit
|
||||
```
|
||||
|
||||
**Multiple PRs in stack**: Use absorb from top
|
||||
|
||||
```bash
|
||||
gt top
|
||||
git add .
|
||||
gt absorb -a
|
||||
gt submit --stack
|
||||
```
|
||||
|
||||
Graphite routes changes to correct branches based on file history.
|
||||
|
||||
## Reorganizing Stacks
|
||||
|
||||
```bash
|
||||
# Move branch to different parent
|
||||
gt move --onto new-parent
|
||||
|
||||
# Move specific branch
|
||||
gt move --source branch-name --onto target
|
||||
|
||||
# After reorganization
|
||||
gt restack
|
||||
```
|
||||
|
||||
## Submitting
|
||||
|
||||
```bash
|
||||
# Current branch + downstack
|
||||
gt submit
|
||||
|
||||
# Entire stack
|
||||
gt submit --stack
|
||||
|
||||
# Non-interactive (automation)
|
||||
gt submit --no-interactive
|
||||
```
|
||||
|
||||
## Stack Visualization
|
||||
|
||||
```bash
|
||||
# JSON with parent relationships (preferred for scripts)
|
||||
gt status
|
||||
|
||||
# Visual tree
|
||||
gt ls
|
||||
|
||||
# Recent history
|
||||
gt log
|
||||
```
|
||||
|
||||
## Sync and Maintenance
|
||||
|
||||
```bash
|
||||
# Pull trunk, rebase stacks, clean merged
|
||||
gt sync
|
||||
|
||||
# Rebase branches onto updated parents
|
||||
gt restack
|
||||
|
||||
# Undo last gt operation
|
||||
gt undo
|
||||
```
|
||||
|
||||
## When Things Go Wrong
|
||||
|
||||
Stack corruption symptoms:
|
||||
- Branches appear as siblings instead of parent-child
|
||||
- PRs contain wrong files
|
||||
- `gt status` shows unexpected structure
|
||||
|
||||
See [recovery.md](references/recovery.md) for step-by-step recovery procedures.
|
||||
|
||||
<references>
|
||||
|
||||
- [commands.md](references/commands.md) - Quick command reference
|
||||
- [recovery.md](references/recovery.md) - Stack corruption recovery
|
||||
|
||||
</references>
|
||||
@@ -0,0 +1,84 @@
|
||||
# Graphite Command Reference
|
||||
|
||||
Quick reference organized by task.
|
||||
|
||||
## Creating Branches
|
||||
|
||||
| Command | Purpose |
|
||||
| ------- | ------- |
|
||||
| `gt create 'name'` | Create branch (explicit name) |
|
||||
| `gt create -m "msg"` | Create branch (name from message) |
|
||||
| `gt create 'name' -am "msg"` | Create + stage all + commit |
|
||||
| `gt create 'name' --insert -am "msg"` | Insert between current and child |
|
||||
|
||||
## Modifying Branches
|
||||
|
||||
| Command | Purpose |
|
||||
| ------- | ------- |
|
||||
| `gt modify` | Amend with staged changes |
|
||||
| `gt modify -a` | Stage all + amend |
|
||||
| `gt modify -acm "msg"` | Stage all + new commit (same branch) |
|
||||
| `gt modify --into branch -m "msg"` | Commit staged to different branch |
|
||||
|
||||
## Absorbing Changes
|
||||
|
||||
| Command | Purpose |
|
||||
| ------- | ------- |
|
||||
| `gt absorb` | Route staged changes to appropriate branch |
|
||||
| `gt absorb -a` | Stage all + route to appropriate branches |
|
||||
|
||||
Use from top of stack when addressing multi-PR feedback.
|
||||
|
||||
## Stack Reorganization
|
||||
|
||||
| Command | Purpose |
|
||||
| ------- | ------- |
|
||||
| `gt move --onto target` | Move current branch to new parent |
|
||||
| `gt move --source src --onto target` | Move specific branch |
|
||||
| `gt restack` | Rebase all branches onto updated parents |
|
||||
| `gt split` | Split multi-commit branch into stack |
|
||||
|
||||
## Stack Visualization
|
||||
|
||||
| Command | Purpose |
|
||||
| ------- | ------- |
|
||||
| `gt status` | JSON with parent relationships (scripting) |
|
||||
| `gt ls` | Visual tree of stack |
|
||||
| `gt log` | Stack history |
|
||||
|
||||
## Submitting
|
||||
|
||||
| Command | Purpose |
|
||||
| ------- | ------- |
|
||||
| `gt submit` | Submit current + downstack |
|
||||
| `gt submit --stack` | Submit entire stack |
|
||||
| `gt submit --no-interactive` | Non-interactive (automation) |
|
||||
|
||||
## Sync and Maintenance
|
||||
|
||||
| Command | Purpose |
|
||||
| ------- | ------- |
|
||||
| `gt sync` | Pull trunk, rebase, clean merged |
|
||||
| `gt restack` | Rebase branches onto updated parents |
|
||||
| `gt undo` | Undo last gt operation |
|
||||
|
||||
## Metadata Management
|
||||
|
||||
| Command | Purpose |
|
||||
| ------- | ------- |
|
||||
| `gt track branch` | Add branch to Graphite tracking |
|
||||
| `gt untrack branch` | Remove from Graphite tracking |
|
||||
| `gt repo fix` | Attempt automatic repair |
|
||||
|
||||
## Flags
|
||||
|
||||
Common flags across commands:
|
||||
|
||||
| Flag | Meaning |
|
||||
| ---- | ------- |
|
||||
| `-a` | Stage all changes |
|
||||
| `-m "msg"` | Commit message |
|
||||
| `-am "msg"` | Stage all + commit message |
|
||||
| `--insert` / `-i` | Insert between current and child |
|
||||
| `--no-interactive` | Skip prompts (automation) |
|
||||
| `--stack` | Apply to entire stack |
|
||||
@@ -0,0 +1,168 @@
|
||||
# Stack Recovery Procedures
|
||||
|
||||
When parallel agents or mixed git/gt operations corrupt the stack.
|
||||
|
||||
## Symptoms of Corruption
|
||||
|
||||
- Branches appear as siblings instead of parent-child
|
||||
- PRs contain files from wrong features
|
||||
- PR titles don't match branch content
|
||||
- `gt status` shows unexpected structure
|
||||
- `gt ls` shows flat tree instead of stack
|
||||
|
||||
## Recovery Workflow
|
||||
|
||||
```
|
||||
Assess → Save Work → Fix Relationships → Redistribute → Restack → Submit
|
||||
```
|
||||
|
||||
## Phase 1: Assess Damage
|
||||
|
||||
```bash
|
||||
# Save uncommitted work first
|
||||
git stash push -u -m "WIP before recovery"
|
||||
|
||||
# See Graphite's view (source of truth for parents)
|
||||
gt status
|
||||
|
||||
# Visual tree
|
||||
gt ls
|
||||
|
||||
# Compare with expected structure
|
||||
# Document which branches are wrong
|
||||
```
|
||||
|
||||
Questions to answer:
|
||||
- Which branches have wrong parents?
|
||||
- Which files ended up in wrong branches?
|
||||
- What should the correct stack structure be?
|
||||
|
||||
## Phase 2: Fix Branch Relationships
|
||||
|
||||
Move branches to correct parents:
|
||||
|
||||
```bash
|
||||
# Move branch to correct parent
|
||||
gt move --source wrong-branch --onto correct-parent
|
||||
|
||||
# Example: branch should be child of feature-a, not sibling
|
||||
gt move --source feature-b --onto feature-a
|
||||
```
|
||||
|
||||
For complex reorganization:
|
||||
|
||||
```bash
|
||||
# Move multiple branches
|
||||
gt move --source branch-1 --onto main
|
||||
gt move --source branch-2 --onto branch-1
|
||||
gt move --source branch-3 --onto branch-2
|
||||
```
|
||||
|
||||
## Phase 3: Insert Missing Branches
|
||||
|
||||
If branches need to be inserted:
|
||||
|
||||
```bash
|
||||
# Go to parent branch
|
||||
gt checkout parent-branch
|
||||
|
||||
# Insert new branch between parent and existing child
|
||||
gt create 'missing-branch' --insert -am "feat: description"
|
||||
```
|
||||
|
||||
## Phase 4: Redistribute Files
|
||||
|
||||
Move files to correct branches:
|
||||
|
||||
```bash
|
||||
# Go to top of stack
|
||||
gt top
|
||||
|
||||
# Restore stashed work
|
||||
git stash pop
|
||||
|
||||
# Stage specific files
|
||||
git add path/to/file.ts
|
||||
|
||||
# Commit to correct downstack branch
|
||||
gt modify --into target-branch -m "feat: move file to correct branch"
|
||||
|
||||
# Repeat for each misplaced file
|
||||
```
|
||||
|
||||
Alternative using absorb (when files should go to original branches):
|
||||
|
||||
```bash
|
||||
gt top
|
||||
git add .
|
||||
gt absorb -a
|
||||
```
|
||||
|
||||
## Phase 5: Restack and Verify
|
||||
|
||||
```bash
|
||||
# Rebase all branches onto updated parents
|
||||
gt restack
|
||||
|
||||
# Verify structure
|
||||
gt status
|
||||
gt ls
|
||||
|
||||
# Check each branch has correct files
|
||||
gt checkout branch-1
|
||||
ls -la
|
||||
|
||||
gt checkout branch-2
|
||||
ls -la
|
||||
```
|
||||
|
||||
## Phase 6: Submit Fixed Stack
|
||||
|
||||
```bash
|
||||
# Submit the corrected stack
|
||||
gt submit --stack
|
||||
```
|
||||
|
||||
Review PRs to ensure:
|
||||
- Correct files in each PR
|
||||
- Correct parent/child relationships
|
||||
- PR titles match content
|
||||
|
||||
## Emergency Recovery
|
||||
|
||||
When normal recovery fails:
|
||||
|
||||
```bash
|
||||
# Try automatic repair
|
||||
gt repo fix
|
||||
|
||||
# If that fails, nuclear option:
|
||||
# 1. Note current branch contents
|
||||
# 2. Create fresh branches
|
||||
# 3. Manually move files
|
||||
# 4. Rebuild stack from scratch
|
||||
```
|
||||
|
||||
## Metadata Repair
|
||||
|
||||
When Graphite's tracking diverges from Git:
|
||||
|
||||
```bash
|
||||
# Add branch created outside Graphite
|
||||
gt track branch-name
|
||||
# Prompts to select correct parent
|
||||
|
||||
# Remove branch from Graphite tracking
|
||||
gt untrack branch-name
|
||||
```
|
||||
|
||||
## Prevention
|
||||
|
||||
To avoid future corruption:
|
||||
|
||||
1. **Single orchestrator** - Only one agent performs git operations
|
||||
2. **Explicit commits** - Use `gt modify --into` for specific branches
|
||||
3. **Regular status checks** - Run `gt status` before complex operations
|
||||
4. **Atomic stacks** - Keep stacks focused (3-5 branches max)
|
||||
|
||||
See the [multi-agent-vcs](../../multi-agent-vcs/SKILL.md) skill for multi-agent coordination patterns.
|
||||
Reference in New Issue
Block a user