Skip to content
🤖 Consolidated, AI-optimized BMAD docs: llms-full.txt. Fetch this plain text file for complete context.

Project Context

The project-context.md file is your project’s implementation guide for AI agents. Similar to a “constitution” in other development systems, it captures the rules, patterns, and preferences that ensure consistent code generation across all workflows.

AI agents make implementation decisions constantly — which patterns to follow, how to structure code, what conventions to use. Without clear guidance, they may:

  • Follow generic best practices that don’t match your codebase
  • Make inconsistent decisions across different stories
  • Miss project-specific requirements or constraints

The project-context.md file solves this by documenting what agents need to know in a concise, LLM-optimized format.

Every implementation workflow automatically loads project-context.md if it exists. The architect workflow also loads it to respect your technical preferences when designing the architecture.

Loaded by these workflows:

  • create-architecture — respects technical preferences during solutioning
  • create-story — informs story creation with project patterns
  • dev-story — guides implementation decisions
  • code-review — validates against project standards
  • quick-dev — applies patterns when implementing tech-specs
  • sprint-planning, retrospective, correct-course — provides project-wide context

The project-context.md file is useful at any stage of a project:

ScenarioWhen to CreatePurpose
New project, before architectureManually, before create-architectureDocument your technical preferences so the architect respects them
New project, after architectureVia generate-project-context or manuallyCapture architecture decisions for implementation agents
Existing projectVia generate-project-contextDiscover existing patterns so agents follow established conventions
Quick Flow projectBefore or during quick-devEnsure quick implementation respects your patterns

The file has two main sections:

Documents the frameworks, languages, and tools your project uses with specific versions:

## Technology Stack & Versions
- Node.js 20.x, TypeScript 5.3, React 18.2
- State: Zustand (not Redux)
- Testing: Vitest, Playwright, MSW
- Styling: Tailwind CSS with custom design tokens

Documents patterns and conventions that agents might otherwise miss:

## Critical Implementation Rules
**TypeScript Configuration:**
- Strict mode enabled — no `any` types without explicit approval
- Use `interface` for public APIs, `type` for unions/intersections
**Code Organization:**
- Components in `/src/components/` with co-located `.test.tsx`
- Utilities in `/src/lib/` for reusable pure functions
- API calls use the `apiClient` singleton — never fetch directly
**Testing Patterns:**
- Unit tests focus on business logic, not implementation details
- Integration tests use MSW to mock API responses
- E2E tests cover critical user journeys only
**Framework-Specific:**
- All async operations use the `handleError` wrapper for consistent error handling
- Feature flags accessed via `featureFlag()` from `@/lib/flags`
- New routes follow the file-based routing pattern in `/src/app/`

Focus on what’s unobvious — things agents might not infer from reading code snippets. Don’t document standard practices that apply universally.

You have three options:

Create the file at _bmad-output/project-context.md and add your rules:

Terminal window
# In your project root
mkdir -p _bmad-output
touch _bmad-output/project-context.md

Edit it with your technology stack and implementation rules. The architect and implementation workflows will automatically find and load it.

Run the generate-project-context workflow after completing your architecture:

Terminal window
/bmad-bmm-generate-project-context

This scans your architecture document and project files to generate a context file capturing the decisions made.

For existing projects, run generate-project-context to discover existing patterns:

Terminal window
/bmad-bmm-generate-project-context

The workflow analyzes your codebase to identify conventions, then generates a context file you can review and refine.

Without project-context.md, agents make assumptions that may not match your project:

Without ContextWith Context
Uses generic patternsFollows your established conventions
Inconsistent style across storiesConsistent implementation
May miss project-specific constraintsRespects all technical requirements
Each agent decides independentlyAll agents align with same rules

This is especially important for:

  • Quick Flow — skips PRD and architecture, so context file fills the gap
  • Team projects — ensures all agents follow the same standards
  • Existing projects — prevents breaking established patterns

The project-context.md file is a living document. Update it when:

  • Architecture decisions change
  • New conventions are established
  • Patterns evolve during implementation
  • You identify gaps from agent behavior

You can edit it manually at any time, or re-run generate-project-context to update it after significant changes.