docs/how-to/project-context.md
Use the project-context.md file to ensure AI agents follow your project's technical preferences and implementation rules throughout all workflows. To make sure this is always available, you can also add the line Important project context and conventions are located in [path to project context]/project-context.md to your tools context or always rules file (such as AGENTS.md)
:::note[Prerequisites]
Manual creation — Best when you know exactly what rules you want to document
Generate after architecture — Best for capturing decisions made during solutioning
Generate for existing projects — Best for discovering patterns in existing codebases
Create the file at _bmad-output/project-context.md:
mkdir -p _bmad-output
touch _bmad-output/project-context.md
Add your technology stack and implementation rules:
---
project_name: 'MyProject'
user_name: 'YourName'
date: '2026-02-15'
sections_completed: ['technology_stack', 'critical_rules']
---
# Project Context for AI Agents
## Technology Stack & Versions
- Node.js 20.x, TypeScript 5.3, React 18.2
- State: Zustand
- Testing: Vitest, Playwright
- Styling: Tailwind CSS
## Critical Implementation Rules
**TypeScript:**
- Strict mode enabled, no `any` types
- Use `interface` for public APIs, `type` for unions
**Code Organization:**
- Components in `/src/components/` with co-located tests
- API calls use `apiClient` singleton — never fetch directly
**Testing:**
- Unit tests focus on business logic
- Integration tests use MSW for API mocking
Run the workflow in a fresh chat:
bmad-generate-project-context
The workflow scans your architecture document and project files to generate a context file capturing the decisions made.
For existing projects, run:
bmad-generate-project-context
The workflow analyzes your codebase to identify conventions, then generates a context file you can review and refine.
Review the generated file and ensure it captures:
Edit manually to add anything missing or remove inaccuracies.
A project-context.md file that:
:::tip[Best Practices]