/mini-harness:breakdown-pr [branch] [base] [mode=plan|execute] [max_lines=1000]from mini-harness
Analyzes a large feature branch and produces a dependency-ordered stack of small, reviewable PRs. Supports planning (read-only) and execution modes with configurable max lines per PR.
Ships in mini-harness. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Analyze a large feature branch and produce a dependency-ordered stack of small, reviewable PRs. Planning is read-only by default. Creating branches, commits, or PRs requires explicit approval of the proposed plan.
Planning requires only Git and read access to the repository. Execution requires the stack tool the repository uses.
| Tool | Required For | Notes |
|---|---|---|
git | Plan and execute | Required for all phases. |
gh | GitHub metadata and PR creation | Use if installed and authenticated. Do not install without user approval. |
gh-stack, gt, ghstack, or native Git | Stack submission | Prefer the repository's existing stack workflow. |
If a tool is missing, complete the plan and report the missing tool. Do not install extensions or publish branches unless the user explicitly approves.
| Input | Required | Default | Description |
|---|---|---|---|
branch | No | current branch | Feature branch to decompose. |
base | No | repo default branch | Base branch for the original diff. |
mode | No | plan | plan prints the split only; execute may create the stack after approval. |
max_lines | No | 400 | Hard target for changed lines per PR. Prefer closer to 200 when practical. |
stack_tool | No | auto-detect | One of repo convention, gh-stack, Graphite gt, ghstack, or native Git. |
If the base branch, branch, stack tool, or inclusion of uncommitted changes is ambiguous, ask before execution. For planning, state the assumption and continue when the assumption is low-risk.
Identify the current branch with git branch --show-current if branch is
omitted.
Identify the base branch. Prefer gh repo view --json defaultBranchRef when
available; otherwise inspect origin/HEAD or ask if ambiguous.
Check working tree state with git status --short. If there are uncommitted
changes, state whether they are included in the analysis.
Capture the source diff and commit story:
git merge-base <base> <branch>
git diff --stat <base>...<branch>
git diff --numstat <base>...<branch>
git diff --name-status --find-renames <base>...<branch>
git log --reverse --oneline <base>...<branch>
Preserve the original branch name and merge base for later verification.
Classify every changed file. When a file contains multiple concerns, classify at the hunk level instead of forcing the entire file into one PR.
| Type | Use For | Examples |
|---|---|---|
schema | Data contracts and public type definitions | .proto, .msg, API types, migrations |
infra | Build, CI, packaging, dependencies, generated config | CMakeLists.txt, workflow YAML, lockfiles |
core | Algorithms, domain behavior, business logic | solvers, controllers, services |
api | Public entry points and integration surfaces | wrappers, CLI scripts, ROS nodes, routes |
test | Tests, fixtures, golden files | unit tests, integration tests, fixtures |
docs | Documentation-only changes | README, guides, diagrams |
fix | Standalone bug fixes | targeted correctness patches |
refactor | Behavior-preserving structure | renames, moves, extractions |
For each file or hunk group, record:
Create a graph where nodes are file groups or hunk groups and edges mean "must land before." Add edges for these cases:
Identify independent subgraphs. Independent subgraphs may become separate stacks instead of one long stack.
Apply these rules in order:
max_lines unless a single atomic change cannot be split safely.Use conventional-commit-style titles:
<type>(<scope>): <short description>
For stacked PR title clarity, optionally prefix titles with [n/N] when the
repository convention allows it.
Print the plan using the output format below and stop for approval before any side effects. The plan must include enough detail for a reviewer to understand the order, scope, and verification for each PR.
Proceed only when mode=execute and the user explicitly approves the exact
plan. Before making branches or commits:
git add -p or
git restore -p --source=<branch> -- <path>.git cherry-pick -n only when original commits
already match the intended PR boundaries.Do not force-push, delete branches, install tools, or create PRs unless the user has approved that specific action.
For each PR branch, run its verification command. Then verify the final stack matches the original branch:
git diff --stat <base>...<stack-top>
git diff --exit-code <original-branch> <stack-top>
git range-diff <base> <original-branch> <stack-top>
If git range-diff is unavailable or too noisy, report that and use the tree
diff plus per-PR verification as the fallback.
# PR Breakdown Plan
**Branch:** `<branch>` -> `<base>`
**Mode:** `plan` or `execute requested`
**Total diff:** <files> files, <+insertions> insertions, <-deletions> deletions
**Proposed stacks:** <count>
**Proposed PRs:** <count>
**Assumptions:** <branch/base/uncommitted-change assumptions>
## Stack Overview
| # | Title | Files/Hunks | Lines | Depends On | Complexity | Verify |
|---|---|---|---:|---|---|---|
| 1 | `<type>(<scope>): <description>` | `<paths or hunk groups>` | ~120 | None | low | `<command>` |
| 2 | `<type>(<scope>): <description>` | `<paths or hunk groups>` | ~180 | #1 | medium | `<command>` |
## PR Details
### PR 1: `<title>`
- **Purpose:** <one sentence>
- **Includes:** <files or hunks>
- **Excludes:** <nearby changes intentionally left for later PRs>
- **Depends on:** None
- **Lines changed:** ~N
- **Review focus:** <what reviewers should inspect>
- **Risk:** low / medium / high, with reason
- **Verify:** `<command>`
### PR 2: `<title>`
...
## Dependency Graph
```text
PR 1 -> PR 2 -> PR 4
PR 1 -> PR 3
```
## Independent Tracks
- Track A: <PRs and rationale>
- Track B: <PRs and rationale>
## Execution Notes
- <stack tool or native Git plan>
- <hunk-level split warnings>
- <missing tool/auth notes>
## Approval Gate
Reply with approval to execute this exact plan, or request changes to the split.
git range-diff is human-readable verification, not a machine-stable report.https://code.visualstudio.com/docs/copilot/customization/agent-skillshttps://agentskills.io/https://github.com/github/awesome-copilothttps://graphite.com/guides/best-practices-managing-pr-size, https://graphite.com/guides/how-do-stacked-diffs-workhttps://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-brancheshttps://git-scm.com/docs/git-range-diffWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub hangyu8123/mini-harness --plugin mini-harness9 skills in this plugin
/code-review-and-qualityMulti-axis, review-only code review of a diff across six axes — request achievement, correctness, readability/simplicity, architecture, security, and performance — with severity-labelled findings. TRIGGER: invoked by a mini-harness skill's review stage when the dial `code_review=local` is set. Not a planning-time skill./code-simplificationSimplify code for clarity while preserving exact behavior — reduce nesting, split long functions, remove redundancy and dead code, and fix unclear names. TRIGGER: invoked by a mini-harness skill's review stage when the dial `simplify=local` is set. Not a planning-time skill./i-have-adhdShape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress tangents, give specific time estimates, make wins visible. Invoke with /i-have-adhd; stays on until "stop adhd mode".Other plugins' skills for the same job