Context-first project planning toolkit for humans and AI coding agents.
Install · Context-first flow · Commands · Project types · Examples
BeforeCode creates a planning workspace that captures the real idea first, asks for missing context, and then generates build-ready Markdown documentation.
| Without BeforeCode | With BeforeCode |
|---|---|
| Generic docs | Context-aware docs |
| Missing decisions hidden | Missing decisions become open questions |
| PRD, TRD, QA drift apart | Docs share one source of truth |
| Build starts before scope is clear | Build starts from reviewed context |
Recommended project setup:
npm install --save-dev beforecode
npx beforecode startUse without installing:
npx beforecode startUse a prepared idea file:
npx beforecode start --from idea.mdAdvanced quick-template mode:
npx beforecode init --type saas --name "My App"beforecode start captures your idea, target users, problem, MVP scope, out-of-scope items, technical preferences, and build mode before creating docs.
flowchart TD
Context[00 Project Context] --> Questions[01 Open Questions]
Context --> Brief[Project Brief]
Questions --> PRD[PRD / SRS]
Brief --> PRD
PRD --> UX[UX Flows]
PRD --> Access[Permission Matrix]
PRD --> TRD[Technical Requirements]
UX --> TRD
Access --> TRD
TRD --> DB[Database Schema]
TRD --> API[API Documentation]
DB --> API
PRD --> QA[QA Test Plan]
API --> QA
QA --> Plan[Implementation Plan]
npx beforecode start
npx beforecode check
npx beforecode score
npx beforecode doctor
npx beforecode handoff --name "My App"Generated structure:
your-project/
├── .beforecoderc.json
└── docs/
├── 00-project-context.md
├── 01-open-questions.md
├── 03-project-brief.md
├── 04-research-report.md
├── 05-prd.md
├── 06-ux-flows.md
├── 07-trd.md
└── ...
| Command | Description |
|---|---|
beforecode start |
Capture project context first, then generate docs |
beforecode start --from idea.md |
Generate docs from an idea/context file |
beforecode init --type <type> |
Advanced quick-template mode |
beforecode add <template> |
Add a single template |
beforecode check |
Check which docs exist |
beforecode score |
Show readiness by category |
beforecode doctor |
Audit missing docs, shallow docs, config, and handoff readiness |
beforecode handoff |
Generate AGENTS.md and AI handoff docs |
beforecode list |
Show project types and templates |
| Type | Best for |
|---|---|
small |
Prototype or small app |
portfolio |
Portfolio or personal website |
saas |
Multi-user SaaS product |
crm |
CRM, ERP, or operations system |
ecommerce |
Store or marketplace |
mobile |
Mobile application |
ai-agent |
Tool-using or autonomous AI agent |
opensource |
Public library, CLI, or developer tool |
- Existing files are not overwritten unless
--forceis passed. --dry-runpreviews generated files without writing.- Missing context is written as
TBDinstead of being invented. .beforecoderc.jsonsaves project settings for future commands.
- Examples gallery
- SaaS CRM Pro reference pack
- AI Video Editor reference pack
- Browser QA Agent reference pack
- Example quality standard
- CLI usage guide
- Release runbook
- Reference material
- Node.js 18 or later
BeforeCode helps teams start with clarity before opening the editor.