fix-issue

A command that takes one or more GitHub issues through investigation, code changes, checks, and a pull request. It classifies each issue as a bug, feature request, or question before choosing a workflow.

In plain words
What is it for?
Use it to resolve GitHub bugs, implement feature requests, or handle issue questions with test-driven development (writing tests before the fix) and an audit step.
Why use it?
It removes the need to coordinate issue details, branches, tests, reviews, and pull-request creation manually. It also stops when required checks fail or the issue is unclear.

Command for Claude Code

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/xiaolai/vmark/fix-issue
Clone the repo
git clone --depth 1 https://github.com/xiaolai/vmark

Made for: Claude Code.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,403 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.00017 $0.02403
Opus 5 $0.00009 $0.01202
Sonnet 5 $0.00003 $0.00481
Haiku 4.5 $0.00002 $0.00240

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

Security

Grade A, and why

fix-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 2d 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.

.claude/commands/fix-issue.md · 282 lines

How it starts

The opening of the file, as written. The whole thing — 282 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fix Issue

Resolve one or more GitHub issues end-to-end: fetch, classify, branch, fix with TDD, Codex audit loop, gate, and PR.

Input

$ARGUMENTS

Pre-flight Checks

  1. Parse arguments — extract issue numbers (e.g. #123, 123, #123 #456).
    • No arguments: print usage and STOP.
  2. Working tree must be clean — run git status --porcelain. If dirty, error and STOP.
  3. Confirm on main/up-to-date — run git branch --show-current and git fetch origin.

Single-Issue Pipeline

When exactly one issue number is provided, run phases 1-6 sequentially.

Phase 1: Fetch & Classify

gh issue view {N} --json number,title,body,labels,state,assignees
  • If issue not found or closed: warn user, ask whether to proceed, or STOP.
  • Classify by labels or body content:
Classification Trigger Path
Bug label contains bug, or body mentions error/crash/broken Bug path (Phase 3a)
Feature label contains feature/enhancement Feature path (Phase 3b)
Question label contains question Question path (Phase 3c)
Ambiguous no matching labels Ask user to classify

Phase 2: Branch Setup

  • Generate slug from title: lowercase, strip non-ASCII, replace spaces with -, truncate to 40 chars.
  • Branch name: fix/issue-{N}-{slug} (bug) or feat/issue-{N}-{slug} (feature).
  • If branch already exists: ask user — reuse or rename.
  • Create and checkout the branch.

Phase 3: Resolve

3a. Bug Path

Follow the philosophy from /fix — no half measures.

  1. Reproduce — Read relevant code, trace call chain from symptom to root cause.
  2. Diagnose — Find root cause, check for similar patterns elsewhere.
  3. RED — Write a failing test capturing the bug (see .claude/rules/10-tdd.md).
  4. GREEN — Fix the root cause with minimal, focused changes.
  5. REFACTOR — Clean up without changing behavior.
3b. Feature Path
  1. Research — Search for best practices, prior art, established patterns (AGENTS.md mandate).
  2. Plan — Design the implementation. If it would touch 10+ files or need 4+ work items, redirect to /feature-workflow and STOP this pipeline.
  3. TDD implement — RED/GREEN/REFACTOR per work item.
  4. Edge cases — Brainstorm and test: empty input, null, Unicode/CJK, rapid actions, concurrent access.

Read the full file on GitHub · 282 lines

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. 2d ago First seen · 282 lines · 17 tokens per session scan A d3e37151b046

Subscribe to this mod's changes

fix-issue is a command published in the GitHub repository xiaolai/vmark (544 stars, last pushed 2d ago), licensed ISC. It adds 17 tokens to every session and 2,403 once invoked, about $0.0001 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-30.