[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C17TTYCNW13C35ZXBWJ0ZS":3,"skill-same:01M6C17TTYCNW13C35ZXBWJ0ZS":67},{"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":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6C17TTYCNW13C35ZXBWJ0ZS","cost-history",null,"Show cost trends across multiple workflow sessions, surfacing expensive operations, spending patterns, and outliers","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-history\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],"history","cost history","cost","workflow","sessions","operations","show","patterns","across","trends","spending","2026-11-10 10:12:30",false,"---\nnamespace: aiwg\nname: cost-history\nplatforms: [all]\ndescription: Show cost trends across multiple workflow sessions, surfacing expensive operations, spending patterns, and outliers\n---\n\n# cost-history\n\nYou show cost trends across multiple workflow sessions. You read historical cost records from `.aiwg\u002Fralph\u002Fsessions\u002F` and surface patterns — which operations are expensive, how spending has changed over time, and which sessions were outliers.\n\nFor questions about what happened in historical conversations, use\n`session-explore`. When explaining a cost outlier, correlate the cost record with\ncatalog tool\u002Fsession evidence only through a reliable identity mapping. Catalog\ntool-call\u002Fresult counts and timeline duration are not token usage or billed spend;\nreport an unavailable correlation rather than joining by a similar title.\n## Triggers\n\nAlternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):\n\n- \"what have I spent overall\" → full history summary\n- \"are costs going up or down\" → trend analysis\n- \"most expensive sessions\" → sorted history by cost\n- \"cost this week\" \u002F \"cost this month\" → time-windowed history\n\n## Trigger Patterns Reference\n\n| Pattern | Example | Action |\n|---------|---------|--------|\n| Full history | \"show cost history\" | `aiwg cost-history` |\n| Recent sessions | \"last 5 sessions\" | `aiwg cost-history --last 5` |\n| Time window | \"costs this week\" | `aiwg cost-history --since 7d` |\n| Trend summary | \"are my costs trending up\" | `aiwg cost-history --trend` |\n| Sorted by cost | \"most expensive sessions\" | `aiwg cost-history --sort cost` |\n\n## Behavior\n\nWhen triggered:\n\n1. **Determine scope**:\n   - Default: all recorded sessions, newest first\n   - `--last N`: most recent N sessions\n   - `--since \u003Cduration>`: sessions within the time window (e.g., `7d`, `30d`, `2026-03-01`)\n\n2. **Read session records**:\n   - `.aiwg\u002Fralph\u002Fsessions\u002F*\u002Fmetrics.json` — per-session cost records\n   - `.aiwg\u002Fralph\u002Fcost-tracking.json` — aggregated history index\n\n3. **Compute trend data**:\n   - Session-over-session delta\n   - Rolling 7-session average\n   - Outlier detection (sessions > 2x average)\n\n4. **Run the command**:\n\n   ```bash\n   # All sessions, newest first\n   aiwg cost-history\n\n   # Most recent 10 sessions\n   aiwg cost-history --last 10\n\n   # Sessions in the past 30 days\n   aiwg cost-history --since 30d\n\n   # Trend analysis\n   aiwg cost-history --trend\n\n   # Sorted by cost descending\n   aiwg cost-history --sort cost\n\n   # JSON output\n   aiwg cost-history --json\n   ```\n\n## Report Format\n\n### Standard History Output\n\n```\nCost History (12 sessions)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nDate        Session                     Tokens    Cost    Status\n──────────  ──────────────────────────  ────────  ──────  ──────\n2026-04-01  sdlc-review-143022          61,250    $0.18   green\n2026-03-31  greenfield-092211           94,800    $0.28   green\n2026-03-30  security-review-174503     118,400    $0.36   yellow\n2026-03-28  api-development-110022      52,100    $0.15   green\n2026-03-26  full-stack-iteration-3     201,700    $0.61   red *outlier\n...\n\nTotals (12 sessions)\n  Total tokens: 842,100\n  Total cost:   $2.54\n  Avg\u002Fsession:  $0.21\n\n7-session rolling average: $0.23\nTrend: stable (±8% over last 7 sessions)\n```\n\n### Trend Output (`--trend`)\n\n```\nCost Trend — Last 7 Sessions\n  Session 6 (oldest):  $0.28\n  Session 5:           $0.22\n  Session 4:           $0.36\n  Session 3:           $0.15\n  Session 2:           $0.61  ← outlier (full-stack-iteration-3)\n  Session 1:           $0.18\n  Current avg:         $0.23\n\nDirection: stable\nOutliers:  1 (full-stack-iteration-3 — 2.6x average)\n```\n\n## Efficiency Thresholds\n\nSessions are color-coded by tokens\u002Fline ratio against the MetaGPT 124 tokens\u002Fline benchmark (REF-013):\n\n| Status | Tokens\u002FLine | Meaning |\n|--------|-------------|---------|\n| green | ≤ 124 | At or below MetaGPT benchmark |\n| yellow | 125–150 | Above benchmark, acceptable |\n| red | > 150 | Significantly above benchmark — review recommended |\n\n## Examples\n\n### Example 1: Quick history overview\n\n**User**: \"Show cost history\"\n\n**Action**:\n```bash\naiwg cost-history\n```\n\n**Response**: Full session history table with totals, rolling average, and trend direction.\n\n### Example 2: Recent session costs\n\n**User**: \"What did the last 3 sessions cost?\"\n\n**Extraction**: `--last 3`\n\n**Action**:\n```bash\naiwg cost-history --last 3\n```\n\n**Response**:\n```\nCost History (last 3 sessions)\n\nDate        Session                  Tokens   Cost\n──────────  ───────────────────────  ───────  ────\n2026-04-01  sdlc-review-143022       61,250   $0.18\n2026-03-31  greenfield-092211        94,800   $0.28\n2026-03-30  security-review-174503  118,400   $0.36\n\nTotal: $0.82 over 3 sessions  (avg: $0.27)\n```\n\n### Example 3: Identifying expensive outliers\n\n**User**: \"Which sessions were most expensive?\"\n\n**Action**:\n```bash\naiwg cost-history --sort cost\n```\n\n**Response**: History table sorted by cost descending, with outlier flag on sessions more than 2x the rolling average.\n\n## Clarification Prompts\n\nIf a time window is ambiguous:\n\n- \"Should I show all-time history or a specific window? (e.g., last 7 days, last 30 days)\"\n\n## References\n\n- @$AIWG_ROOT\u002Fsrc\u002Fcli\u002Fhandlers\u002Fsubcommands.ts — Cost history 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","# cost-history\n\nYou show cost trends across multiple workflow sessions. You read historical cost records from `.aiwg\u002Fralph\u002Fsessions\u002F` and surface patterns — which operations are expensive, how spending has changed over time, and which sessions were outliers.\n\nFor questions about what happened in historical conversations, use\n`session-explore`. When explaining a cost outlier, correlate the cost record with\ncatalog tool\u002Fsession evidence only through a reliable identity mapping. Catalog\ntool-call\u002Fresult counts and timeline duration are not token usage or billed spend;\nreport an unavailable correlation rather than joining by a similar title.\n## Triggers\n\nAlternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):\n\n- \"what have I spent overall\" → full history summary\n- \"are costs going up or down\" → trend analysis\n- \"most expensive sessions\" → sorted history by cost\n- \"cost this week\" \u002F \"cost this month\" → time-windowed history\n\n## Trigger Patterns Reference\n\n| Pattern | Example | Action |\n|---------|---------|--------|\n| Full history | \"show cost history\" | `aiwg cost-history` |\n| Recent sessions | \"last 5 sessions\" | `aiwg cost-history --last 5` |\n| Time window | \"costs this week\" | `aiwg cost-history --since 7d` |\n| Trend summary | \"are my costs trending up\" | `aiwg cost-history --trend` |\n| Sorted by cost | \"most expensive sessions\" | `aiwg cost-history --sort cost` |\n\n## Behavior\n\nWhen triggered:\n\n1. **Determine scope**:\n   - Default: all recorded sessions, newest first\n   - `--last N`: most recent N sessions\n   - `--since \u003Cduration>`: sessions within the time window (e.g., `7d`, `30d`, `2026-03-01`)\n\n2. **Read session records**:\n   - `.aiwg\u002Fralph\u002Fsessions\u002F*\u002Fmetrics.json` — per-session cost records\n   - `.aiwg\u002Fralph\u002Fcost-tracking.json` — aggregated history index\n\n3. **Compute trend data**:\n   - Session-over-session delta\n   - Rolling 7-session average\n   - Outlier detection (sessions > 2x average)\n\n4. **Run the command**:\n\n   ```bash\n   # All sessions, newest first\n   aiwg cost-history\n\n   # Most recent 10 sessions\n   aiwg cost-history --last 10\n\n   # Sessions in the past 30 days\n   aiwg cost-history --since 30d\n\n   # Trend analysis\n   aiwg cost-history --trend\n\n   # Sorted by cost descending\n   aiwg cost-history --sort cost\n\n   # JSON output\n   aiwg cost-history --json\n   ```\n\n## Report Format\n\n### Standard History Output\n\n```\nCost History (12 sessions)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nDate        Session                     Tokens    Cost    Status\n──────────  ──────────────────────────  ────────  ──────  ──────\n2026-04-01  sdlc-review-143022          61,250    $0.18   green\n2026-03-31  greenfield-092211           94,800    $0.28   green\n2026-03-30  security-review-174503     118,400    $0.36   yellow\n2026-03-28  api-development-110022      52,100    $0.15   green\n2026-03-26  full-stack-iteration-3     201,700    $0.61   red *outlier\n...\n\nTotals (12 sessions)\n  Total tokens: 842,100\n  Total cost:   $2.54\n  Avg\u002Fsession:  $0.21\n\n7-session rolling average: $0.23\nTrend: stable (±8% over last 7 sessions)\n```\n\n### Trend Output (`--trend`)\n\n```\nCost Trend — Last 7 Sessions\n  Session 6 (oldest):  $0.28\n  Session 5:           $0.22\n  Session 4:           $0.36\n  Session 3:           $0.15\n  Session 2:           $0.61  ← outlier (full-stack-iteration-3)\n  Session 1:           $0.18\n  Current avg:         $0.23\n\nDirection: stable\nOutliers:  1 (full-stack-iteration-3 — 2.6x average)\n```\n\n## Efficiency Thresholds\n\nSessions are color-coded by tokens\u002Fline ratio against the MetaGPT 124 tokens\u002Fline benchmark (REF-013):\n\n| Status | Tokens\u002FLine | Meaning |\n|--------|-------------|---------|\n| green | ≤ 124 | At or below MetaGPT benchmark |\n| yellow | 125–150 | Above benchmark, acceptable |\n| red | > 150 | Significantly above benchmark — review recommended |\n\n## Examples\n\n### Example 1: Quick history overview\n\n**User**: \"Show cost history\"\n\n**Action**:\n```bash\naiwg cost-history\n```\n\n**Response**: Full session history table with totals, rolling average, and trend direction.\n\n### Example 2: Recent session costs\n\n**User**: \"What did the last 3 sessions cost?\"\n\n**Extraction**: `--last 3`\n\n**Action**:\n```bash\naiwg cost-history --last 3\n```\n\n**Response**:\n```\nCost History (last 3 sessions)\n\nDate        Session                  Tokens   Cost\n──────────  ───────────────────────  ───────  ────\n2026-04-01  sdlc-review-143022       61,250   $0.18\n2026-03-31  greenfield-092211        94,800   $0.28\n2026-03-30  security-review-174503  118,400   $0.36\n\nTotal: $0.82 over 3 sessions  (avg: $0.27)\n```\n\n### Example 3: Identifying expensive outliers\n\n**User**: \"Which sessions were most expensive?\"\n\n**Action**:\n```bash\naiwg cost-history --sort cost\n```\n\n**Response**: History table sorted by cost descending, with outlier flag on sessions more than 2x the rolling average.\n\n## Clarification Prompts\n\nIf a time window is ambiguous:\n\n- \"Should I show all-time history or a specific window? (e.g., last 7 days, last 30 days)\"\n\n## References\n\n- @$AIWG_ROOT\u002Fsrc\u002Fcli\u002Fhandlers\u002Fsubcommands.ts — Cost history 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",{"name":5,"namespace":40,"platforms":41,"description":7},"aiwg",[42],"all","main","6754967c344ccb087a8de06972f55a41067b291b","agentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fcost-history",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 02:10:01",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add jmagly\u002Faiwg --skill cost-history",{"tool":59,"command":60},"bunx","bunx skills add jmagly\u002Faiwg --skill cost-history",{"tool":62,"command":63},"pnpm","pnpm dlx skills add jmagly\u002Faiwg --skill cost-history","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Faddons\u002Faiwg-utils\u002Fskills\u002Fcost-history\u002FSKILL.md",true,[],[68,96,120,126,133,147],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":75,"publishedAt":35},"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",[74],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95],"host","host hardening","hardening","read","re","recommendations","remediation","plan","port","verification","Bash","access","only","retention","audit","never","firewall","bind","secrets","request",{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":106,"publishedAt":35},"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",[102,105],{"categoryNo":103,"categoryName":104,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[107,108,109,79,110,84,111,112,86,113,76,114,88,115,116,91,92,117,118,119],"exposure analysis","analysis","unknown","credentials","collection","ufw","ports","internet","local","scope","reconstruction","operator","write",{"skillNo":121,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":125,"publishedAt":35},"01M70P8QATMPKA78E4FT5D2TNA","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[124],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[78,76,77,87,79,95,82,81,90,83,84,85,86,94,88,89,80,91,92,93],{"skillNo":127,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":132,"publishedAt":35},"01M70NMPVJ5H0JH131P60FW4R8","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[130,131],{"categoryNo":103,"categoryName":104,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[108,107,91,110,84,111,86,109,76,114,88,115,116,79,92,113,112,117,118,119],{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":140,"publishedAt":35},"01M6CB4DDR0B4NNCFK7ZK7449H","fixture-skill","Exercise rule delivery.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frule-delivery\u002Fskills\u002Ffixture-skill\u002FSKILL.md",[139],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[141,142,143,144,145,146],"fixture skill","fixture","rule","delivery","true","exercise",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":154,"publishedAt":35},"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",[153],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[155,156,115,157,142],"pi","pi local","duplicate"]