brownfield-fix

brownfield-fix is a command for Claude Code from wednesday-solutions/ai-agent-skills. It costs 0 tokens per session (944 once invoked), scanned A, original, MIT.

A pre-edit risk report for a file in an existing codebase. It combines the file's history, dependencies, affected files, entry-point status, circular dependencies, and test-coverage gaps into a safe-to-edit assessment.

In plain words
What is it for?
Use it before editing a file to review its risk score, dependent files, change history, circular dependencies, coverage gaps, and recommended safety checks.
Why use it?
It shows what could break before you modify a file that other parts of the project rely on. This helps you recognize high-impact or poorly tested areas early.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it before editing a file to review its risk score, dependent files, change history, circular dependencies, coverage gaps, and recommended safety checks.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/wednesday-solutions/ai-agent-skills/brownfield-fix
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.

Clone the repo
git clone --depth 1 https://github.com/wednesday-solutions/ai-agent-skills

Made for: Claude Code.

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 brownfield-fix

README.md
[![agentmods](https://agentmods.dev/badge/commands/wednesday-solutions/ai-agent-skills/brownfield-fix/github.svg)](https://agentmods.dev/commands/wednesday-solutions/ai-agent-skills/brownfield-fix)
Your own site
<a href="https://agentmods.dev/commands/wednesday-solutions/ai-agent-skills/brownfield-fix"><img src="https://agentmods.dev/badge/commands/wednesday-solutions/ai-agent-skills/brownfield-fix/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for brownfield-fix

Your own site · 80×15
<a href="https://agentmods.dev/commands/wednesday-solutions/ai-agent-skills/brownfield-fix"><img src="https://agentmods.dev/badge/commands/wednesday-solutions/ai-agent-skills/brownfield-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 944 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00944
Opus 5 $0.00000 $0.00472
Sonnet 5 $0.00000 $0.00189
Haiku 4.5 $0.00000 $0.00094

Measured 12d ago against content hash af5b2a612d9f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

brownfield-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 12d 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/brownfield-fix.md · 129 lines

How it starts

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

/brownfield-fix — Pre-Edit Risk Check

Purpose

Run a risk assessment before editing any file in a brownfield codebase. Provides a risk card showing impact scope, danger zones, and safe-to-edit verdict.

Trigger

  • "Check the risk before I edit this"
  • "What breaks if I change this file?"
  • "Is this file safe to modify?"

Type: /brownfield-fix <file-path> (or leave empty to check currently open file)


Steps

1. Resolve the target file path

If $ARGUMENTS is empty, assume the currently open file in the editor. If $ARGUMENTS is a relative path, resolve it relative to the project root.

2. Query the file summary from DB

const queries = require('./.wednesday/queries-loader.js'); // Loader helper
const fileSummary = queries.getFileSummary('.wednesday/graph.db', targetFile);

if (!fileSummary) {
  console.log('File not found in graph. Run /brownfield-map first.');
  return;
}

This single query returns:

  • Risk score & band
  • Git history (commits, bugs, age)
  • Import counts (fan-in/fan-out)
  • Blast radius (transitive dependents)
  • Entry point info
  • Circular dep membership
  • Coverage gaps

3. Check for daemons and adapters

Daemons and adapters are included in the file summary from the DB:

  • Daemon patterns (setInterval, cron, process.on) → recorded as gap_type
  • Adapter references (database, HTTP, payment) → recorded in analysis

6. Build the risk card

Format:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
FILE: <relative-path>
RISK SCORE: <score>/100  [<band>]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

IMPACT SCOPE
  Direct dependents:    <N> files
  Transitive affected:  <N> files
  
CONTRIBUTING FACTORS
  Bug fixes in history: <N>
  Total commits:        <N>
  File age:             <N> days
  Import fanout:        <N>
  Unresolved gaps:      <N>
  
DAEMONS & ADAPTERS
  <list or "None">
  
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
VERDICT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[If SAFE or MODERATE]
✓ Safe to edit. Low blast radius. <one-line summary>

[If RISKY]
⚠ HIGH RISK. Affects <N> files. Review these before committing:
  • <top impacted file 1>
  • <top impacted file 2>
  • <top impacted file 3>

[If CRITICAL]
🛑 CRITICAL. <reason>. Do NOT edit without:
  1. Talking to the maintainer
  2. Running full test suite
  3. Code review from <most recent author>

Read the full file on GitHub · 129 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. 12d ago First seen · 129 lines · 0 tokens per session scan A af5b2a612d9f

Subscribe to this mod's changes

brownfield-fix is a command published in the GitHub repository wednesday-solutions/ai-agent-skills (168 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 944 tokens. 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.