[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C17X7AV90C1MVM0WD650MP":3,"skill-same:01M6C17X7AV90C1MVM0WD650MP":71},{"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":28,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":52,"ownerHtmlUrl":53,"ownerBlogUrl":54,"ownerDescription":55,"updatedAt":56,"install":57,"resources":70},"01M6C17X7AV90C1MVM0WD650MP","cost-report",null,"Generate a cost report for an AIWG session or observe per-bot OpenRouter fleet spend","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\u002Faiwg-utils\u002Fskills\u002Fcost-report\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38],"report","cost report","cost","bot","generate","openrouter","session","observe","fleet","for","2026-11-10 10:12:30",false,"---\nnamespace: aiwg\nname: cost-report\nplatforms: [all]\ndescription: Generate a cost report for an AIWG session or observe per-bot OpenRouter fleet spend\n\n---\n\n# cost-report\n\nYou generate a cost and token-spending report for the current or most recent workflow session. You read accumulated token usage data from `.aiwg\u002Fralph\u002Fcost-tracking.json` and present a breakdown by operation, model, and time period.\n\n## Triggers\n\nAlternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):\n\n- \"how much did that cost\" → report for most recent session\n- \"what did this iteration cost\" → report scoped to current agent loop\n- \"token breakdown\" → report with per-model detail\n- \"did we stay in budget\" → report with budget threshold comparison\n\n## Trigger Patterns Reference\n\n| Pattern | Example | Action |\n|---------|---------|--------|\n| Session cost | \"cost report\" | `aiwg cost-report` |\n| Current loop cost | \"how much has this session cost so far\" | `aiwg cost-report --session current` |\n| Named session | \"cost for the greenfield run\" | `aiwg cost-report --session greenfield` |\n| Model breakdown | \"show costs by model\" | `aiwg cost-report --by-model` |\n| Budget check | \"are we over budget\" | `aiwg cost-report --budget \u003CN>` |\n| Fleet spend | \"show fleet spend\" | `aiwg cost-report --fleet` |\n\n## Behavior\n\nWhen triggered:\n\n### Fleet mode\n\nFor `--fleet`, run the native CLI handler. It reads `~\u002F.config\u002Faiwg\u002Ffleet.yaml`, resolves each `key_ref` only from `~\u002F.config\u002Faiwg\u002Fkeys\u002F` or `AIWG_OPENROUTER_KEY_*`, and reports `bot | machine | spend MTD | cap | % used | top-3 expensive sessions`.\n\nFleet manifests contain references only. Never read a credential from a project manifest, print a credential, or copy one into an artifact. AIWG observes and correlates spend; OpenRouter enforces all limits and caps. Session\u002Fmodel correlation is optional and uses locally recorded `bot=`, `session=`, and `generation_id=` tags in `.aiwg\u002Factivity.log`.\n\n```bash\naiwg cost-report --fleet\naiwg cost-report --fleet --json\naiwg cost-report --key \u003Ckey_ref> --monthly-cap 10\n```\n\nFor setup and security details, see `@$AIWG_ROOT\u002Fdocs\u002Fguides\u002Fopenrouter-fleet-costs.md`.\n\n### Session mode\n\n1. **Determine scope**:\n   - Default: most recent completed session\n   - `--session current`: running session (live data)\n   - `--session \u003Cname>`: named session from history\n\n2. **Read cost tracking data**:\n   - Primary source: `.aiwg\u002Fralph\u002Fcost-tracking.json`\n   - Fallback: aggregate from `.aiwg\u002Fralph\u002Fsessions\u002F*\u002Fmetrics.json`\n\n3. **Compute the report**:\n   - Total tokens (input + output)\n   - Estimated cost using model pricing table\n   - Breakdown by workflow step and model\n   - Comparison to MetaGPT baseline (124 tokens\u002Fline, REF-013)\n\n4. **Run the command**:\n\n   ```bash\n   # Default report (most recent session)\n   aiwg cost-report\n\n   # Current running session\n   aiwg cost-report --session current\n\n   # JSON output (for scripting)\n   aiwg cost-report --json\n\n   # Filter to specific model\n   aiwg cost-report --model claude-sonnet-5\n\n   # Budget threshold check\n   aiwg cost-report --budget 5.00\n   ```\n\n## Report Format\n\n### Standard Output\n\n```\nCost Report — Session: sdlc-review-20260401-143022\nDuration: 4m 12s\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nToken Usage\n  Input tokens:   42,310\n  Output tokens:  18,940\n  Total tokens:   61,250\n\nEstimated Cost\n  claude-sonnet-4-5:  $0.18  (61,250 tokens)\n  Total:              $0.18\n\nEfficiency vs Benchmark\n  Tokens\u002Fline:    112  (MetaGPT baseline: 124)  [green]\n  vs baseline:    -9.7%  (better than benchmark)\n\nSteps\n  architecture-designer  →  18,200 tokens  $0.07\n  security-architect     →  14,600 tokens  $0.06\n  test-architect         →  13,100 tokens  $0.05\n  technical-writer       →  15,350 tokens  $0.06 (incl. synthesis)\n```\n\n### Budget Check Output\n\n```\nBudget: $5.00\nUsed:   $0.18  (3.6% of budget)\nStatus: Within budget\n```\n\n## Data Sources\n\n| Source | Contents |\n|--------|----------|\n| `.aiwg\u002Fralph\u002Fcost-tracking.json` | Aggregated session costs |\n| `.aiwg\u002Fralph\u002Fsessions\u002F*\u002Fmetrics.json` | Per-session detailed metrics |\n| `src\u002Fmetrics\u002Ftoken-counter.ts` | Token estimation logic (4 chars\u002Ftoken) |\n\n## Examples\n\n### Example 1: Quick session report\n\n**User**: \"How much did that cost?\"\n\n**Extraction**: Cost report for most recent session\n\n**Action**:\n```bash\naiwg cost-report\n```\n\n**Response**: Session report with token totals, estimated cost, and efficiency rating against the MetaGPT baseline.\n\n### Example 2: Budget check mid-session\n\n**User**: \"Are we over the $2 budget for this run?\"\n\n**Extraction**: Budget comparison for current session\n\n**Action**:\n```bash\naiwg cost-report --session current --budget 2.00\n```\n\n**Response**:\n```\nBudget: $2.00\nUsed:   $0.43  (21.5% of budget)\nStatus: Within budget\nProjected total (at current rate): $0.71\n```\n\n### Example 3: Model breakdown\n\n**User**: \"Show me costs broken down by model\"\n\n**Action**:\n```bash\naiwg cost-report --by-model\n```\n\n**Response**:\n```\nCost by Model\n  claude-sonnet-4-5:   $0.12  (38,400 tokens)\n  claude-haiku-3-5:    $0.02   (6,200 tokens)\n  Total:               $0.14  (44,600 tokens)\n```\n\n## Clarification Prompts\n\nIf the session is ambiguous:\n\n- \"Should I report on the current session or the most recent completed session?\"\n\n## References\n\n- @$AIWG_ROOT\u002Fsrc\u002Fcli\u002Fhandlers\u002Fsubcommands.ts — Cost report handler\n- @$AIWG_ROOT\u002Fsrc\u002Fmetrics\u002Ftoken-counter.ts — Token counting and MetaGPT baseline (REF-013)\n- @$AIWG_ROOT\u002Fdocs\u002Fcli-reference.md — CLI reference\n- @$AIWG_ROOT\u002Fdocs\u002Fguides\u002Fopenrouter-fleet-costs.md — OpenRouter fleet configuration and security contract\n","# cost-report\n\nYou generate a cost and token-spending report for the current or most recent workflow session. You read accumulated token usage data from `.aiwg\u002Fralph\u002Fcost-tracking.json` and present a breakdown by operation, model, and time period.\n\n## Triggers\n\nAlternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):\n\n- \"how much did that cost\" → report for most recent session\n- \"what did this iteration cost\" → report scoped to current agent loop\n- \"token breakdown\" → report with per-model detail\n- \"did we stay in budget\" → report with budget threshold comparison\n\n## Trigger Patterns Reference\n\n| Pattern | Example | Action |\n|---------|---------|--------|\n| Session cost | \"cost report\" | `aiwg cost-report` |\n| Current loop cost | \"how much has this session cost so far\" | `aiwg cost-report --session current` |\n| Named session | \"cost for the greenfield run\" | `aiwg cost-report --session greenfield` |\n| Model breakdown | \"show costs by model\" | `aiwg cost-report --by-model` |\n| Budget check | \"are we over budget\" | `aiwg cost-report --budget \u003CN>` |\n| Fleet spend | \"show fleet spend\" | `aiwg cost-report --fleet` |\n\n## Behavior\n\nWhen triggered:\n\n### Fleet mode\n\nFor `--fleet`, run the native CLI handler. It reads `~\u002F.config\u002Faiwg\u002Ffleet.yaml`, resolves each `key_ref` only from `~\u002F.config\u002Faiwg\u002Fkeys\u002F` or `AIWG_OPENROUTER_KEY_*`, and reports `bot | machine | spend MTD | cap | % used | top-3 expensive sessions`.\n\nFleet manifests contain references only. Never read a credential from a project manifest, print a credential, or copy one into an artifact. AIWG observes and correlates spend; OpenRouter enforces all limits and caps. Session\u002Fmodel correlation is optional and uses locally recorded `bot=`, `session=`, and `generation_id=` tags in `.aiwg\u002Factivity.log`.\n\n```bash\naiwg cost-report --fleet\naiwg cost-report --fleet --json\naiwg cost-report --key \u003Ckey_ref> --monthly-cap 10\n```\n\nFor setup and security details, see `@$AIWG_ROOT\u002Fdocs\u002Fguides\u002Fopenrouter-fleet-costs.md`.\n\n### Session mode\n\n1. **Determine scope**:\n   - Default: most recent completed session\n   - `--session current`: running session (live data)\n   - `--session \u003Cname>`: named session from history\n\n2. **Read cost tracking data**:\n   - Primary source: `.aiwg\u002Fralph\u002Fcost-tracking.json`\n   - Fallback: aggregate from `.aiwg\u002Fralph\u002Fsessions\u002F*\u002Fmetrics.json`\n\n3. **Compute the report**:\n   - Total tokens (input + output)\n   - Estimated cost using model pricing table\n   - Breakdown by workflow step and model\n   - Comparison to MetaGPT baseline (124 tokens\u002Fline, REF-013)\n\n4. **Run the command**:\n\n   ```bash\n   # Default report (most recent session)\n   aiwg cost-report\n\n   # Current running session\n   aiwg cost-report --session current\n\n   # JSON output (for scripting)\n   aiwg cost-report --json\n\n   # Filter to specific model\n   aiwg cost-report --model claude-sonnet-5\n\n   # Budget threshold check\n   aiwg cost-report --budget 5.00\n   ```\n\n## Report Format\n\n### Standard Output\n\n```\nCost Report — Session: sdlc-review-20260401-143022\nDuration: 4m 12s\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nToken Usage\n  Input tokens:   42,310\n  Output tokens:  18,940\n  Total tokens:   61,250\n\nEstimated Cost\n  claude-sonnet-4-5:  $0.18  (61,250 tokens)\n  Total:              $0.18\n\nEfficiency vs Benchmark\n  Tokens\u002Fline:    112  (MetaGPT baseline: 124)  [green]\n  vs baseline:    -9.7%  (better than benchmark)\n\nSteps\n  architecture-designer  →  18,200 tokens  $0.07\n  security-architect     →  14,600 tokens  $0.06\n  test-architect         →  13,100 tokens  $0.05\n  technical-writer       →  15,350 tokens  $0.06 (incl. synthesis)\n```\n\n### Budget Check Output\n\n```\nBudget: $5.00\nUsed:   $0.18  (3.6% of budget)\nStatus: Within budget\n```\n\n## Data Sources\n\n| Source | Contents |\n|--------|----------|\n| `.aiwg\u002Fralph\u002Fcost-tracking.json` | Aggregated session costs |\n| `.aiwg\u002Fralph\u002Fsessions\u002F*\u002Fmetrics.json` | Per-session detailed metrics |\n| `src\u002Fmetrics\u002Ftoken-counter.ts` | Token estimation logic (4 chars\u002Ftoken) |\n\n## Examples\n\n### Example 1: Quick session report\n\n**User**: \"How much did that cost?\"\n\n**Extraction**: Cost report for most recent session\n\n**Action**:\n```bash\naiwg cost-report\n```\n\n**Response**: Session report with token totals, estimated cost, and efficiency rating against the MetaGPT baseline.\n\n### Example 2: Budget check mid-session\n\n**User**: \"Are we over the $2 budget for this run?\"\n\n**Extraction**: Budget comparison for current session\n\n**Action**:\n```bash\naiwg cost-report --session current --budget 2.00\n```\n\n**Response**:\n```\nBudget: $2.00\nUsed:   $0.43  (21.5% of budget)\nStatus: Within budget\nProjected total (at current rate): $0.71\n```\n\n### Example 3: Model breakdown\n\n**User**: \"Show me costs broken down by model\"\n\n**Action**:\n```bash\naiwg cost-report --by-model\n```\n\n**Response**:\n```\nCost by Model\n  claude-sonnet-4-5:   $0.12  (38,400 tokens)\n  claude-haiku-3-5:    $0.02   (6,200 tokens)\n  Total:               $0.14  (44,600 tokens)\n```\n\n## Clarification Prompts\n\nIf the session is ambiguous:\n\n- \"Should I report on the current session or the most recent completed session?\"\n\n## References\n\n- @$AIWG_ROOT\u002Fsrc\u002Fcli\u002Fhandlers\u002Fsubcommands.ts — Cost report handler\n- @$AIWG_ROOT\u002Fsrc\u002Fmetrics\u002Ftoken-counter.ts — Token counting and MetaGPT baseline (REF-013)\n- @$AIWG_ROOT\u002Fdocs\u002Fcli-reference.md — CLI reference\n- @$AIWG_ROOT\u002Fdocs\u002Fguides\u002Fopenrouter-fleet-costs.md — OpenRouter fleet configuration and security contract\n",{"name":5,"namespace":44,"platforms":45,"description":7},"aiwg",[46],"all","main","6754967c344ccb087a8de06972f55a41067b291b","agentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fcost-report",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-11 08:11:25",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add jmagly\u002Faiwg --skill cost-report",{"tool":63,"command":64},"bunx","bunx skills add jmagly\u002Faiwg --skill cost-report",{"tool":66,"command":67},"pnpm","pnpm dlx skills add jmagly\u002Faiwg --skill cost-report","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fcost-report\u002FSKILL.md",true,[],[72,100,124,130,137,151],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":79,"publishedAt":39},"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",[78],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99],"host","host hardening","hardening","read","re","recommendations","remediation","plan","port","verification","Bash","access","only","retention","audit","never","firewall","bind","secrets","request",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":110,"publishedAt":39},"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",[106,109],{"categoryNo":107,"categoryName":108,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[111,112,113,83,114,88,115,116,90,117,80,118,92,119,120,95,96,121,122,123],"exposure analysis","analysis","unknown","credentials","collection","ufw","ports","internet","local","scope","reconstruction","operator","write",{"skillNo":125,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":129,"publishedAt":39},"01M70P8QATMPKA78E4FT5D2TNA","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[128],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[82,80,81,91,83,99,86,85,94,87,88,89,90,98,92,93,84,95,96,97],{"skillNo":131,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":136,"publishedAt":39},"01M70NMPVJ5H0JH131P60FW4R8","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[134,135],{"categoryNo":107,"categoryName":108,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[112,111,95,114,88,115,90,113,80,118,92,119,120,83,96,117,116,121,122,123],{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":144,"publishedAt":39},"01M6CB4DDR0B4NNCFK7ZK7449H","fixture-skill","Exercise rule delivery.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frule-delivery\u002Fskills\u002Ffixture-skill\u002FSKILL.md",[143],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[145,146,147,148,149,150],"fixture skill","fixture","rule","delivery","true","exercise",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":158,"publishedAt":39},"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",[157],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[159,160,119,161,146],"pi","pi local","duplicate"]