brownfield

brownfield is a skill for Claude Code, Codex from pktikkani/agent-skills. It costs 63 tokens per session (2,833 once invoked), scanned A, original, MIT.

A set of rules for bringing an existing, inherited codebase under clearer working discipline without rewriting it. A brownfield project is an older or already-used codebase whose structure and history must be preserved.

In plain words
What is it for?
Use it when onboarding an old repository, documenting its current structure, setting rules that stop new problems, or making small, opportunistic improvements.
Why use it?
It documents how the repository really works, prevents further decline, and allows improvements alongside normal work. This reduces codebase archaeology and avoids risky large-scale rewrites.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions AGENTS.md.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/me/x/foo.

Good fit Use it when onboarding an old repository, documenting its current structure, setting rules that stop new problems, or making small, opportunistic improvements.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/pktikkani/agent-skills/brownfield/github.svg)](https://agentmods.dev/skills/pktikkani/agent-skills/brownfield)
Your own site
<a href="https://agentmods.dev/skills/pktikkani/agent-skills/brownfield"><img src="https://agentmods.dev/badge/skills/pktikkani/agent-skills/brownfield/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/pktikkani/agent-skills/brownfield"><img src="https://agentmods.dev/badge/skills/pktikkani/agent-skills/brownfield.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,833 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.00063 $0.02833
Opus 5 $0.00032 $0.01417
Sonnet 5 $0.00013 $0.00567
Haiku 4.5 $0.00006 $0.00283

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

Security

Grade A, and why

brownfield 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/check_discipline.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/skills/brownfield/SKILL.md · 137 lines

How it starts

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

Brownfield

Retrofit an existing repo with the same discipline contract /greenfield gives a new one, so a returning agent (or you, months later) can re-enter in one file-read instead of codebase archaeology. The difference from greenfield: you inherit a codebase with history, and you must not break it.

Core law: ratchet, don't renovate

Document reality first. Freeze decay at today's level. Improve only opportunistically, in the same commit as work you were already doing. Never propose a rewrite.

A brownfield repo already works (or half-works) and has a shape someone chose for reasons you may not see. Your job is to make that shape legible and enforced, not to impose the shape it "should" have had. The BLUEPRINT you write describes the repo as it is — including its warts, recorded honestly as grandfathered facts — and the gate you install ratchets from there: it forbids things getting worse, and lets them get better one file at a time. Any structural improvement is a separate, deliberate decision the returning agent makes with eyes open, never a big-bang refactor you kick off during onboarding.

Generate the files below in the repo's root. If a file already exists, update it; never clobber real content.

1. Read the repo first — no writing until you understand it

Reverse-engineering an honest BLUEPRINT is impossible without reading. Spend the first block of time reading, not writing:

  • README / docs — the stated intent (often stale; note where it lies).
  • Entry pointsmain.*, app.*, index.*, manage.py, package.json scripts, Makefile, Dockerfile, pyproject.toml/requirements.txt/package.json deps. These tell you the real stack and how it boots.
  • Actual structure — walk the source tree; note the real top-level modules and what each actually does (not what its name claims).
  • git loggit log --oneline -30 and git log --stat -5 for the shape of recent work: what's churning, what's stable, what the last agent was mid-way through.
  • Auto-memory — if ~/.claude/projects/<encoded-path>/memory/ exists for this repo, read it. <encoded-path> is the repo's absolute path with / replaced by - (e.g. /Users/me/x/foo-Users-me-x-foo). Durable facts there (decisions, gotchas, org context) are promotion candidates for AGENTS.md.
  • Existing ADRs / decision docsdocs/adr/, DECISIONS.md, CONTEXT.md if present.

Read the full file on GitHub · 137 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 137 lines · 63 tokens per session scan A 78ab42057156

Subscribe to this mod's changes

brownfield is a skill published in the GitHub repository pktikkani/agent-skills (2 stars, last pushed 2d ago), licensed MIT. It adds 63 tokens to every session and 2,833 once invoked, about $0.0003 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.

Related

Other skills, from other repositories