$npx -y skills add aj-geddes/claude-code-bmad-skills --skill bmad-document-projectBROWNFIELD planning input. Scans an existing codebase READ-ONLY and writes project-documentation.md — ground truth for stack, structure, key flows, conventions, and integration points — so downstream BMAD planning skills start from reality. Does NOT modify code; produces only the
| 1 | # BMAD Document Project |
| 2 | |
| 3 | **BROWNFIELD entry point.** When a project already has code, planning skills need |
| 4 | ground truth — not guesses about the stack or conventions. This skill performs a |
| 5 | systematic, READ-ONLY codebase scan and emits `project-documentation.md`, the |
| 6 | authoritative current-state snapshot that every downstream BMAD planning skill loads. |
| 7 | |
| 8 | **No code is written, modified, or executed.** Allowed tools are Read, Glob, Grep, |
| 9 | Write (for the output document only), and TodoWrite (to track scan progress). |
| 10 | |
| 11 | --- |
| 12 | |
| 13 | ## Output |
| 14 | |
| 15 | `bmad-output/project-documentation.md` |
| 16 | (or the user-configured output folder — honor it) |
| 17 | |
| 18 | Load `bmad-output/project-context.md` if it exists; merge any constraints already |
| 19 | recorded there rather than rediscovering them from scratch. |
| 20 | |
| 21 | --- |
| 22 | |
| 23 | ## Three Intents |
| 24 | |
| 25 | Ask which intent applies if ambiguous; never silently regenerate an existing document. |
| 26 | |
| 27 | ### Create — initial scan |
| 28 | |
| 29 | Use TodoWrite to track the six scan passes below. Complete every pass before writing |
| 30 | the final document. |
| 31 | |
| 32 | **Pass 1 — Repository skeleton** |
| 33 | |
| 34 | ``` |
| 35 | Glob: **/* (depth ≤ 3, exclude node_modules, .git, dist, build, __pycache__, .venv) |
| 36 | Glob: *.md, *.txt, *.rst at root and docs/ |
| 37 | ``` |
| 38 | |
| 39 | Capture: directory tree shape, presence of monorepo markers (`packages/`, |
| 40 | `apps/`, `libs/`), top-level config files, documentation roots. |
| 41 | |
| 42 | **Pass 2 — Stack and toolchain** |
| 43 | |
| 44 | Read whichever of these exist (don't fail on missing files): |
| 45 | |
| 46 | | File | What to extract | |
| 47 | |------|----------------| |
| 48 | | `package.json` / `package-lock.json` | runtime + dev deps, scripts | |
| 49 | | `pyproject.toml` / `requirements*.txt` / `Pipfile` | Python stack | |
| 50 | | `go.mod` | Go module + dependencies | |
| 51 | | `Cargo.toml` | Rust crate | |
| 52 | | `pom.xml` / `build.gradle` | JVM stack | |
| 53 | | `Gemfile` | Ruby stack | |
| 54 | | `composer.json` | PHP stack | |
| 55 | | `*.csproj` / `*.sln` | .NET stack | |
| 56 | | `Dockerfile` / `docker-compose*.yml` | container strategy | |
| 57 | | `.github/workflows/*.yml` / `*.gitlab-ci.yml` / `Jenkinsfile` | CI/CD chain | |
| 58 | | `*.tf` / `*.bicep` / `*.yaml` (in infra/) | IaC / cloud provider | |
| 59 | |
| 60 | Record: primary language, frameworks, major libraries, runtime version pins, |
| 61 | test frameworks (note them — do NOT run them), build tool, package manager. |
| 62 | |
| 63 | **Pass 3 — Entry points and key flows** |
| 64 | |
| 65 | ``` |
| 66 | Grep: "main\|entrypoint\|app\.listen\|createServer\|handler\|router\|routes" |
| 67 | Grep: "export default\|module\.exports\|@app\.route\|@Controller\|@RestController" |
| 68 | ``` |
| 69 | |
| 70 | Read the top-level entry files surfaced (max 5–8 files; skim, don't exhaustively read). |
| 71 | |
| 72 | Capture: how the app starts, primary routing layer, authentication/middleware chain |
| 73 | (names only), background workers or queues detected. |
| 74 | |
| 75 | **Pass 4 — Module / domain structure** |
| 76 | |
| 77 | Read directory names and `index.*` / `__init__.*` files one level down from `src/`, |
| 78 | `app/`, `lib/`, or the equivalent. |
| 79 | |
| 80 | ``` |
| 81 | Glob: src/**/index.{ts,js,py,go,rb} |
| 82 | Glob: app/**/__init__.py |
| 83 | ``` |
| 84 | |
| 85 | Capture: module names and inferred responsibility, layer boundaries (controllers / |
| 86 | services / repositories / models / utils), shared utilities. |
| 87 | |
| 88 | **Pass 5 — Conventions and patterns** |
| 89 | |
| 90 | Sample 3–5 representative files per layer (prefer recently modified if discernible |
| 91 | from file names / path depth): |
| 92 | |
| 93 | ``` |
| 94 | Grep: "class \|interface \|type \|enum " — naming style |
| 95 | Grep: "async \|await \|Promise\|goroutine\|concurrent" — concurrency pattern |
| 96 | Grep: "import \|require\|from " — module resolution style |
| 97 | Grep: "console\.log\|logger\.\|log\." — logging approach |
| 98 | Grep: "\.env\|process\.env\|os\.environ\|config\." — config/secrets pattern |
| 99 | ``` |
| 100 | |
| 101 | Capture: naming conventions (casing style for files, classes, functions), error |
| 102 | handling style, logging approach, config/secrets management, test file location |
| 103 | convention (name only — no execution). |
| 104 | |
| 105 | **Pass 6 — Integration points** |
| 106 | |
| 107 | ``` |
| 108 | Grep: "http[s]\?://\|fetch(\|axios\.\|requests\.\|http\.Get\|RestTemplate" |
| 109 | Grep: "database\|db\.\|pool\.\|prisma\.\|mongoose\.\|sqlx\.\|gorm\." |
| 110 | Grep: "redis\|kafka\|rabbitmq\|sqs\|pubsub\|queue\|event" |
| 111 | Grep: " |