Project Documentation — {{PROJECT_NAME}}
BROWNFIELD ground truth. Generated by the BMAD
bmad-document-projectskill via READ-ONLY codebase scan. This document feeds BMAD planning skills (PRD, architecture, tech-spec, project-context) so they start from reality. Do not hand-edit without noting changes; run an Update scan to keep it current.
- Scan date: {{SCAN_DATE}}
- Codebase root: {{CODEBASE_ROOT}}
- BMAD track (if initialized): {{BMAD_TRACK}}
1. Repository Structure
Layout
{{DIRECTORY_TREE}}Depth-3 snapshot; node_modules, .git, dist, build, and cache directories excluded.
Monorepo / Workspace Signals
{{MONOREPO_SIGNALS}}
<!-- not detected | mono-repo with packages/ | turborepo | nx workspace | lerna | pnpm workspaces | go workspace | ... -->Documentation Roots
{{DOC_ROOTS}}
<!-- paths to README, docs/, wiki/, ADR directories -->2. Stack and Toolchain
Primary Language(s) and Runtime
| Language | Version | Evidence File |
|---|---|---|
| {{LANG_1}} | {{LANG_1_VERSION}} | {{LANG_1_EVIDENCE}} |
| {{LANG_2}} | {{LANG_2_VERSION}} | {{LANG_2_EVIDENCE}} |
Framework(s)
| Framework | Version | Role |
|---|---|---|
| {{FRAMEWORK_1}} | {{FRAMEWORK_1_VERSION}} | {{FRAMEWORK_1_ROLE}} |
| {{FRAMEWORK_2}} | {{FRAMEWORK_2_VERSION}} | {{FRAMEWORK_2_ROLE}} |
Key Dependencies
Runtime:
{{RUNTIME_DEPS}}
<!-- bullet list: library name, version, purpose -->Build / Dev toolchain:
{{BUILD_DEPS}}
<!-- package manager, bundler, transpiler, linter, formatter -->Test Framework(s)
{{TEST_FRAMEWORKS}}
<!-- name and version only — these are NOTED, not executed -->Container / Infrastructure
{{INFRA_SUMMARY}}
<!-- Dockerfile base image, docker-compose services, IaC provider, CI/CD platform -->3. Entry Points and Key Flows
Application Bootstrap
| Entry File | Role |
|---|---|
| {{ENTRY_1}} | {{ENTRY_1_ROLE}} |
| {{ENTRY_2}} | {{ENTRY_2_ROLE}} |
Primary Routing Layer
{{ROUTING_SUMMARY}}
<!-- Router name, route file locations, top-level route groups detected -->Authentication / Middleware Chain
{{AUTH_MIDDLEWARE}}
<!-- Middleware names in order (e.g. cors → auth → rateLimit → router). Names only. -->Background Workers / Queues
{{BACKGROUND_WORKERS}}
<!-- Job names, scheduler type, queue consumers detected. Write "None detected." if absent. -->4. Module and Domain Structure
Layer Breakdown
| Layer / Module | Path(s) | Inferred Responsibility |
|---|---|---|
| {{MODULE_1}} | {{MODULE_1_PATH}} | {{MODULE_1_RESP}} |
| {{MODULE_2}} | {{MODULE_2_PATH}} | {{MODULE_2_RESP}} |
| {{MODULE_3}} | {{MODULE_3_PATH}} | {{MODULE_3_RESP}} |
| {{MODULE_4}} | {{MODULE_4_PATH}} | {{MODULE_4_RESP}} |
| {{MODULE_5}} | {{MODULE_5_PATH}} | {{MODULE_5_RESP}} |
Cross-Cutting Utilities
{{SHARED_UTILS}}
<!-- paths and inferred roles for shared helpers, constants, types, middleware -->Notable Domain Concepts (from naming)
{{DOMAIN_CONCEPTS}}
<!-- Entity names, aggregate names, or domain language detected in file/class names -->5. Conventions and Patterns
Naming Conventions
| Artifact | Convention | Example |
|---|---|---|
| Files | {{FILE_NAMING}} | {{FILE_NAMING_EX}} |
| Classes / Types | {{CLASS_NAMING}} | {{CLASS_NAMING_EX}} |
| Functions | {{FN_NAMING}} | {{FN_NAMING_EX}} |
| Constants | {{CONST_NAMING}} | {{CONST_NAMING_EX}} |
Module Resolution
{{MODULE_RESOLUTION}}
<!-- ESM import / CommonJS require / path aliases / barrel exports detected -->Concurrency Model
{{CONCURRENCY_MODEL}}
<!-- async/await, Promises, goroutines, threads, none detected -->Error Handling Style
{{ERROR_HANDLING}}
<!-- throw/catch, Result types, error middleware, panic/recover, custom error classes -->Logging Approach
{{LOGGING}}
<!-- library name (winston, pino, zap, logrus, structlog …), log levels used, log targets -->Configuration and Secrets
{{CONFIG_PATTERN}}
<!-- .env files, env vars, config library, secrets manager detected -->Test File Location Convention
{{TEST_CONVENTION}}
<!-- __tests__/, *.test.ts, *_test.go, spec/ — location and naming pattern -->6. Integration Points
External HTTP APIs
| Service / Domain | Direction | Notes |
|---|---|---|
| {{EXT_API_1}} | {{EXT_API_1_DIR}} | {{EXT_API_1_NOTES}} |
| {{EXT_API_2}} | {{EXT_API_2_DIR}} | {{EXT_API_2_NOTES}} |
Direction: inbound (called by external parties) | outbound (we call them) | both.
Database(s)
| Database | Type | ORM / Driver | Connection Pattern |
|---|---|---|---|
| {{DB_1}} | {{DB_1_TYPE}} | {{DB_1_ORM}} | {{DB_1_CONN}} |
| {{DB_2}} | {{DB_2_TYPE}} | {{DB_2_ORM}} | {{DB_2_CONN}} |
Message Queues / Event Buses
{{QUEUES}}
<!-- Queue type (Kafka, SQS, Redis Streams, RabbitMQ…), topic/queue names detected, pub/sub roles. Write "None detected." if absent. -->Object / File Storage
{{OBJECT_STORAGE}}
<!-- Provider, bucket/container naming pattern, SDK used. Write "None detected." if absent. -->Third-Party Services
| Service | Category | SDK / Client |
|---|---|---|
| {{SVC_1}} | {{SVC_1_CAT}} | {{SVC_1_SDK}} |
| {{SVC_2}} | {{SVC_2_CAT}} | {{SVC_2_SDK}} |
Categories: auth provider, payment, email/SMS, monitoring, analytics, CDN, search.
7. Planning Notes
Observations from the scan that are relevant to planning but require a decision. These are NOT implementation tasks — they are inputs for the PRD and architecture skills.
{{PLANNING_NOTES}}
<!-- Examples: - "No migrations folder detected; schema management approach unknown — clarify before architecture." - "Three separate HTTP clients used for external APIs; consolidation may be worth an ADR." - "Auth middleware detected but no role/permission model visible at this scan depth." -->8. Open Questions
Questions the scan raised that cannot be answered from static analysis. Resolve these before starting PRD or architecture work.
- {{OPEN_Q_1}}
- {{OPEN_Q_2}}
- {{OPEN_Q_3}}
9. Document History
| Date | Author | Change |
|---|---|---|
| {{SCAN_DATE}} | BMAD bmad-document-project | Initial scan |
BMAD Planning & Orchestrator · Document Project · tracks bmad-document-project from the BMAD Method by the BMAD Code Organization (https://github.com/bmad-code-org/BMAD-METHOD)