src/bmm-skills/3-solutioning/bmad-generate-project-context/steps/step-01-discover.md
{communication_language}Discover the project's technology stack, existing patterns, and critical implementation rules that AI agents must follow when writing code.
First, check if project context already exists:
{project_knowledge}/project-context.md or {project-root}/**/project-context.mdLoad and analyze project files to identify technologies:
Architecture Document:
{planning_artifacts}/architecture.mdPackage Files:
package.json, requirements.txt, Cargo.toml, etc.Configuration Files:
tsconfig.json)Search through existing codebase for patterns:
Naming Conventions:
Code Organization:
Documentation Patterns:
Look for rules that AI agents might miss:
Language-Specific Rules:
Framework-Specific Rules:
Testing Rules:
Development Workflow Rules:
Based on discovery, create or update the context document:
Copy template from ../project-context-template.md to {output_folder}/project-context.md
Initialize frontmatter fields.
Load existing context and prepare for updates
Set frontmatter sections_completed to track what will be updated
Report findings to user:
"Welcome {{user_name}}! I've analyzed your project for {{project_name}} to discover the context that AI agents need.
Technology Stack Discovered: {{list_of_technologies_with_versions}}
Existing Patterns Found:
Key Areas for Context Rules:
{if_existing_context} Existing Context: Found {{sections}} sections already defined. We can update or add to these. {/if_existing_context}
Ready to create/update your project context. This will help AI agents implement code consistently with your project's standards.
[C] Continue to context generation"
HALT ā wait for user selection before proceeding.
ā Existing project context properly detected and handled ā Technology stack accurately identified with versions ā Critical implementation patterns discovered ā Project context document properly initialized ā Discovery findings clearly presented to user ā User ready to proceed with context generation
ā Not checking for existing project context before creating new one ā Missing critical technology versions or configurations ā Overlooking important coding patterns or conventions ā Not initializing frontmatter properly ā Not presenting clear discovery summary to user
After user selects [C] to continue, load ./step-02-generate.md to collaboratively generate the specific project context rules.
Remember: Do NOT proceed to step-02 until user explicitly selects [C] from the menu and discovery is confirmed and the initial file has been written as directed in this discovery step!