establish-context-first
Confirm your working environment and available resources before executing task instructions to ensure accurate, informed execution.
Establish Environmental Context First
Before diving into task execution, take a moment to understand your working environment. This prevents mistakes, wasted effort, and ensures your actions align with the actual project structure.
Steps
Confirm your current working directory
- Check where you are in the file system
- Understand the project root and folder structure
Survey available files and resources
- List key files, configurations, and dependencies
- Identify project type, language, and tooling
- Note any critical files (package.json, .env, README, etc.)
Understand constraints and requirements
- Check for existing conventions or patterns
- Identify any environment-specific settings
- Note version requirements or compatibility issues
Then receive and act on instructions
- With context established, proceed with substantive tasks
- Reference specific files and structures with confidence
- Make decisions informed by actual project state
Tips
- Use
pwd, ls -la, and file exploration to build awareness quickly
- For code projects, scan package.json, requirements.txt, or similar first
- Ask clarifying questions if the environment is unclear before starting work
- This upfront investment saves debugging time later
Example
Instead of immediately editing files, first explore: "I can see this is a React project with TypeScript in /src, dependencies in package.json, and tests in __tests__. Now I'm ready to implement the feature."
1---2name: establish-context-first3description: establish-context-first4---5# establish-context-first67Confirm your working environment and available resources before executing task instructions to ensure accurate, informed execution.89## Establish Environmental Context First1011Before diving into task execution, take a moment to understand your working environment. This prevents mistakes, wasted effort, and ensures your actions align with the actual project structure.1213### Steps14151. **Confirm your current working directory**16 - Check where you are in the file system17 - Understand the project root and folder structure18192. **Survey available files and resources**20 - List key files, configurations, and dependencies21 - Identify project type, language, and tooling22 - Note any critical files (package.json, .env, README, etc.)23243. **Understand constraints and requirements**25 - Check for existing conventions or patterns26 - Identify any environment-specific settings27 - Note version requirements or compatibility issues28294. **Then receive and act on instructions**30 - With context established, proceed with substantive tasks31 - Reference specific files and structures with confidence32 - Make decisions informed by actual project state3334### Tips3536- Use `pwd`, `ls -la`, and file exploration to build awareness quickly37- For code projects, scan package.json, requirements.txt, or similar first38- Ask clarifying questions if the environment is unclear before starting work39- This upfront investment saves debugging time later4041### Example4243Instead of immediately editing files, first explore: "I can see this is a React project with TypeScript in `/src`, dependencies in `package.json`, and tests in `__tests__`. Now I'm ready to implement the feature."