Environment Observation Skill
Objective: To gather a comprehensive understanding of the current environment. This skill goes beyond a simple ls to build a detailed picture of the system's state, which is crucial for effective diagnosis and planning.
Instructions:
When you invoke this skill, you should execute a series of commands to investigate the environment. Use your judgment to select the most relevant commands for the current task. Do not execute all of these commands blindly.
1. File System Structure:
- •List the contents of the current directory, including hidden files:
ls -la - •Recursively list the contents of the current directory:
ls -R - •Find all files of a specific type (e.g.,
.py,.js,.json):find . -type f -name "*.py" - •Display the directory structure in a tree-like format:
tree -L 2(iftreeis installed)
2. Installed Packages and Dependencies:
- •For Python projects, list installed packages:
pip listorpip freeze - •For Node.js projects, list installed packages:
npm list - •Check the contents of dependency files:
cat requirements.txt,cat package.json
3. Running Processes:
- •List all running processes:
ps aux - •Filter for specific processes (e.g.,
python,node,java):ps aux | grep python - •List running Docker containers:
docker ps -a
4. System State:
- •Check disk space usage:
df -h - •Check memory usage:
free -m - •Check network connections:
netstat -tuln
5. Key File Contents:
- •Based on the
predictive_intelligenceskill, read the contents of any identified key files.- •Example:
cat main.py,cat config.json
- •Example:
Synthesize Findings:
After running the relevant commands, create a summary of your findings. This summary should highlight any information that is particularly relevant to the current task.
Example Usage:
Task: "The Flask application in this directory is failing to start. Can you figure out why?"
Observation Process:
- •
ls -la: Look forapp.py,requirements.txt, and a.flaskenvfile. - •
cat requirements.txt: Check ifFlaskis listed as a dependency. - •
pip list | grep Flask: Verify that Flask is actually installed in the environment. - •
ps aux | grep python: Check if a Python process is already running, which might be holding a port. - •
cat app.py: Look for the host and port the application is trying to bind to.
Synthesis: "The environment contains a Flask application in app.py and a requirements.txt file. The Flask package is listed in requirements.txt but is not currently installed in the environment (output of pip list was empty). There are no other Python processes running. The first step should be to install the dependencies with pip install -r requirements.txt."