fix

A command for investigating a software problem, writing a test that demonstrates it, applying a complete fix, and running the project's full checks. It follows a test-first process and focuses on the underlying cause.

In plain words
What is it for?
Use it to reproduce and diagnose bugs, create regression tests, repair the root cause, and verify the result with the project's check-all command.
Why use it?
It discourages temporary patches, bypasses, and fixes that only hide symptoms. The required verification is intended to reduce regressions, meaning new failures caused by the change.

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

Made for: Claude Code.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 790 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.00013 $0.00790
Opus 5 $0.00006 $0.00395
Sonnet 5 $0.00003 $0.00158
Haiku 4.5 $0.00001 $0.00079

Measured yesterday against content hash 12c2d581016a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fix 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 yesterday.

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.md · 92 lines

How it starts

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

Fix

Context

$ARGUMENTS

Fixing Philosophy

No half measures. Every fix must be complete and correct.

Principles

  1. Understand before fixing — Read the code, trace the flow, identify root cause
  2. Fix the cause, not the symptom — No band-aids, no workarounds, no "good enough"
  3. Rewrite if necessary — Bad code deserves replacement, not patching
  4. Test-first — Write a failing test that captures the bug, then fix, then verify green (see .claude/rules/10-tdd.md)
  5. Zero regressions — Run pnpm check:all before declaring done
  6. Clean as you go — If you touch it, leave it better than you found it

Anti-patterns to Avoid

  • Adding flags to bypass broken logic
  • Wrapping bad code in try-catch to silence errors
  • Commenting out problematic code
  • Adding TODO for "later"
  • Special-casing edge cases without fixing core issue
  • Copy-pasting fixes across similar code

Process

1. Reproduce

  • Read the relevant source files. Trace the call chain from symptom to root cause.
  • If the issue involves UI behavior, ask the user to reproduce it (no dev server — use Tauri MCP for E2E when available).

2. Diagnose

  • Find the root cause, not just where it crashes.
  • Check if similar patterns exist elsewhere — the same bug may lurk in related code.

3. Test First (RED)

  • Write a failing test that captures the bug.
  • Follow the pattern catalog in .claude/rules/10-tdd.md:
    • Store bug → store test with getState()
    • Plugin bug → minimal schema + createState() helper
    • Hook bug → renderHook with mocked dependencies
    • Util bug → table-driven it.each covering the broken case
  • Exception: CSS-only or visual bugs don't need unit tests — use visual QA instead.

4. Fix Properly (GREEN)

  • Address the root cause. Rewrite if the existing code is fundamentally flawed.
  • Keep the diff minimal and focused — don't refactor unrelated code.
  • Follow project conventions:
    • Use @/ imports for cross-module, relative for same-module
    • Use design tokens, never hardcoded colors (.claude/rules/31-design-tokens.md)
    • No Zustand store destructuring in components
    • Keep files under ~300 lines

Read the full file on GitHub · 92 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. yesterday First seen · 92 lines · 13 tokens per session scan A 12c2d581016a

Subscribe to this mod's changes

fix is a command published in the GitHub repository xiaolai/vmark (544 stars, last pushed 2d ago), licensed ISC. It adds 13 tokens to every session and 790 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.