skills/brownfield-discovery/SKILL.md
--- name: brownfield-discovery description: Maps an existing codebase systematically. Use when entering an unfamiliar project, before writing specs or plans, or when you need to understand tech stack, architecture, conventions, business context, and outstanding concerns. Use when NOT: starting a greenfield project — you already understand the architecture. --- # Brownfield Discovery ## Overview When you land in an unfamiliar codebase, you need to understand *what this thing does*, *how it's b
npx skillsauth add SystangoTechnologies/agent-skills skills/brownfield-discoveryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When you land in an unfamiliar codebase, you need to understand what this thing does, how it's built, how it's organized, and what hurts. Brownfield discovery is the process of systematically mapping that knowledge so you can make informed decisions instead of guessing. Five parallel agents, each focused on one dimension, produce a persistent .context/ directory that seeds all subsequent skills with the facts they need.
.context/ files and they're current (skip directly to the skill using them)Explicitly choose: are you mapping the entire project, or one module/service?
Full project: Use for understanding the whole system before major changes or planning.
Single module: Use when you're only touching one part and need to understand it deeply without context flooding.
State the scope clearly before proceeding. This shapes which files each agent reads.
Deploy 5 parallel Explore agents. Each gets one brief and writes exactly one file to .context/, returning only a one-sentence confirmation (no summaries, no intermediate reports back).
| Agent | Reads | Writes | Example Brief |
|-------|-------|--------|---|
| Project | README, PRD, docs, high-level comments, git history (project goals) | .context/project.md | "What does this project do? Who uses it? What problems does it solve? What are explicit non-goals?" |
| Stack | package.json, pyproject.toml, Gemfile, go.mod, Dockerfile, CI (yml), .env.example | .context/stack.md | "What's the tech stack? List all major dependencies, runtime versions, build/test/run commands. What's the deployment target?" |
| Architecture | Directory structure, main routers/handlers, service boundaries, data models, config files | .context/architecture.md | "How is the code organized? What are the major layers (frontend/backend/db)? How do components communicate? What are the integration points?" |
| Conventions | Actual code samples (multiple files), linter config (.eslintrc, prettier, black.toml), test examples, PR template | .context/conventions.md | "What are the code style rules? Naming patterns? Where do tests live? Testing approach (unit/integration/e2e)? Any project-specific gotchas?" |
| Concerns | TODOs in code, failing tests, bug reports, CHANGELOG, inconsistent patterns, performance notes, type errors, security comments | .context/concerns.md | "What's broken or fragile? What tech debt exists? Which modules are inconsistent? What areas are high-risk? What tests fail?" |
Each agent:
.context/ file (creates the directory if needed)Read all 5 files you just created. Write .context/OVERVIEW.md:
# Project Context Overview
## What This Is
[3-5 bullet summary of what the project does, who uses it, what problem it solves]
## Quick Reference
| Dimension | File | Purpose |
|-----------|------|---------|
| Project | [project.md](./project.md) | Business context: purpose, users, goals |
| Stack | [stack.md](./stack.md) | Tech: dependencies, runtime, build/test/run commands |
| Architecture | [architecture.md](./architecture.md) | Code organization: layers, boundaries, data flow |
| Conventions | [conventions.md](./conventions.md) | Code style: naming, patterns, testing approach |
| Concerns | [concerns.md](./concerns.md) | Pain points: debt, fragile areas, known issues |
## Start Here (for agents)
When you land in this project:
1. Read this overview first (you're reading it now)
2. Based on your task, jump to the relevant dimension file above
3. If writing a spec: read project.md → stack.md → architecture.md → concerns.md
4. If implementing: read conventions.md → concerns.md → architecture.md
5. If debugging: read architecture.md → stack.md → concerns.md
## Latest Update
[Date]. Checked against actual code: [3 spot-check claims verified].
This synthesized file is what agents read first when entering the project. Everything else is detail.
Using the discovered facts, create or update CLAUDE.md at the project root. Include:
Tech Stack — From stack.md:
## Tech Stack
- Language/Framework: [from stack.md]
- Dependencies: [key ones from stack.md]
- Database: [from stack.md]
- Build tool: [from stack.md]
- Test framework: [from stack.md]
[Link to .context/stack.md for full details]
Commands — From stack.md:
## Commands
| Command | Purpose |
|---------|---------|
| [cmd] | [what it does] |
[Link to .context/stack.md for exhaustive list]
Code Conventions — From conventions.md:
## Code Conventions
[Key 3-5 rules from conventions.md]
[Link to .context/conventions.md for gotchas and exceptions]
Boundaries — From concerns.md:
## Boundaries
- Never: [things that hurt in the past, from concerns.md]
- [Additional constraints from concerns.md]
Humans read CLAUDE.md; agents and future developers reference .context/ files for detail. Keep CLAUDE.md concise and forward-facing.
Pick 3 specific claims from your .context/ files. Verify them against the actual code:
Example spot-checks:
.context/stack.md says "React 18 + TypeScript 5" — check package.json.context/conventions.md says "Tests colocate next to source" — find a real example of a colocated test file.context/architecture.md says "API layer wraps database queries" — read one actual route handler and verifyIf any claim is wrong, fix it now. Don't commit context docs that hallucinated details.
| Rationalization | Reality |
|---|---|
| "I'll just read the code when I need it" | You'll re-read the same patterns repeatedly. Context docs are a 2-hour upfront investment that saves 20 hours of code-reading. |
| "The README is good enough" | READMEs describe how to run the code. .context/ describes how it's organized. Different purposes, both needed. |
| "Parallel agents will miss details" | They're not writing a formal spec — they're writing discoverable pointers to evidence. Depth comes from agents reading .context/ when building, not from a 200-page document. |
| "This is overhead we can't afford" | It's not overhead. It's building the foundation that all subsequent skills depend on. Skip it, and spec-driven-development, planning, and code-review all become slower. |
| ".context/ files will go stale" | That's fine. They're not gospel — they're starting points. When you find something wrong, fix it. If a file is stale enough to be harmful, re-run this skill. |
.context/ and return one-sentence confirmation only..context/OVERVIEW.md is longer than one screen. Too detailed. It should be a quick index, not a deep dive..context/ files contradict each other (e.g., stack says PostgreSQL but architecture mentions "MongoDB queries"). Resolve these before moving on. They point to documentation or code rot..context/. Link them. CLAUDE.md is the rules file; .context/ is the evidence. Keep them synchronized.Before finishing:
.context/: project.md, stack.md, architecture.md, conventions.md, concerns.md.context/OVERVIEW.md summarizes all 5 on one screen and links to them.context/ have been spot-checked against actual code.context/ for details.context/ file is longer than 3 screens (dimension files should be scannable, not encyclopedic).context/stack.md and actual project files (package.json, Dockerfile, CI config)tools
Creates specs before coding with mandatory Jira MCP validation and story-key grounding. Use when starting a Jira-tracked feature or significant change and requirements are unclear, ambiguous, or incomplete.
devops
Prepares production launches and updates Jira ticket/task comments. Use when preparing to deploy to production and when launch readiness/progress must be communicated in Jira.
tools
Breaks Jira story work into ordered tasks. Use when you have a story spec and need to break work into implementable tasks with story-scoped files under `jira-spec/{story-id}/`. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.
development
Discovers and invokes agent skills. Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.