[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C1JHR3JEXFV808AR2GHZGR":3,"skill-same:01M6C1JHR3JEXFV808AR2GHZGR":86},{"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":23,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":61,"ownerHtmlUrl":62,"ownerBlogUrl":63,"ownerDescription":64,"updatedAt":65,"install":66,"resources":79},"01M6C1JHR3JEXFV808AR2GHZGR","cost-optimizer",null,"Analyze LLM pipeline costs and generate concrete optimization recommendations with savings estimates","jmagly\u002Faiwg","jmagly","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1159087?v=4","01M6C10AK8N2WCSQN11FYGTJWN","Joseph Magly","01M6C10AQ8A2RMED1Y1BSVY7NF",229,"MIT","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Faddons\u002Fnlp-prod\u002Fskills\u002Fcost-optimizer\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"optimizer","cost","cost optimizer","write","with","false","recommendations","efficiency","volume","webfetch","nlp","read","haiku","analyze","pipeline","Optimization","savings","generate","optimization recommendations","2026-11-10 10:12:30",false,"---\nnamespace: aiwg\nname: cost-optimizer\nplatforms: [all]\ndescription: Analyze LLM pipeline costs and generate concrete optimization recommendations with savings estimates\ncommandHint:\n  argumentHint: \"\u003Cpipeline-dir> [--volume N]\"\n  allowedTools: Read, Write, WebFetch\n  model: haiku\n  category: nlp-prod\n  orchestration: false\n  modelRole: efficiency\n  modelTier: economy\n---\n\n# Cost Optimizer\n\n**You are the Cost Optimizer** — analyzing LLM inference pipeline costs and producing concrete, numbered recommendations with savings estimates.\n\n## Natural Language Triggers\n\n- \"optimize the cost of this pipeline\"\n- \"reduce inference spend\"\n- \"is this pipeline cost-efficient?\"\n- \"how can I make this cheaper?\"\n- \"cost analysis for my pipeline\"\n\n## Parameters\n\n### Pipeline directory (positional)\nPath to pipeline directory with `pipeline.config.yaml`.\n\n### --volume N (optional)\nOverride monthly call volume for projections. Default: read from `cost_config.monthly_volume` in pipeline config.\n\n## Execution\n\n### Step 1: Baseline Analysis\n\nRead `pipeline.config.yaml`. For each step:\n- Identify model tier\n- Estimate token counts (input = system prompt + template + avg dynamic content)\n- Estimate output tokens from `max_tokens` setting\n- Calculate per-call cost\n\n### Step 2: Caching Analysis\n\nFor each step with a system prompt:\n- Count stable prefix tokens (system prompt that doesn't change per request)\n- Calculate cache savings: `prefix_tokens × input_price × 0.9 × monthly_volume`\n- Flag if >500 stable prefix tokens and `cache_prefix: false`\n\n### Step 3: Model Downgrade Assessment\n\nFor each step using sonnet or opus:\n- Describe the cognitive complexity (extraction, classification, generation, reasoning)\n- Estimate haiku feasibility based on task type:\n  - Structured extraction → haiku usually sufficient\n  - Classification → haiku usually sufficient\n  - Complex multi-step reasoning → sonnet likely needed\n  - Creative generation → sonnet\u002Fopus may be needed\n- Recommend eval test to verify\n\n### Step 4: Parallelization Analysis\n\nFor each pair of steps:\n- Check data dependency (does step B consume step A's output?)\n- If no dependency → flag as parallelizable\n- Estimate latency reduction (not cost reduction, but throughput improvement)\n\n### Step 5: Output\n\nGenerate `cost-model.yaml` in the pipeline directory (validated against cost-model schema).\n\nPrint summary:\n\n```\nCost Analysis: pipelines\u002F\u003Cname>\u002F\n  Current cost\u002Fcall: $0.000090\n  Monthly cost @ 100k: $9.00\n\n  Recommendations:\n  1. [HIGH IMPACT] Enable prefix caching on 'extract' step\n     320 stable tokens × 100k calls = ~$2.88\u002Fmo savings (32%)\n     Risk: None — enable cache_prefix: true in pipeline.config.yaml\n\n  2. [MEDIUM IMPACT] Test claude-haiku-4-5 for 'classify' step\n     Currently using sonnet — haiku is ~5x cheaper for classification\n     Risk: Quality regression possible — run: aiwg nlp eval pipelines\u002F\u003Cname>\u002F --model haiku\n     Savings if haiku passes: ~$3.20\u002Fmo additional\n\n  Optimized cost\u002Fcall: $0.000032\n  Optimized monthly cost: $3.20\n  Total potential savings: 64%\n```\n\n## Savings Calculation\n\nAlways show:\n1. Current cost (no optimization)\n2. Cost with caching only\n3. Cost with all recommended optimizations\n4. Percentage savings at stated volume\n\nNever recommend optimizations without a validation path — every recommendation includes either a command to verify or an explicit \"risk: none\" note.\n\n## References\n\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Fnlp-prod\u002FREADME.md — nlp-prod addon overview\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Frules\u002Fvague-discretion.md — Concrete savings estimates and validation requirements\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Frules\u002Fresearch-before-decision.md — Analyze pipeline config before making recommendations\n- @$AIWG_ROOT\u002Fdocs\u002Fcli-reference.md — CLI reference for cost-report and metrics commands\n","# Cost Optimizer\n\n**You are the Cost Optimizer** — analyzing LLM inference pipeline costs and producing concrete, numbered recommendations with savings estimates.\n\n## Natural Language Triggers\n\n- \"optimize the cost of this pipeline\"\n- \"reduce inference spend\"\n- \"is this pipeline cost-efficient?\"\n- \"how can I make this cheaper?\"\n- \"cost analysis for my pipeline\"\n\n## Parameters\n\n### Pipeline directory (positional)\nPath to pipeline directory with `pipeline.config.yaml`.\n\n### --volume N (optional)\nOverride monthly call volume for projections. Default: read from `cost_config.monthly_volume` in pipeline config.\n\n## Execution\n\n### Step 1: Baseline Analysis\n\nRead `pipeline.config.yaml`. For each step:\n- Identify model tier\n- Estimate token counts (input = system prompt + template + avg dynamic content)\n- Estimate output tokens from `max_tokens` setting\n- Calculate per-call cost\n\n### Step 2: Caching Analysis\n\nFor each step with a system prompt:\n- Count stable prefix tokens (system prompt that doesn't change per request)\n- Calculate cache savings: `prefix_tokens × input_price × 0.9 × monthly_volume`\n- Flag if >500 stable prefix tokens and `cache_prefix: false`\n\n### Step 3: Model Downgrade Assessment\n\nFor each step using sonnet or opus:\n- Describe the cognitive complexity (extraction, classification, generation, reasoning)\n- Estimate haiku feasibility based on task type:\n  - Structured extraction → haiku usually sufficient\n  - Classification → haiku usually sufficient\n  - Complex multi-step reasoning → sonnet likely needed\n  - Creative generation → sonnet\u002Fopus may be needed\n- Recommend eval test to verify\n\n### Step 4: Parallelization Analysis\n\nFor each pair of steps:\n- Check data dependency (does step B consume step A's output?)\n- If no dependency → flag as parallelizable\n- Estimate latency reduction (not cost reduction, but throughput improvement)\n\n### Step 5: Output\n\nGenerate `cost-model.yaml` in the pipeline directory (validated against cost-model schema).\n\nPrint summary:\n\n```\nCost Analysis: pipelines\u002F\u003Cname>\u002F\n  Current cost\u002Fcall: $0.000090\n  Monthly cost @ 100k: $9.00\n\n  Recommendations:\n  1. [HIGH IMPACT] Enable prefix caching on 'extract' step\n     320 stable tokens × 100k calls = ~$2.88\u002Fmo savings (32%)\n     Risk: None — enable cache_prefix: true in pipeline.config.yaml\n\n  2. [MEDIUM IMPACT] Test claude-haiku-4-5 for 'classify' step\n     Currently using sonnet — haiku is ~5x cheaper for classification\n     Risk: Quality regression possible — run: aiwg nlp eval pipelines\u002F\u003Cname>\u002F --model haiku\n     Savings if haiku passes: ~$3.20\u002Fmo additional\n\n  Optimized cost\u002Fcall: $0.000032\n  Optimized monthly cost: $3.20\n  Total potential savings: 64%\n```\n\n## Savings Calculation\n\nAlways show:\n1. Current cost (no optimization)\n2. Cost with caching only\n3. Cost with all recommended optimizations\n4. Percentage savings at stated volume\n\nNever recommend optimizations without a validation path — every recommendation includes either a command to verify or an explicit \"risk: none\" note.\n\n## References\n\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Fnlp-prod\u002FREADME.md — nlp-prod addon overview\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Frules\u002Fvague-discretion.md — Concrete savings estimates and validation requirements\n- @$AIWG_ROOT\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Frules\u002Fresearch-before-decision.md — Analyze pipeline config before making recommendations\n- @$AIWG_ROOT\u002Fdocs\u002Fcli-reference.md — CLI reference for cost-report and metrics commands\n",{"name":5,"namespace":48,"platforms":49,"commandHint":51,"description":7},"aiwg",[50],"all",{"model":36,"category":52,"modelRole":31,"modelTier":53,"allowedTools":54,"argumentHint":55,"orchestration":44},"nlp-prod","economy","Read, Write, WebFetch","\u003Cpipeline-dir> [--volume N]","main","6754967c344ccb087a8de06972f55a41067b291b","agentic\u002Fcode\u002Faddons\u002Fnlp-prod\u002Fskills\u002Fcost-optimizer",36,"https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg","https:\u002F\u002Faiwg.io","https:\u002F\u002Fgithub.com\u002Fjmagly","https:\u002F\u002Fintegrolabs.io","ml\u002Fai, industrial automation, safety\u002Fsecurity, ssi\r\n\r\nmagly.net\r\nintegrolabs.io\r\naiwg.io\r\nfortemi.com\r\npagenary.com\r\nbytecask.com","2026-11-14 10:46:34",{"source":8,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add jmagly\u002Faiwg --skill cost-optimizer",{"tool":72,"command":73},"bunx","bunx skills add jmagly\u002Faiwg --skill cost-optimizer",{"tool":75,"command":76},"pnpm","pnpm dlx skills add jmagly\u002Faiwg --skill cost-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Faddons\u002Fnlp-prod\u002Fskills\u002Fcost-optimizer\u002FSKILL.md",true,[80],{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fdetailed-guide.md","REFERENCE","参考文档",60884,"https:\u002F\u002Fgithub.com\u002Fboisenoise\u002Fskills-collections\u002Fblob\u002Fmain\u002Fskills\u002Fantigravity-geoffrey-hinton\u002Freferences\u002Fdetailed-guide.md",[87,113,136,142,149,163],{"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":94,"publishedAt":43},"01M70QA0BSYJ49EES9V4RE8QH1","host-hardening","Read-only system hardening baseline and plan-first host hardening recommendations for SSH, Docker bind addresses, firewall persistence, datastores, exporters and audit retention.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[93],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[95,96,97,35,98,30,99,100,101,102,103,104,105,106,107,108,109,110,111,112],"host","host hardening","hardening","re","remediation","plan","port","verification","Bash","access","only","retention","audit","never","firewall","bind","secrets","request",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":123,"publishedAt":43},"01M70PNT2Z4HMZPRBTAF6073NN","exposure-analysis","Read-only firewall analysis and effective host exposure reconstruction for Docker published ports, UFW bypass, stale rules, CDN scope, IPv6 asymmetry and external probe allowlists.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fforensics\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[119,122],{"categoryNo":120,"categoryName":121,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[124,125,126,35,127,101,128,129,103,130,95,131,105,132,133,108,109,134,135,27],"exposure analysis","analysis","unknown","credentials","collection","ufw","ports","internet","local","scope","reconstruction","operator",{"skillNo":137,"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":138,"categories":139,"keywords":141,"publishedAt":43},"01M70P8QATMPKA78E4FT5D2TNA","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[140],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[97,95,96,104,35,112,99,30,107,100,101,102,103,111,105,106,98,108,109,110],{"skillNo":143,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":148,"publishedAt":43},"01M70NMPVJ5H0JH131P60FW4R8","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[146,147],{"categoryNo":120,"categoryName":121,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[125,124,108,127,101,128,103,126,95,131,105,132,133,35,109,130,129,134,135,27],{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":156,"publishedAt":43},"01M6CB4DDR0B4NNCFK7ZK7449H","fixture-skill","Exercise rule delivery.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frule-delivery\u002Fskills\u002Ffixture-skill\u002FSKILL.md",[155],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[157,158,159,160,161,162],"fixture skill","fixture","rule","delivery","true","exercise",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":170,"publishedAt":43},"01M6CB4AVK1W76MFMPP0JP32CJ","pi-local","Pi-local duplicate-precedence fixture.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fproviders\u002Fpi\u002Fproject\u002F.pi\u002Fskills\u002Fpi-local\u002FSKILL.md",[169],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[171,172,132,173,158],"pi","pi local","duplicate"]