/maruda:gh-issue-resolverfrom maruda
Implements fixes for GitHub Issues by creating a feature branch from an agreed plan comment, running tests, and opening a PR. Requires a prior plan from gh-issue-planner.
Ships in maruda. 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.
Implement and verify a fix for a GitHub Issue, starting from the agreed response plan that gh-issue-planner has already posted as a comment on the issue. This skill creates a feature branch, uses a git worktree as a temporary implementation sandbox, runs tests, opens a Pull Request, and verifies the fix against the original issue.
gh-issue-planner, identified by the HTML marker <!-- gh-issue-planner:agreed-plan --> near the end of the comment body.gh-issue-planner first. Do not improvise an unagreed plan in this skill.Run the following command (replace <id> with the issue number):
gh issue view <id> --json number,title,body,labels,state,url,comments
From the comments array:
<!-- gh-issue-planner:agreed-plan -->.gh-issue-planner first.gh-issue-planner so how far to build is agreed first. The plan is written
in the user's language, so look for the section by meaning (e.g. "How far to build"), not
by the Japanese heading string.Resolve <base-ref> first — everything downstream (the branch, the PR's base, and the
verification baseline in Step 8) is measured against it:
| Flow | <base-ref> |
|---|---|
| individual (default) | the integration branch recorded in CLAUDE.md, falling back to the default branch |
| stack | the branch of the Issue this one depends on |
| batch | the epic branch, passed in by gh-batch-runner |
# 1. Create a branch from <base-ref> (without switching the main working tree)
git branch <branch-name> <base-ref>
# Examples: fix/42-add-timeout-to-fetch feat/15-user-export-api
# 2. Create an isolated worktree from that branch
git worktree add ../<branch-name> <branch-name>
Branch naming convention:
fix/<id>-<short-description>feat/<id>-<short-description>refactor/<id>-<short-description>All implementation work (Steps 3–4.5) is performed inside the worktree directory ../<branch-name>. The main working tree stays on its current branch throughout.
Before writing any code, check the agreed どこまで作るか against what you now see in the
worktree. If an earlier item of the check before building turns out to be enough (the codebase already has it, the
standard library covers it, one line does it), write no code and return to
gh-issue-planner with what you found — どこまで作るか is part of the agreement, so building
less is a plan change, not an implementation shortcut.
Apply the changes defined in the agreed plan inside the worktree directory. Follow these rules:
gh-issue-planner rather than silently expanding the scope here# Run tests relevant to the changed area (inside the worktree directory)
# Ensure no regressions in existing tests
# Verify new tests pass
If tests fail, diagnose and fix before proceeding. Do not skip failing tests.
If the change is data-related (see the trigger list in Step 8.1), also run
data-validation here — inside the worktree, while the main working tree still holds the
base branch and attribution is cheapest:
/maruda:data-validation <changed-data-scope> # baseline: <base-ref>
Treat a regression-class FAIL exactly like a failing test: fix it now, do not proceed with
it outstanding. Step 8 re-runs the check as the final gate.
Tests say the change did not break what is measured. They do not say it is the change that was agreed, and nobody has read it yet. Before the worktree is torn down, have it reviewed against the plan.
Commit first, and run the review inside the worktree. The reviewer reads
git diff <base-ref>...HEAD; work that is not committed on the branch, or a review run
from the main working tree (still on its own branch), reviews nothing:
# inside ../<branch-name> — stage the files this change touched, not everything that
# happens to be in the directory (build output, local env files)
git add <changed files>
git diff --cached --quiet || git commit -m "<type>(#<id>): <short description>"
/maruda:gh-pr-reviewer Issue #<id>, base <base-ref> # run from ../<branch-name>
Its fixed header carries, among its lines, the ones this step acts on:
<!-- gh-pr-reviewer:result -->
RESULT: PASS | FAIL
SUMMARY: important <n> / nit <n> / pre-existing <n>
READ: independent | not independent
HUMAN-REVIEW: none | <category>: <file> — <reason>[; <category>: <file> — <reason>]
An "empty diff" finding means the review saw nothing — fix the invocation (commit, base ref, directory) and run it again once; that retry is not an iteration of the budget. If the diff is still empty, stop and report it rather than retrying.
Act on each class — the classes map onto Step 8.3, and no new rule is needed:
| Review class | Treated as | Action |
|---|---|---|
| Important | regression — this change caused it | Fix it now, under rules 1–2 of 8.4 (inside the 影響範囲, minimal, never by weakening a check), then re-run the tests and the review. The 8.2 diagnosis is not run here — it runs after the PR |
| Pre-existing | pre-existing | Do not fix. Collect for 8.6 |
| Nit | — | Do not stop, do not fix on the review's account. Record the count in the PR body |
Each round of fixes is one iteration of the same budget as 8.4 — three in total across
Step 4.5 and Step 8, not three each. A round counts once however many checks it re-runs:
an 8.4 round that re-runs both the review and the diagnosis is one iteration, not two. An Important finding
the review marks unchanged since the previous run means the fix did not work: go to 8.7
rather than trying the same thing again. Commit each fix before re-running the review.
A Scope finding is fixed by taking the out-of-scope change back out — restoring that
file to what it was when the branch was cut (git checkout $(git merge-base <base-ref> HEAD) -- <file>, the same commit the review compares against; git rm <file> when the branch
added it) is always allowed, and is not "leaving the 影響範囲". If the agreed
work cannot be done without that file, the plan is wrong: go to 8.7. Any other fix that
would leave the agreed 影響範囲 goes to 8.7 immediately.
Stopping here happens before a PR exists: keep the branch and its commits locally, do not push, open no PR, and report as in 8.7.
In a batch (gh-batch-runner, where <base-ref> is the epic branch and the work is
committed on that same branch) git diff <base-ref>...HEAD is empty by construction. This
step is not part of the batch's per-Issue pass: gh-batch-runner reviews the whole epic
branch once, against every member's plan, before it opens the PR (its Step 5).
HUMAN-REVIEW is not a failure and never blocks. Carry it to the PR body (Step 7) so the
person who merges knows where to look. Carry READ: not independent there too — a review
that was not read by a fresh context is weaker, and the reader of the PR should know.
After tests pass, remove the worktree and switch the main working tree to the feature branch:
# Remove the worktree — the branch and its commits are preserved
git worktree remove ../<branch-name>
# Switch the main working tree to the feature branch
git checkout <branch-name>
The main working tree now reflects the implemented changes.
Run the application in the normal development environment and verify the fix on screen. Confirm the fix addresses the acceptance criteria in the original issue.
Push the branch first. A PR can only show commits that exist on the remote, and
gh pr create does not reliably push for you when it runs without a terminal:
git push -u origin <branch-name>
Never force-push, and never push to <base-ref> itself. If the push fails, stop and
report it — do not open a PR against a branch that is not there.
gh pr create --base <base-ref> --title "<type>(#<id>): <short description>" --body "$(cat <<'EOF'
## Summary
<What was changed and why — reference the issue>
Closes #<id>
## どこまで作るか
<copied verbatim from the agreed plan: 結論 / 作らないもの / 削らないもの>
## Changes
- <file>: <what changed>
- <file>: <what changed>
## Testing
- [ ] Existing tests pass
- [ ] New tests added for changed behavior
- [ ] Manual verification completed
## Verification
- gh-pr-reviewer: <PASS | FAIL → PASS (n Important fixed)> — nit <n>, pre-existing <n><, read not independent>
EOF
)"
When the review's HUMAN-REVIEW line is not none, put this directly under ## Summary,
before anything else, with the review's own categories and reasons:
> **人が必ず見るべき変更を含みます (needs a human read)**
> - <category>: <file> — <reason>
Verification is not a suggestion to the user — it is work this skill performs. Re-run the diagnosis, read the result, and fix what this change broke, without waiting to be asked.
Start with the basics:
Then run the autonomous verification loop below.
Re-run a diagnostic skill when any of its triggers is present in the diff:
| Skill | Re-run when the diff touches |
|---|---|
data-validation | migrations, DDL, schema files, ORM models/entities, serializers/DTOs, queries, fixtures/seeds/factories, import-export or ETL code, validation rules, or any column/field rename or type change |
vulnerability-scan | the issue originated from vulnerability-scan, or the diff touches auth, input handling, queries, file paths, outbound requests, or headers/cookies |
dependency-audit | the issue originated from dependency-audit, or the diff touches a dependency manifest or lockfile (package.json, *.lock, pnpm-lock.yaml, go.mod, pyproject.toml, requirements*.txt, Gemfile, composer.json, Cargo.toml, …), workspace config (pnpm-workspace.yaml, go.work, …), or a Dockerfile / image reference |
software-evaluation | the issue originated from software-evaluation |
Run every skill whose triggers fire. If none fire, skip to 8.5.
Run each selected skill against the changed scope, passing <base-ref> from Step 2 as the
baseline so attribution is possible. The baseline is always what this branch was cut from —
in a batch that is the epic branch, so a finding that already fails there is pre-existing for
this Issue:
/maruda:data-validation <changed-data-scope> # baseline: <base-ref>
/maruda:vulnerability-scan <changed-path>
/maruda:dependency-audit <changed-path> # run on <base-ref> and on HEAD in the same session
/maruda:software-evaluation <changed-path>
dependency-audit has no baseline flag: run it on <base-ref> (the main working tree, or a
temporary worktree of it) and on this branch back to back in one session, the second run
with --skip-db-update, so both runs use the same vulnerability database (check that the two
reports show the same DB UpdatedAt). An advisory present in both is pre-existing. One only on
this branch is a regression only if the diff (git diff <base-ref>...HEAD) adds or changes
that package@version in a lockfile or an image reference; otherwise it is pre-existing — an
advisory published between the two runs. The rule is the same whatever found it (Found by):
--skip-db-update fixes Trivy's database only, while pnpm audit / npm audit query the
registry on every run. A target the audit could not run is environmental.
data-validation writes no file in this mode — read its session output directly. Parse the
fixed header block it emits:
<!-- data-validation:result -->
RESULT: PASS | WARN | FAIL
and its attribution table:
<!-- data-validation:attribution -->
| ID | Class | Basis |
| Class | Meaning | Action |
|---|---|---|
| regression | Passes on the base, fails now — this change caused it | Fix autonomously (8.4) |
| pre-existing | Fails on the base too | Do not fix. Collect for 8.6 |
| environmental | Fixture missing, tool absent, connection unavailable | Do not fix. Report in 8.6 |
| unknown | No baseline was available | Do not fix. Treat as pre-existing |
Only regression is in scope. Fixing a pre-existing finding here is scope creep, and it
buries an unrelated defect inside this PR's diff.
For each regression finding, in severity order:
git push) so the PR carries it; if the push fails, stop and report. In a batch there
is no PR yet and nothing is pushed here — gh-batch-runner pushes the epic branch
itself, after its whole-branch review. If Step 4.5 ran, the diff being shipped
is no longer the diff that was reviewed, so re-run gh-pr-reviewer on it and treat its
classes as in Step 4.5 — in a batch Step 4.5 did not run, and neither does this (the
batch reviews its branch as a whole). Then
re-run the diagnosis from 8.2.regression findings appear, they count toward the same budget.Attempt budget: 3 iterations of the whole loop. Count an iteration each time you return to 8.2 after applying fixes; iterations already spent on review findings in Step 4.5 count toward the same three. Then:
Never spend the budget re-attempting the same fix. If two consecutive iterations produce the same finding with the same remediation, the plan is wrong — go to 8.7 now rather than burning the third attempt.
Amend the PR body with what verification found and what was fixed in response, so the
autonomous edits are visible to the reviewer rather than buried in the commit log. (In a
batch there is no PR to update — skip this step; the batch writes its own PR body.) Before
touching the body, confirm the PR actually contains the work it is about to describe —
the PR's head must be the local HEAD:
test "$(gh pr view --json headRefOid --jq .headRefOid)" = "$(git rev-parse HEAD)"
If it is not, push and run the check again. If it still fails — the push was rejected, or
gh pr view itself failed — stop and report rather than writing a result the PR does not
contain. Extend
the ## Verification section Step 7 started — one line per check, never two lines for the
same one. If the review was re-run in 8.4, replace its line and the human-read block under
## Summary with the latest result — add the block if a fix newly earned it:
## Verification
- Full test suite: pass
- gh-pr-reviewer: FAIL → PASS (1 Important fixed: R-02) — nit 2, pre-existing 1
- data-validation: FAIL → PASS (2 regressions fixed: D-01, D-03)
- vulnerability-scan: not triggered
- dependency-audit: complete — no new advisories (DB 2026-11-05)
pre-existing and environmental findings are real, and dropping them silently is how they
survive forever. Report them, and offer to file them — but do not create Issues without the
user's confirmation:
Findings outside this change's scope (not fixed here):
[pre-existing] D-02 users.email is empty on 3.2% of rows
[pre-existing] D-04 2 future-dated created_at values
[pre-existing] R-03 rows.Err() is never checked (internal/order/repo.go:120)
[environmental] D-05 payments.yml is not loaded by the test setup
Register these as GitHub Issues? (report-to-issues)
If the user agrees, hand the findings to report-to-issues.
When the loop cannot close, stop and return to gh-issue-planner. Do not merge, do not
mark the issue resolved, and do not paper over the failure:
⛔ Verification did not converge for Issue #<id>.
Outstanding regressions:
D-01 orders.status contains values outside the declared enum (3 attempts)
Reason: the fix requires changing internal/model/order.go, which is outside the
agreed plan's 影響範囲 (db/migrations/ only).
The agreed plan needs revision. Re-run gh-issue-planner on Issue #<id>.
Leave the branch and the PR in place — the planner needs the work to reason about. When the stop came from Step 4.5 there is no PR yet: leave the branch and its commits, and do not open one.
✅ Implementation complete and verified for Issue #<id>.
Tests: pass | data-validation: PASS | 2 regressions fixed during verification
This closes the improvement cycle loop — and closes it with the fix already applied, not with a suggestion that someone re-run the diagnosis later.
Do NOT run this step automatically. Execute only when the user explicitly requests cleanup (e.g., "ブランチを削除して", "マージしたので片付けて", "clean up the branch").
Typical trigger: the PR has been merged and the user is ready to discard the feature branch.
# Switch back to the default branch
git checkout main # or master / trunk as appropriate
# Delete the local branch (-d guards against unmerged changes)
git branch -d <branch-name>
# Prune stale remote-tracking refs if the remote branch was already deleted
git fetch --prune
gh-issue-planner<base-ref> is one decision made once (Step 2) and reused for the branch, the PR base
and the verification baseline — never mix two of themgh-pr-reviewer, Step 4.5) before anyone is asked to look at it; what the review calls
Important is fixed under the same budget and the same wall as any other regressiongh-issue-planner, never widening
the scope unilaterallyWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
github-issues, pull-request, feature-branch, issue-resolution
Other plugins' skills for the same job
npx claudepluginhub northraystudio/maruda --plugin maruda15 skills in this plugin
/data-validationInspect a project's data for correctness and produce a read-only validation report — record counts, NULL rates, value distribution, uniqueness, referential integrity, format validity, and sampled evidence rows. Data is read only from the project's own test fixtures/seed data or from an explicitly configured connection; never from a guessed or production source. Triggers on requests like "validate the data", "check data quality", "データ検証", "データの妥当性を確認", "NULL率を調べて", "件数がおかしい", "/maruda:data-validation", or when `gh-issue-resolver` verifies a data-related change. Does NOT modify any data or code — read-only inspection only. Produces no JSON.
/dependency-auditAudit third-party dependencies for known vulnerabilities (OWASP A06) without running SAST. Scans lockfiles under a path (plus the owning workspace root lockfile) and explicitly named container images with a pinned Trivy; reports severity, package, version, fixed version, source, and reachability. Records what was scanned and marks what could not be as "not run" with the reason, never as zero. Writes a security-audit-format report for `report-to-issues` and a JSON summary. Only when the user asks, also converts each scanned target into an SBOM (CycloneDX by default, or SPDX) — never by default. Triggers on requests like "依存の脆弱性を調べて", "依存を監査して", "ロックファイルの脆弱性", "ベースイメージの脆弱性", "dependency audit", "check dependencies for CVEs", "scan the lockfile", "scan this image", "SBOMも出して", "generate an SBOM", "CycloneDX", "SPDX", "/maruda:dependency-audit", or when `vulnerability-scan` or `gh-issue-resolver` delegates the dependency audit. Read-only: never upgrades, installs, regenerates a lockfile, or builds an image.
/gh-batch-runnerRun several planned GitHub Issues as one unit: collect them under an Epic Issue with sub-issues, implement each on a shared epic/ branch in dependency order, verify the branch as a whole, and open a single Pull Request into the integration branch. Use when the user wants several Issues fixed, verified and released together. Triggers include requests such as Issue1,2,3をまとめて対応して / まとめて修正してリリースしたい / この3件を一緒に出して, 'batch these issues', 'do issues 1 2 3 together', 'ship these issues as one release'. Prerequisite: every member Issue needs an agreed plan comment from gh-issue-planner. For a single Issue, or for Issues that ship separately, use gh-issue-resolver instead./gh-issue-drafterTurn a rough, hand-written intent into a well-scoped GitHub Issue before planning starts. Takes a loose 'what I want' from the user, proposes the missing structure (Done definition, Out of scope, Design constraints), gets the user's approval, and creates the Issue via the gh CLI with a scoped-issue marker so gh-issue-planner can pick it up. When the intent is too large for one Issue, it proposes splitting it into independent Issues or an Epic with sub-issues. This is the human-authored counterpart to report-to-issues (which registers machine-generated findings). Use when the user wants to file a new Issue from a rough idea, is about to write an Issue by hand, or asks to turn a note/thought into an Issue. Triggers include requests like Issueを起こして / Issueを作って / ざっくり書くのでIssueにして, 'draft an issue', 'create an issue for', 'turn this into an issue', 'file an issue'. Does NOT plan or implement — hand off to gh-issue-planner for the response plan, then gh-issue-resolver for implementation./gh-issue-plannerFetch a GitHub Issue by ID using the gh CLI, investigate related code, propose a structured response plan (policy, impact scope, implementation steps), and post the agreed plan as a comment on the issue. Implementation/PR creation is out of scope — use gh-issue-resolver for that. Use when the user provides a GitHub Issue ID or asks to investigate/analyze/plan a GitHub Issue. Triggers include issue IDs like #42 or 'issue 42', requests such as Issueを調査して / Issueの対応方針を立てて, analyze issue #N, plan issue #N, investigate issue, look at issue. Accepts several Issues at once (e.g. '1,2,3' or 'Issue 1と2を計画して'): it investigates once and posts one agreed-plan comment per Issue./gh-pr-reviewerReview a diff before it becomes a Pull Request (or an open PR) against the intent it was written for: the agreed plan posted by `gh-issue-planner`, the Issue's Done conditions, or the PR description. Checks that the change stays inside the agreed impact scope, covers every Done condition, keeps what the plan said must not be cut, and does not weaken tests or thresholds; then has the diff read once in a fresh context for bugs. Reports findings with `file:line`, classified Important / Nit / Pre-existing, in a fixed header `gh-issue-resolver` and `gh-batch-runner` read. Triggers on requests like "review this diff", "review the PR", "PRをレビューして", "差分をレビューして", "プラン通りか確認して", "/maruda:gh-pr-reviewer", or when `gh-issue-resolver` reviews its own change, or `gh-batch-runner` a whole epic branch, before opening a PR. Does NOT modify code, Issues or PRs — read-only. Produces no JSON.