brownfield

brownfield is a skill for Claude Code, Codex from Q00/ouroboros. It costs 14 tokens per session (2,144 once invoked), scanned A, original, MIT.

A tool for scanning existing coding projects and linked worktrees, then choosing which repositories should be the default context for interviews. A brownfield project is an existing codebase rather than a new one.

In plain words
What is it for?
Use it to scan repositories, view or set default repositories, or create project configuration from an existing codebase.
Why use it?
It helps an agent understand which existing repositories are relevant before asking questions or planning work.

Skill for Claude CodeCodex

Part of the ouroboros plugin — 22 skills, 21 agents, 3 hooks, 1 MCP server shipped together

About the project

Q00/ouroboros is an Agent OS for running coding agents through interviews, staged evaluation, and repeated improvement cycles. It helps developers turn vague requests into tested code across multiple agent runtimes. Its catalogue add-ons provide workflows, agents, hooks, instructions, and integrations for operating those processes.

Q00/ouroboros · 5,769 stars · on GitHub · ouroboros.page

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 skills/q00/ouroboros/brownfield
Any agent
npx skills add Q00/ouroboros --skill brownfield
Clone the repo
git clone --depth 1 https://github.com/Q00/ouroboros

Made for: Claude Code, Codex.

Or install ouroboros, the plugin that ships this one along with the rest of its 22 skills, 21 agents, 3 hooks, 1 MCP server.

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/q00/ouroboros/brownfield.svg)](https://agentmods.dev/skills/q00/ouroboros/brownfield)
Your own site
<a href="https://agentmods.dev/skills/q00/ouroboros/brownfield"><img src="https://agentmods.dev/badge/skills/q00/ouroboros/brownfield.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,144 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.1 $0.00014 $0.02144
Opus 5 $0.00007 $0.01072
Sonnet 5 $0.00003 $0.00429
Haiku 4.5 $0.00001 $0.00214

Measured 3d ago against content hash 9c9477269fdd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 3d 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.

skills/brownfield/SKILL.md · 242 lines

How it starts

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

/ouroboros:brownfield

Scan a root directory for existing git repositories and linked worktrees, then manage default repos used as context in interviews.

Usage

ooo brownfield                # Scan repos and set defaults
ooo brownfield scan           # Scan only (no default selection)
ooo brownfield defaults       # Show current defaults
ooo brownfield set 6,18,19   # Set defaults by repo numbers
ooo brownfield detect [path]  # Author mechanical.toml via one AI call

Trigger keywords: "brownfield", "scan repos", "default repos", "brownfield scan", "mechanical detect"


How It Works

Default flow (ooo brownfield with no args)

Step 1: Scan

Show scanning indicator:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Scanning for Existing Projects...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Looking for git repositories and worktrees up to two directories below the scan root.
Local repos and repos with any remote name are eligible.
This may take a moment...

Implementation — use MCP tools only, do NOT use CLI or Python scripts:

CRITICAL — deferred-schema guard (prevents "Invalid tool parameters"): This skill can call ouroboros_brownfield across multiple turns (scan, set_defaults, defaults, and set). A deferred schema loaded for one turn is NOT guaranteed to remain loaded for the next. Immediately before EVERY ouroboros_brownfield call, re-run tool discovery query: "+ouroboros brownfield" (idempotent — a no-op when already loaded). If the load returns no matching tool (and the tool is not already callable — an empty load for an already-exposed tool is an expected no-op, not absence), stop with the MCP-not-available message instead of retrying the failing call.

  1. Load the brownfield MCP tool: tool discovery query: "+ouroboros brownfield"
  2. Call scan+register:
    Tool: ouroboros_brownfield
    Arguments: { "action": "scan" }
    
    This walks scan_root (up to two directory levels deep) for valid seed repos/worktrees and registers them in DB. Each repo or worktree found directly by the walk is registered self-only — Git worktree families are not expanded, so worktrees outside the depth-bounded walk (e.g. under .ouroboros/worktrees) are not pulled in. Existing defaults are preserved.

Read the full file on GitHub · 242 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. 3d ago Changed · +17 lines 9c9477269fdd
  2. 6d ago First seen · 225 lines · 14 tokens per session scan A 5dadce6a6116

Subscribe to this mod's changes

brownfield is a skill published in the GitHub repository Q00/ouroboros (5,769 stars, last pushed yesterday), licensed MIT. It adds 14 tokens to every session and 2,144 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.