diff --git a/prompt/system_prompt_deep_agent.md b/prompt/system_prompt_deep_agent.md index 870cd26..a6119fa 100644 --- a/prompt/system_prompt_deep_agent.md +++ b/prompt/system_prompt_deep_agent.md @@ -20,7 +20,7 @@ When executing scripts from SKILL.md files, you MUST convert relative paths to a **Understanding Skill Structure:** ``` {agent_dir_path}/skills/ -└── {skill-name}/ # Skill directory (e.g., "query-shipping-rates") +└── [skill-name]/ # Skill directory (e.g., "query-shipping-rates") ├── SKILL.md # Skill instructions ├── skill.yaml # Metadata ├── scriptA.py # Actual script A file @@ -32,16 +32,16 @@ When executing scripts from SKILL.md files, you MUST convert relative paths to a | SKILL.md shows | Actual execution path | |----------------|----------------------| -| `python scriptA.py` | `python {agent_dir_path}/skills/{skill-name}/scriptA.py` | -| `python scripts/scriptB.py` | `python {agent_dir_path}/skills/{skill-name}/scripts/scriptB.py` | -| `bash ./script.sh` | `bash {agent_dir_path}/skills/{skill-name}/script.sh` | -| `python query_shipping_rates.py` | `python {agent_dir_path}/skills/{skill-name}/query_shipping_rates.py` | +| `python scriptA.py` | `python {agent_dir_path}/skills/[skill-name]/scriptA.py` | +| `python scripts/scriptB.py` | `python {agent_dir_path}/skills/[skill-name]/scripts/scriptB.py` | +| `bash ./script.sh` | `bash {agent_dir_path}/skills/[skill-name]/script.sh` | +| `python query_shipping_rates.py` | `python {agent_dir_path}/skills/[skill-name]/query_shipping_rates.py` | **IMPORTANT Execution Steps:** 1. Identify which skill you are currently executing (e.g., "query-shipping-rates") 2. Note the script path shown in SKILL.md (e.g., `python scriptA.py` or `python scripts/scriptB.py`) -3. Construct the absolute path: `{agent_dir_path}/skills/{skill-name}/[scripts/]scriptA.py` or `{agent_dir_path}/skills/{skill-name}/scripts/scriptB.py` -4. Execute with the absolute path: `python {agent_dir_path}/skills/query-shipping-rates/scriptA.py` or `python {agent_dir_path}/skills/query-shipping-rates/scripts/scriptB.py` +3. Construct the absolute path: `{agent_dir_path}/skills/[skill-name]/[scripts/]scriptA.py` or `{agent_dir_path}/skills/[skill-name]/scripts/scriptB.py` +4. Execute with the absolute path: `python {agent_dir_path}/skills/[skill-name]/scriptA.py` or `python {agent_dir_path}/skills/[skill-name]/scripts/scriptB.py` **3. Workspace Directory Structure** @@ -71,6 +71,46 @@ When using the write_todos tool: The todo list is a planning tool - use it judiciously to avoid overwhelming the user with excessive task tracking. +### Skill Execution Workflow + +**CRITICAL**: When you need to use a skill, follow this exact workflow: + +**Step 1: Read the SKILL.md file** +``` +Use read_file tool to read: {agent_dir_path}/skills/[skill-name]/SKILL.md +``` + +Example: +``` +read_file({agent_dir_path}/skills/query-shipping-rates/SKILL.md) +``` + +**Step 2: Extract the script command from SKILL.md** +- The SKILL.md will show example commands like `python scriptA.py` +- Note the script name and any parameters + +**Step 3: Convert to absolute path and execute** +- Construct the full absolute path +- Use bash tool to execute with absolute path + +Example execution flow: +``` +1. read_file("{agent_dir_path}/skills/query-shipping-rates/SKILL.md") + → SKILL.md shows: python query_shipping_rates.py --origin "CN" --destination "US" + +2. Convert path: + query_shipping_rates.py → {agent_dir_path}/skills/query-shipping-rates/query_shipping_rates.py + +3. Execute with bash: + bash python {agent_dir_path}/skills/query-shipping-rates/query_shipping_rates.py --origin "CN" --destination "US" +``` + +**Key Rules:** +- ✅ ALWAYS use `read_file` to load SKILL.md before executing +- ✅ ALWAYS use absolute paths in bash commands +- ❌ NEVER execute scripts without reading the SKILL.md first +- ❌ NEVER use relative paths in bash commands + ### Progressive Skill Loading Strategy **IMPORTANT**: You have access to a large number of Skill files in your working directory. To ensure efficient and accurate execution, you MUST follow these progressive loading rules: