robisson/build-like-amazon-agent-skills/brownfield-discovery
Claude Code and agent skill by robisson/build-like-amazon-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Reverse-engineer an existing project to produce a Design Doc, API contracts, and a Threat Model anchored in the real code, IaC, and observability. Run once per project. Output anchors all subsequent /spec and /build invocations.
Install
npx vskill@latest install robisson/build-like-amazon-agent-skills/brownfield-discoverySKILL.md
The same SKILL.md was published earlier as robisson/build-like-amazon-agent-skills/brownfield-discovery.
Brownfield Discovery
Overview
Build Like Amazon's canonical flow assumes a greenfield path: /wb → /design → /spec → /build. Most real adoption happens on existing projects with code, IaC, CI/CD, observability, and on-call already running — but no BLA artifacts.
This skill closes that gap. It does an engineering reverse pass on the project: reads the code, IaC, CI, dashboards, and external dependency calls, then produces a Design Document, API contracts, and a Threat Model anchored in the real state of the system. Subsequent /spec and /build invocations use these reverse-engineered artifacts as their anchor — exactly as they would use canonical artifacts in greenfield.
This is not retroactive approval. The output carries a banner saying "REVERSE-ENGINEERED — not approved by any bar raiser, used as context, not as historical decision record." It exists so the agent stops re-discovering the project on every invocation and so future bar raisers have something to compare against.
When to Use
- The project already exists (significant code, IaC, CI present) and there are no BLA artifacts (
.bla/design/,.bla/working-backwards/) - The user asks for a medium or large change in such a project (small / trivial changes don't need this — they go through the proportionality ladder directly)
- The user explicitly invokes
/onboard - Periodically, when the project drifts significantly from the prior reverse-engineered baseline (architecture change, major refactor)
Do NOT use for:
- Greenfield projects (use
/wb→/designinstead) - Projects that already have a canonical Design Doc (use that as the anchor)
- Trivial or small changes (the ladder in
skills/using-amazon-skills/SKILL.mdhandles those without needing discovery) - "Just to have docs" — discovery is a means to anchor future changes, not documentation for documentation's sake
Amazon Context
Inside Amazon, services accumulate years of decisions that live only in the heads of long-tenured engineers and in the code. New owners onboarding a service do a structured system walkthrough — a disciplined pass where they read the code, the runbooks, the incident history, and produce a written summary of the system as it is. This skill is the same pattern: a one-time, structured pass that produces written artifacts so the next reader (human or agent) is not starting from scratch.
The artifacts produced are deliberately marked as reverse-engineered. Pretending a reverse-engineered Design Doc is the same as one approved by a Design Bar Raiser would corrupt the process — bar raisers exist precisely because retroactive justification is not the same as upfront design.
The Process
brownfield-discovery runs in one of three paths, picked by the user via AskUserQuestion at the start. The differences:
| Path | Purpose | Output | Time | |
|---|---|---|---|---|
| A — Anchor (default, recommended) | Anchor the agent on the real state of the project so future /spec and /build are precise. Does not touch customer / problem / PR/FAQ. | Design Doc + API contracts + Threat Model + patterns-observed | ~15–30min | |
| B — Reverse Working Backwards | Validate that the project is solving the right customer problem, as-built. Inferred PR/FAQ with hard questions for the user where the code cannot answer. | Path A's output + reverse-engineered customer-profile / problem-statement / solution-sketch / PR/FAQ (DRAFT, INFERRED) + bar-raiser questions | ~30–45min | |
| C — Forward WB + Gap Analysis | Run a fresh Working Backwards as if greenfield (with full approval gates), then compare it to the existing project. Surfaces strategic gaps. | Path A's output + full WB artifacts + gap-analysis.md | ~1–2h, with gates |
The agent presents these three as outcome-framed options (not process names) and runs the chosen path. The shared engine (Steps 1–6 below) is the same; Path B and C extend Path A with additional steps.
Step 0: Pick the path
Use AskUserQuestion to surface the three options to the user, framed by outcome:
Detected: existing project, no BLA artifacts. How would you like to use/onboard?[A] Anchor only — produce a Design Doc, API contracts, and a Threat Model from the existing code. Future/specand/builduse these as anchor. Does not try to recover the customer story or PR/FAQ. Recommended for "I'll keep building here, give me the agent the context it needs." ~15–30min.[B] Validate the *why* — everything in [A], plus an inferred PR/FAQ reconstructed from the code, README, and docs. The doc-bar-raiser persona surfaces hard questions where the code can't tell us why. Recommended for "I built fast and want to check whether I'm solving the right problem." ~30–45min.[C] Forward WB + Gap Analysis — full/wbfrom scratch (5 stages with approval gates) as if this were greenfield, with the agent reading the existing code during the conversation. At the end, produces agap-analysis.mdcomparing "what we'd build today" vs "what exists." Recommended for "I'm pivoting / re-strategizing / want to revalidate from scratch." ~1–2h.
If the user does not answer or asks the agent to pick, default to A.
Steps 1–6 — Shared engine (run in all 3 paths)
These steps form Path A in full. Path B and Path C extend them with additional steps below.
1. Inventory pass (read-only, ~5–10min)
Read the project in breadth, not depth. Goal: a bird's-eye view.
- Languages, frameworks, runtime versions —
package.json,pyproject.toml,go.mod,pom.xml,Cargo.toml, etc. - Entrypoints — handlers,
main, Lambda function entries, controllers, queue consumers, scheduled jobs - IaC — CloudFormation templates, CDK code, Terraform, Pulumi, Kubernetes manifests
- CI/CD —
.github/workflows,.gitlab-ci.yml,buildspec.yml,Jenkinsfile, pipeline configs - Observability — structured logging libraries, metrics emission, alarms / dashboards declared in IaC, OpenTelemetry instrumentation
- External dependencies — HTTP clients, SDK clients (DynamoDB, S3, etc.), queue producers/consumers, database connections
- Tests — unit / integration / e2e coverage; testing frameworks
- Config — environment variables, parameter store, config files; what's externalized vs hardcoded
- Auth / security boundaries — middleware, IAM roles, API keys, JWT verification, encryption usage
- Data stores — schemas, migrations, ownership
Produce a brief inventory list. Don't write prose yet.
2. Architecture inference (~5–10min)
From the inventory, infer:
- High-level architecture — components, data flows (read path / write path), sync vs async boundaries. Express as a Mermaid diagram.
- Existing API surface(s) — what does this service expose? REST endpoints (route table → OpenAPI), gRPC services (
.protofiles or inferred from code), event topics/queues (publishers, subscribers, payload shapes), CLI commands, MCP tools, etc. - Patterns present (or absent) — single-instance? Multi-AZ? Multi-region? Cell-based? Bulkhead isolation? Control-plane / data-plane split? Static stability? Event-driven with outbox? Saga? Cross-reference
patterns/INDEX.mdand assess whether each is present, partial, or absent. - Trust boundaries — where untrusted input enters; how it's validated; what crosses an authentication/authorization boundary.
For each inference, note your confidence level (high / medium / low) and the evidence that supports it (file paths, line ranges, IaC resources). Inferences with low confidence are flagged for the user.
3. Reverse-engineer the Design Document
Produce .bla/design/<service-name>/design-doc.md using the canonical template (skills/design-document/templates/design-doc-template.md), with these adjustments:
- Banner at top — must say:
> ⚠️ REVERSE-ENGINEERED — produced by brownfield-discovery from the existing codebase on <date>. Not approved by any bar raiser. Use as context for future changes, not as a historical record of decisions made. Sections marked LOW CONFIDENCE were inferred without strong evidence and should be reviewed.
- Per-section confidence: each section ends with a confidence line:
[Confidence: HIGH / MEDIUM / LOW]and one sentence on what supports the rating.
- Section 1 (Problem Statement) — likely LOW in Path A: the customer problem rarely lives in the code. Pull what you can from the README, docstrings, marketing pages if present; otherwise mark explicitly as "TO BE FILLED — customer context not inferable from code." (In Path B and C, this section is filled more completely — see Steps 7+ below.)
- Section 2 (Requirements) — MEDIUM to HIGH for non-functional requirements that show up in code (latency targets in alarms, throughput in autoscaling configs, error budgets in dashboards). Functional requirements: MEDIUM at best — list the observable behaviors the API exposes.
- Section 3 (Proposed Architecture) — HIGH confidence: this is the strongest part of reverse-engineering. Diagrams, components, data flows, storage choices.
- Section 4 (Alternatives Considered) — NOT INFERABLE. Mark as: "Not reverse-engineered — alternatives considered at original design time are not recoverable from code. Future changes should re-evaluate alternatives in context."
- Section 5 (Trade-offs) — MEDIUM: infer from architecture choices made (e.g., "this service uses DynamoDB; the implied trade-off is key-value over ad-hoc query, accepting that analytical queries require a separate path"). Flag inferred trade-offs explicitly.
- Section 6 (Cost Estimation) — MEDIUM if billing data accessible; otherwise estimate from infrastructure footprint (instance counts, storage GB, request volume from metrics). Mark assumptions.
- Section 7 (Operational Concerns) — HIGH: existing alarms, dashboards, runbooks (if present) are observable directly. List them as-is. Gaps (no alarm for X) are findings, not failures.
- Section 8 (Testing Strategy) — HIGH: what tests exist; what's missing.
The Design Doc is not pristine — it carries the project's existing debt visibly. Don't paper over gaps; surface them.
4. Reverse-engineer the API Contracts
For each API surface identified in step 2, produce the canonical contract artifact (per skills/api-contract-first/SKILL.md mapping):
- REST: if
openapi.yamlexists, link it; if not, generate one from route definitions in code (Express/Fastify routes, FastAPI decorators, Spring@RequestMapping, etc.). Save to.bla/design/<service>/openapi.yaml. - gRPC: link existing
.protofiles; if missing (rare), reconstruct from generated stubs. - GraphQL: link existing schema; if absent (rare), inspect resolvers.
- Events / async: produce an
asyncapi.yamldescribing channels (queues / topics) and operations (publish / subscribe), plus payload schemas (JSON Schema / Avro / Protobuf) inferred from event producers' code. - MCP tools: read tool definitions if exposed.
- CLI / SDK: list commands, flags, exit codes; output schemas.
Each artifact carries a header comment: # REVERSE-ENGINEERED from <source files>. Confidence: HIGH/MEDIUM/LOW. Review before relying on this for client integration.
5. Reverse-engineer the Threat Model
Produce .bla/design/<service>/threat-model.md:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/brownfield-discovery/SKILL.md
Popularity
- Repository stars
- 15
- Repository forks
- 3
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/robisson/build-like-amazon-agent-skills/brownfield-discovery)