[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M752N8138KWQKBHK85BTJ3F4":3,"skill-same:01M752N8138KWQKBHK85BTJ3F4":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M752N8138KWQKBHK85BTJ3F4","meta-tools-lifecycle",null,"Master the complete tool lifecycle workflow: create, validate, approve, reload, and use. Agents learn to autonomously orchestrate tool creation with policy validation and human approval.","review-bench\u002Ftallclub_matimo","review-bench","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F286778065?v=4","01M7517F9NTEPDZDAXJBR30FWT","ReviewBench","01M752MJ9AMPM35VHCA4HV09DY",0,"MIT","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo\u002Fblob\u002Fmain\u002Ftypescript\u002Fpackages\u002Fcore\u002Fskills\u002Fmeta-tools-lifecycle\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: meta-tools-lifecycle\ndescription: \"Master the complete tool lifecycle workflow: create, validate, approve, reload, and use. Agents learn to autonomously orchestrate tool creation with policy validation and human approval.\"\nmetadata:\n  category: \"Tool Lifecycle\"\n  difficulty: \"advanced\"\n  apply-to: \"matimo_create_tool matimo_validate_tool matimo_doctor matimo_review matimo_reload_tools matimo_list_user_tools\"\n---\n\n# Meta-Tools Lifecycle: Complete Workflow\n\nThis skill teaches you how to autonomously orchestrate Matimo's **complete tool lifecycle**—from conception through validation, human approval, registration, and delivery. This is the workflow for agents that **create tools dynamically**.\n\n## The Complete Tool Lifecycle\n\n```\n1. Understand Requirements\n   ↓\n2. Design YAML (matimo_validate_tool or matimo_doctor for validation)\n   ↓\n3. Create on Disk (matimo_create_tool)\n   ↓\n4. Request Human Approval (matimo_review)\n   ↓\n5. Reload Registry (matimo_reload_tools)\n   ↓\n6. Execute the Tool\n   ↓\n7. List & Manage (matimo_list_user_tools)\n```\n\n## Step 1: Understand Requirements\n\nBefore writing YAML, clarify:\n\n**What does the tool need to do?**\n- Read-only (GET) vs. modify data (POST\u002FPUT\u002FDELETE)\n- Which API endpoint(s) to call\n- What inputs does it need (parameters)\n- What output should it return\n\n**What domain?**\n- Public API (GitHub, weather, etc.)\n- Internal service\n- File system operation\n- Something else\n\n**Is it safe?**\n- Uses whitelisted domains only\n- Uses safe HTTP methods (GET\u002FPOST preferred)\n- No SSRF attacks (no internal IPs)\n- No arbitrary code execution\n\n## Step 2: Design YAML with Validation\n\n### Generate Complete YAML First\n\n**REQUIRED fields (all must be present):**\n\n```yaml\nname: tool_name                          # snake_case, unique identifier\nversion: \"1.0.0\"                         # semantic version (required string)\ndescription: \"What this tool does\"       # clear one-liner\n\nparameters:                              # even if empty, must be present\n  param_name:\n    type: string                         # string, number, boolean, array, object\n    required: true                       # boolean (required\u002Foptional)\n    description: \"What it does\"\n\nexecution:                               # must match: http, command, or function\n  type: http                             # exact type string\n  method: GET                            # if http: GET, POST, PUT, DELETE, PATCH\n  url: \"https:\u002F\u002Fapi.example.com\u002Fendpoint\"  # if http: full URL\n  # For type: command, provide: command, args\n  # For type: function, provide: handler, code\n```\n\n**Example: Minimal Valid Tool**\n\n```yaml\nname: weather_lookup\nversion: \"1.0.0\"\ndescription: Get current weather for a city\nparameters:\n  city:\n    type: string\n    required: true\n    description: City name (e.g., \"New York\")\nexecution:\n  type: http\n  method: GET\n  url: \"https:\u002F\u002Fapi.weatherapi.com\u002Fcurrent?q={city}\"\n```\n\n### Validate Before Creating\n\n**Always call matimo_doctor BEFORE matimo_create_tool:**\n\n```\nInput:  matimo_doctor(yaml_content: \"\u003Cyour complete YAML>\")\nOutput: { valid: true, ... }  ✅ Safe to create\n  OR:   { valid: false, schemaErrors: [...], policyErrors: [...] }  ❌ Fix first\n```\n\n**If validation fails:**\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `version: Invalid input, expected string` | Missing\u002Fwrong type | Add `version: \"1.0.0\"` |\n| `execution: Invalid input, expected object` | Missing section | Add complete `execution` block |\n| `execution.method: Invalid option` | Wrong HTTP verb | Use GET, POST, PUT, DELETE, or PATCH |\n| `parameters: Invalid input, expected object` | Missing field | Add `parameters: {}` or with actual params |\n| `Command tools are blocked (policy)` | Trying to use `type: command` | Use HTTP GET\u002FPOST instead |\n| `SSRF detected: forbidden IP range` | Using internal IP (169.254.*, 10.*) | Use public APIs |\n| `Reserved namespace violation: matimo_*` | Name starts with `matimo_` | Choose different name |\n\n**If policy blocks your tool:**\n- **Understand why**: Read the rule that blocked it\n- **Redesign**: Use an allowed API or method\n- **Re-validate**: Check with matimo_doctor again until `valid: true`\n\n**Example: Fixing Validation Errors**\n\n```\nWRONG:\nname: weather_fetch\n# Missing version ❌\n\nVALIDATED:\nname: weather_fetch\nversion: \"1.0.0\"\ndescription: Get weather\nparameters: {}\nexecution:\n  type: http\n  method: GET\n  url: \"https:\u002F\u002Fapi.weatherapi.com\u002Fv1\u002Fcurrent.json\"\n```\n\n## Step 3: Create Tool on Disk\n\nOnce `matimo_doctor` returns `valid: true`:\n\n```\nCall matimo_create_tool with:\n  - name: \"tool_name\"\n  - yaml_content: \"\u003Ccomplete YAML string>\"\n  - target_dir: \"\u003Cdirectory path provided by user>\"\n\nExpected response:\n{\n  \"success\": true,\n  \"path\": \"\u002Fpath\u002Fto\u002Ftool_name\u002Fdefinition.yaml\",\n  \"status\": \"draft\",\n  \"approvalState\": \"pending\",\n  \"message\": \"Tool created as draft. Requires approval before execution...\"\n}\n```\n\n**What happens:**\n1. ✅ Tool YAML written to disk: `{target_dir}\u002Ftool_name\u002Fdefinition.yaml`\n2. ✅ Tool status set to `draft` (not yet approved)\n3. ✅ Approval state marked `pending` (waiting for human)\n4. ⏸️ Tool NOT yet executable (needs approval)\n\n**Common responses:**\n\n| Response | Meaning | Next Step |\n|----------|---------|-----------|\n| `success: true, approvalState: \"pending\"` | Draft created, awaiting approval | Call matimo_review |\n| `success: true, approvalState: \"auto-approved\"` | Low-risk tool, ready to use | Call matimo_reload_tools |\n| `success: false, message: \"...\"` | Creation failed (invalid YAML) | Call matimo_doctor again, fix errors, retry |\n\n## Step 4: Request Human Approval\n\n**Critical:** Tools created by agents are `untrusted` and require human approval:\n\n```\nCall matimo_review with:\n  - toolName: \"weather_fetch\"\n  - target_dir: \"\u003Csame directory>\"\n\nExpected response (if human approves):\n{\n  \"approved\": true,\n  \"message\": \"Tool approved for production.\"\n}\n\nExpected response (if human rejects):\n{\n  \"approved\": false,\n  \"message\": \"Tool rejected.\"\n  \u002F\u002F Tool remains draft, NOT executable\n}\n```\n\n**What the human sees:**\n- Tool name and description\n- Parameters and their types\n- Execution method (HTTP GET, etc.)\n- Proposed by agent, security reviewed\n- **Decision:** Approve (y) or reject (n)\n\n**If rejected:**\n- ❌ Tool remains in `draft` status\n- ❌ Cannot execute or reload\n- 💡 Understand why human rejected, redesign, and re-submit\n\n**If approved:**\n- ✅ Tool marked as `approved` status\n- ✅ HMAC signature created (tamper detection)\n- ✅ Ready for reload\n\n## Step 5: Reload Registry\n\nAfter human approval, the tool registry must be refreshed:\n\n```\nCall matimo_reload_tools with:\n  - target_dir: \"\u003Csame directory>\"\n\nExpected response:\n{\n  \"loaded\": [\"weather_fetch\", \"...\"],\n  \"approved\": [\"weather_fetch\"],\n  \"rejected\": [],\n  \"message\": \"Reloaded X tools...\"\n}\n```\n\n**What happens:**\n1. 🔄 System re-scans all tool directories\n2. ✅ Approved tools become executable\n3. ❌ Rejected tools are skipped\n4. 📝 Registry updated in-memory\n\n**After reload:**\n- Tool is **discoverable** by agents\n- Tool can be **called** via matimo.execute()\n- Tool appears in **LLM tool bindings** (if using LangChain)\n\n## Step 6: Execute the Tool\n\nOnce reloaded, the agent can call the tool naturally:\n\n```\nFor HTTP tool:\n  Input:  { city: \"New York\" }\n  Action: matimo.execute(\"weather_fetch\", { city: \"New York\" })\n  Output: { success: true, weather: { ... } }\n\nFor created tool with requires_approval: true:\n  First call prompts human: \"Approve execution of weather_fetch?\"\n  On approval: Tool executes\n  On rejection: Tool blocked\n```\n\n**Agent-created tools with requires_approval:**\n- ✅ Can be created\n- ✅ Can be approved for production\n- ✅ Still require human approval on **first execution** (extra safety)\n- ✅ After human approves once, auto-approved in session\n\n## Step 7: List and Manage Tools\n\nDiscover what tools have been created:\n\n```\nCall matimo_list_user_tools with:\n  - target_dir: \"\u003Csame directory>\"\n\nExpected response:\n{\n  \"tools\": [\n    {\n      \"name\": \"weather_fetch\",\n      \"status\": \"approved\",\n      \"riskLevel\": \"LOW\",\n      \"description\": \"Get weather for a city\"\n    },\n    {\n      \"name\": \"file_reader\",\n      \"status\": \"rejected\",\n      \"reason\": \"Command tools are blocked\"\n    }\n  ]\n}\n```\n\n**What you learn:**\n- ✅ `weather_fetch` is ready to use (approved)\n- ❌ `file_reader` failed policy (rejected)\n- 📊 Risk levels guide execution safety\n\n---\n\n## Common Patterns\n\n### Pattern 1: Safe HTTP GET Tool\n\n```yaml\nname: github_user_lookup\nversion: \"1.0.0\"\ndescription: Look up a GitHub user's profile\nparameters:\n  username:\n    type: string\n    required: true\n    description: GitHub username (e.g., \"octocat\")\nexecution:\n  type: http\n  method: GET\n  url: \"https:\u002F\u002Fapi.github.com\u002Fusers\u002F{username}\"\n```\n\n→ **Result**: Auto-approved (low-risk read-only), no human approval needed\n\n---\n\n### Pattern 2: Safe HTTP POST Tool\n\n```yaml\nname: todo_create\nversion: \"1.0.0\"\ndescription: Create a new todo item\nparameters:\n  title:\n    type: string\n    required: true\n  completed:\n    type: boolean\n    required: false\nexecution:\n  type: http\n  method: POST\n  url: \"https:\u002F\u002Fjsonplaceholder.typicode.com\u002Ftodos\"\n```\n\n→ **Result**: Pending approval, human reviews then approves\n\n---\n\n### Pattern 3: Blocked Command Tool\n\n```yaml\nname: shell_exec\nversion: \"1.0.0\"\ndescription: Execute shell commands\nparameters:\n  cmd:\n    type: string\n    required: true\nexecution:\n  type: command\n  command: bash\n  args: [\"-c\", \"{cmd}\"]\n```\n\n→ **Result**: `matimo_doctor` blocks immediately with \"Command tools are blocked (policy)\"\n\n**What agent learns:** \"I can't create shell commands; use HTTP instead\"\n\n---\n\n### Pattern 4: Policy Violation - SSRF\n\n```yaml\nname: metadata_probe\nversion: \"1.0.0\"\nexecution:\n  type: http\n  method: GET\n  url: \"http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F\"  # AWS EC2 metadata ❌\n```\n\n→ **Result**: `matimo_doctor` blocks with \"SSRF detected: forbidden IP range 169.254.*\"\n\n**What agent learns:** \"Can't probe internal IPs; they're blocked\"\n\n---\n\n### Pattern 5: Namespace Hijack (Rejected)\n\n```yaml\nname: matimo_backdoor  # WRONG: Reserved namespace ❌\n```\n\n→ **Result**: `matimo_doctor` blocks with \"Reserved namespace violation: matimo_* is protected\"\n\n**What agent learns:** \"Can't use matimo_* names; they're reserved for built-ins\"\n\n---\n\n## Workflow Decision Tree\n\n**Should I create this tool?**\n\n```\nDoes it solve the user's goal? → YES → Proceed\n  ↓\nIs it safe (policy passes)?\n  ├─ YES → Create (agent-created tools always pending approval)\n  │  └─→ matimo_doctor → matimo_create_tool → matimo_review\n  │     → matimo_reload_tools → Execute\n  │\n  └─ NO → Understand policy error\n     → Redesign to comply (different API, different method)\n     → Re-validate with matimo_doctor\n     → When valid, create\n```\n\n**If human rejects approval:**\n\n```\nWhy did they reject?\n  ├─ Security concern → Redesign differently\n  ├─ Governance concern → Ask for clarification\n  ├─ Not needed → Mark complete, try different approach\n  └─ Technical issue → Fix and re-submit\n```\n\n**If policy blocks:**\n\n```\nWhich rule blocked it?\n  ├─ Command blocked → Use HTTP instead\n  ├─ SSRF detected → Use public API, not internal IP\n  ├─ Namespace reserved → Rename without matimo_ prefix\n  ├─ Domain blocked → Check allowed-domains policy\n  └─ Other → Read error, understand constraint, redesign\n```\n\n---\n\n## Debugging & Troubleshooting\n\n### Symptom: matimo_doctor returns validation errors\n\n```\nField: \"execution.method\"\nMessage: \"Invalid option: expected one of GET|POST|PUT|DELETE|PATCH\"\n```\n\n**Fix:**\n1. Read error: method was `PATCH` when `execution.type: http` expects GET\u002FPOST\u002FPUT\u002FDELETE\u002FPATCH\n2. Check YAML: wrong value or syntax\n3. Correct: `method: POST` (exact casing)\n4. Re-validate with matimo_doctor\n\n### Symptom: matimo_create_tool returns \"success: false\"\n\n```\nMessage: \"Schema validation failed: Tool schema validation failed:\n  • version: Invalid input: expected string, received undefined\"\n```\n\n**Fix:**\n1. YAML is missing `version` field\n2. Add: `version: \"1.0.0\"`\n3. Call matimo_doctor to verify\n4. Then matimo_create_tool\n\n### Symptom: matimo_review asks for approval but tool is `auto-approved`\n\n```\nExpected: Tool should be executable immediately\nActual: Human still asked to approve\n```\n\n**Fix:**\n- Low-risk tools (GET-only to public APIs) are `auto-approved`\n- Other tools are `pending` and require human approval\n- This is correct behavior for agent-created tools\n- Call matimo_reload_tools after approval\n\n### Symptom: Tool not in registry after matimo_reload_tools\n\n```\nExpected: \"weather_fetch\" in matimo_list_user_tools()\nActual: Not in list\n```\n\n**Fix:**\n1. Did matimo_review succeed? (Check for `approved: true`)\n2. Did matimo_reload_tools complete? (Check response)\n3. Call matimo_list_user_tools() to verify\n4. If still missing, re-run matimo_reload_tools\n\n---\n\n## Key Principles\n\n1. ✅ **Always validate before creating** — matimo_doctor catches errors early\n2. ✅ **Accept human feedback** — If rejected, learn why and redesign\n3. ✅ **Respect policy** — It's there to prevent attacks; work within it\n4. ✅ **Reload after approval** — Tools don't appear until registry is refreshed\n5. ✅ **Complete YAML is critical** — Missing `version` or `execution` = failure\n6. ✅ **Name tools for discovery** — Clear names help humans understand what they're approving\n\n---\n\n## References\n\n- **Complete tool creation spec**: See `tool-creation` skill\n- **Policy validation rules**: See `policy-validation` skill\n- **Tool discovery**: See `tool-discovery` skill\n- **Matimo Architecture**: See copilot-instructions.md\n\n---\n\n**Last Updated:** March 2026  \n**Status:** Complete  \n**Level:** Advanced (assumes familiarity with tool-creation skill)\n","# Meta-Tools Lifecycle: Complete Workflow\n\nThis skill teaches you how to autonomously orchestrate Matimo's **complete tool lifecycle**—from conception through validation, human approval, registration, and delivery. This is the workflow for agents that **create tools dynamically**.\n\n## The Complete Tool Lifecycle\n\n```\n1. Understand Requirements\n   ↓\n2. Design YAML (matimo_validate_tool or matimo_doctor for validation)\n   ↓\n3. Create on Disk (matimo_create_tool)\n   ↓\n4. Request Human Approval (matimo_review)\n   ↓\n5. Reload Registry (matimo_reload_tools)\n   ↓\n6. Execute the Tool\n   ↓\n7. List & Manage (matimo_list_user_tools)\n```\n\n## Step 1: Understand Requirements\n\nBefore writing YAML, clarify:\n\n**What does the tool need to do?**\n- Read-only (GET) vs. modify data (POST\u002FPUT\u002FDELETE)\n- Which API endpoint(s) to call\n- What inputs does it need (parameters)\n- What output should it return\n\n**What domain?**\n- Public API (GitHub, weather, etc.)\n- Internal service\n- File system operation\n- Something else\n\n**Is it safe?**\n- Uses whitelisted domains only\n- Uses safe HTTP methods (GET\u002FPOST preferred)\n- No SSRF attacks (no internal IPs)\n- No arbitrary code execution\n\n## Step 2: Design YAML with Validation\n\n### Generate Complete YAML First\n\n**REQUIRED fields (all must be present):**\n\n```yaml\nname: tool_name                          # snake_case, unique identifier\nversion: \"1.0.0\"                         # semantic version (required string)\ndescription: \"What this tool does\"       # clear one-liner\n\nparameters:                              # even if empty, must be present\n  param_name:\n    type: string                         # string, number, boolean, array, object\n    required: true                       # boolean (required\u002Foptional)\n    description: \"What it does\"\n\nexecution:                               # must match: http, command, or function\n  type: http                             # exact type string\n  method: GET                            # if http: GET, POST, PUT, DELETE, PATCH\n  url: \"https:\u002F\u002Fapi.example.com\u002Fendpoint\"  # if http: full URL\n  # For type: command, provide: command, args\n  # For type: function, provide: handler, code\n```\n\n**Example: Minimal Valid Tool**\n\n```yaml\nname: weather_lookup\nversion: \"1.0.0\"\ndescription: Get current weather for a city\nparameters:\n  city:\n    type: string\n    required: true\n    description: City name (e.g., \"New York\")\nexecution:\n  type: http\n  method: GET\n  url: \"https:\u002F\u002Fapi.weatherapi.com\u002Fcurrent?q={city}\"\n```\n\n### Validate Before Creating\n\n**Always call matimo_doctor BEFORE matimo_create_tool:**\n\n```\nInput:  matimo_doctor(yaml_content: \"\u003Cyour complete YAML>\")\nOutput: { valid: true, ... }  ✅ Safe to create\n  OR:   { valid: false, schemaErrors: [...], policyErrors: [...] }  ❌ Fix first\n```\n\n**If validation fails:**\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `version: Invalid input, expected string` | Missing\u002Fwrong type | Add `version: \"1.0.0\"` |\n| `execution: Invalid input, expected object` | Missing section | Add complete `execution` block |\n| `execution.method: Invalid option` | Wrong HTTP verb | Use GET, POST, PUT, DELETE, or PATCH |\n| `parameters: Invalid input, expected object` | Missing field | Add `parameters: {}` or with actual params |\n| `Command tools are blocked (policy)` | Trying to use `type: command` | Use HTTP GET\u002FPOST instead |\n| `SSRF detected: forbidden IP range` | Using internal IP (169.254.*, 10.*) | Use public APIs |\n| `Reserved namespace violation: matimo_*` | Name starts with `matimo_` | Choose different name |\n\n**If policy blocks your tool:**\n- **Understand why**: Read the rule that blocked it\n- **Redesign**: Use an allowed API or method\n- **Re-validate**: Check with matimo_doctor again until `valid: true`\n\n**Example: Fixing Validation Errors**\n\n```\nWRONG:\nname: weather_fetch\n# Missing version ❌\n\nVALIDATED:\nname: weather_fetch\nversion: \"1.0.0\"\ndescription: Get weather\nparameters: {}\nexecution:\n  type: http\n  method: GET\n  url: \"https:\u002F\u002Fapi.weatherapi.com\u002Fv1\u002Fcurrent.json\"\n```\n\n## Step 3: Create Tool on Disk\n\nOnce `matimo_doctor` returns `valid: true`:\n\n```\nCall matimo_create_tool with:\n  - name: \"tool_name\"\n  - yaml_content: \"\u003Ccomplete YAML string>\"\n  - target_dir: \"\u003Cdirectory path provided by user>\"\n\nExpected response:\n{\n  \"success\": true,\n  \"path\": \"\u002Fpath\u002Fto\u002Ftool_name\u002Fdefinition.yaml\",\n  \"status\": \"draft\",\n  \"approvalState\": \"pending\",\n  \"message\": \"Tool created as draft. Requires approval before execution...\"\n}\n```\n\n**What happens:**\n1. ✅ Tool YAML written to disk: `{target_dir}\u002Ftool_name\u002Fdefinition.yaml`\n2. ✅ Tool status set to `draft` (not yet approved)\n3. ✅ Approval state marked `pending` (waiting for human)\n4. ⏸️ Tool NOT yet executable (needs approval)\n\n**Common responses:**\n\n| Response | Meaning | Next Step |\n|----------|---------|-----------|\n| `success: true, approvalState: \"pending\"` | Draft created, awaiting approval | Call matimo_review |\n| `success: true, approvalState: \"auto-approved\"` | Low-risk tool, ready to use | Call matimo_reload_tools |\n| `success: false, message: \"...\"` | Creation failed (invalid YAML) | Call matimo_doctor again, fix errors, retry |\n\n## Step 4: Request Human Approval\n\n**Critical:** Tools created by agents are `untrusted` and require human approval:\n\n```\nCall matimo_review with:\n  - toolName: \"weather_fetch\"\n  - target_dir: \"\u003Csame directory>\"\n\nExpected response (if human approves):\n{\n  \"approved\": true,\n  \"message\": \"Tool approved for production.\"\n}\n\nExpected response (if human rejects):\n{\n  \"approved\": false,\n  \"message\": \"Tool rejected.\"\n  \u002F\u002F Tool remains draft, NOT executable\n}\n```\n\n**What the human sees:**\n- Tool name and description\n- Parameters and their types\n- Execution method (HTTP GET, etc.)\n- Proposed by agent, security reviewed\n- **Decision:** Approve (y) or reject (n)\n\n**If rejected:**\n- ❌ Tool remains in `draft` status\n- ❌ Cannot execute or reload\n- 💡 Understand why human rejected, redesign, and re-submit\n\n**If approved:**\n- ✅ Tool marked as `approved` status\n- ✅ HMAC signature created (tamper detection)\n- ✅ Ready for reload\n\n## Step 5: Reload Registry\n\nAfter human approval, the tool registry must be refreshed:\n\n```\nCall matimo_reload_tools with:\n  - target_dir: \"\u003Csame directory>\"\n\nExpected response:\n{\n  \"loaded\": [\"weather_fetch\", \"...\"],\n  \"approved\": [\"weather_fetch\"],\n  \"rejected\": [],\n  \"message\": \"Reloaded X tools...\"\n}\n```\n\n**What happens:**\n1. 🔄 System re-scans all tool directories\n2. ✅ Approved tools become executable\n3. ❌ Rejected tools are skipped\n4. 📝 Registry updated in-memory\n\n**After reload:**\n- Tool is **discoverable** by agents\n- Tool can be **called** via matimo.execute()\n- Tool appears in **LLM tool bindings** (if using LangChain)\n\n## Step 6: Execute the Tool\n\nOnce reloaded, the agent can call the tool naturally:\n\n```\nFor HTTP tool:\n  Input:  { city: \"New York\" }\n  Action: matimo.execute(\"weather_fetch\", { city: \"New York\" })\n  Output: { success: true, weather: { ... } }\n\nFor created tool with requires_approval: true:\n  First call prompts human: \"Approve execution of weather_fetch?\"\n  On approval: Tool executes\n  On rejection: Tool blocked\n```\n\n**Agent-created tools with requires_approval:**\n- ✅ Can be created\n- ✅ Can be approved for production\n- ✅ Still require human approval on **first execution** (extra safety)\n- ✅ After human approves once, auto-approved in session\n\n## Step 7: List and Manage Tools\n\nDiscover what tools have been created:\n\n```\nCall matimo_list_user_tools with:\n  - target_dir: \"\u003Csame directory>\"\n\nExpected response:\n{\n  \"tools\": [\n    {\n      \"name\": \"weather_fetch\",\n      \"status\": \"approved\",\n      \"riskLevel\": \"LOW\",\n      \"description\": \"Get weather for a city\"\n    },\n    {\n      \"name\": \"file_reader\",\n      \"status\": \"rejected\",\n      \"reason\": \"Command tools are blocked\"\n    }\n  ]\n}\n```\n\n**What you learn:**\n- ✅ `weather_fetch` is ready to use (approved)\n- ❌ `file_reader` failed policy (rejected)\n- 📊 Risk levels guide execution safety\n\n---\n\n## Common Patterns\n\n### Pattern 1: Safe HTTP GET Tool\n\n```yaml\nname: github_user_lookup\nversion: \"1.0.0\"\ndescription: Look up a GitHub user's profile\nparameters:\n  username:\n    type: string\n    required: true\n    description: GitHub username (e.g., \"octocat\")\nexecution:\n  type: http\n  method: GET\n  url: \"https:\u002F\u002Fapi.github.com\u002Fusers\u002F{username}\"\n```\n\n→ **Result**: Auto-approved (low-risk read-only), no human approval needed\n\n---\n\n### Pattern 2: Safe HTTP POST Tool\n\n```yaml\nname: todo_create\nversion: \"1.0.0\"\ndescription: Create a new todo item\nparameters:\n  title:\n    type: string\n    required: true\n  completed:\n    type: boolean\n    required: false\nexecution:\n  type: http\n  method: POST\n  url: \"https:\u002F\u002Fjsonplaceholder.typicode.com\u002Ftodos\"\n```\n\n→ **Result**: Pending approval, human reviews then approves\n\n---\n\n### Pattern 3: Blocked Command Tool\n\n```yaml\nname: shell_exec\nversion: \"1.0.0\"\ndescription: Execute shell commands\nparameters:\n  cmd:\n    type: string\n    required: true\nexecution:\n  type: command\n  command: bash\n  args: [\"-c\", \"{cmd}\"]\n```\n\n→ **Result**: `matimo_doctor` blocks immediately with \"Command tools are blocked (policy)\"\n\n**What agent learns:** \"I can't create shell commands; use HTTP instead\"\n\n---\n\n### Pattern 4: Policy Violation - SSRF\n\n```yaml\nname: metadata_probe\nversion: \"1.0.0\"\nexecution:\n  type: http\n  method: GET\n  url: \"http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F\"  # AWS EC2 metadata ❌\n```\n\n→ **Result**: `matimo_doctor` blocks with \"SSRF detected: forbidden IP range 169.254.*\"\n\n**What agent learns:** \"Can't probe internal IPs; they're blocked\"\n\n---\n\n### Pattern 5: Namespace Hijack (Rejected)\n\n```yaml\nname: matimo_backdoor  # WRONG: Reserved namespace ❌\n```\n\n→ **Result**: `matimo_doctor` blocks with \"Reserved namespace violation: matimo_* is protected\"\n\n**What agent learns:** \"Can't use matimo_* names; they're reserved for built-ins\"\n\n---\n\n## Workflow Decision Tree\n\n**Should I create this tool?**\n\n```\nDoes it solve the user's goal? → YES → Proceed\n  ↓\nIs it safe (policy passes)?\n  ├─ YES → Create (agent-created tools always pending approval)\n  │  └─→ matimo_doctor → matimo_create_tool → matimo_review\n  │     → matimo_reload_tools → Execute\n  │\n  └─ NO → Understand policy error\n     → Redesign to comply (different API, different method)\n     → Re-validate with matimo_doctor\n     → When valid, create\n```\n\n**If human rejects approval:**\n\n```\nWhy did they reject?\n  ├─ Security concern → Redesign differently\n  ├─ Governance concern → Ask for clarification\n  ├─ Not needed → Mark complete, try different approach\n  └─ Technical issue → Fix and re-submit\n```\n\n**If policy blocks:**\n\n```\nWhich rule blocked it?\n  ├─ Command blocked → Use HTTP instead\n  ├─ SSRF detected → Use public API, not internal IP\n  ├─ Namespace reserved → Rename without matimo_ prefix\n  ├─ Domain blocked → Check allowed-domains policy\n  └─ Other → Read error, understand constraint, redesign\n```\n\n---\n\n## Debugging & Troubleshooting\n\n### Symptom: matimo_doctor returns validation errors\n\n```\nField: \"execution.method\"\nMessage: \"Invalid option: expected one of GET|POST|PUT|DELETE|PATCH\"\n```\n\n**Fix:**\n1. Read error: method was `PATCH` when `execution.type: http` expects GET\u002FPOST\u002FPUT\u002FDELETE\u002FPATCH\n2. Check YAML: wrong value or syntax\n3. Correct: `method: POST` (exact casing)\n4. Re-validate with matimo_doctor\n\n### Symptom: matimo_create_tool returns \"success: false\"\n\n```\nMessage: \"Schema validation failed: Tool schema validation failed:\n  • version: Invalid input: expected string, received undefined\"\n```\n\n**Fix:**\n1. YAML is missing `version` field\n2. Add: `version: \"1.0.0\"`\n3. Call matimo_doctor to verify\n4. Then matimo_create_tool\n\n### Symptom: matimo_review asks for approval but tool is `auto-approved`\n\n```\nExpected: Tool should be executable immediately\nActual: Human still asked to approve\n```\n\n**Fix:**\n- Low-risk tools (GET-only to public APIs) are `auto-approved`\n- Other tools are `pending` and require human approval\n- This is correct behavior for agent-created tools\n- Call matimo_reload_tools after approval\n\n### Symptom: Tool not in registry after matimo_reload_tools\n\n```\nExpected: \"weather_fetch\" in matimo_list_user_tools()\nActual: Not in list\n```\n\n**Fix:**\n1. Did matimo_review succeed? (Check for `approved: true`)\n2. Did matimo_reload_tools complete? (Check response)\n3. Call matimo_list_user_tools() to verify\n4. If still missing, re-run matimo_reload_tools\n\n---\n\n## Key Principles\n\n1. ✅ **Always validate before creating** — matimo_doctor catches errors early\n2. ✅ **Accept human feedback** — If rejected, learn why and redesign\n3. ✅ **Respect policy** — It's there to prevent attacks; work within it\n4. ✅ **Reload after approval** — Tools don't appear until registry is refreshed\n5. ✅ **Complete YAML is critical** — Missing `version` or `execution` = failure\n6. ✅ **Name tools for discovery** — Clear names help humans understand what they're approving\n\n---\n\n## References\n\n- **Complete tool creation spec**: See `tool-creation` skill\n- **Policy validation rules**: See `policy-validation` skill\n- **Tool discovery**: See `tool-discovery` skill\n- **Matimo Architecture**: See copilot-instructions.md\n\n---\n\n**Last Updated:** March 2026  \n**Status:** Complete  \n**Level:** Advanced (assumes familiarity with tool-creation skill)\n",{"name":5,"metadata":24,"description":7},{"apply-to":25,"category":26,"difficulty":27},"matimo_create_tool matimo_validate_tool matimo_doctor matimo_review matimo_reload_tools matimo_list_user_tools","Tool Lifecycle","advanced","main","3ace42f8c811a205651ca8cf53bc2608abffc266","typescript\u002Fpackages\u002Fcore\u002Fskills\u002Fmeta-tools-lifecycle",1,"https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo","https:\u002F\u002Fgithub.com\u002Freview-bench","https:\u002F\u002Freview-bench.ai","An open benchmark for AI code review.","2026-10-27 08:01:51",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add review-bench\u002Ftallclub_matimo --skill meta-tools-lifecycle",{"tool":43,"command":44},"bunx","bunx skills add review-bench\u002Ftallclub_matimo --skill meta-tools-lifecycle",{"tool":46,"command":47},"pnpm","pnpm dlx skills add review-bench\u002Ftallclub_matimo --skill meta-tools-lifecycle","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo\u002Fblob\u002Fmain\u002Ftypescript\u002Fpackages\u002Fcore\u002Fskills\u002Fmeta-tools-lifecycle\u002FSKILL.md",true,[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M752QFT5TGZZ68013YTNW8J3","twilio","Complete guide to all Twilio tools — text, media, delivery tracking, E.164 formatting, and message management.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo\u002Fblob\u002Fmain\u002Ftypescript\u002Fpackages\u002Ftwilio\u002Fskills\u002Ftwilio\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M752QAKQFZKM84MN9R5334VX","slack","Complete guide to all Slack tools — messaging, channels, users, search, files, reactions, and threads.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo\u002Fblob\u002Fmain\u002Ftypescript\u002Fpackages\u002Fslack\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M752Q60H6SQAHAH9BB2MZQN6","postgres","Complete guide to all PostgreSQL tools — parameterized queries, schema navigation, data retrieval, and safe database interaction patterns.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo\u002Fblob\u002Fmain\u002Ftypescript\u002Fpackages\u002Fpostgres\u002Fskills\u002Fpostgres\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M752Q2700VY1QWPACWX8AVFQ","notion","Complete guide to all Notion tools — databases, pages, blocks, queries, and content management.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo\u002Fblob\u002Fmain\u002Ftypescript\u002Fpackages\u002Fnotion\u002Fskills\u002Fnotion\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M752PZ82SCVF6H1GPKQ54JWR","mailchimp","Complete guide to all Mailchimp tools — campaigns, audiences, lists, templates, segments, and email marketing.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo\u002Fblob\u002Fmain\u002Ftypescript\u002Fpackages\u002Fmailchimp\u002Fskills\u002Fmailchimp\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M752PQW4F1SP8DXQMFMYKDBK","hubspot","Complete guide to all HubSpot CRM tools — contacts, companies, deals, tickets, products, line items, pipelines, and entity management.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo\u002Fblob\u002Fmain\u002Ftypescript\u002Fpackages\u002Fhubspot\u002Fskills\u002Fhubspot\u002FSKILL.md",[],[]]