[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DEDDN8HD74N7FBBN2AT96X":3,"skill-same:01M7DEDDN8HD74N7FBBN2AT96X":52},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":14,"categories":15,"keywords":16,"publishedAt":17,"linkOnly":18,"markdownContent":19,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":12,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":27,"install":28,"resources":41},"01M7DEDDN8HD74N7FBBN2AT96X","tool-prompt-optimization",null,"ayooooo123\u002Feros","ayooooo123","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F248791769?v=4","01M7DEA52FSZZQ76TCMECHBH0X","01M7DEA5305KDDJNPNDACGZGGG",0,"MIT","https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002F.omp\u002Fskills\u002Ftool-prompt-optimization\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tool-prompt-optimization\ndescription: Optimize the description prompts an AI agent reads to learn its built-in tools (the `.md` files under prompts\u002Ftools\u002F). Two halves: (1) measure how much of a prompt is already inferable from the tool's JSON parameter schema + name, to prune redundancy with evidence; (2) house authoring rules for what belongs in a tool prompt vs what stays in code. Use when auditing, trimming, writing, or reviewing tool prompts, deciding what schema field descriptions already cover, or testing schema-vs-prompt overlap before deleting prompt lines.\n---\n\n# Tool Prompt Optimization\n\nPrompt\u002Fschema overlap: content reconstructible from `(name, JSON schema, blank outline)` is a *prune candidate*, never an automatic delete. Probe this overlap for evidence, not vibes: predict the prompt body from those inputs. Reliably recovered lines: candidates; no-model recovery: load-bearing — keep.\n\n## Run probe\n\n`scripts\u002Fprobe.ts`: `@oh-my-pi\u002Fpi-ai` `completeSimple`; production-matching model\u002Fauth\u002Fprovider behavior.\n\n```bash\nbun .omp\u002Fskills\u002Ftool-prompt-optimization\u002Fscripts\u002Fprobe.ts \\\n  --schema \u003Cfile|json> --template \u003Cfile|text> --name \u003Ctool_name>\n```\n\n- Required: `--schema`, `--template` — file path or inline value.\n- No `--model`: panel `fireworks\u002Fkimi-k2.7-code`, `anthropic\u002Fclaude-opus-4-8`, `openai\u002Fgpt-5.5` × `--samples` (default 3); requires `FIREWORKS_API_KEY` \u002F `ANTHROPIC_API_KEY` \u002F `OPENAI_API_KEY`.\n- `--model p\u002Fid,p\u002Fid`: override panel. Tune: `--samples N`, `--max-tokens`, `--json`.\n- Programmatic: `import { probe } from \".\u002Fscripts\u002Fprobe.ts\"` → `{ prompt, results: [{ model, samples: [{ text, stopReason, usage, error }] }] }`.\n\n### Builtin shortcut — preferred for this repo\n\n`scripts\u002Fprobe-builtin.ts` instantiates the live tool; gets exact `toolWireSchema`, `tool.description`, and derived outline:\n\n```bash\nbun .omp\u002Fskills\u002Ftool-prompt-optimization\u002Fscripts\u002Fprobe-builtin.ts --tool \u003Cname> [--no-summary] [--show]\n```\n\n- `--show`: resolved schema, derived outline, real prompt; exits without API calls. Inspect before spending tokens.\n- `--no-summary`: direct summary-line-blank ablation.\n- `--samples` \u002F `--model` \u002F `--max-tokens` \u002F `--json`: panel passthrough. Output ends with real prompt for in-place diff.\n- Factory-map bypasses settings allowlist: gated `irc`, `github`, … resolve. Construction availability gate (e.g. missing `gh` CLI) → manual inputs.\n\n## Inputs\n\n**Schema:** wire schema the model sees, never hand-sketch. Arktype:\n\n```ts\nimport { arkToWireSchema } from \"@oh-my-pi\u002Fpi-ai\"; \u002F\u002F or toolWireSchema(tool)\nJSON.stringify(arkToWireSchema(toolSchema), null, 2);\n```\n\nInclude `required`, `additionalProperties: false`; omission makes usage appear looser than reality.\n\n**Template:** actual `.md` structure with bodies blanked — one-line summary, then each section tag containing `...`.\n\n```\nStructural code search via native ast-grep AST matching.\n\n\u003Cinstruction>\n...\n\u003C\u002Finstruction>\n\n\u003Coutput>\n...\n\u003C\u002Foutput>\n\n\u003Ccritical>\n...\n\u003C\u002Fcritical>\n```\n\n## Interpret\n\nBucket each real-prompt line:\n\n- **Prune candidate:** stable across samples **and** models; schema restatement — parameter names\u002Ftypes, `required`, field-description value examples, stated clamp ranges.\n- **Keep:** no model recovers it — defaults\u002Fdirection (`gitignore` default true); routing\u002Fescalation (`NEVER` shell out to `find`\u002F`fd` → use this tool; broad exploration → `Task` subagent); exact output shape (mtime sort, grouping, `artifact:\u002F\u002F` truncation); worked anti-patterns; type-invisible constraints (AST metavariable grammar, C++ trailing `;`).\n\nOne sample: noise. Stable cross-sample\u002Fmodel overlap is only a candidate; history must clear it. MUST NOT delete on inferability alone.\n\n## Caveats — before every deletion\n\n- **MUST `git blame` each cut line; read its commit\u002Fissue.** Many lines are incident scar tissue: hallucinated flag, shell-out, repo-root scan, fabricated anchor. Keep scar tissue. History distinguishes schema restatement from incident prevention. Inferability necessary, NEVER sufficient.\n- **Memorization ≠ inference:** public repos, including this one, may be training data. Repo-specific prediction absent from schema — exact tool names, internal URI schemes, `Task` subagent — is recitation; discount it.\n- **Outline leaks:** summary and section names hint. For schema-alone inference, second pass: no summary, generic section tags. Content surviving only the summary is summary-inferable, not schema-inferable.\n\n## Verdict\n\nPredictions usually recover schema-covered parameter mechanics\u002Fgeneric usage, not defaults, output shape, routing, anti-patterns, domain grammar. Prune the former only after per-line `git blame`; keep the latter. Self-documenting flag tools (`find`) prune heavily; DSL\u002Fcapability tools (`read`, `ast_grep`) barely.\n\n## Tool Prompt Authoring\n\nTool prompts are not API docs: teach when to choose a tool, input shape, and agent-owned failures. Engine internals, recovery heuristics, fallback chains, performance tuning: code.\n\n### Surface, not machinery\n\nAgents choose from prose, not source: tell WHEN\u002FWHY, NEVER internal HOW.\n\n- `read.md`: every covered source — file\u002Fdir\u002Farchive\u002Fsqlite\u002FPDF\u002FURL — prevents `cat`\u002F`curl`\u002F`tar`; omit chunker, binary sniffer, cache layer.\n- `lsp.md`: \"You MUST use `lsp` whenever a language server is available — safer than text-based alternatives.\" Omit LSP wire protocol, server lifecycle, capability negotiation.\n- `ast_edit`: metavariable syntax\u002Fworkflow: \"Loosest existence check: `pat: 'executeBash'` with narrow paths\"; omit AST engine, query compilation, tree-sitter grammar selection.\n- `hashline.md` (this repo): patch grammar — anchors, ops, payloads, ranges — and successful edit shapes. Hide `tryRecoverHashlineWithCache`, fuzz factor, bigram tables, `findUniqueSuffixMatch`, `untilAborted`, `formatGroupedFiles`; agent sees only \"the tool resolved your typo\" or \"the anchor was stale, re-read\".\n\nIf a detail cannot change agent behavior, it does NOT belong. Each sentence MUST shift an agent decision.\n\n### Good prompt anatomy\n\n1. **One-line purpose:** agent-vocabulary problem; not \"wraps libfoo with X\", but \"compact, line-anchored edit format\".\n2. **Input grammar\u002Fsurface:** operators, parameters, selectors; concrete emitted syntax.\n3. **Worked examples:** 3–8 common shapes. Example IS explanation; do not narrate twice.\n4. **Agent-owned failure shapes:** input-fixable stale anchors, missing payload prefix, fabricated hash; omit silently recovered failures.\n5. **Anti-patterns:** real-failure WRONG\u002FRIGHT pairs for retry-causing mistakes, never imagined ones.\n6. **`\u003Ccritical>` recap:** 3–6 load-bearing lines for agents skipping body.\n\n### Exclude\n\n- Implementation file\u002Ffunction names, module layout.\n- Recovery, retry, normalization, caching, fuzz matching.\n- Performance characteristics such as \"this is O(n)\", unless strategy-changing.\n- Telemetry, logging, debug flags, unsettable env vars.\n- Version history, deprecated parameters, \"previously this worked differently\".\n- Cross-tool plumbing such as \"this calls `read` under the hood\", unless coordination required.\n","# Tool Prompt Optimization\n\nPrompt\u002Fschema overlap: content reconstructible from `(name, JSON schema, blank outline)` is a *prune candidate*, never an automatic delete. Probe this overlap for evidence, not vibes: predict the prompt body from those inputs. Reliably recovered lines: candidates; no-model recovery: load-bearing — keep.\n\n## Run probe\n\n`scripts\u002Fprobe.ts`: `@oh-my-pi\u002Fpi-ai` `completeSimple`; production-matching model\u002Fauth\u002Fprovider behavior.\n\n```bash\nbun .omp\u002Fskills\u002Ftool-prompt-optimization\u002Fscripts\u002Fprobe.ts \\\n  --schema \u003Cfile|json> --template \u003Cfile|text> --name \u003Ctool_name>\n```\n\n- Required: `--schema`, `--template` — file path or inline value.\n- No `--model`: panel `fireworks\u002Fkimi-k2.7-code`, `anthropic\u002Fclaude-opus-4-8`, `openai\u002Fgpt-5.5` × `--samples` (default 3); requires `FIREWORKS_API_KEY` \u002F `ANTHROPIC_API_KEY` \u002F `OPENAI_API_KEY`.\n- `--model p\u002Fid,p\u002Fid`: override panel. Tune: `--samples N`, `--max-tokens`, `--json`.\n- Programmatic: `import { probe } from \".\u002Fscripts\u002Fprobe.ts\"` → `{ prompt, results: [{ model, samples: [{ text, stopReason, usage, error }] }] }`.\n\n### Builtin shortcut — preferred for this repo\n\n`scripts\u002Fprobe-builtin.ts` instantiates the live tool; gets exact `toolWireSchema`, `tool.description`, and derived outline:\n\n```bash\nbun .omp\u002Fskills\u002Ftool-prompt-optimization\u002Fscripts\u002Fprobe-builtin.ts --tool \u003Cname> [--no-summary] [--show]\n```\n\n- `--show`: resolved schema, derived outline, real prompt; exits without API calls. Inspect before spending tokens.\n- `--no-summary`: direct summary-line-blank ablation.\n- `--samples` \u002F `--model` \u002F `--max-tokens` \u002F `--json`: panel passthrough. Output ends with real prompt for in-place diff.\n- Factory-map bypasses settings allowlist: gated `irc`, `github`, … resolve. Construction availability gate (e.g. missing `gh` CLI) → manual inputs.\n\n## Inputs\n\n**Schema:** wire schema the model sees, never hand-sketch. Arktype:\n\n```ts\nimport { arkToWireSchema } from \"@oh-my-pi\u002Fpi-ai\"; \u002F\u002F or toolWireSchema(tool)\nJSON.stringify(arkToWireSchema(toolSchema), null, 2);\n```\n\nInclude `required`, `additionalProperties: false`; omission makes usage appear looser than reality.\n\n**Template:** actual `.md` structure with bodies blanked — one-line summary, then each section tag containing `...`.\n\n```\nStructural code search via native ast-grep AST matching.\n\n\u003Cinstruction>\n...\n\u003C\u002Finstruction>\n\n\u003Coutput>\n...\n\u003C\u002Foutput>\n\n\u003Ccritical>\n...\n\u003C\u002Fcritical>\n```\n\n## Interpret\n\nBucket each real-prompt line:\n\n- **Prune candidate:** stable across samples **and** models; schema restatement — parameter names\u002Ftypes, `required`, field-description value examples, stated clamp ranges.\n- **Keep:** no model recovers it — defaults\u002Fdirection (`gitignore` default true); routing\u002Fescalation (`NEVER` shell out to `find`\u002F`fd` → use this tool; broad exploration → `Task` subagent); exact output shape (mtime sort, grouping, `artifact:\u002F\u002F` truncation); worked anti-patterns; type-invisible constraints (AST metavariable grammar, C++ trailing `;`).\n\nOne sample: noise. Stable cross-sample\u002Fmodel overlap is only a candidate; history must clear it. MUST NOT delete on inferability alone.\n\n## Caveats — before every deletion\n\n- **MUST `git blame` each cut line; read its commit\u002Fissue.** Many lines are incident scar tissue: hallucinated flag, shell-out, repo-root scan, fabricated anchor. Keep scar tissue. History distinguishes schema restatement from incident prevention. Inferability necessary, NEVER sufficient.\n- **Memorization ≠ inference:** public repos, including this one, may be training data. Repo-specific prediction absent from schema — exact tool names, internal URI schemes, `Task` subagent — is recitation; discount it.\n- **Outline leaks:** summary and section names hint. For schema-alone inference, second pass: no summary, generic section tags. Content surviving only the summary is summary-inferable, not schema-inferable.\n\n## Verdict\n\nPredictions usually recover schema-covered parameter mechanics\u002Fgeneric usage, not defaults, output shape, routing, anti-patterns, domain grammar. Prune the former only after per-line `git blame`; keep the latter. Self-documenting flag tools (`find`) prune heavily; DSL\u002Fcapability tools (`read`, `ast_grep`) barely.\n\n## Tool Prompt Authoring\n\nTool prompts are not API docs: teach when to choose a tool, input shape, and agent-owned failures. Engine internals, recovery heuristics, fallback chains, performance tuning: code.\n\n### Surface, not machinery\n\nAgents choose from prose, not source: tell WHEN\u002FWHY, NEVER internal HOW.\n\n- `read.md`: every covered source — file\u002Fdir\u002Farchive\u002Fsqlite\u002FPDF\u002FURL — prevents `cat`\u002F`curl`\u002F`tar`; omit chunker, binary sniffer, cache layer.\n- `lsp.md`: \"You MUST use `lsp` whenever a language server is available — safer than text-based alternatives.\" Omit LSP wire protocol, server lifecycle, capability negotiation.\n- `ast_edit`: metavariable syntax\u002Fworkflow: \"Loosest existence check: `pat: 'executeBash'` with narrow paths\"; omit AST engine, query compilation, tree-sitter grammar selection.\n- `hashline.md` (this repo): patch grammar — anchors, ops, payloads, ranges — and successful edit shapes. Hide `tryRecoverHashlineWithCache`, fuzz factor, bigram tables, `findUniqueSuffixMatch`, `untilAborted`, `formatGroupedFiles`; agent sees only \"the tool resolved your typo\" or \"the anchor was stale, re-read\".\n\nIf a detail cannot change agent behavior, it does NOT belong. Each sentence MUST shift an agent decision.\n\n### Good prompt anatomy\n\n1. **One-line purpose:** agent-vocabulary problem; not \"wraps libfoo with X\", but \"compact, line-anchored edit format\".\n2. **Input grammar\u002Fsurface:** operators, parameters, selectors; concrete emitted syntax.\n3. **Worked examples:** 3–8 common shapes. Example IS explanation; do not narrate twice.\n4. **Agent-owned failure shapes:** input-fixable stale anchors, missing payload prefix, fabricated hash; omit silently recovered failures.\n5. **Anti-patterns:** real-failure WRONG\u002FRIGHT pairs for retry-causing mistakes, never imagined ones.\n6. **`\u003Ccritical>` recap:** 3–6 load-bearing lines for agents skipping body.\n\n### Exclude\n\n- Implementation file\u002Ffunction names, module layout.\n- Recovery, retry, normalization, caching, fuzz matching.\n- Performance characteristics such as \"this is O(n)\", unless strategy-changing.\n- Telemetry, logging, debug flags, unsettable env vars.\n- Version history, deprecated parameters, \"previously this worked differently\".\n- Cross-tool plumbing such as \"this calls `read` under the hood\", unless coordination required.\n",{},"main","9eb971906c3c448a4a395e4e9a308cabb375d785",".omp\u002Fskills\u002Ftool-prompt-optimization","https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros","https:\u002F\u002Fgithub.com\u002Fayooooo123","2026-09-27 07:42:00",{"source":7,"skillName":5,"commands":29,"prompt":39,"zipAvailable":40},[30,33,36],{"tool":31,"command":32},"npx","npx skills add ayooooo123\u002Feros --skill tool-prompt-optimization",{"tool":34,"command":35},"bunx","bunx skills add ayooooo123\u002Feros --skill tool-prompt-optimization",{"tool":37,"command":38},"pnpm","pnpm dlx skills add ayooooo123\u002Feros --skill tool-prompt-optimization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002F.omp\u002Fskills\u002Ftool-prompt-optimization\u002FSKILL.md",true,[42,48],{"path":43,"resourceType":44,"resourceTypeDesc":45,"sizeBytes":46,"sourceHtmlUrl":47},"scripts\u002Fprobe-builtin.ts","SCRIPT","脚本",6075,"https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002F.omp\u002Fskills\u002Ftool-prompt-optimization\u002Fscripts\u002Fprobe-builtin.ts",{"path":49,"resourceType":44,"resourceTypeDesc":45,"sizeBytes":50,"sourceHtmlUrl":51},"scripts\u002Fprobe.ts",7990,"https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002F.omp\u002Fskills\u002Ftool-prompt-optimization\u002Fscripts\u002Fprobe.ts",[53,60,67,74,80,87],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":17},"01M7DEEHHTGASBZ8CFKHSJDYXY","greet","A greeting skill for testing","https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Fmarketplace\u002Ffixtures\u002Fvalid-marketplace\u002Fplugins\u002Fhello-plugin\u002Fskills\u002Fgreet\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":17},"01M7DEEEFZEAAD13CEWS2AQDJF","valid-skill","A valid skill for testing purposes.","https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fvalid-skill\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":17},"01M7DEEC2HBHJNZPTTWQW8225Y","unknown-field","A skill with an unknown frontmatter field.","https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Funknown-field\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":17},"01M7DEEB1CJ155WF7GGBDSKH39","no-frontmatter","https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fno-frontmatter\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":17},"01M7DEE8BBH15S1JKWGMNSWWJ2","child-skill","A nested skill in a subdirectory.","https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fnested\u002Fchild-skill\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":6,"repositoryNo":11,"starsCount":12,"licenseSpdxId":13,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":17},"01M7DEE4SQBHZ52YFE0V39EJ9F","different-name","A skill with a name that doesn't match the directory.","https:\u002F\u002Fgithub.com\u002Fayooooo123\u002Feros\u002Fblob\u002Fmain\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fname-mismatch\u002FSKILL.md",[],[]]