[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M752P27J2QP1YKEPTGAKFBCV":3,"skill-same:01M752P27J2QP1YKEPTGAKFBCV":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},"01M752P27J2QP1YKEPTGAKFBCV","tool-creation",null,"Create tools for the Matimo SDK. Understand YAML tool definitions, execution types, authentication, parameter validation, and quality standards. Apply this skill when implementing Matimo tools.","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\u002Ftool-creation\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: tool-creation\ndescription: Create tools for the Matimo SDK. Understand YAML tool definitions, execution types, authentication, parameter validation, and quality standards. Apply this skill when implementing Matimo tools.\nmetadata:\n  category: \"Tool Development\"\n  difficulty: \"intermediate\"\n  user-invokable: \"true\"\n---\n\n# Tool Creation for Matimo SDK\n\nThis skill teaches you how to properly create, configure, and validate tools for the **Matimo SDK**—a configuration-driven framework where tools are defined once in YAML and executed everywhere (factory pattern, decorators, LangChain).\n\n> **Two audiences — know which one you are:**\n>\n> | You are an **Agent at runtime** | You are an **SDK developer** |\n> |---|---|\n> | Creating tools dynamically via `matimo_create_tool` | Adding tools to the SDK codebase |\n> | Tools go to `.\u002Fmatimo-tools\u002F{tool-name}\u002Fdefinition.yaml` (configured by developer) | Tools go to `packages\u002F{provider}\u002Ftools\u002F{tool-name}\u002Fdefinition.yaml` |\n> | Validate with `matimo_doctor` (meta-tool) | Validate with `pnpm validate-tools` (CLI) |\n> | Approval needed: `matimo_approve_tool` → `matimo_reload_tools` | No approval flow — merged via git |\n>\n> **If you are an agent using meta-tools, follow the \"Agent at runtime\" column throughout this skill.**\n\n## Matimo Architecture Overview\n\n### Tool Execution Flow\n\n```\nTool Definition (YAML)\n         ↓\n    ToolLoader (parse & validate)\n         ↓\n    ToolRegistry (in-memory store)\n         ↓\nMatimoInstance.execute(name, params)\n         ↓\n  Select Executor Based on execution.type\n         ↓\nCommandExecutor | HttpExecutor | FunctionExecutor\n         ↓\n  Validate output against output_schema\n         ↓\n    Return structured result\n```\n\n### Key Concepts\n\n- **Tools are YAML-first**: Define once in YAML, execute anywhere\n- **Always include `requires_approval: true`**: Required by policy for all agent-created tools\n- **Default execution type is `http`**: `command` and `function` types are **blocked by policy by default** — only use `http` unless the developer has explicitly enabled the others\n- **Parameter templating**: Use `{paramName}` syntax for dynamic values\n- **Authentication**: Provider-agnostic (API key, bearer, basic, OAuth2)\n- **Output validation**: All responses validated against Zod schemas\n- **Error handling**: Structured errors with retry\u002Fbackoff policies\n\n> ⚠️ **Policy defaults block `command` and `function` tools.** Always use `type: http` unless you have confirmed the developer has set `allowCommandTools: true` or `allowFunctionTools: true` in the policy. Creating a `command` or `function` tool without explicit policy permission will fail validation.\n\n### File Structure\n\n**Agent at runtime** (using `matimo_create_tool`):\n```\n{target_dir}\u002F{tool-name}\u002F              ← target_dir is configured by the developer\n└── definition.yaml                    ← Tool YAML — written by meta-tool\n```\nDefault `target_dir` is `.\u002Fmatimo-tools` unless overridden. The approved tool **stays in this path permanently** — it is NOT cleared on restart. The `ApprovalManifest` (`.matimo-approvals.json`) is stored in the same directory.\n\n**SDK developer** (adding to codebase):\n```\npackages\u002F{provider}\u002Ftools\u002F{tool-name}\u002F\n├── definition.yaml                    ← Tool configuration\n└── index.ts                          ← Executor script (if type: command)\n```\n\n### Agent Tool Lifecycle (runtime creation)\n\n```\nmatimo_doctor(yaml_content)             ← 1. Validate YAML + policy FIRST\n         ↓ { valid: true }\nmatimo_create_tool(name, yaml_content, target_dir)\n         ↓ writes {target_dir}\u002F{name}\u002Fdefinition.yaml\n         ↓ status: \"draft\", approvalState: \"pending\"\nmatimo_approve_tool(name, tool_dir)     ← 3. Human approves\n         ↓ status updated to \"approved\" in same file\n         ↓ .matimo-approvals.json written to target_dir\nmatimo_reload_tools()                   ← 4. Hot-reload registry\n         ↓ approved tool is now live and executable\nmatimo.execute(tool-name, params)       ← 5. Use the tool\n```\n\n> ✅ **Approved tools are stored permanently** in `target_dir` on disk. They survive restarts as long as `target_dir` is included in Matimo's `toolPaths` config. They are NOT stored in temp directories — that is only used in demo examples.\n\n## When Creating Tools\n\nApply this skill when:\n- An agent needs to **create a new tool at runtime** (use meta-tools workflow above)\n- **Defining tool YAML** structure (applies to both agents and SDK developers)\n- Configuring **authentication**, **parameter templating**, or **output validation**\n- An SDK developer is **adding a new provider package** (e.g., GitHub, AWS, Notion)\n\n\n## Tool Definition Structure\n\n### Minimal Valid Tool (HTTP)\n\n```yaml\nname: tool_name                           # snake_case, unique across all tools\ndescription: What this tool does          # Clear, specific description\nversion: '1.0.0'\nrequires_approval: true                    # Must be true for agent-created tools\n\nparameters:                               # User-provided inputs\n  required_param:\n    type: string                          # string, number, boolean, object, array\n    required: true\n    description: What this parameter does\n\nexecution:\n  type: http                              # Type: http, command, or function\n  method: POST\n  url: 'https:\u002F\u002Fapi.example.com\u002Fv1\u002Fresource'\n  headers:\n    Authorization: 'Bearer {AUTH_TOKEN}'  # Template with env vars\n  body:\n    field: '{required_param}'             # Template with parameters\n\nauthentication:\n  type: api_key                           # Define how auth is handled\n  location: header\n  name: Authorization\n\noutput_schema:                            # Response must match this schema\n  type: object\n  properties:\n    success:\n      type: boolean\n  required:\n    - success\n\nexamples:\n  - name: \"Basic usage\"\n    params:\n      required_param: \"value\"\n```\n\n---\n\n## Execution Types\n\n> **Policy Rule:** By default, `command` and `function` execution types are **blocked** (`allowCommandTools: false`, `allowFunctionTools: false`). The safe default is `type: http`. Before using `command` or `function`, always run `matimo_doctor` to check if the policy in your environment allows it.\n\n### Type: HTTP ✅ Always Allowed\n\nFor REST API integrations (Slack, GitHub, AWS, etc.):\n\n```yaml\nexecution:\n  type: http\n  method: POST                          # GET, POST, PUT, DELETE, PATCH\n  url: 'https:\u002F\u002Fapi.example.com\u002Fendpoint'\n  timeout_ms: 30000\n  headers:\n    Authorization: 'Bearer {API_TOKEN}'\n    Content-Type: application\u002Fjson\n  query_params:\n    filter: '{paramName}'\n  body:\n    channel: '{channel}'\n    message: '{text}'\n```\n\n**Key patterns:**\n- Templating: `{paramName}` replaced with actual parameter values\n- Auth template: `{API_TOKEN}` replaced with `MATIMO_{TOOL_NAME}_API_KEY` env var\n- Headers\u002Fquery\u002Fbody all support templating\n- Timeouts default to 30000ms (30 seconds)\n\n### Type: Command ⛔ Blocked by Default\n\n> **Policy:** `allowCommandTools: false` by default. Creating a `command` tool will fail `matimo_doctor` unless the developer has explicitly set `allowCommandTools: true`. Do not attempt to create command tools unless you have confirmed this is allowed.\n\nIf allowed by policy:\n\n```yaml\nexecution:\n  type: command\n  command: 'tsx'                        # Executable to run\n  timeout_ms: 30000\n  args:\n    - 'packages\u002Fprovider\u002Ftool\u002Fexecutor.ts'\n    - '--param'\n    - '{paramValue}'\n```\n\n**Key patterns:**\n- Command executor receives templated args\n- Executor must output JSON to stdout\n- Parse args with Node's `parseArgs` utility\n- Use `getGlobalMatimoLogger()` for logging, never bare `console.log`\n\n### Type: Function ⛔ Blocked by Default\n\n> **Policy:** `allowFunctionTools: false` by default. Creating a `function` tool will fail `matimo_doctor` unless the developer has explicitly set `allowFunctionTools: true`. Do not attempt to create function tools unless you have confirmed this is allowed.\n\nIf allowed by policy:\n\n```yaml\nexecution:\n  type: function\n  handler: 'execute'                    # Function name in code block\n  code: |\n    export async function execute(params) {\n      return { success: true, data: params };\n    }\n```\n\n**Key patterns:**\n- Handler function receives `params` object\n- Must return object matching `output_schema`\n- Can be async\n- No file I\u002FO or CLI access\n\n---\n\n## Authentication Configuration\n\n> ❌ **NEVER write placeholder text in YAML** — strings like `YOUR_API_KEY`, `API_KEY_HERE`, or `replace_me` are **invalid**. They will be sent to the API as-is and cause authentication failures.\n>\n> ✅ **Always use `{VARIABLE_NAME}` template syntax.** The system replaces these at execution time from environment variables.\n\n### API Key (Header)\n\n```yaml\nauthentication:\n  type: api_key\n  location: header                      # Or: query, body\n  name: Authorization\n```\n\nEnvironment variable: `MATIMO_{TOOL_NAME}_API_KEY`\n\nWhen executing, the system injects: `Authorization: Bearer \u003Ckey-from-env>`\n\n### API Key (Query Parameter)\n\nSome APIs (e.g., weatherapi.com, OpenWeatherMap) require the key in the URL query string, not a header:\n\n```yaml\nexecution:\n  type: http\n  method: GET\n  url: 'https:\u002F\u002Fapi.weatherapi.com\u002Fv1\u002Fcurrent.json'\n  query_params:\n    key: '{WEATHER_API_KEY}'            # ✅ Template — resolved from env at runtime\n    q: '{city}'\n\nauthentication:\n  type: api_key\n  location: query\n  name: key\n```\n\nSet the key via environment variable before running: `WEATHER_API_KEY=your_actual_key`\n\n> ⚠️ Never embed the key directly in the URL string like `?key=abc123` — use the `query_params` map with `{VAR_NAME}` templating.\n\n### Bearer Token\n\n```yaml\nauthentication:\n  type: bearer\n```\n\nEnvironment variable: `MATIMO_{TOOL_NAME}_BEARER_TOKEN`\n\nInjected as: `Authorization: Bearer \u003Ctoken>`\n\n### Basic Auth\n\n```yaml\nauthentication:\n  type: basic\n  username_env: MATIMO_{TOOL_NAME}_USERNAME\n  password_env: MATIMO_{TOOL_NAME}_PASSWORD\n```\n\nEncodes as `Authorization: Basic base64(username:password)`\n\n### OAuth2\n\n```yaml\nauthentication:\n  type: oauth2\n  provider: google                      # google, github, slack, etc.\n  scopes:\n    - 'https:\u002F\u002Fwww.googleapis.com\u002Fauth\u002Fdrive'\n```\n\nOAuth configuration defined in provider's `definition.yaml`. System handles authorization code → token exchange.\n\n---\n\n## Parameter Definition\n\n### Basic Parameters\n\n```yaml\nparameters:\n  name:\n    type: string                        # string, number, boolean, object, array\n    required: true\n    description: Parameter description\n```\n\n### With Constraints\n\n```yaml\nparameters:\n  email:\n    type: string\n    required: true\n    pattern: '^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$'    # Email regex validation\n  \n  priority:\n    type: string\n    enum:\n      - low\n      - medium\n      - high                            # Restrict to specific values\n  \n  timeout:\n    type: number\n    min: 1\n    max: 300\n    default: 30                         # Use if not provided\n  \n  port:\n    type: number\n    min: 1\n    max: 65535\n  \n  count:\n    type: number\n    min_length: 0\n    max_length: 100                     # For strings\n```\n\n### Parameter Templating in Execution\n\n```yaml\nexecution:\n  type: http\n  body:\n    filter: '{priority}'                # Replaced with actual value\n    count: '{count}'                    # Numbers automatically stringified\n    tags:\n      - '{tag1}'\n      - '{tag2}'\n```\n\nWhen executing with `{ priority: 'high', count: 42, tag1: 'urgent', tag2: 'system' }`:\n- `{priority}` → `\"high\"`\n- `{count}` → `\"42\"`\n- `{tag1}`, `{tag2}` → array elements\n\n---\n\n## Output Schema Validation\n\nAll tools must define `output_schema`. Responses are validated with Zod:\n\n```yaml\noutput_schema:\n  type: object\n  properties:\n    success:\n      type: boolean\n      description: Operation success\n    \n    data:\n      type: object\n      description: Response data\n      properties:\n        id:\n          type: string\n        timestamp:\n          type: string\n        count:\n          type: number\n    \n    error:\n      type: object\n      description: Error details (if failed)\n  \n  required:\n    - success\n```\n\n**Execution behavior:**\n1. Tool executes (HTTP, command, or function)\n2. Response parsed and validated against schema\n3. If validation fails → `MatimoError(INVALID_SCHEMA, ...)`\n4. If validation succeeds → result returned to caller\n\n---\n\n## Error Handling & Retry Policies\n\n```yaml\nerror_handling:\n  retry: 3                              # Retry up to 3 times\n  backoff_type: exponential             # exponential or linear\n  initial_delay_ms: 500                 # First retry delay\n  max_delay_ms: 30000                   # Maximum delay between retries\n  retry_on_status:                      # HTTP status codes to retry\n    - 429                               # Rate limited\n    - 500                               # Server error\n    - 503                               # Service unavailable\n```\n\n**Retry behavior:**\n- Delay = `initial_delay_ms * (backoff_exponent ^ attempt_number)`\n- Capped at `max_delay_ms`\n- Only retries on specified HTTP status codes\n- Non-2xx responses still validated against schema\n\n---\n\n## Command Executor Implementation\n\n> ⚠️ **Only applicable if `allowCommandTools: true` is set in policy.** If you are unsure, run `matimo_doctor` on your YAML first — it will fail immediately if command tools are blocked.\n\nFor `type: command` tools, create an executor at `packages\u002F{provider}\u002Ftools\u002F{tool-name}\u002Findex.ts`:\n\n```typescript\nimport { parseArgs } from 'util';\nimport { getGlobalMatimoLogger } from '@matimo\u002Fcore';\n\ninterface ExecutorParams {\n  channel: string;\n  text?: string;\n}\n\nasync function main() {\n  const logger = getGlobalMatimoLogger();\n  \n  try {\n    \u002F\u002F Parse command-line arguments\n    const { values } = parseArgs({\n      options: {\n        channel: { type: 'string' },\n        text: { type: 'string' }\n      }\n    });\n    \n    \u002F\u002F Validate required params\n    if (!values.channel) {\n      throw new Error('channel is required');\n    }\n    \n    const params: ExecutorParams = {\n      channel: values.channel as string,\n      text: values.text\n    };\n    \n    \u002F\u002F Execute business logic\n    const result = await executeLogic(params);\n    \n    \u002F\u002F Output as JSON\n    console.log(JSON.stringify(result));\n  } catch (error) {\n    logger.error('Executor failed', {\n      error: error instanceof Error ? error.message : String(error)\n    });\n    \n    console.log(JSON.stringify({\n      success: false,\n      message: error instanceof Error ? error.message : String(error)\n    }));\n    \n    process.exit(1);\n  }\n}\n\nasync function executeLogic(params: ExecutorParams) {\n  \u002F\u002F Your actual logic here\n  return {\n    success: true,\n    message: 'Operation completed',\n    data: { channel: params.channel }\n  };\n}\n\nmain();\n```\n\n**Key guidelines:**\n- Always use `getGlobalMatimoLogger()`, never bare `console.log` in core code\n- Validate all parameters\n- Output JSON with structure matching `output_schema`\n- Exit with code 1 on error\n- Never log secrets\n\n---\n\n## Code Quality Standards\n\n### Zod Validation\n\nAll parameter parsing must use Zod:\n\n```typescript\nimport { z } from 'zod';\n\nconst ParamSchema = z.object({\n  channel: z.string().min(1),\n  text: z.string().optional(),\n  timeout: z.number().min(1).max(300).default(30)\n});\n\nconst params = ParamSchema.parse(input);  \u002F\u002F Throws if invalid\n```\n\n### Error Handling\n\nUse `MatimoError` with structured error codes:\n\n```typescript\nimport { MatimoError, ErrorCode } from '@matimo\u002Fcore';\n\nthrow new MatimoError(\n  'API request failed',\n  ErrorCode.EXECUTION_FAILED,\n  {\n    toolName: 'slack_send',\n    statusCode: 500,\n    details: { message: 'Server error' }\n    \u002F\u002F Never include secrets\n  }\n);\n```\n\nError codes:\n- `INVALID_SCHEMA` — Parameter or response validation failed\n- `EXECUTION_FAILED` — Tool execution failed\n- `AUTH_FAILED` — Authentication missing or invalid\n- `TOOL_NOT_FOUND` — Tool definition not found\n\n### Type Safety\n\n- Use strict TypeScript (no `any` type)\n- Export types alongside implementations\n- Use discriminated unions: `{ type: 'command', command: string }`\n- Never trust user input without validation\n\n---\n\n## Strict Rules & Enforcement Standards\n\nThese rules are **non-negotiable** for all Matimo tools. Violations block tool approval.\n\n### 1. Naming Conventions (STRICT)\n\n**Tool Names:**\n- ✅ MUST use `snake_case` (e.g., `slack_send_message`, `github_create_issue`)\n- ✅ MUST be globally unique across all providers\n- ✅ MUST describe the action clearly (no abbreviations like `slack_msg`)\n- ❌ NO camelCase, PascalCase, or kebab-case\n- ❌ NO generic names like `execute` or `run`\n\n**Parameters (YAML):**\n- ✅ MUST use `camelCase` (e.g., `channelId`, `messageText`, `retryCount`)\n- ✅ MUST be descriptive and match API conventions\n- ❌ NO snake_case in parameter names\n- ❌ NO single-letter parameters (except standard `a`, `b` in math examples)\n\n**Parameters (TypeScript\u002FJavaScript):**\n- ✅ MUST use `camelCase` for variables (e.g., `const channelId = ...`)\n- ✅ Class\u002Ffunction names MUST use `PascalCase` (e.g., `SlackClient`, `parseResponse()`)\n- ✅ Constants MUST use `UPPER_SNAKE_CASE` (e.g., `MAX_RETRIES`, `API_TIMEOUT_MS`)\n- ✅ Private methods MUST use `#` prefix (e.g., `#validateResponse()`)\n- ❌ NO inconsistent casing within a single tool\n\n**Provider Packages:**\n- ✅ MUST use `snake_case` (e.g., `@matimo\u002Fslack`, `@matimo\u002Fgithub`)\n- ✅ Directory path: `packages\u002F{provider}\u002Ftools\u002F{tool_name}\u002F`\n- ❌ NO uppercase letters in directory names\n\n**Example (Correct):**\n```yaml\n# packages\u002Fslack\u002Ftools\u002Fslack_send_message\u002Fdefinition.yaml\nname: slack_send_message\nparameters:\n  channelId:        # camelCase\n    type: string\n    required: true\n  messageText:      # camelCase\n    type: string\n```\n\n### 2. Tool Completeness (CRITICAL)\n\n**All tools MUST be fully functional:**\n\n✅ **Required Elements:**\n- ☑️ Tool definition YAML must be complete and valid\n- ☑️ All parameters in YAML must be documented with type, description, required\n- ☑️ All examples in YAML must match the defined parameters (no extra\u002Fmissing params)\n- ☑️ All referenced environment variables MUST be documented in description\n- ☑️ Output schema MUST match actual API response structure\n- ☑️ Error handling MUST cover all documented failure modes\n- ☑️ Executor code (if `type: command`) must be fully implemented\n- ☑️ Authentication setup must be tested and working\n- ☑️ Tool must execute without errors in all example scenarios\n\n❌ **Never Allow:**\n- Stub implementations with TODO comments\n- @TODO, FIXME, XXX, HACK comments in production code\n- @ts-ignore, eslint-disable comments (fix the actual issue)\n- Placeholder values in examples\n- \"Coming soon\" features\n- Incomplete authentication configuration\n\n**Completeness Checklist:**\n```\nBefore submitting a tool:\n[ ] Tool YAML parses without errors (pnpm validate-tools)\n[ ] All parameters in YAML have type + description + required\n[ ] All examples match parameter definitions exactly\n[ ] Output schema matches real API responses\n[ ] Error handling uses MatimoError with ErrorCode\n[ ] Tests pass with 80%+ coverage (pnpm test:coverage)\n[ ] No console.log in main code (use logger)\n[ ] No env var references without documentation\n[ ] Tool executes successfully in all examples\n[ ] No TODO\u002FFIXME\u002FXXX\u002FHACK comments\n[ ] No @ts-ignore, eslint-disable comments\n```\n\n### 3. Parameter Validation (STRICT)\n\n**Parameter Definition Requirements:**\n- ✅ EVERY parameter MUST have `type`, `description`, `required`\n- ✅ `type` must be one of: `string`, `number`, `boolean`, `array`, `object`\n- ✅ `description` must explain WHAT and WHY (e.g., \"Slack channel ID (starts with C)\")\n- ✅ Constraints MUST be specific:\n  - For strings: `minLength`, `maxLength`, `pattern` (regex)\n  - For numbers: `minimum`, `maximum`, step\n  - For arrays: `minItems`, `maxItems`, `items` (type)\n  - For enums: `enum: [value1, value2]`\n- ✅ Default values MUST match their type\n- ❌ NO `type: object` without `properties` defined\n- ❌ NO vague descriptions like \"The text parameter\"\n\n**Valid Parameter Example:**\n```yaml\nparameters:\n  channelId:\n    type: string\n    required: true\n    description: \"Slack channel ID (format: C0123456789, starts with C)\"\n    pattern: \"^C[A-Z0-9]{10,}$\"\n    \n  messageText:\n    type: string\n    required: false\n    description: \"Plain text message to send. Supports markdown. Max 4000 chars.\"\n    maxLength: 4000\n    \n  threadTimestamp:\n    type: number\n    required: false\n    description: \"Parent message timestamp for threading (Unix epoch, decimal)\"\n    minimum: 0\n    \n  tags:\n    type: array\n    required: false\n    description: \"Optional tags to categorize the message\"\n    items:\n      type: string\n    minItems: 1\n    maxItems: 5\n```\n\n### 4. Authentication (MANDATORY for HTTP tools)\n\n**Every HTTP tool MUST have authentication:**\n- ✅ `authentication` block MUST specify type and location\n- ✅ Supported types: `api_key`, `bearer`, `basic`, `oauth2`\n- ✅ Environment variable naming: `MATIMO_{TOOL_NAME}_{AUTH_TYPE}` (uppercase)\n- ✅ Authentication setup MUST be documented (which provider supports which auth)\n- ✅ Token refresh\u002Fexpiration MUST be handled if applicable\n- ❌ NO tools with `type: http` and no authentication\n- ❌ NO hardcoded credentials or tokens\n\n**Example (Correct):**\n```yaml\nexecution:\n  type: http\n  method: POST\n  url: 'https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.postMessage'\n  headers:\n    Authorization: 'Bearer {SLACK_BOT_TOKEN}'\n\nauthentication:\n  type: api_key\n  location: header\n  name: Authorization\n```\n\n### 5. Output Schema Validation (REQUIRED)\n\n**Output schema MUST match actual API response:**\n- ✅ Schema MUST be present for every tool\n- ✅ Schema MUST use Zod-compatible JSON schema\n- ✅ Schema MUST match real API success response\n- ✅ Response validation MUST fail if schema doesn't match\n- ❌ NO generic `{ type: object }` schemas\n- ❌ NO schemas that don't match actual responses\n\n**Example (Correct):**\n```yaml\noutput_schema:\n  type: object\n  properties:\n    ok:\n      type: boolean\n      description: \"Request succeeded\"\n    message:\n      type: object\n      properties:\n        type:\n          type: string\n        ts:\n          type: string\n        channel:\n          type: string\n  required: [ok, message]\n```\n\n### 6. Error Handling (MANDATORY)\n\n**All errors MUST use MatimoError:**\n- ✅ MUST import and use `MatimoError` from `@matimo\u002Fcore`\n- ✅ MUST use correct `ErrorCode` (INVALID_SCHEMA, EXECUTION_FAILED, AUTH_FAILED, TOOL_NOT_FOUND)\n- ✅ Error messages MUST be clear and actionable\n- ✅ Error details MUST include context (but NO secrets)\n- ✅ Setup `error_handling.retry` if operation is idempotent\n- ❌ NO custom error classes\n- ❌ NO throwing plain Error or Error subclasses\n\n**Example (Correct):**\n```typescript\nimport { MatimoError, ErrorCode } from '@matimo\u002Fcore';\n\nif (!channelId) {\n  throw new MatimoError(\n    'Channel ID is required',\n    ErrorCode.INVALID_SCHEMA,\n    { expectedFormat: 'C0123456789' }\n  );\n}\n\ntry {\n  const response = await fetch(url);\n  if (!response.ok) {\n    throw new MatimoError(\n      'Slack API request failed',\n      ErrorCode.EXECUTION_FAILED,\n      { statusCode: response.status }  \u002F\u002F NOT the response body\n    );\n  }\n} catch (error) {\n  throw new MatimoError(\n    'Network error',\n    ErrorCode.EXECUTION_FAILED,\n    { message: error instanceof Error ? error.message : 'Unknown error' }\n  );\n}\n```\n\n### 7. Logging (NO console.log in Core)\n\n**Log Usage Rules:**\n- ✅ Use `getGlobalMatimoLogger()` from `@matimo\u002Fcore`\n- ✅ Log at appropriate levels: `error`, `warn`, `info`, `debug`\n- ✅ Log important validation failures, auth issues, retries\n- ✅ Never log secrets, credentials, or sensitive data\n- ❌ NO `console.log`, `console.error`, `console.warn` in package code\n- ❌ NO logging secrets, API keys, tokens, passwords\n- ❌ NO over-logging (avoid logs for normal happy paths)\n\n**Example (Correct):**\n```typescript\nimport { getGlobalMatimoLogger } from '@matimo\u002Fcore';\n\nconst logger = getGlobalMatimoLogger();\n\ntry {\n  logger.info('Sending message to Slack', { channel: channelId });\n  \u002F\u002F ...\n} catch (error) {\n  logger.error('Slack API call failed', { statusCode, message });\n  throw new MatimoError('Failed', ErrorCode.EXECUTION_FAILED, { statusCode });\n}\n```\n\n### 10. Enforcement Gates (Agent Checklist)\n\nWhen reviewing a tool, the agent MUST verify:\n\n```\nNAMING CONVENTIONS GATE\n✓ Tool name is snake_case (slack_send_message)\n✓ requires_approval: true is present\n✓ Parameters are camelCase (channelId, messageText)\n✓ Tool name does NOT start with matimo_ (reserved namespace)\n✓ TypeScript uses PascalCase for classes\n\nPOLICY GATE (run matimo_doctor first — fail fast)\n✓ execution.type is http  (command\u002Ffunction blocked by default)\n✓ URL domain is in allowedDomains list\n✓ HTTP method is GET or POST (default allowed methods)\n✓ No SSRF risk (no internal IPs or metadata endpoints)\n✓ Credential name is in allowedCredentials list\n✓ matimo_doctor returns { valid: true } before create\n\nCOMPLETENESS GATE\n✓ YAML parses without errors\n✓ All parameters have type, description, required\n✓ All examples match parameter definitions\n✓ No TODO\u002FFIXME\u002FHACK comments\n\nQUALITY GATE\n✓ Output schema matches real API response\n✓ Error handling uses MatimoError + ErrorCode\n✓ Authentication configured (if HTTP)\n✓ Env vars documented and referenced\n\nDELIVERY GATE\n✓ All gates passed\n✓ Tool ready for production use\n✓ Can be merged without caveats\n```\n\n---\n\n## Workflow: Creating a New Tool\n\n### Agent at Runtime (using meta-tools)\n\n#### Step 1: Write YAML in memory\n\nCompose the full tool definition YAML string. Required fields:\n- `name`, `description`, `version`\n- `requires_approval: true` ← **mandatory — policy will reject without it**\n- `parameters` (with types and descriptions)\n- `execution` — **use `type: http`** (command\u002Ffunction blocked by default)\n- `authentication` (mandatory for HTTP tools)\n- `output_schema`\n\n#### Step 2: Validate with `matimo_doctor` FIRST\n\n```\nmatimo_doctor(yaml_content: \"\u003Cfull YAML string>\")\n```\n\n- ✅ `{ valid: true }` → proceed to Step 3\n- ❌ `{ valid: false, policyViolations: [...] }` → fix the YAML and re-validate\n\n**Common failures and fixes:**\n\n| Failure | Fix |\n|---------|-----|\n| `command tools blocked` | Change `type: command` → `type: http` |\n| `function tools blocked` | Change `type: function` → `type: http` |\n| `domain not allowed` | Use a domain in the `allowedDomains` list |\n| `HTTP method not allowed` | Use `GET` or `POST` |\n| `reserved namespace` | Rename — don't start with `matimo_` |\n| `requires_approval missing` | Add `requires_approval: true` |\n| `forced-approval` | Same — add `requires_approval: true` |\n\n#### Step 3: Create on disk with `matimo_create_tool`\n\n```\nmatimo_create_tool(\n  name: \"my_tool_name\",\n  yaml_content: \"\u003Cvalidated YAML>\",\n  target_dir: \"\u003Cpath the developer configured, e.g. .\u002Fmatimo-tools>\"\n)\n```\n\nResult:\n- Tool written to `{target_dir}\u002F{name}\u002Fdefinition.yaml`\n- `status: \"draft\"`, `approvalState: \"pending\"` (or `\"auto-approved\"` for low-risk GET tools)\n- **This path is permanent** — approved tools stay here and survive restarts\n\n#### Step 4: Get human approval\n\n```\nmatimo_approve_tool(name: \"my_tool_name\", tool_dir: \"\u003Csame target_dir>\")\n```\n\n- Updates `status` to `\"approved\"` in the same `definition.yaml`\n- Writes approval hash to `{target_dir}\u002F.matimo-approvals.json`\n\n#### Step 5: Reload and use\n\n```\nmatimo_reload_tools()         ← Hot-reloads registry from disk\nmatimo.execute(\"my_tool_name\", params)   ← Tool is now live\n```\n\n---\n\n### SDK Developer (adding to codebase)\n\n#### Step 1: Create directory\n```bash\nmkdir -p packages\u002F{provider}\u002Ftools\u002F{tool-name}\n```\n\n#### Step 2: Write `definition.yaml`\n\nSame YAML structure as above. No `requires_approval` needed for SDK-shipped tools.\n\n#### Step 3: Add test fixture\n```bash\ncp packages\u002F{provider}\u002Ftools\u002F{tool-name}\u002Fdefinition.yaml \\\n   packages\u002Fcore\u002Ftest\u002Ffixtures\u002F{provider}\u002F{tool-name}-fixture.yaml\n```\n\n#### Step 4: Validate & test\n```bash\npnpm validate-tools              # Check YAML schema\npnpm test                        # Run test suite\npnpm test:coverage               # Verify 80%+ coverage\npnpm lint                        # Check code quality\n```\n\n---\n\n## Validation & Quality Checks\n\n### Agent: Validate with `matimo_doctor`\n\nRun before every `matimo_create_tool` call:\n\n✅ YAML syntax is valid  \n✅ Policy compliance (domains, methods, execution type, namespace)  \n✅ Schema fields present (name, parameters, execution, output_schema)  \n✅ `requires_approval: true` present  \n\n### SDK Developer: Validate with CLI\n\n```bash\npnpm validate-tools\n```\n\n✅ YAML syntax is valid  \n✅ Schema matches ToolDefinition contract  \n✅ All required fields present  \n✅ Parameter types are consistent  \n\n### Code Quality\n\n```bash\npnpm lint              # ESLint checks\npnpm format           # Prettier formatting\npnpm test             # All tests pass\npnpm test:coverage    # 80%+ coverage\n```\n\n### Security Review\n\n- No hardcoded secrets in definitions\n- No sensitive data in error messages\n- Auth env vars properly documented\n- No `console.log` in production code\n\n---\n\n## Common Patterns\n\n### Pattern 1: Parameter Templating\n\n```yaml\nexecution:\n  type: http\n  url: 'https:\u002F\u002Fapi.example.com\u002Fusers\u002F{user_id}'\n  body:\n    name: '{name}'\n    email: '{email}'\n```\n\nParameters are replaced before execution. Type conversion handled automatically (numbers → strings).\n\n### Pattern 2: Environment Variable Injection\n\n```yaml\nexecution:\n  type: http\n  headers:\n    Authorization: 'Bearer {API_TOKEN}'    # Gets MATIMO_SLACK_API_KEY from env\n```\n\nTemplate syntax: `{UPPERCASE_NAME}` → `process.env.MATIMO_{TOOL_NAME}_UPPERCASE_NAME`\n\n### Pattern 3: Optional Parameters with Defaults\n\n```yaml\nparameters:\n  timeout:\n    type: number\n    required: false\n    default: 30\n\nexecution:\n  args:\n    - '--timeout'\n    - '{timeout}'        # Uses default if not provided\n```\n\n### Pattern 4: Enum Validation\n\n```yaml\nparameters:\n  status:\n    type: string\n    enum:\n      - draft\n      - published\n      - archived\n\nexecution:\n  query_params:\n    status: '{status}'   # Only allows draft, published, or archived\n```\n\n---\n\n## Real Example: Slack Send Message\n\n### definition.yaml\n\n```yaml\nname: slack_send_message\ndescription: Send a text message to a Slack channel\nversion: '1.0.0'\n\nparameters:\n  channel:\n    type: string\n    required: true\n    description: Channel ID or name (e.g., #general or C12345)\n  text:\n    type: string\n    required: true\n    description: Message text to send\n  thread_ts:\n    type: string\n    required: false\n    description: Parent message timestamp for thread replies\n\nexecution:\n  type: http\n  method: POST\n  url: 'https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.postMessage'\n  headers:\n    Authorization: 'Bearer {SLACK_BOT_TOKEN}'\n    Content-Type: application\u002Fjson\n  body:\n    channel: '{channel}'\n    text: '{text}'\n    thread_ts: '{thread_ts}'\n\nauthentication:\n  type: api_key\n  location: header\n  name: Authorization\n\noutput_schema:\n  type: object\n  properties:\n    ok:\n      type: boolean\n    ts:\n      type: string\n    channel:\n      type: string\n  required:\n    - ok\n    - ts\n\nerror_handling:\n  retry: 2\n  backoff_type: exponential\n  initial_delay_ms: 500\n  retry_on_status:\n    - 429\n    - 500\n    - 503\n\nexamples:\n  - name: \"Send to channel\"\n    description: Post a message to #general\n    params:\n      channel: \"#general\"\n      text: \"Hello team!\"\n  \n  - name: \"Reply in thread\"\n    description: Reply to a message thread\n    params:\n      channel: \"#general\"\n      text: \"Thanks for the update\"\n      thread_ts: \"1234567890.123456\"\n```\n\n### Key Decisions\n\n- **Type: http** because Slack API is REST-based\n- **Auth: api_key** in header (standard for Slack)\n- **Parameters**: Optional `thread_ts` for thread replies\n- **Output**: Validates `ok` and `ts` fields\n- **Retry**: Handles rate limiting (429) and server errors\n\n---\n\n## Troubleshooting\n\n### Tool Definition Won't Validate\n\nRun `pnpm validate-tools --verbose` to see:\n- Missing required fields (name, parameters, execution, output_schema)\n- Parameter type mismatches\n- Invalid execution config for selected type\n- Schema validation errors\n\n### Execution Fails with Auth Error\n\nCheck:\n- Env variable exists: `MATIMO_{TOOL_NAME}_API_KEY`\n- Template references correct field: `{API_TOKEN}` not `{api_token}`\n- Authentication.location matches where secret is used (header, query, body)\n\n### Command Executor Not Found\n\nVerify:\n- `index.ts` exists at correct path\n- `command` field in execution matches executable\n- Args array is properly formatted\n- Script outputs valid JSON to stdout\n\n### Parameter Templating Doesn't Work\n\nEnsure:\n- Parameter name in definition matches template: `{paramName}`\n- Template syntax uses exact name from parameters section\n- Parameter is defined as `required: true` or has `default` value\n- Type matches: numbers auto-converted to strings in templates\n\n---\n\n## References\n\n- **Tool lifecycle**: See `meta-tools-lifecycle` skill\n- **Complete tool creation**: See `tool-creation` skill\n- **Tool discovery**: See `tool-discovery` skill\n\n---\n","# Tool Creation for Matimo SDK\n\nThis skill teaches you how to properly create, configure, and validate tools for the **Matimo SDK**—a configuration-driven framework where tools are defined once in YAML and executed everywhere (factory pattern, decorators, LangChain).\n\n> **Two audiences — know which one you are:**\n>\n> | You are an **Agent at runtime** | You are an **SDK developer** |\n> |---|---|\n> | Creating tools dynamically via `matimo_create_tool` | Adding tools to the SDK codebase |\n> | Tools go to `.\u002Fmatimo-tools\u002F{tool-name}\u002Fdefinition.yaml` (configured by developer) | Tools go to `packages\u002F{provider}\u002Ftools\u002F{tool-name}\u002Fdefinition.yaml` |\n> | Validate with `matimo_doctor` (meta-tool) | Validate with `pnpm validate-tools` (CLI) |\n> | Approval needed: `matimo_approve_tool` → `matimo_reload_tools` | No approval flow — merged via git |\n>\n> **If you are an agent using meta-tools, follow the \"Agent at runtime\" column throughout this skill.**\n\n## Matimo Architecture Overview\n\n### Tool Execution Flow\n\n```\nTool Definition (YAML)\n         ↓\n    ToolLoader (parse & validate)\n         ↓\n    ToolRegistry (in-memory store)\n         ↓\nMatimoInstance.execute(name, params)\n         ↓\n  Select Executor Based on execution.type\n         ↓\nCommandExecutor | HttpExecutor | FunctionExecutor\n         ↓\n  Validate output against output_schema\n         ↓\n    Return structured result\n```\n\n### Key Concepts\n\n- **Tools are YAML-first**: Define once in YAML, execute anywhere\n- **Always include `requires_approval: true`**: Required by policy for all agent-created tools\n- **Default execution type is `http`**: `command` and `function` types are **blocked by policy by default** — only use `http` unless the developer has explicitly enabled the others\n- **Parameter templating**: Use `{paramName}` syntax for dynamic values\n- **Authentication**: Provider-agnostic (API key, bearer, basic, OAuth2)\n- **Output validation**: All responses validated against Zod schemas\n- **Error handling**: Structured errors with retry\u002Fbackoff policies\n\n> ⚠️ **Policy defaults block `command` and `function` tools.** Always use `type: http` unless you have confirmed the developer has set `allowCommandTools: true` or `allowFunctionTools: true` in the policy. Creating a `command` or `function` tool without explicit policy permission will fail validation.\n\n### File Structure\n\n**Agent at runtime** (using `matimo_create_tool`):\n```\n{target_dir}\u002F{tool-name}\u002F              ← target_dir is configured by the developer\n└── definition.yaml                    ← Tool YAML — written by meta-tool\n```\nDefault `target_dir` is `.\u002Fmatimo-tools` unless overridden. The approved tool **stays in this path permanently** — it is NOT cleared on restart. The `ApprovalManifest` (`.matimo-approvals.json`) is stored in the same directory.\n\n**SDK developer** (adding to codebase):\n```\npackages\u002F{provider}\u002Ftools\u002F{tool-name}\u002F\n├── definition.yaml                    ← Tool configuration\n└── index.ts                          ← Executor script (if type: command)\n```\n\n### Agent Tool Lifecycle (runtime creation)\n\n```\nmatimo_doctor(yaml_content)             ← 1. Validate YAML + policy FIRST\n         ↓ { valid: true }\nmatimo_create_tool(name, yaml_content, target_dir)\n         ↓ writes {target_dir}\u002F{name}\u002Fdefinition.yaml\n         ↓ status: \"draft\", approvalState: \"pending\"\nmatimo_approve_tool(name, tool_dir)     ← 3. Human approves\n         ↓ status updated to \"approved\" in same file\n         ↓ .matimo-approvals.json written to target_dir\nmatimo_reload_tools()                   ← 4. Hot-reload registry\n         ↓ approved tool is now live and executable\nmatimo.execute(tool-name, params)       ← 5. Use the tool\n```\n\n> ✅ **Approved tools are stored permanently** in `target_dir` on disk. They survive restarts as long as `target_dir` is included in Matimo's `toolPaths` config. They are NOT stored in temp directories — that is only used in demo examples.\n\n## When Creating Tools\n\nApply this skill when:\n- An agent needs to **create a new tool at runtime** (use meta-tools workflow above)\n- **Defining tool YAML** structure (applies to both agents and SDK developers)\n- Configuring **authentication**, **parameter templating**, or **output validation**\n- An SDK developer is **adding a new provider package** (e.g., GitHub, AWS, Notion)\n\n\n## Tool Definition Structure\n\n### Minimal Valid Tool (HTTP)\n\n```yaml\nname: tool_name                           # snake_case, unique across all tools\ndescription: What this tool does          # Clear, specific description\nversion: '1.0.0'\nrequires_approval: true                    # Must be true for agent-created tools\n\nparameters:                               # User-provided inputs\n  required_param:\n    type: string                          # string, number, boolean, object, array\n    required: true\n    description: What this parameter does\n\nexecution:\n  type: http                              # Type: http, command, or function\n  method: POST\n  url: 'https:\u002F\u002Fapi.example.com\u002Fv1\u002Fresource'\n  headers:\n    Authorization: 'Bearer {AUTH_TOKEN}'  # Template with env vars\n  body:\n    field: '{required_param}'             # Template with parameters\n\nauthentication:\n  type: api_key                           # Define how auth is handled\n  location: header\n  name: Authorization\n\noutput_schema:                            # Response must match this schema\n  type: object\n  properties:\n    success:\n      type: boolean\n  required:\n    - success\n\nexamples:\n  - name: \"Basic usage\"\n    params:\n      required_param: \"value\"\n```\n\n---\n\n## Execution Types\n\n> **Policy Rule:** By default, `command` and `function` execution types are **blocked** (`allowCommandTools: false`, `allowFunctionTools: false`). The safe default is `type: http`. Before using `command` or `function`, always run `matimo_doctor` to check if the policy in your environment allows it.\n\n### Type: HTTP ✅ Always Allowed\n\nFor REST API integrations (Slack, GitHub, AWS, etc.):\n\n```yaml\nexecution:\n  type: http\n  method: POST                          # GET, POST, PUT, DELETE, PATCH\n  url: 'https:\u002F\u002Fapi.example.com\u002Fendpoint'\n  timeout_ms: 30000\n  headers:\n    Authorization: 'Bearer {API_TOKEN}'\n    Content-Type: application\u002Fjson\n  query_params:\n    filter: '{paramName}'\n  body:\n    channel: '{channel}'\n    message: '{text}'\n```\n\n**Key patterns:**\n- Templating: `{paramName}` replaced with actual parameter values\n- Auth template: `{API_TOKEN}` replaced with `MATIMO_{TOOL_NAME}_API_KEY` env var\n- Headers\u002Fquery\u002Fbody all support templating\n- Timeouts default to 30000ms (30 seconds)\n\n### Type: Command ⛔ Blocked by Default\n\n> **Policy:** `allowCommandTools: false` by default. Creating a `command` tool will fail `matimo_doctor` unless the developer has explicitly set `allowCommandTools: true`. Do not attempt to create command tools unless you have confirmed this is allowed.\n\nIf allowed by policy:\n\n```yaml\nexecution:\n  type: command\n  command: 'tsx'                        # Executable to run\n  timeout_ms: 30000\n  args:\n    - 'packages\u002Fprovider\u002Ftool\u002Fexecutor.ts'\n    - '--param'\n    - '{paramValue}'\n```\n\n**Key patterns:**\n- Command executor receives templated args\n- Executor must output JSON to stdout\n- Parse args with Node's `parseArgs` utility\n- Use `getGlobalMatimoLogger()` for logging, never bare `console.log`\n\n### Type: Function ⛔ Blocked by Default\n\n> **Policy:** `allowFunctionTools: false` by default. Creating a `function` tool will fail `matimo_doctor` unless the developer has explicitly set `allowFunctionTools: true`. Do not attempt to create function tools unless you have confirmed this is allowed.\n\nIf allowed by policy:\n\n```yaml\nexecution:\n  type: function\n  handler: 'execute'                    # Function name in code block\n  code: |\n    export async function execute(params) {\n      return { success: true, data: params };\n    }\n```\n\n**Key patterns:**\n- Handler function receives `params` object\n- Must return object matching `output_schema`\n- Can be async\n- No file I\u002FO or CLI access\n\n---\n\n## Authentication Configuration\n\n> ❌ **NEVER write placeholder text in YAML** — strings like `YOUR_API_KEY`, `API_KEY_HERE`, or `replace_me` are **invalid**. They will be sent to the API as-is and cause authentication failures.\n>\n> ✅ **Always use `{VARIABLE_NAME}` template syntax.** The system replaces these at execution time from environment variables.\n\n### API Key (Header)\n\n```yaml\nauthentication:\n  type: api_key\n  location: header                      # Or: query, body\n  name: Authorization\n```\n\nEnvironment variable: `MATIMO_{TOOL_NAME}_API_KEY`\n\nWhen executing, the system injects: `Authorization: Bearer \u003Ckey-from-env>`\n\n### API Key (Query Parameter)\n\nSome APIs (e.g., weatherapi.com, OpenWeatherMap) require the key in the URL query string, not a header:\n\n```yaml\nexecution:\n  type: http\n  method: GET\n  url: 'https:\u002F\u002Fapi.weatherapi.com\u002Fv1\u002Fcurrent.json'\n  query_params:\n    key: '{WEATHER_API_KEY}'            # ✅ Template — resolved from env at runtime\n    q: '{city}'\n\nauthentication:\n  type: api_key\n  location: query\n  name: key\n```\n\nSet the key via environment variable before running: `WEATHER_API_KEY=your_actual_key`\n\n> ⚠️ Never embed the key directly in the URL string like `?key=abc123` — use the `query_params` map with `{VAR_NAME}` templating.\n\n### Bearer Token\n\n```yaml\nauthentication:\n  type: bearer\n```\n\nEnvironment variable: `MATIMO_{TOOL_NAME}_BEARER_TOKEN`\n\nInjected as: `Authorization: Bearer \u003Ctoken>`\n\n### Basic Auth\n\n```yaml\nauthentication:\n  type: basic\n  username_env: MATIMO_{TOOL_NAME}_USERNAME\n  password_env: MATIMO_{TOOL_NAME}_PASSWORD\n```\n\nEncodes as `Authorization: Basic base64(username:password)`\n\n### OAuth2\n\n```yaml\nauthentication:\n  type: oauth2\n  provider: google                      # google, github, slack, etc.\n  scopes:\n    - 'https:\u002F\u002Fwww.googleapis.com\u002Fauth\u002Fdrive'\n```\n\nOAuth configuration defined in provider's `definition.yaml`. System handles authorization code → token exchange.\n\n---\n\n## Parameter Definition\n\n### Basic Parameters\n\n```yaml\nparameters:\n  name:\n    type: string                        # string, number, boolean, object, array\n    required: true\n    description: Parameter description\n```\n\n### With Constraints\n\n```yaml\nparameters:\n  email:\n    type: string\n    required: true\n    pattern: '^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$'    # Email regex validation\n  \n  priority:\n    type: string\n    enum:\n      - low\n      - medium\n      - high                            # Restrict to specific values\n  \n  timeout:\n    type: number\n    min: 1\n    max: 300\n    default: 30                         # Use if not provided\n  \n  port:\n    type: number\n    min: 1\n    max: 65535\n  \n  count:\n    type: number\n    min_length: 0\n    max_length: 100                     # For strings\n```\n\n### Parameter Templating in Execution\n\n```yaml\nexecution:\n  type: http\n  body:\n    filter: '{priority}'                # Replaced with actual value\n    count: '{count}'                    # Numbers automatically stringified\n    tags:\n      - '{tag1}'\n      - '{tag2}'\n```\n\nWhen executing with `{ priority: 'high', count: 42, tag1: 'urgent', tag2: 'system' }`:\n- `{priority}` → `\"high\"`\n- `{count}` → `\"42\"`\n- `{tag1}`, `{tag2}` → array elements\n\n---\n\n## Output Schema Validation\n\nAll tools must define `output_schema`. Responses are validated with Zod:\n\n```yaml\noutput_schema:\n  type: object\n  properties:\n    success:\n      type: boolean\n      description: Operation success\n    \n    data:\n      type: object\n      description: Response data\n      properties:\n        id:\n          type: string\n        timestamp:\n          type: string\n        count:\n          type: number\n    \n    error:\n      type: object\n      description: Error details (if failed)\n  \n  required:\n    - success\n```\n\n**Execution behavior:**\n1. Tool executes (HTTP, command, or function)\n2. Response parsed and validated against schema\n3. If validation fails → `MatimoError(INVALID_SCHEMA, ...)`\n4. If validation succeeds → result returned to caller\n\n---\n\n## Error Handling & Retry Policies\n\n```yaml\nerror_handling:\n  retry: 3                              # Retry up to 3 times\n  backoff_type: exponential             # exponential or linear\n  initial_delay_ms: 500                 # First retry delay\n  max_delay_ms: 30000                   # Maximum delay between retries\n  retry_on_status:                      # HTTP status codes to retry\n    - 429                               # Rate limited\n    - 500                               # Server error\n    - 503                               # Service unavailable\n```\n\n**Retry behavior:**\n- Delay = `initial_delay_ms * (backoff_exponent ^ attempt_number)`\n- Capped at `max_delay_ms`\n- Only retries on specified HTTP status codes\n- Non-2xx responses still validated against schema\n\n---\n\n## Command Executor Implementation\n\n> ⚠️ **Only applicable if `allowCommandTools: true` is set in policy.** If you are unsure, run `matimo_doctor` on your YAML first — it will fail immediately if command tools are blocked.\n\nFor `type: command` tools, create an executor at `packages\u002F{provider}\u002Ftools\u002F{tool-name}\u002Findex.ts`:\n\n```typescript\nimport { parseArgs } from 'util';\nimport { getGlobalMatimoLogger } from '@matimo\u002Fcore';\n\ninterface ExecutorParams {\n  channel: string;\n  text?: string;\n}\n\nasync function main() {\n  const logger = getGlobalMatimoLogger();\n  \n  try {\n    \u002F\u002F Parse command-line arguments\n    const { values } = parseArgs({\n      options: {\n        channel: { type: 'string' },\n        text: { type: 'string' }\n      }\n    });\n    \n    \u002F\u002F Validate required params\n    if (!values.channel) {\n      throw new Error('channel is required');\n    }\n    \n    const params: ExecutorParams = {\n      channel: values.channel as string,\n      text: values.text\n    };\n    \n    \u002F\u002F Execute business logic\n    const result = await executeLogic(params);\n    \n    \u002F\u002F Output as JSON\n    console.log(JSON.stringify(result));\n  } catch (error) {\n    logger.error('Executor failed', {\n      error: error instanceof Error ? error.message : String(error)\n    });\n    \n    console.log(JSON.stringify({\n      success: false,\n      message: error instanceof Error ? error.message : String(error)\n    }));\n    \n    process.exit(1);\n  }\n}\n\nasync function executeLogic(params: ExecutorParams) {\n  \u002F\u002F Your actual logic here\n  return {\n    success: true,\n    message: 'Operation completed',\n    data: { channel: params.channel }\n  };\n}\n\nmain();\n```\n\n**Key guidelines:**\n- Always use `getGlobalMatimoLogger()`, never bare `console.log` in core code\n- Validate all parameters\n- Output JSON with structure matching `output_schema`\n- Exit with code 1 on error\n- Never log secrets\n\n---\n\n## Code Quality Standards\n\n### Zod Validation\n\nAll parameter parsing must use Zod:\n\n```typescript\nimport { z } from 'zod';\n\nconst ParamSchema = z.object({\n  channel: z.string().min(1),\n  text: z.string().optional(),\n  timeout: z.number().min(1).max(300).default(30)\n});\n\nconst params = ParamSchema.parse(input);  \u002F\u002F Throws if invalid\n```\n\n### Error Handling\n\nUse `MatimoError` with structured error codes:\n\n```typescript\nimport { MatimoError, ErrorCode } from '@matimo\u002Fcore';\n\nthrow new MatimoError(\n  'API request failed',\n  ErrorCode.EXECUTION_FAILED,\n  {\n    toolName: 'slack_send',\n    statusCode: 500,\n    details: { message: 'Server error' }\n    \u002F\u002F Never include secrets\n  }\n);\n```\n\nError codes:\n- `INVALID_SCHEMA` — Parameter or response validation failed\n- `EXECUTION_FAILED` — Tool execution failed\n- `AUTH_FAILED` — Authentication missing or invalid\n- `TOOL_NOT_FOUND` — Tool definition not found\n\n### Type Safety\n\n- Use strict TypeScript (no `any` type)\n- Export types alongside implementations\n- Use discriminated unions: `{ type: 'command', command: string }`\n- Never trust user input without validation\n\n---\n\n## Strict Rules & Enforcement Standards\n\nThese rules are **non-negotiable** for all Matimo tools. Violations block tool approval.\n\n### 1. Naming Conventions (STRICT)\n\n**Tool Names:**\n- ✅ MUST use `snake_case` (e.g., `slack_send_message`, `github_create_issue`)\n- ✅ MUST be globally unique across all providers\n- ✅ MUST describe the action clearly (no abbreviations like `slack_msg`)\n- ❌ NO camelCase, PascalCase, or kebab-case\n- ❌ NO generic names like `execute` or `run`\n\n**Parameters (YAML):**\n- ✅ MUST use `camelCase` (e.g., `channelId`, `messageText`, `retryCount`)\n- ✅ MUST be descriptive and match API conventions\n- ❌ NO snake_case in parameter names\n- ❌ NO single-letter parameters (except standard `a`, `b` in math examples)\n\n**Parameters (TypeScript\u002FJavaScript):**\n- ✅ MUST use `camelCase` for variables (e.g., `const channelId = ...`)\n- ✅ Class\u002Ffunction names MUST use `PascalCase` (e.g., `SlackClient`, `parseResponse()`)\n- ✅ Constants MUST use `UPPER_SNAKE_CASE` (e.g., `MAX_RETRIES`, `API_TIMEOUT_MS`)\n- ✅ Private methods MUST use `#` prefix (e.g., `#validateResponse()`)\n- ❌ NO inconsistent casing within a single tool\n\n**Provider Packages:**\n- ✅ MUST use `snake_case` (e.g., `@matimo\u002Fslack`, `@matimo\u002Fgithub`)\n- ✅ Directory path: `packages\u002F{provider}\u002Ftools\u002F{tool_name}\u002F`\n- ❌ NO uppercase letters in directory names\n\n**Example (Correct):**\n```yaml\n# packages\u002Fslack\u002Ftools\u002Fslack_send_message\u002Fdefinition.yaml\nname: slack_send_message\nparameters:\n  channelId:        # camelCase\n    type: string\n    required: true\n  messageText:      # camelCase\n    type: string\n```\n\n### 2. Tool Completeness (CRITICAL)\n\n**All tools MUST be fully functional:**\n\n✅ **Required Elements:**\n- ☑️ Tool definition YAML must be complete and valid\n- ☑️ All parameters in YAML must be documented with type, description, required\n- ☑️ All examples in YAML must match the defined parameters (no extra\u002Fmissing params)\n- ☑️ All referenced environment variables MUST be documented in description\n- ☑️ Output schema MUST match actual API response structure\n- ☑️ Error handling MUST cover all documented failure modes\n- ☑️ Executor code (if `type: command`) must be fully implemented\n- ☑️ Authentication setup must be tested and working\n- ☑️ Tool must execute without errors in all example scenarios\n\n❌ **Never Allow:**\n- Stub implementations with TODO comments\n- @TODO, FIXME, XXX, HACK comments in production code\n- @ts-ignore, eslint-disable comments (fix the actual issue)\n- Placeholder values in examples\n- \"Coming soon\" features\n- Incomplete authentication configuration\n\n**Completeness Checklist:**\n```\nBefore submitting a tool:\n[ ] Tool YAML parses without errors (pnpm validate-tools)\n[ ] All parameters in YAML have type + description + required\n[ ] All examples match parameter definitions exactly\n[ ] Output schema matches real API responses\n[ ] Error handling uses MatimoError with ErrorCode\n[ ] Tests pass with 80%+ coverage (pnpm test:coverage)\n[ ] No console.log in main code (use logger)\n[ ] No env var references without documentation\n[ ] Tool executes successfully in all examples\n[ ] No TODO\u002FFIXME\u002FXXX\u002FHACK comments\n[ ] No @ts-ignore, eslint-disable comments\n```\n\n### 3. Parameter Validation (STRICT)\n\n**Parameter Definition Requirements:**\n- ✅ EVERY parameter MUST have `type`, `description`, `required`\n- ✅ `type` must be one of: `string`, `number`, `boolean`, `array`, `object`\n- ✅ `description` must explain WHAT and WHY (e.g., \"Slack channel ID (starts with C)\")\n- ✅ Constraints MUST be specific:\n  - For strings: `minLength`, `maxLength`, `pattern` (regex)\n  - For numbers: `minimum`, `maximum`, step\n  - For arrays: `minItems`, `maxItems`, `items` (type)\n  - For enums: `enum: [value1, value2]`\n- ✅ Default values MUST match their type\n- ❌ NO `type: object` without `properties` defined\n- ❌ NO vague descriptions like \"The text parameter\"\n\n**Valid Parameter Example:**\n```yaml\nparameters:\n  channelId:\n    type: string\n    required: true\n    description: \"Slack channel ID (format: C0123456789, starts with C)\"\n    pattern: \"^C[A-Z0-9]{10,}$\"\n    \n  messageText:\n    type: string\n    required: false\n    description: \"Plain text message to send. Supports markdown. Max 4000 chars.\"\n    maxLength: 4000\n    \n  threadTimestamp:\n    type: number\n    required: false\n    description: \"Parent message timestamp for threading (Unix epoch, decimal)\"\n    minimum: 0\n    \n  tags:\n    type: array\n    required: false\n    description: \"Optional tags to categorize the message\"\n    items:\n      type: string\n    minItems: 1\n    maxItems: 5\n```\n\n### 4. Authentication (MANDATORY for HTTP tools)\n\n**Every HTTP tool MUST have authentication:**\n- ✅ `authentication` block MUST specify type and location\n- ✅ Supported types: `api_key`, `bearer`, `basic`, `oauth2`\n- ✅ Environment variable naming: `MATIMO_{TOOL_NAME}_{AUTH_TYPE}` (uppercase)\n- ✅ Authentication setup MUST be documented (which provider supports which auth)\n- ✅ Token refresh\u002Fexpiration MUST be handled if applicable\n- ❌ NO tools with `type: http` and no authentication\n- ❌ NO hardcoded credentials or tokens\n\n**Example (Correct):**\n```yaml\nexecution:\n  type: http\n  method: POST\n  url: 'https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.postMessage'\n  headers:\n    Authorization: 'Bearer {SLACK_BOT_TOKEN}'\n\nauthentication:\n  type: api_key\n  location: header\n  name: Authorization\n```\n\n### 5. Output Schema Validation (REQUIRED)\n\n**Output schema MUST match actual API response:**\n- ✅ Schema MUST be present for every tool\n- ✅ Schema MUST use Zod-compatible JSON schema\n- ✅ Schema MUST match real API success response\n- ✅ Response validation MUST fail if schema doesn't match\n- ❌ NO generic `{ type: object }` schemas\n- ❌ NO schemas that don't match actual responses\n\n**Example (Correct):**\n```yaml\noutput_schema:\n  type: object\n  properties:\n    ok:\n      type: boolean\n      description: \"Request succeeded\"\n    message:\n      type: object\n      properties:\n        type:\n          type: string\n        ts:\n          type: string\n        channel:\n          type: string\n  required: [ok, message]\n```\n\n### 6. Error Handling (MANDATORY)\n\n**All errors MUST use MatimoError:**\n- ✅ MUST import and use `MatimoError` from `@matimo\u002Fcore`\n- ✅ MUST use correct `ErrorCode` (INVALID_SCHEMA, EXECUTION_FAILED, AUTH_FAILED, TOOL_NOT_FOUND)\n- ✅ Error messages MUST be clear and actionable\n- ✅ Error details MUST include context (but NO secrets)\n- ✅ Setup `error_handling.retry` if operation is idempotent\n- ❌ NO custom error classes\n- ❌ NO throwing plain Error or Error subclasses\n\n**Example (Correct):**\n```typescript\nimport { MatimoError, ErrorCode } from '@matimo\u002Fcore';\n\nif (!channelId) {\n  throw new MatimoError(\n    'Channel ID is required',\n    ErrorCode.INVALID_SCHEMA,\n    { expectedFormat: 'C0123456789' }\n  );\n}\n\ntry {\n  const response = await fetch(url);\n  if (!response.ok) {\n    throw new MatimoError(\n      'Slack API request failed',\n      ErrorCode.EXECUTION_FAILED,\n      { statusCode: response.status }  \u002F\u002F NOT the response body\n    );\n  }\n} catch (error) {\n  throw new MatimoError(\n    'Network error',\n    ErrorCode.EXECUTION_FAILED,\n    { message: error instanceof Error ? error.message : 'Unknown error' }\n  );\n}\n```\n\n### 7. Logging (NO console.log in Core)\n\n**Log Usage Rules:**\n- ✅ Use `getGlobalMatimoLogger()` from `@matimo\u002Fcore`\n- ✅ Log at appropriate levels: `error`, `warn`, `info`, `debug`\n- ✅ Log important validation failures, auth issues, retries\n- ✅ Never log secrets, credentials, or sensitive data\n- ❌ NO `console.log`, `console.error`, `console.warn` in package code\n- ❌ NO logging secrets, API keys, tokens, passwords\n- ❌ NO over-logging (avoid logs for normal happy paths)\n\n**Example (Correct):**\n```typescript\nimport { getGlobalMatimoLogger } from '@matimo\u002Fcore';\n\nconst logger = getGlobalMatimoLogger();\n\ntry {\n  logger.info('Sending message to Slack', { channel: channelId });\n  \u002F\u002F ...\n} catch (error) {\n  logger.error('Slack API call failed', { statusCode, message });\n  throw new MatimoError('Failed', ErrorCode.EXECUTION_FAILED, { statusCode });\n}\n```\n\n### 10. Enforcement Gates (Agent Checklist)\n\nWhen reviewing a tool, the agent MUST verify:\n\n```\nNAMING CONVENTIONS GATE\n✓ Tool name is snake_case (slack_send_message)\n✓ requires_approval: true is present\n✓ Parameters are camelCase (channelId, messageText)\n✓ Tool name does NOT start with matimo_ (reserved namespace)\n✓ TypeScript uses PascalCase for classes\n\nPOLICY GATE (run matimo_doctor first — fail fast)\n✓ execution.type is http  (command\u002Ffunction blocked by default)\n✓ URL domain is in allowedDomains list\n✓ HTTP method is GET or POST (default allowed methods)\n✓ No SSRF risk (no internal IPs or metadata endpoints)\n✓ Credential name is in allowedCredentials list\n✓ matimo_doctor returns { valid: true } before create\n\nCOMPLETENESS GATE\n✓ YAML parses without errors\n✓ All parameters have type, description, required\n✓ All examples match parameter definitions\n✓ No TODO\u002FFIXME\u002FHACK comments\n\nQUALITY GATE\n✓ Output schema matches real API response\n✓ Error handling uses MatimoError + ErrorCode\n✓ Authentication configured (if HTTP)\n✓ Env vars documented and referenced\n\nDELIVERY GATE\n✓ All gates passed\n✓ Tool ready for production use\n✓ Can be merged without caveats\n```\n\n---\n\n## Workflow: Creating a New Tool\n\n### Agent at Runtime (using meta-tools)\n\n#### Step 1: Write YAML in memory\n\nCompose the full tool definition YAML string. Required fields:\n- `name`, `description`, `version`\n- `requires_approval: true` ← **mandatory — policy will reject without it**\n- `parameters` (with types and descriptions)\n- `execution` — **use `type: http`** (command\u002Ffunction blocked by default)\n- `authentication` (mandatory for HTTP tools)\n- `output_schema`\n\n#### Step 2: Validate with `matimo_doctor` FIRST\n\n```\nmatimo_doctor(yaml_content: \"\u003Cfull YAML string>\")\n```\n\n- ✅ `{ valid: true }` → proceed to Step 3\n- ❌ `{ valid: false, policyViolations: [...] }` → fix the YAML and re-validate\n\n**Common failures and fixes:**\n\n| Failure | Fix |\n|---------|-----|\n| `command tools blocked` | Change `type: command` → `type: http` |\n| `function tools blocked` | Change `type: function` → `type: http` |\n| `domain not allowed` | Use a domain in the `allowedDomains` list |\n| `HTTP method not allowed` | Use `GET` or `POST` |\n| `reserved namespace` | Rename — don't start with `matimo_` |\n| `requires_approval missing` | Add `requires_approval: true` |\n| `forced-approval` | Same — add `requires_approval: true` |\n\n#### Step 3: Create on disk with `matimo_create_tool`\n\n```\nmatimo_create_tool(\n  name: \"my_tool_name\",\n  yaml_content: \"\u003Cvalidated YAML>\",\n  target_dir: \"\u003Cpath the developer configured, e.g. .\u002Fmatimo-tools>\"\n)\n```\n\nResult:\n- Tool written to `{target_dir}\u002F{name}\u002Fdefinition.yaml`\n- `status: \"draft\"`, `approvalState: \"pending\"` (or `\"auto-approved\"` for low-risk GET tools)\n- **This path is permanent** — approved tools stay here and survive restarts\n\n#### Step 4: Get human approval\n\n```\nmatimo_approve_tool(name: \"my_tool_name\", tool_dir: \"\u003Csame target_dir>\")\n```\n\n- Updates `status` to `\"approved\"` in the same `definition.yaml`\n- Writes approval hash to `{target_dir}\u002F.matimo-approvals.json`\n\n#### Step 5: Reload and use\n\n```\nmatimo_reload_tools()         ← Hot-reloads registry from disk\nmatimo.execute(\"my_tool_name\", params)   ← Tool is now live\n```\n\n---\n\n### SDK Developer (adding to codebase)\n\n#### Step 1: Create directory\n```bash\nmkdir -p packages\u002F{provider}\u002Ftools\u002F{tool-name}\n```\n\n#### Step 2: Write `definition.yaml`\n\nSame YAML structure as above. No `requires_approval` needed for SDK-shipped tools.\n\n#### Step 3: Add test fixture\n```bash\ncp packages\u002F{provider}\u002Ftools\u002F{tool-name}\u002Fdefinition.yaml \\\n   packages\u002Fcore\u002Ftest\u002Ffixtures\u002F{provider}\u002F{tool-name}-fixture.yaml\n```\n\n#### Step 4: Validate & test\n```bash\npnpm validate-tools              # Check YAML schema\npnpm test                        # Run test suite\npnpm test:coverage               # Verify 80%+ coverage\npnpm lint                        # Check code quality\n```\n\n---\n\n## Validation & Quality Checks\n\n### Agent: Validate with `matimo_doctor`\n\nRun before every `matimo_create_tool` call:\n\n✅ YAML syntax is valid  \n✅ Policy compliance (domains, methods, execution type, namespace)  \n✅ Schema fields present (name, parameters, execution, output_schema)  \n✅ `requires_approval: true` present  \n\n### SDK Developer: Validate with CLI\n\n```bash\npnpm validate-tools\n```\n\n✅ YAML syntax is valid  \n✅ Schema matches ToolDefinition contract  \n✅ All required fields present  \n✅ Parameter types are consistent  \n\n### Code Quality\n\n```bash\npnpm lint              # ESLint checks\npnpm format           # Prettier formatting\npnpm test             # All tests pass\npnpm test:coverage    # 80%+ coverage\n```\n\n### Security Review\n\n- No hardcoded secrets in definitions\n- No sensitive data in error messages\n- Auth env vars properly documented\n- No `console.log` in production code\n\n---\n\n## Common Patterns\n\n### Pattern 1: Parameter Templating\n\n```yaml\nexecution:\n  type: http\n  url: 'https:\u002F\u002Fapi.example.com\u002Fusers\u002F{user_id}'\n  body:\n    name: '{name}'\n    email: '{email}'\n```\n\nParameters are replaced before execution. Type conversion handled automatically (numbers → strings).\n\n### Pattern 2: Environment Variable Injection\n\n```yaml\nexecution:\n  type: http\n  headers:\n    Authorization: 'Bearer {API_TOKEN}'    # Gets MATIMO_SLACK_API_KEY from env\n```\n\nTemplate syntax: `{UPPERCASE_NAME}` → `process.env.MATIMO_{TOOL_NAME}_UPPERCASE_NAME`\n\n### Pattern 3: Optional Parameters with Defaults\n\n```yaml\nparameters:\n  timeout:\n    type: number\n    required: false\n    default: 30\n\nexecution:\n  args:\n    - '--timeout'\n    - '{timeout}'        # Uses default if not provided\n```\n\n### Pattern 4: Enum Validation\n\n```yaml\nparameters:\n  status:\n    type: string\n    enum:\n      - draft\n      - published\n      - archived\n\nexecution:\n  query_params:\n    status: '{status}'   # Only allows draft, published, or archived\n```\n\n---\n\n## Real Example: Slack Send Message\n\n### definition.yaml\n\n```yaml\nname: slack_send_message\ndescription: Send a text message to a Slack channel\nversion: '1.0.0'\n\nparameters:\n  channel:\n    type: string\n    required: true\n    description: Channel ID or name (e.g., #general or C12345)\n  text:\n    type: string\n    required: true\n    description: Message text to send\n  thread_ts:\n    type: string\n    required: false\n    description: Parent message timestamp for thread replies\n\nexecution:\n  type: http\n  method: POST\n  url: 'https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.postMessage'\n  headers:\n    Authorization: 'Bearer {SLACK_BOT_TOKEN}'\n    Content-Type: application\u002Fjson\n  body:\n    channel: '{channel}'\n    text: '{text}'\n    thread_ts: '{thread_ts}'\n\nauthentication:\n  type: api_key\n  location: header\n  name: Authorization\n\noutput_schema:\n  type: object\n  properties:\n    ok:\n      type: boolean\n    ts:\n      type: string\n    channel:\n      type: string\n  required:\n    - ok\n    - ts\n\nerror_handling:\n  retry: 2\n  backoff_type: exponential\n  initial_delay_ms: 500\n  retry_on_status:\n    - 429\n    - 500\n    - 503\n\nexamples:\n  - name: \"Send to channel\"\n    description: Post a message to #general\n    params:\n      channel: \"#general\"\n      text: \"Hello team!\"\n  \n  - name: \"Reply in thread\"\n    description: Reply to a message thread\n    params:\n      channel: \"#general\"\n      text: \"Thanks for the update\"\n      thread_ts: \"1234567890.123456\"\n```\n\n### Key Decisions\n\n- **Type: http** because Slack API is REST-based\n- **Auth: api_key** in header (standard for Slack)\n- **Parameters**: Optional `thread_ts` for thread replies\n- **Output**: Validates `ok` and `ts` fields\n- **Retry**: Handles rate limiting (429) and server errors\n\n---\n\n## Troubleshooting\n\n### Tool Definition Won't Validate\n\nRun `pnpm validate-tools --verbose` to see:\n- Missing required fields (name, parameters, execution, output_schema)\n- Parameter type mismatches\n- Invalid execution config for selected type\n- Schema validation errors\n\n### Execution Fails with Auth Error\n\nCheck:\n- Env variable exists: `MATIMO_{TOOL_NAME}_API_KEY`\n- Template references correct field: `{API_TOKEN}` not `{api_token}`\n- Authentication.location matches where secret is used (header, query, body)\n\n### Command Executor Not Found\n\nVerify:\n- `index.ts` exists at correct path\n- `command` field in execution matches executable\n- Args array is properly formatted\n- Script outputs valid JSON to stdout\n\n### Parameter Templating Doesn't Work\n\nEnsure:\n- Parameter name in definition matches template: `{paramName}`\n- Template syntax uses exact name from parameters section\n- Parameter is defined as `required: true` or has `default` value\n- Type matches: numbers auto-converted to strings in templates\n\n---\n\n## References\n\n- **Tool lifecycle**: See `meta-tools-lifecycle` skill\n- **Complete tool creation**: See `tool-creation` skill\n- **Tool discovery**: See `tool-discovery` skill\n\n---\n",{"name":5,"metadata":24,"description":7},{"category":25,"difficulty":26,"user-invokable":27},"Tool Development","intermediate","true","main","3ace42f8c811a205651ca8cf53bc2608abffc266","typescript\u002Fpackages\u002Fcore\u002Fskills\u002Ftool-creation",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 tool-creation",{"tool":43,"command":44},"bunx","bunx skills add review-bench\u002Ftallclub_matimo --skill tool-creation",{"tool":46,"command":47},"pnpm","pnpm dlx skills add review-bench\u002Ftallclub_matimo --skill tool-creation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Freview-bench\u002Ftallclub_matimo\u002Fblob\u002Fmain\u002Ftypescript\u002Fpackages\u002Fcore\u002Fskills\u002Ftool-creation\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",[],[]]