fix

A command that scans NL programming artifacts, which are structured files for describing coding-agent behavior, and automatically fixes certain formatting and metadata problems.

In plain words
What is it for?
It helps score artifacts first, then fix supported issues such as missing frontmatter, heading levels, argument hints, field names, and skill names.
Why use it?
It removes routine cleanup work such as missing fields, inconsistent headings, trailing spaces, and incorrect command metadata.

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/xiaolai/nlpm/fix
Clone the repo
git clone --depth 1 https://github.com/xiaolai/nlpm
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 664 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.00021 $0.00664
Opus 5 $0.00010 $0.00332
Sonnet 5 $0.00004 $0.00133
Haiku 4.5 $0.00002 $0.00066

Measured 2d ago against content hash 6d37df9e6c15, 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 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.

commands/fix.md · 78 lines

How it starts

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

User Input

$ARGUMENTS

Workflow

Step 1: Score First

Parse $ARGUMENTS for a path (default: cwd if empty). Dispatch the nlpm:scorer agent via Task tool to score all artifacts at that path. Collect all findings.

If no artifacts are found → "No NL programming artifacts found." and stop.

Step 2: Classify Findings

Separate findings into auto-fixable and not-auto-fixable:

Auto-fixable (will be applied):

  • Missing user-invocable: false on shared partials → add to frontmatter
  • tools field in command frontmatter where allowed-tools is expected → rename field (note: tools in agent frontmatter is valid and not auto-fixed)
  • Heading hierarchy gaps (## → ####) → insert missing ### level
  • Trailing whitespace → strip
  • Missing description in shared partial frontmatter → generate from filename and first heading
  • Missing name in skill frontmatter → derive from directory name
  • Missing argument-hint on commands that reference $ARGUMENTS in body → add "[args]"

Suggested fixes (shown with diff, applied only if user approves):

  • Agent using opus for mechanical task → suggest downgrade to sonnet/haiku with rationale
  • Agent with no <example> blocks → generate skeleton examples from description
  • Skill >500 lines → suggest split points based on H2 sections

NOT auto-fixable (reported but not modified):

  • Vague descriptions (what should the trigger phrases be?)
  • Behavioral contradictions (which artifact is right?)
  • Scope boundaries, output formats, error handling

Step 3: Apply Fixes

For each auto-fixable finding:

  1. Read the file
  2. Apply the fix using Edit tool
  3. Log: "Fixed: {file}:{line} — {what was changed}"

Step 4: Re-Score

Re-run scoring on all fixed files to compute new scores.

Step 5: Report

NLPM Fix Report

Fixed {N} findings in {M} files:
  {file}:{line} — added user-invocable: false (+25 points)
  {file}:{line} — renamed tools → allowed-tools (+0 points, consistency)
  {file}:{line} — inserted missing ### heading (+0 points)

Not auto-fixable ({N} findings remain):
  [{SEVERITY}] {file}:{line} — {finding} (requires human judgment)

Score changes:
  {file}   {old_score} → {new_score}  (+{delta})

Overall: {old_avg} → {new_avg}

Read the full file on GitHub · 78 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 · 78 lines · 21 tokens per session scan A 6d37df9e6c15

Subscribe to this mod's changes

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