[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ESRN50PWR96VJ9ARWMXGQW":3,"skill-same:01M7ESRN50PWR96VJ9ARWMXGQW":52},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":45},"01M7ESRN50PWR96VJ9ARWMXGQW","skill-cost-projections",null,"Project remaining workflow cost from per-phase averages — warns on budget ceiling overruns","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fskill-cost-projections\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: skill-cost-projections\ndescription: \"Project remaining workflow cost from per-phase averages — warns on budget ceiling overruns\"\ndisable-model-invocation: true\n---\n\n> **Host: Codex CLI** — This skill was designed for Claude Code and adapted for Codex.\n> Cross-reference commands use installed skill names in Codex rather than `\u002Focto:*` slash commands.\n> Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it.\n> For host tool equivalents, see `skills\u002Fblocks\u002Fcodex-host-adapter.md`.\n\n\n# Cost Projections Skill\n\n## Overview\n\nProjects remaining workflow cost based on per-phase averages from completed work. Displays cost data in the HUD\u002Fstatusline and warns when projected totals exceed a configured budget ceiling.\n\n**Minimum data requirement:** Needs **2+ completed steps** before projecting. With fewer than 2 data points, the average is unreliable — display actual spend only and skip projection.\n\n\n## Step 1: Collect Completed Phase Costs\n\nRead cost data from `~\u002F.claude-octopus\u002Fmetrics\u002F` or from metrics-tracker.sh output. Each completed phase\u002Fstep should have an associated cost entry.\n\n```bash\n# Read metrics from the session metrics directory\nMETRICS_DIR=\"$HOME\u002F.claude-octopus\u002Fmetrics\"\nSESSION_METRICS=\"$METRICS_DIR\u002Fsession-$(date +%Y%m%d).jsonl\"\n\n# Each line contains: {\"phase\": \"discover\", \"cost\": 0.42, \"tokens_in\": 12000, \"tokens_out\": 3400, \"timestamp\": \"...\"}\n# Sum costs from completed steps\ncompleted_costs=$(jq -s '[.[].cost]' \"$SESSION_METRICS\")\ncompleted_count=$(jq -s 'length' \"$SESSION_METRICS\")\ntotal_spent=$(jq -s '[.[].cost] | add' \"$SESSION_METRICS\")\n```\n\n**Data sources (in priority order):**\n1. `~\u002F.claude-octopus\u002Fmetrics\u002Fsession-*.jsonl` — structured per-phase cost entries\n2. `metrics-tracker.sh` output — fallback for legacy sessions\n3. HUD accumulated cost counters — last resort\n\nIf fewer than 2 completed steps are available, display only actual spend:\n```\n💰 Spent: $0.42 (1 step complete — need 2+ for projection)\n```\n\n\n## Step 2: Compute Average Cost Per Step\n\nCalculate the mean cost across all completed steps.\n\n```bash\navg_cost=$(echo \"$total_spent \u002F $completed_count\" | bc -l)\n```\n\n**Formula:**\n```\navg_cost = total_cost \u002F completed_steps\n```\n\n**Example:** If 3 steps cost $0.30, $0.50, $0.40 → avg = $1.20 \u002F 3 = $0.40\u002Fstep\n\n\n## Step 3: Project Remaining Cost\n\nMultiply the average cost per step by the number of remaining steps.\n\n```bash\nremaining_steps=$((total_steps - completed_count))\nprojected_remaining=$(echo \"$avg_cost * $remaining_steps\" | bc -l)\nprojected_total=$(echo \"$total_spent + $projected_remaining\" | bc -l)\n```\n\n**Formula:**\n```\nprojected_remaining = avg_cost × remaining_steps\nprojected_total     = total_spent + projected_remaining\n```\n\n**Step counts by workflow type:**\n| Workflow | Total Steps | Example Phases |\n|----------|-------------|----------------|\n| embrace  | 4           | Discover, Define, Develop, Deliver |\n| research | 3-7         | Per-agent probe count |\n| review   | 3           | Fleet, Verifier, Synthesis |\n| debate   | 3           | Opening, Rebuttal, Synthesis |\n\n\n## Step 4: Display in HUD\n\nFormat the cost projection for the HUD\u002Fstatusline display.\n\n**Standard display:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n```\n\n**Format rules:**\n- All dollar amounts to 2 decimal places\n- Projected total prefixed with `~` to indicate estimate\n- Use `💰` prefix for the cost line\n- Show in a single compact line for statusline integration\n\n**When insufficient data (\u003C 2 steps):**\n```\n💰 Spent: $0.42 (need 2+ steps for projection)\n```\n\n**Integration:** This display line is emitted by the octopus-hud hook and rendered in the statusline alongside phase progress and provider status.\n\n\n## Step 5: Budget Ceiling Warning\n\nIf the `OCTO_BUDGET_CEILING` environment variable is set, compare the projected total against it and warn on overrun.\n\n```bash\nif [[ -n \"${OCTO_BUDGET_CEILING:-}\" ]]; then\n  ceiling=\"$OCTO_BUDGET_CEILING\"\n  if (( $(echo \"$projected_total > $ceiling\" | bc -l) )); then\n    overage=$(echo \"$projected_total - $ceiling\" | bc -l)\n    echo \"⚠️ Budget ceiling: \\$$ceiling — projected to exceed by \\$$overage\"\n  fi\nfi\n```\n\n**Display when over budget:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n⚠️ Budget ceiling: $5.00 — projected to exceed by $1.00\n```\n\n**Display when within budget:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n✅ Within budget ceiling: $10.00\n```\n\n**Note:** `OCTO_BUDGET_CEILING` is optional. When unset, no ceiling check is performed.\n\n\n## Step 6: Profile Suggestion\n\nIf the projected total is high relative to the task, suggest switching to the budget profile to reduce costs.\n\n```bash\n# Suggest budget profile when projected total exceeds $5.00 (configurable)\nCOST_THRESHOLD=\"${OCTO_COST_THRESHOLD:-5.00}\"\nif (( $(echo \"$projected_total > $COST_THRESHOLD\" | bc -l) )); then\n  echo \"💡 Tip: Switch to OCTO_PROFILE=budget to reduce costs\"\nfi\n```\n\n**Display:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n💡 Tip: Switch to OCTO_PROFILE=budget to reduce costs\n```\n\nThe budget profile (`OCTO_PROFILE=budget`) routes to cheaper models and reduces agent count to minimize spend.\n\n\n## Complete Display Examples\n\n**Normal — within budget, moderate cost:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n```\n\n**Over budget ceiling:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n⚠️ Budget ceiling: $5.00 — projected to exceed by $1.00\n💡 Tip: Switch to OCTO_PROFILE=budget to reduce costs\n```\n\n**Early in workflow (insufficient data):**\n```\n💰 Spent: $0.42 (need 2+ steps for projection)\n```\n\n**Low cost — no warnings:**\n```\n💰 Spent: $0.80 | Est. remaining: $0.80 | Total: ~$1.60\n```\n\n\n## Integration\n\n### With octopus-hud hook\nThe cost projection line is rendered as part of the HUD statusline output, updated after each phase completes.\n\n### With metrics-tracker.sh\nReads per-phase cost data written by the metrics tracker. Each completed phase logs cost, token counts, and provider details.\n\n### With OCTO_PROFILE\nWhen `OCTO_PROFILE=budget` is active, the projection accounts for reduced per-step costs from cheaper model routing.\n\n\n## Error Handling\n\n**No metrics directory:**\n```\n💰 Cost projection unavailable — no metrics data found\n```\n\n**Corrupted metrics data:**\nSkip malformed entries and project from valid data only. If no valid entries remain, show unavailable message.\n\n**Zero remaining steps:**\nWhen all steps are complete, show final total only:\n```\n💰 Final cost: $4.80 (4 steps)\n```\n","> **Host: Codex CLI** — This skill was designed for Claude Code and adapted for Codex.\n> Cross-reference commands use installed skill names in Codex rather than `\u002Focto:*` slash commands.\n> Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it.\n> For host tool equivalents, see `skills\u002Fblocks\u002Fcodex-host-adapter.md`.\n\n\n# Cost Projections Skill\n\n## Overview\n\nProjects remaining workflow cost based on per-phase averages from completed work. Displays cost data in the HUD\u002Fstatusline and warns when projected totals exceed a configured budget ceiling.\n\n**Minimum data requirement:** Needs **2+ completed steps** before projecting. With fewer than 2 data points, the average is unreliable — display actual spend only and skip projection.\n\n\n## Step 1: Collect Completed Phase Costs\n\nRead cost data from `~\u002F.claude-octopus\u002Fmetrics\u002F` or from metrics-tracker.sh output. Each completed phase\u002Fstep should have an associated cost entry.\n\n```bash\n# Read metrics from the session metrics directory\nMETRICS_DIR=\"$HOME\u002F.claude-octopus\u002Fmetrics\"\nSESSION_METRICS=\"$METRICS_DIR\u002Fsession-$(date +%Y%m%d).jsonl\"\n\n# Each line contains: {\"phase\": \"discover\", \"cost\": 0.42, \"tokens_in\": 12000, \"tokens_out\": 3400, \"timestamp\": \"...\"}\n# Sum costs from completed steps\ncompleted_costs=$(jq -s '[.[].cost]' \"$SESSION_METRICS\")\ncompleted_count=$(jq -s 'length' \"$SESSION_METRICS\")\ntotal_spent=$(jq -s '[.[].cost] | add' \"$SESSION_METRICS\")\n```\n\n**Data sources (in priority order):**\n1. `~\u002F.claude-octopus\u002Fmetrics\u002Fsession-*.jsonl` — structured per-phase cost entries\n2. `metrics-tracker.sh` output — fallback for legacy sessions\n3. HUD accumulated cost counters — last resort\n\nIf fewer than 2 completed steps are available, display only actual spend:\n```\n💰 Spent: $0.42 (1 step complete — need 2+ for projection)\n```\n\n\n## Step 2: Compute Average Cost Per Step\n\nCalculate the mean cost across all completed steps.\n\n```bash\navg_cost=$(echo \"$total_spent \u002F $completed_count\" | bc -l)\n```\n\n**Formula:**\n```\navg_cost = total_cost \u002F completed_steps\n```\n\n**Example:** If 3 steps cost $0.30, $0.50, $0.40 → avg = $1.20 \u002F 3 = $0.40\u002Fstep\n\n\n## Step 3: Project Remaining Cost\n\nMultiply the average cost per step by the number of remaining steps.\n\n```bash\nremaining_steps=$((total_steps - completed_count))\nprojected_remaining=$(echo \"$avg_cost * $remaining_steps\" | bc -l)\nprojected_total=$(echo \"$total_spent + $projected_remaining\" | bc -l)\n```\n\n**Formula:**\n```\nprojected_remaining = avg_cost × remaining_steps\nprojected_total     = total_spent + projected_remaining\n```\n\n**Step counts by workflow type:**\n| Workflow | Total Steps | Example Phases |\n|----------|-------------|----------------|\n| embrace  | 4           | Discover, Define, Develop, Deliver |\n| research | 3-7         | Per-agent probe count |\n| review   | 3           | Fleet, Verifier, Synthesis |\n| debate   | 3           | Opening, Rebuttal, Synthesis |\n\n\n## Step 4: Display in HUD\n\nFormat the cost projection for the HUD\u002Fstatusline display.\n\n**Standard display:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n```\n\n**Format rules:**\n- All dollar amounts to 2 decimal places\n- Projected total prefixed with `~` to indicate estimate\n- Use `💰` prefix for the cost line\n- Show in a single compact line for statusline integration\n\n**When insufficient data (\u003C 2 steps):**\n```\n💰 Spent: $0.42 (need 2+ steps for projection)\n```\n\n**Integration:** This display line is emitted by the octopus-hud hook and rendered in the statusline alongside phase progress and provider status.\n\n\n## Step 5: Budget Ceiling Warning\n\nIf the `OCTO_BUDGET_CEILING` environment variable is set, compare the projected total against it and warn on overrun.\n\n```bash\nif [[ -n \"${OCTO_BUDGET_CEILING:-}\" ]]; then\n  ceiling=\"$OCTO_BUDGET_CEILING\"\n  if (( $(echo \"$projected_total > $ceiling\" | bc -l) )); then\n    overage=$(echo \"$projected_total - $ceiling\" | bc -l)\n    echo \"⚠️ Budget ceiling: \\$$ceiling — projected to exceed by \\$$overage\"\n  fi\nfi\n```\n\n**Display when over budget:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n⚠️ Budget ceiling: $5.00 — projected to exceed by $1.00\n```\n\n**Display when within budget:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n✅ Within budget ceiling: $10.00\n```\n\n**Note:** `OCTO_BUDGET_CEILING` is optional. When unset, no ceiling check is performed.\n\n\n## Step 6: Profile Suggestion\n\nIf the projected total is high relative to the task, suggest switching to the budget profile to reduce costs.\n\n```bash\n# Suggest budget profile when projected total exceeds $5.00 (configurable)\nCOST_THRESHOLD=\"${OCTO_COST_THRESHOLD:-5.00}\"\nif (( $(echo \"$projected_total > $COST_THRESHOLD\" | bc -l) )); then\n  echo \"💡 Tip: Switch to OCTO_PROFILE=budget to reduce costs\"\nfi\n```\n\n**Display:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n💡 Tip: Switch to OCTO_PROFILE=budget to reduce costs\n```\n\nThe budget profile (`OCTO_PROFILE=budget`) routes to cheaper models and reduces agent count to minimize spend.\n\n\n## Complete Display Examples\n\n**Normal — within budget, moderate cost:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n```\n\n**Over budget ceiling:**\n```\n💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00\n⚠️ Budget ceiling: $5.00 — projected to exceed by $1.00\n💡 Tip: Switch to OCTO_PROFILE=budget to reduce costs\n```\n\n**Early in workflow (insufficient data):**\n```\n💰 Spent: $0.42 (need 2+ steps for projection)\n```\n\n**Low cost — no warnings:**\n```\n💰 Spent: $0.80 | Est. remaining: $0.80 | Total: ~$1.60\n```\n\n\n## Integration\n\n### With octopus-hud hook\nThe cost projection line is rendered as part of the HUD statusline output, updated after each phase completes.\n\n### With metrics-tracker.sh\nReads per-phase cost data written by the metrics tracker. Each completed phase logs cost, token counts, and provider details.\n\n### With OCTO_PROFILE\nWhen `OCTO_PROFILE=budget` is active, the projection accounts for reduced per-step costs from cheaper model routing.\n\n\n## Error Handling\n\n**No metrics directory:**\n```\n💰 Cost projection unavailable — no metrics data found\n```\n\n**Corrupted metrics data:**\nSkip malformed entries and project from valid data only. If no valid entries remain, show unavailable message.\n\n**Zero remaining steps:**\nWhen all steps are complete, show final total only:\n```\n💰 Final cost: $4.80 (4 steps)\n```\n",{"name":5,"description":7,"disable-model-invocation":24},true,"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fskill-cost-projections",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":24},[35,38,41],{"tool":36,"command":37},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill skill-cost-projections",{"tool":39,"command":40},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill skill-cost-projections",{"tool":42,"command":43},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill skill-cost-projections","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fskill-cost-projections\u002FSKILL.md",[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"agents\u002Fopenai.yaml","REFERENCE","参考文档",175,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fskill-cost-projections\u002Fagents\u002Fopenai.yaml",[53,61,66,73,80,87],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":60},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":62,"name":55,"nameZh":6,"description":56,"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":60},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\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":60},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\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":60},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\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":60},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\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":60},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]