Get the FREE Ultimate OpenClaw Setup Guide →

triage

Scanned
npx machina-cli add skill technicalpickles/pickled-claude-plugins/triage --openclaw
Files (1)
SKILL.md
4.9 KB

Git Triage

Overview

Full inventory of your git work state with rich context for decision-making. Shows worktrees, stashes, branches, and uncommitted work with enough detail to decide what to clean up, resume, or address.

Announce: "Using git:triage to inventory your work in progress..."

When to Use

  • Starting your day - "what was I working on?"
  • User asks about git state, worktrees, stashes
  • User wants to clean up old work
  • User says "triage", "inventory", "what's in progress?"

Scope

Full inventory by default. User can scope to:

  • worktrees - just worktrees
  • stash - just stashes
  • branches - just local branches

Workflow

1. Gather State

# Worktrees
git worktree list --porcelain

# Stashes
git stash list

# Local branches with tracking info
git branch -vv

# Current status
git status --porcelain

2. Enrich Each Item

For Worktrees

For each worktree, gather:

# Get branch and status
cd {worktree_path}
branch=$(git branch --show-current)
git status --porcelain

# Check for associated PR
gh pr list --head {branch} --json number,title,state,url

# Check for plan file
ls docs/plans/*{branch-keywords}* 2>/dev/null

If uncommitted changes exist:

  • List files changed, grouped by directory
  • Summarize what the changes appear to be doing (infer from diff)
  • Show unpushed commit subjects

For Stashes

# Get stash details
git stash show stash@{N} --stat

# Check if source branch still exists
git branch --list {branch_from_stash_message}

For Branches

# Check if merged to main
git branch --merged main | grep {branch}

# Get associated PR
gh pr list --head {branch} --state all --json number,state,url

# Last commit age
git log -1 --format="%cr" {branch}

3. Present Inventory

Format with full context:

## Git Triage

### Worktrees

#### `.worktrees/feature-oauth` (feature/oauth)
- **PR:** https://github.com/owner/repo/pull/1234 (open, 2 approvals)
- **Plan:** `docs/plans/2025-01-15-oauth-design.md`
- **Uncommitted:** 3 files in `src/auth/`
  - Adding Google OAuth provider configuration
  - `oauth.ts`, `config.ts`, `types.ts` modified
- **Unpushed:** 1 commit - "Add OAuth config scaffolding"
- **Recommendation:** Resume - PR is approved, needs final push

#### `.worktrees/pr-999-fix-typo`
- **PR:** https://github.com/owner/repo/pull/999 (merged)
- **Clean:** No uncommitted changes
- **Recommendation:** Safe to delete - PR merged

---

### Stashes

#### `stash@{0}` - "WIP on feature/auth: debugging session"
- **Age:** 3 weeks
- **Source branch:** feature/auth (exists)
- **Files:** 5 files in `src/auth/`
- **Recommendation:** Review - branch exists, may be superseded

#### `stash@{1}` - "WIP on old-feature: abandoned work"
- **Age:** 2 months
- **Source branch:** old-feature (deleted)
- **Recommendation:** Likely safe to drop - source branch gone

---

### Branches

#### `feature/old-experiment`
- **Last commit:** 6 weeks ago
- **PR:** https://github.com/owner/repo/pull/800 (closed, not merged)
- **Tracking:** origin/feature/old-experiment (gone)
- **Recommendation:** Safe to delete - PR closed, remote deleted

---

## Summary

- **2 worktrees** (1 active, 1 safe to delete)
- **2 stashes** (1 to review, 1 likely droppable)
- **1 branch** safe to delete

Ready to clean up?

4. Offer Actions

Use AskUserQuestion for cleanup decisions:

What would you like to do?
(A) Delete merged worktree `.worktrees/pr-999-fix-typo`
(B) Review stash@{0} contents
(C) Delete stale branch `feature/old-experiment`
(D) Clean up all safe-to-delete items
(E) Nothing right now

Never auto-delete - always require user confirmation.

For option (D), list exactly what will be deleted and confirm:

This will delete:
- Worktree: .worktrees/pr-999-fix-typo
- Branch: feature/old-experiment
- Stash: stash@{1}

Proceed?
(A) Yes, delete all
(B) Let me pick individually
(C) Cancel

Quick Reference

ItemKey InfoCommands
WorktreeBranch, PR, plan, uncommittedgit worktree list, gh pr list --head
StashAge, source branch, filesgit stash list, git stash show
BranchMerged?, PR, tracking, agegit branch -vv, gh pr list --head

Output Guidelines

  • Full PR URLs - always clickable/copy-pasteable
  • Summarize uncommitted work - infer purpose from diff, not just file count
  • Include plan references - link to docs/plans/ if relevant
  • Actionable recommendations - explain why something is safe/needs attention
  • Never auto-delete - always confirm destructive actions

Related

  • git:checkout - Resume work on a worktree
  • git:inbox - PRs awaiting your review (inbound work)
  • superpowers:finishing-a-development-branch - Clean up after completing work

Source

git clone https://github.com/technicalpickles/pickled-claude-plugins/blob/main/plugins/git/skills/triage/SKILL.mdView on GitHub

Overview

Git Triage provides a full inventory of your git work state with rich context. It lists worktrees, stashes, branches, and uncommitted changes to help you decide what to clean up, resume, or address.

How This Skill Works

Triage gathers state from worktrees, stashes, and local branches, along with the current status. It enriches each item with PR status and plan references, then presents a formatted inventory with actionable recommendations.

When to Use It

  • Starting your day to recall what you're working on
  • Answering a user who asks about git state, worktrees, or stashes
  • Cleaning up old or unused work
  • When you say 'triage', 'inventory', or 'what's in progress?'
  • Before cleanup or merging to decide what to keep or delete

Quick Start

  1. Step 1: Gather state with git worktree list --porcelain, git stash list, git branch -vv, and git status --porcelain
  2. Step 2: Enrich each item by checking PR status (gh pr list) and related plan files
  3. Step 3: Present the inventory and review recommended cleanup or resume actions

Best Practices

  • Run a full inventory by default to get complete context
  • Scope results to specific areas (worktrees, stashes, branches) when needed
  • Enrich items with PR status and related plan files for better decisions
  • Check uncommitted changes and unpushed commits before acting
  • Always confirm actions with the user; no automatic deletions

Example Use Cases

  • A feature OAuth worktree shows an open PR, a plan file, and uncommitted changes; triage suggests resuming and pushing the final changes
  • stash@{0} references a WIP on a non-existent source branch; triage recommends dropping the stash
  • branch feature/old-experiment is merged to main but still tracked remotely; triage flags it for possible deletion
  • two worktrees in progress with different task scopes; triage helps choose which to resume first
  • stashes contain quick fixes in src/auth but the corresponding branch has been deleted; triage marks as droppable

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers