git-ops
Full git + worktree orchestrator. Rich status survey, per-worktree triage (prunable/WIP/ghost/orphan), commits, PRs, branches, releases, rebases — reads run inline, writes dispatch to a background Sonnet agent. Triggers on: status, state, where are we, git status, anything to commit, anything to push, commit, push, pull request, create PR, git diff, rebase, stash, branch, merge, release, tag, changelog, semver, cherry-pick, bisect, worktree, worktree survey, prunable worktrees, land worktree.
What this skill does
# Git Ops
Intelligent git operations orchestrator. Routes read-only queries inline for speed, dispatches write operations to a background Sonnet agent (`git-agent`) to free the main session.
## Architecture
```
User intent (commit, PR, rebase, status, etc.)
|
+---> Tier 1: Read-only (status, log, diff, blame)
| |
| +---> Execute INLINE via Bash (fast, no subagent)
|
+---> Tier 2: Safe writes (commit, push, tag, PR, stash)
| |
| +---> Gather context from conversation
| +---> Dispatch to git-agent (background, Sonnet)
| | +---> Fallback: general-purpose with inlined protocol
| +---> Agent executes and reports back
|
+---> Tier 3: Destructive (rebase, reset, force-push, branch -D)
|
+---> Dispatch to git-agent (background, Sonnet)
| +---> Fallback: general-purpose with inlined protocol
+---> Agent produces PREFLIGHT REPORT (does NOT execute)
+---> Orchestrator relays preflight to user
+---> On confirmation: re-dispatch with execute authority
```
## Safety Tiers
### Tier 1: Read-Only - Run Inline
No subagent needed. Execute directly via Bash for instant results.
| Operation | Command |
|-----------|---------|
| **Status (rich)** | `bash $HOME/.claude/skills/git-ops/scripts/status.sh` — one-shot HEAD + sync + tree + worktrees + branches + PR |
| **Worktree survey** | `bash $HOME/.claude/skills/git-ops/scripts/worktree-survey.sh` — per-worktree state, drift detection, prunable/WIP/ghost/orphan triage |
| Status (bare) | `git status --short` |
| Log | `git log --oneline -20` |
| Diff (unstaged) | `git diff --stat` |
| Diff (staged) | `git diff --cached --stat` |
| Diff (full) | `git diff [file]` or `git diff --cached [file]` |
| Branch list | `git branch -v` |
| Remote branches | `git branch -rv` |
| Stash list | `git stash list` |
| Blame | `git blame [file]` |
| Show commit | `git show [hash] --stat` |
| Reflog | `git reflog --oneline -20` |
| Tags | `git tag --list --sort=-v:refname` |
| Worktree list | `git worktree list` |
| PR list | `gh pr list` |
| PR status | `gh pr view [N]` |
| Issue list | `gh issue list` |
| CI checks | `gh pr checks [N]` |
| Run status | `gh run list --limit 5` |
For T1 operations, format results cleanly and present directly. Use `delta` for diffs when available.
**When to reach for the bundled scripts:**
- User asks "status", "where are we", "anything to commit", "anything to push" → `status.sh`
- User asks about worktrees, prunable branches, drift, "what can we clean up" → `worktree-survey.sh`
- Both scripts exit 0 if clean, 1 if attention needed, 2 if not-a-repo — composable.
## Hygiene Checks (Proactive — Run During Every T1 Status)
When running any status check, scan for these anti-patterns and surface them **before** the status output. Don't wait for the user to notice. The `status.sh` script handles checks 1 and 2 automatically; checks 3 and 4 are Claude's responsibility.
### Anti-pattern 1: Main checkout on a feature branch 🔴
**Signal:** In the main checkout (not a worktree) and `git branch --show-current` ≠ the repo's default branch (`main`/`master`/`trunk`).
**Why it's bad:** The main checkout is the fallback workspace. Feature branches sitting there block clean status reads, confuse worktree operations, and make it unclear what "current" state is. Feature work belongs in dedicated worktrees.
**Flag it:** Emit a prominent warning before the status output.
**Fix:**
```bash
git checkout main # return main to trunk
git worktree add .claude/worktrees/<name> <feature-branch> # move work to worktree
```
**Detecting main checkout vs worktree:**
```bash
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
# ".git" → main checkout → check applies
# contains "worktrees" → inside a worktree → skip this check
```
### Anti-pattern 2: Stale merged branches 🟡
**Signal:** `git branch --merged <default>` returns branches other than the trunk.
**Why it's bad:** Merged-but-undeleted branches are noise that obscures what's actually in flight.
**Flag it:** Report the count. Suggest `git branch cleanup` to review and delete.
### Anti-pattern 3: WIP commits on a pushed branch 🟡
**Signal:** `git log --oneline @{u}..HEAD` contains subject lines matching `wip|WIP|todo|TODO|fixme|FIXME|temp|TEMP|hack|HACK`.
**Why it's bad:** WIP markers in pushed history signal unfinished work that shouldn't have left the local machine. Creates confusing history and blocks clean PRs.
**Flag it:** List the offending commits and suggest an interactive rebase to squash or rename.
### Anti-pattern 4: Large uncommitted pile 🟡
**Signal:** staged + unstaged + untracked > 20 files.
**Why it's bad:** Large uncommitted diffs are hard to review, easy to lose, and signal a broken "commit as you go" habit.
**Flag it:** Note the total and suggest committing incrementally by logical unit.
---
### Tier 2: Safe Writes - Dispatch to Agent
Gather relevant context, then dispatch to `git-agent` (background, Sonnet).
**Context gathering before dispatch:**
| Operation | Context to Gather |
|-----------|-------------------|
| **Commit** | What the user has been working on (from conversation), staged files, recent commit style |
| **Push** | Current branch, tracking info, commits ahead of remote |
| **PR create** | All commits on branch vs main, conversation context for description |
| **Tag/release** | Commits since last tag, version pattern in use |
| **Stash** | Current changes, user's stash message if provided |
| **Cherry-pick** | Target commit details, current branch |
| **Branch create** | Base branch, naming convention from recent branches |
| **gh issue create** | User description, labels if mentioned |
**Dispatch template:**
```
You are the git-agent handling a Tier 2 (safe write) operation.
## Domain Knowledge
For release or PR operations, read CI context first:
- Read: skills/ci-cd-ops/SKILL.md (release workflows, PR conventions)
## Context
- Current branch: {branch}
- Repository: {repo info}
- User intent: {what the user asked for}
- Conversation context: {relevant summary of what was being worked on}
## Operation
{specific operation details}
## Project Conventions
{commit style, branch naming, PR template if detected}
Execute the operation following your T2 protocol (verify state, execute, confirm, report).
```
### Tier 3: Destructive - Preflight Required
Dispatch to `git-agent` with explicit instruction to produce a preflight report ONLY.
**Dispatch template (preflight):**
```
You are the git-agent handling a Tier 3 (destructive) operation.
## Context
- Current branch: {branch}
- Repository: {repo info}
- User intent: {what the user asked for}
## Operation
{specific operation details}
IMPORTANT: Do NOT execute this operation. Produce a T3 Preflight Report only.
Show exactly what will happen, what the risks are, and how to recover.
```
**After user confirms:** Re-dispatch with execute authority:
```
User has confirmed the Tier 3 operation after reviewing the preflight.
## Approved Operation
{exact operation from preflight}
## Confirmation
Proceed with execution. Follow T3 execution protocol:
1. Create a safety bookmark: note the current HEAD hash
2. Execute the operation
3. Verify the result
4. Report with the safety bookmark for recovery
```
## Dispatch Mechanics
### Background Agent (Default for T2/T3)
```python
# Dispatch to git-agent, runs in background, Sonnet model
Agent(
subagent_type="git-agent",
model="sonnet",
run_in_background=True, # Frees main session
prompt="..." # From dispatch templates above
)
```
The main session continues working while the agent handles git operations. Results arrive asynchronously.
### Foreground Agent (When Result Needed Immediately)
For operations where the user is waiting on the result (e.g., "commit this thenRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.