Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This is a **Claude Code plugins repository** containing production-ready hooks f
| **content-guards** | Pre/PostToolUse | Bash, Write, Edit | Token limits, markdown/README validation, webfetch guard, issue/PR backlog limits, public-repo leakage guard |
| **git-guards** | PreToolUse | Bash, Edit, Write, NotebookEdit | Blocks dangerous git/gh commands and file edits on main branch |
| **git-workflows** | Command/Skill | `/sync-main`, `/git-flow-next`, `/troubleshoot-rebase`, `/troubleshoot-precommit`, `/troubleshoot-worktree`, `/pre-commit-architecture` | Local git sync, branching model, and rebase/pre-commit/worktree troubleshooting |
| **github-workflows** | Command/Skill | `/ship`, `/finalize-pr`, `/refresh-repo` (incl. `--sweep` and `--prune-stale` modes), `/rebase-pr`, `/squash-merge-pr`, `/pr-sweep`, `/resolve-pr-threads`, `/gh-cli-patterns`, `/shape-issues`, `/trigger-ai-reviews` | GitHub PR/issue management workflows, cross-repo workspace sweep, stale-branch pruning, and risk-ranked open-PR sweep-to-zero |
| **github-workflows** | Command/Skill | `/ship`, `/finalize-pr`, `/refresh-repo`, `/prune-branches` (incl. `--sweep` and `--prune-stale` modes), `/rebase-pr`, `/squash-merge-pr`, `/pr-sweep`, `/resolve-pr-threads`, `/gh-cli-patterns`, `/shape-issues`, `/trigger-ai-reviews` | GitHub PR/issue management workflows, cross-repo workspace sweep, stale-branch pruning, and risk-ranked open-PR sweep-to-zero |
| **infra-orchestration** | Skill | `/orchestrate-infra`, `/sync-inventory`, `/test-e2e` | Cross-repo infrastructure orchestration for Terraform and Ansible |
| **code-standards** | Skill | `/code-quality-standards`, `/review-standards` | Code quality standards, documentation formatting, testing philosophy, and review guidelines |
| **git-standards** | Skill | `/git-workflow-standards`, `/pr-standards` | Git workflow standards, branch hygiene, PR creation guards, workaround vs fix classification, and issue linking |
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ invocation. Skill-based plugins provide slash commands:
/ship # Full automation: commit, push, PR, finalize
/finalize-pr # Drive PR to merge-ready state
/squash-merge-pr # Validate and squash merge
/refresh-repo # Sync main, check PRs, cleanup worktrees
/refresh-repo # Sync main, check PRs
/prune-branches # Delete dead branches and worktrees
/wrap-up # Session-completion verdict + forward artifact
/resolve-codeql # Fix CodeQL security alerts
/delegate-to-ai # Route tasks to available AI models
Expand Down
4 changes: 2 additions & 2 deletions ai-cli-harness-better-practices/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ flowchart TD

subgraph optional["Optional git enrichment"]
refresh["/refresh-repo\n(github-workflows)"]:::external
prune["/prune-branches\n(github-workflows)"]:::external
ghcli["/gh-cli-patterns\n(github-workflows)"]:::external
cleangone["/clean_gone\n(commit-commands)"]:::external
end

subgraph referred["Referred out, never rebuilt"]
Expand All @@ -36,7 +36,7 @@ flowchart TD
wrapup --> handoff
wrapup --> retro
wrapup -.->|"if git repo"| refresh
wrapup -.->|"if git repo"| cleangone
wrapup -.->|"if git repo"| prune

status --> handoff
status -.->|"if git repo"| ghcli
Expand Down
4 changes: 2 additions & 2 deletions ai-cli-harness-better-practices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ This plugin deliberately does not reimplement work that already exists:
| Prose quality | `elements-of-style:writing-clearly-and-concisely` |

The git-side actions the continuity skills delegate to live in their own
plugins: `github-workflows:refresh-repo`, `github-workflows:gh-cli-patterns`,
and `commit-commands:clean_gone`.
plugin: `github-workflows:refresh-repo`, `github-workflows:prune-branches`,
and `github-workflows:gh-cli-patterns`.

## Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ to `handoff` and `wrap-up`'s resume blocks, not this dashboard.
Step 0 and handles conditional repository cleanup.
- **resume** (this plugin) — cold pickup; reuses this skill's derivation.
- **replan** (this plugin) — rebuilds a plan this skill shows has drifted.
- **refresh-repo** (github-workflows) — Checks PR merge-readiness, syncs local
main, and cleans worktrees.
- **refresh-repo** (github-workflows) — Checks PR merge-readiness and syncs local main.
- **prune-branches** (github-workflows) — Deletes stale branches and worktrees.
- **retrospecting** (claude-retrospective) — Generates detailed retrospectives
based on session logs and git diffs.
34 changes: 12 additions & 22 deletions ai-cli-harness-better-practices/skills/wrap-up/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ skipped" in the summary, and run A2 and A4 as normal. Steps A2 and A4 are the
part of a wrap-up that always applies.

In a repository, run Steps A1 and A2 **in parallel** (they are independent).
Step A3 starts as soon as Step A1 completes (depends on its remote prune). Step
A4 runs after all prior steps finish. Provide a summary of actions taken.
Step A3 runs after both finish. Provide a summary of actions taken.

### A1. Refresh Repository (repository only)
### A1. Refresh and Prune Repository (repository only)

Invoke `/refresh-repo` to:
Invoke `/refresh-repo` to sync, then `/prune-branches` to delete anything
left with nothing useful:

- Check merge-readiness of any remaining open PRs
- Sync the local default branch with remote (main on trunk repos, develop on git-flow repos)
- Clean up stale worktrees (merged PRs, `[gone]` remote branches)
- Delete stale branches and worktrees — local, remote, or both
- Report repository state

### A2. Quick Retrospective
Expand All @@ -111,17 +111,7 @@ reporting a full retrospective.

**Requires**: `claude-retrospective` plugin (external). If not installed, skip this step and note it was skipped.

### A3. Clean Gone Branches (repository only)

Invoke `/clean_gone` to remove any local branches whose remote tracking branch has been deleted:

- Identify branches marked `[gone]`
- Remove associated worktrees
- Delete the local branches

**Requires**: `commit-commands` plugin (external). If not installed, skip this step and note it was skipped.

### A4. Follow-Up Session Prompt
### A3. Follow-Up Session Prompt

If `/session-status` in Step 0 surfaced follow-up work, invoke the `/handoff`
skill to emit the next-session artifact. Pass it the "Recommended Prompt for Next
Expand Down Expand Up @@ -159,7 +149,7 @@ Wrap-Up Summary

## Path B — Resume blocks (plan incomplete)

Skip Path A entirely. Skipping is intentional: `/refresh-repo` prunes stale
Skip Path A entirely. Skipping is intentional: `/prune-branches` deletes stale
worktrees, which would delete the in-flight worktree the user needs to resume
in.

Expand Down Expand Up @@ -269,15 +259,15 @@ Sequence:
Closes the gap where `gh pr close --delete-branch` removes only the remote
branch and leaves the local branch + worktree behind. Reuses the
worktree-removal command shape from `/troubleshoot-worktree` and aligns with
`/clean_gone`'s post-removal state.
`/prune-branches`'s post-removal state.

## Related Skills

- **handoff** (this plugin) — builds the two-part next-session artifact (goal
statement under 4000 chars + full prompt) used by Path A Step A4 and Path B Step B2
- **refresh-repo** (github-workflows) — PR readiness check + repo sync +
worktree cleanup (Path A Step A1 dependency); also provides `--sweep` and
`--prune-stale` modes
statement under 4000 chars + full prompt) used by Path A Step A3 and Path B Step B2
- **refresh-repo** (github-workflows) — PR readiness check + default-branch sync (Path A Step A1)
- **prune-branches** (github-workflows) — stale branch and worktree cleanup
(Path A Step A1); also provides `--sweep` and `--prune-stale` modes
- **shape-issues** (github-workflows) — Shape and create well-structured GitHub
issues for code/repo defects and features; not for incidents (Zammad, see
session-status Step 4 and pr-standards)
Expand Down
3 changes: 2 additions & 1 deletion git-standards/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ flowchart LR
subgraph consumers["Skills that load these standards"]
SM["/sync-main\n(git-workflows)"]:::external
RR["/refresh-repo\n(git-workflows)"]:::external
PB["/prune-branches\n(git-workflows)"]:::external
RP["/rebase-pr\n(git-workflows)"]:::external
SHIP["/ship\n(github-workflows)"]:::external
FPR["/finalize-pr\n(github-workflows)"]:::external
SI["/shape-issues\n(github-workflows)"]:::external
end

GWS -.->|"informs branch ops"| SM
GWS -.->|"informs cleanup"| RR
GWS -.->|"informs cleanup"| PB
GWS -.->|"informs merge"| RP
PS -.->|"informs PR creation"| SHIP
PS -.->|"informs PR finalization"| FPR
Expand Down
20 changes: 12 additions & 8 deletions git-standards/skills/git-workflow-standards/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ Create a worktree for the change; remove it when the work is done.
Every branch with commits MUST have an associated PR.
Orphaned branches must get a PR or be deleted.

**Stale worktree**: A branch with no open PR, no uncommitted changes, and either a merged PR
whose `headRefOid` matches local `HEAD`, or a deleted remote (`[gone]`) with no commits ahead
of the default branch (`git log origin/<default>..HEAD --oneline` is empty). Branches with open
PRs, local-only branches without merged PRs, local commits beyond the merged PR head, and
worktrees with uncommitted changes are NEVER stale. Use `git worktree remove` (never `--force`)
— Git natively blocks removal of dirty worktrees.
**Stale branch** (worktree-paired, bare local, or remote-only — see
`prune-branches`, github-workflows, for the full procedure): a non-default
branch, checked out nowhere, unreferenced by any open PR (`--head` or
`--base`), with no uncommitted changes (when a worktree exists), and either
a merged PR whose `headRefOid` matches the branch tip, or zero commits ahead
of the default branch. Use `git worktree remove` (never `--force`) for
worktree-paired branches — Git blocks removal of dirty worktrees — and
`git push origin --delete` for a live remote ref, only after
`prune-branches`'s pre-push ancestry re-check.

## Branch Hygiene

Expand Down Expand Up @@ -53,7 +56,7 @@ Sync workflow (replace `<default>` with the repo's actual default branch — see
`gh-cli-patterns`, github-workflows):

```bash
git fetch origin <default> && git pull origin <default> # in the <default> worktree
git pull origin <default> # in the <default> worktree
git merge origin/<default> --no-edit # in the feature worktree
```

Expand Down Expand Up @@ -89,7 +92,8 @@ contradictions, or security-sensitive code.
## Related Skills

- **sync-main** (git-workflows) — Syncs the repo's default branch and merges into current or all PR branches
- **refresh-repo** (github-workflows) — Full repo sync including PR status and worktree cleanup
- **refresh-repo** (github-workflows) — PR status and default-branch sync
- **prune-branches** (github-workflows) — Stale branch and worktree cleanup
- **gh-cli-patterns** (github-workflows) — Canonical default-branch detection (trunk vs git-flow)
- **pr-standards** (git-standards) — PR creation guards, issue linking, and review standards
- **git-flow-next** (git-workflows) — Dedicated git-flow-next guide, worktree setup, and promotion steps
3 changes: 2 additions & 1 deletion git-workflows/skills/sync-main/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ Read files, understand both versions, combine intelligently, stage resolved file

## Related Skills

- **refresh-repo** (github-workflows) — Full repo sync including PR status and worktree cleanup
- **refresh-repo** (github-workflows) — PR status and default-branch sync
- **prune-branches** (github-workflows) — Stale branch and worktree cleanup
- **rebase-pr** (github-workflows) — Rebase-merge workflow that builds on a synced base branch
- **promote-release** (github-workflows) — Moves develop to main on git-flow repos; the fast-forward step here only reads main, never pushes it
- **gh-cli-patterns** (github-workflows) — Canonical default-branch detection (trunk vs git-flow)
Expand Down
3 changes: 2 additions & 1 deletion git-workflows/skills/troubleshoot-worktree/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ echo "<folder>/" >> .gitignore

- **troubleshoot-rebase** (git-workflows) — Diagnose and recover from git rebase failures
- **troubleshoot-precommit** (git-workflows) — Troubleshoot pre-commit hook failures
- **refresh-repo** (github-workflows) — Full repo sync including worktree cleanup
- **refresh-repo** (github-workflows) — Default-branch sync
- **prune-branches** (github-workflows) — Worktree and branch cleanup
1 change: 1 addition & 0 deletions github-workflows/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"./skills/rebase-pr",
"./skills/promote-release",
"./skills/refresh-repo",
"./skills/prune-branches",
"./skills/gh-cli-patterns",
"./skills/shape-issues",
"./skills/resolve-pr-threads",
Expand Down
10 changes: 6 additions & 4 deletions github-workflows/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ graph LR

## 1. Skill Dependency Map

All skills and their cross-plugin dependencies. `/refresh-repo`, `/rebase-pr`,
`/squash-merge-pr`, `/promote-release`, and `/gh-cli-patterns` are local to this
plugin (no cross-plugin hop) — `/squash-merge-pr`, `/rebase-pr`, and
All skills and their cross-plugin dependencies. `/refresh-repo`,
`/prune-branches`, `/rebase-pr`, `/squash-merge-pr`, `/promote-release`, and
`/gh-cli-patterns` are local to this plugin (no cross-plugin hop) —
`/squash-merge-pr`, `/rebase-pr`, and
`/promote-release` all consume the canonical PR-readiness gate and the
default-branch detection from `/gh-cli-patterns` directly. On a git-flow repo,
`/squash-merge-pr` and `/rebase-pr` both refuse a `main`-targeting PR and point
Expand All @@ -41,6 +42,7 @@ flowchart TD
RBP["/rebase-pr"]:::ai
PRR["/promote-release"]:::ai
RFR["/refresh-repo"]:::ai
PBR["/prune-branches"]:::ai
GCP["/gh-cli-patterns"]:::ai
TAR["/trigger-ai-reviews"]:::ai
SI["/shape-issues"]:::ai
Expand Down Expand Up @@ -152,7 +154,7 @@ flowchart TD
direction TB
W1["/refresh-repo\n(this plugin)"]:::ai
W2["/retrospecting quick\n(claude-retrospective, external)"]:::external
W3["/clean_gone\n(commit-commands, external)"]:::external
W3["/prune-branches\n(this plugin)"]:::ai
W4["Summary report"]:::ai

W1 --> W3 --> W4
Expand Down
6 changes: 4 additions & 2 deletions github-workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ See [ARCHITECTURE.md](ARCHITECTURE.md) for integration diagrams and the master s

- **`/ship`** - Full automation: commit, push, create PR(s), and auto-finalize in one command.
- **`/finalize-pr`** - Finalize PRs for merge: single PR, all repo PRs (`all`), or all org PRs (`org`). Includes bot-authored PRs in all modes.
- **`/refresh-repo`** - Check PR merge-readiness, sync local repo, and cleanup stale worktrees
- **`/refresh-repo`** - Check PR merge-readiness and sync the local repo with its default branch
- **`/prune-branches`** - Delete branches and worktrees with nothing useful, local and remote; optional multi-repo sweep
- **`/rebase-pr`** - Merge a PR using local git rebase + signed commits + a direct push to its base branch (main on trunk repos, develop on git-flow repos)
- **`/squash-merge-pr`** - Validate PR readiness and squash merge into its base branch (errors if not ready); refuses on git-flow repos when the base is main
- **`/promote-release`** - Merge-commit a develop → main promotion PR on a git-flow repo; release-please takes over from there
Expand All @@ -32,7 +33,8 @@ claude plugins add jacobpevans-cc-plugins/github-workflows
/finalize-pr 42 # Finalize specific PR by number
/finalize-pr all # Finalize all open PRs in repo (including bots)
/finalize-pr org # Finalize all open PRs across org (including bots)
/refresh-repo # PR check, sync, worktree cleanup
/refresh-repo # PR check, default-branch sync
/prune-branches # Delete dead branches and worktrees
/rebase-pr # Rebase-merge current branch
/rebase-pr 42 # Rebase-merge specific PR by number
/squash-merge-pr # Validate and squash merge
Expand Down
6 changes: 3 additions & 3 deletions github-workflows/skills/pr-sweep/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ description: "Drive open PRs toward zero across one or many repos by risk-rankin

Take a pile of open PRs and drive it to zero: merge what is safe, surface what is
not with a specific reason. This is triage-and-clear, distinct from
`/refresh-repo --sweep` (which syncs repos and cleans worktrees). This skill acts
on **open PRs**; that one acts on **repo/worktree state**.
`/prune-branches --sweep` (which deletes dead branches and worktrees). This
skill acts on **open PRs**; that one acts on **repo/worktree state**.

It does not reimplement merging. It **risk-ranks**, then hands each merge to
`/squash-merge-pr` (which itself runs the readiness gate and calls `/finalize-pr`).
Expand Down Expand Up @@ -83,5 +83,5 @@ outcome, not a failure.

- **squash-merge-pr** (github-workflows) — performs each merge; this skill decides which.
- **finalize-pr** (github-workflows) — PR metadata/soft-block handling, via squash-merge-pr.
- **refresh-repo** (github-workflows) — the repo/worktree sweep; complementary, not this.
- **prune-branches** (github-workflows) — the repo/worktree sweep; complementary, not this.
- **promote-release** (github-workflows) — the correct path for held promotion PRs.
Loading
Loading