fix-gh-issue

fix-gh-issue is a command for coding agents from marmot-protocol/agent-config. It costs 8 tokens per session (529 once invoked), scanned A, original, MIT.

A command for checking and fixing a GitHub issue, then preparing a pull request. GitHub issues are written records of bugs, improvements, or tasks in a code project.

In plain words
What is it for?
Use it when you have an issue number or link and want the issue investigated, fixed, tested, and submitted for review.
Why use it?
It provides a defined path from verifying a reported problem to implementing and checking the fix.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/marmot-protocol/agent-config/fix-gh-issue
Clone the repo
git clone --depth 1 https://github.com/marmot-protocol/agent-config

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-gh-issue

README.md
[![agentmods](https://agentmods.dev/badge/commands/marmot-protocol/agent-config/fix-gh-issue.svg)](https://agentmods.dev/commands/marmot-protocol/agent-config/fix-gh-issue)
Your own site
<a href="https://agentmods.dev/commands/marmot-protocol/agent-config/fix-gh-issue"><img src="https://agentmods.dev/badge/commands/marmot-protocol/agent-config/fix-gh-issue.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 529 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.00529
Opus 5 $0.00004 $0.00264
Sonnet 5 $0.00002 $0.00106
Haiku 4.5 $0.00001 $0.00053

Measured 3d ago against content hash 658df2ce2049, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fix-gh-issue scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

opencode/commands/fix-gh-issue.md · 72 lines

What it actually says

Fix GitHub Issue

Verify an issue from GitHub is valid, create a worktree to work on it, fix the issue, and create a PR.

Instructions

1. Parse and Validate Arguments

  • Read ISSUE_NUMBER from $ARGUMENTS
  • Accept: bare number (5), issue number (#5), or full URL (https://github.com/org/repo/issues/5)
  • Extract just the number. If parsing fails, report an error and stop.

2. Validate Issue

  • Fetch the issue using gh issue view <ISSUE_NUMBER>
  • Read any files in the codebase related to the issue to understand context
  • Determine if this is a valid problem, feature, or task worth working on
  • If not valid, explain why and stop
  • If valid, continue

3. Create Worktree

  • Create a short ISSUE_DESCRIPTION from the issue title (lowercase, hyphens, no special chars)
  • Set BRANCH_NAME to issue-<ISSUE_NUMBER>-<ISSUE_DESCRIPTION>
  • Run: /create-git-worktree <BRANCH_NAME>
  • You are now in the worktree directory, ready to work

4. Fix the Issue

  • Implement the fix or feature
  • Run quality checks: just precommit or just ci
  • Check code coverage: just coverage-text
    • All quality checks must pass
    • Code coverage must be equal or greater than HEAD
  • If checks fail, fix issues and re-run until passing

5. Create PR

  • Commit changes with a descriptive message
  • Create a PR: gh pr create --fill
  • Include Closes #<ISSUE_NUMBER> in the PR body

7. Run code-review

  • Once you've published a PR, start a new session with the /new command
  • Then run the /code-review command to do a full code review.
  • If any issues are surfaced, fix them, run all code quality checks again, and then commit and push your changes

7. Report

After successful PR creation, provide this report:

✅ Issue #<ISSUE_NUMBER> Successfully Completed!

📁 Worktree:
   Location: trees/<BRANCH_NAME>
   Branch: <BRANCH_NAME>

🔗 GitHub:
   Issue: <FULL_ISSUE_URL>
   PR: <FULL_PR_URL>

📝 Summary:
   <Summary of changes made>
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 72 lines · 8 tokens per session scan A 658df2ce2049

Subscribe to this mod's changes

fix-gh-issue is a command published in the GitHub repository marmot-protocol/agent-config (2 stars, last pushed 7mo ago), licensed MIT. It adds 8 tokens to every session and 529 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.