[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74F5XZT04H65G7DXZRG2FYA":3,"skill-same:01M74F5XZT04H65G7DXZRG2FYA":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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M74F5XZT04H65G7DXZRG2FYA","cost-attribution",null,"Track per-client and per-feature LLM and cloud spend with cryptographic audit trail. Use whenever billable operations occur - LLM API calls, infrastructure provisioning, batch jobs. Required for any project with multiple clients or cost-sensitive operations. Integrates with Stratum's append-only billing_records table.","MILTONADINA\u002FDevOPs","MILTONADINA","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106546372?v=4","01M74F3R2PP4Z04DQMMBHSQAT1","Milton Adina","01M74F3R3CHTKPXJV4RP7RR3W8",0,"MIT","https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs\u002Fblob\u002Fmain\u002Fskills\u002Funiversal\u002Fdevops\u002Fcost-attribution\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: cost-attribution\ndescription: Track per-client and per-feature LLM and cloud spend with cryptographic audit trail. Use whenever billable operations occur - LLM API calls, infrastructure provisioning, batch jobs. Required for any project with multiple clients or cost-sensitive operations. Integrates with Stratum's append-only billing_records table.\n---\n\n# Cost Attribution\n\n> Per-tenant cost attribution from day one. Cryptographically signed audit\n> trail.\n\n**Tradeoff:** Every billable op needs a ledger entry. Worth it: client\ninvoicing is automatic, surprise bills are caught early, and cost-by-feature\nguides optimization.\n\n---\n\n## How it works\n\nDevOPs ships two pieces of this: the Stratum `billing_records` ledger and the\nbudget caps below. The exporter, the report command and the anomaly job on\nthis page are the design to build in each project; none of them exists in\nDevOPs yet.\n\n1. OTel baggage carries `tenant.id` and `user.id` on every span.\n2. LLM calls auto-add `cost_usd` via OpenInference instrumentation.\n3. The cost-attribution exporter aggregates costs by `tenant.id` per hour.\n4. Aggregates are written to:\n   - File: `.workflow\u002Fstate\u002Fcost-ledger.jsonl` (per-project)\n   - Stratum: `billing_records` table (HMAC-signed, append-only) if configured\n5. A report command (not yet built; see Reports below) summarizes the ledger.\n\n---\n\n## Ledger entry shape\n\n```json\n{\n  \"ts\": 1716372013,\n  \"tenant_id\": \"client-abc\",\n  \"user_id\": \"user-123\",\n  \"session_id\": \"s-7f3a\",\n  \"operation\": \"llm.call\",\n  \"provider\": \"anthropic\",\n  \"model\": \"claude-sonnet-4-6\",\n  \"input_tokens\": 1234,\n  \"output_tokens\": 567,\n  \"cost_usd\": 0.0122,\n  \"hmac\": \"sha256:...\"  \u002F\u002F Stratum signs server-side\n}\n```\n\n---\n\n## Reports\n\nExample monthly report for one client (illustrative figures; the `devops`\nCLI has no `cost-report` command yet):\n\n```\nClient: client-abc\nPeriod: 2026-05-01 to 2026-05-31\n\nTotal spend:        $124.37\nBy provider:\n  Anthropic:        $118.42\n  OpenAI:             $5.95\nBy model:\n  claude-opus-4-7:   $42.18  (12% of calls)\n  claude-sonnet-4-6: $63.71  (44% of calls)\n  claude-haiku-4-5:  $12.53  (44% of calls)\nBy feature:\n  \u002Fapi\u002Fauth:         $34.21\n  \u002Fapi\u002Fpayments:     $18.42\n  \u002Fapi\u002Fsearch:       $71.74\nCost per session:   avg $0.34, p95 $1.21\nCost per request:   avg $0.0023, p95 $0.012\n```\n\n---\n\n## Hard caps integration\n\n`hooks\u002Funiversal\u002Fpre-tool\u002Fbudget-brake.sh` enforces the caps in\n`.workflow\u002Fstate\u002Fbudget.yml` against its own ledger,\n`.workflow\u002Fstate\u002Fbudget-ledger.jsonl` (not the cost ledger above):\n\n- Per-session cap (default $5)\n- Per-hour cap (default $20)\n- Per-day cap (default $100)\n\nWhen a cap is hit, the hook exits 2 and the tool call is blocked; the agent\ncannot override it. It runs only once the harness registers it as a\nPreToolUse hook (for Claude Code, in `.claude\u002Fsettings.json`).\n`analyzer\u002Finstall.ts` copies the script without registering it, so check the\nsettings before relying on the cap.\n\n---\n\n## Anomaly detection\n\nA daily anomaly job (not yet built) should flag:\n- Day-over-day spend > 3x weekly average\n- Per-client spend exceeding contract terms\n- Calls with token counts > 90th percentile (potential prompt bloat)\n\nIt should write anomalies to `governance\u002Ftelemetry\u002Fcost-anomalies.jsonl`.\n\n---\n\n## Anti-patterns\n\n**Tagging by session only**: lose per-feature breakdown. Always include\nendpoint or skill name in span attributes.\n\n**No HMAC**: ledger entries can be tampered. Always sign server-side.\n\n**No retention policy**: ledger grows unbounded. Roll up to monthly aggregates\nafter 90 days; archive raw to cold storage.\n\n---\n\n**This skill is working when:** client invoices reconcile to ledger entries\nexactly, and cost-anomaly alerts fire before manual review notices the spike.\n","# Cost Attribution\n\n> Per-tenant cost attribution from day one. Cryptographically signed audit\n> trail.\n\n**Tradeoff:** Every billable op needs a ledger entry. Worth it: client\ninvoicing is automatic, surprise bills are caught early, and cost-by-feature\nguides optimization.\n\n---\n\n## How it works\n\nDevOPs ships two pieces of this: the Stratum `billing_records` ledger and the\nbudget caps below. The exporter, the report command and the anomaly job on\nthis page are the design to build in each project; none of them exists in\nDevOPs yet.\n\n1. OTel baggage carries `tenant.id` and `user.id` on every span.\n2. LLM calls auto-add `cost_usd` via OpenInference instrumentation.\n3. The cost-attribution exporter aggregates costs by `tenant.id` per hour.\n4. Aggregates are written to:\n   - File: `.workflow\u002Fstate\u002Fcost-ledger.jsonl` (per-project)\n   - Stratum: `billing_records` table (HMAC-signed, append-only) if configured\n5. A report command (not yet built; see Reports below) summarizes the ledger.\n\n---\n\n## Ledger entry shape\n\n```json\n{\n  \"ts\": 1716372013,\n  \"tenant_id\": \"client-abc\",\n  \"user_id\": \"user-123\",\n  \"session_id\": \"s-7f3a\",\n  \"operation\": \"llm.call\",\n  \"provider\": \"anthropic\",\n  \"model\": \"claude-sonnet-4-6\",\n  \"input_tokens\": 1234,\n  \"output_tokens\": 567,\n  \"cost_usd\": 0.0122,\n  \"hmac\": \"sha256:...\"  \u002F\u002F Stratum signs server-side\n}\n```\n\n---\n\n## Reports\n\nExample monthly report for one client (illustrative figures; the `devops`\nCLI has no `cost-report` command yet):\n\n```\nClient: client-abc\nPeriod: 2026-05-01 to 2026-05-31\n\nTotal spend:        $124.37\nBy provider:\n  Anthropic:        $118.42\n  OpenAI:             $5.95\nBy model:\n  claude-opus-4-7:   $42.18  (12% of calls)\n  claude-sonnet-4-6: $63.71  (44% of calls)\n  claude-haiku-4-5:  $12.53  (44% of calls)\nBy feature:\n  \u002Fapi\u002Fauth:         $34.21\n  \u002Fapi\u002Fpayments:     $18.42\n  \u002Fapi\u002Fsearch:       $71.74\nCost per session:   avg $0.34, p95 $1.21\nCost per request:   avg $0.0023, p95 $0.012\n```\n\n---\n\n## Hard caps integration\n\n`hooks\u002Funiversal\u002Fpre-tool\u002Fbudget-brake.sh` enforces the caps in\n`.workflow\u002Fstate\u002Fbudget.yml` against its own ledger,\n`.workflow\u002Fstate\u002Fbudget-ledger.jsonl` (not the cost ledger above):\n\n- Per-session cap (default $5)\n- Per-hour cap (default $20)\n- Per-day cap (default $100)\n\nWhen a cap is hit, the hook exits 2 and the tool call is blocked; the agent\ncannot override it. It runs only once the harness registers it as a\nPreToolUse hook (for Claude Code, in `.claude\u002Fsettings.json`).\n`analyzer\u002Finstall.ts` copies the script without registering it, so check the\nsettings before relying on the cap.\n\n---\n\n## Anomaly detection\n\nA daily anomaly job (not yet built) should flag:\n- Day-over-day spend > 3x weekly average\n- Per-client spend exceeding contract terms\n- Calls with token counts > 90th percentile (potential prompt bloat)\n\nIt should write anomalies to `governance\u002Ftelemetry\u002Fcost-anomalies.jsonl`.\n\n---\n\n## Anti-patterns\n\n**Tagging by session only**: lose per-feature breakdown. Always include\nendpoint or skill name in span attributes.\n\n**No HMAC**: ledger entries can be tampered. Always sign server-side.\n\n**No retention policy**: ledger grows unbounded. Roll up to monthly aggregates\nafter 90 days; archive raw to cold storage.\n\n---\n\n**This skill is working when:** client invoices reconcile to ledger entries\nexactly, and cost-anomaly alerts fire before manual review notices the spike.\n",{"name":5,"description":7},"main","5a590e92c8f62b54c96a6928215ac2145b671e03","skills\u002Funiversal\u002Fdevops\u002Fcost-attribution","https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs","https:\u002F\u002Fgithub.com\u002FMILTONADINA","https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fmiltonadina","CS\u002FCybersecurity SWE & former Epidemiologist. Building secure, test-driven full-stack & mobile apps (TS\u002FReact\u002FNode, Java\u002FSpring, Flutter).","2026-11-14 20:03:36",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add MILTONADINA\u002FDevOPs --skill cost-attribution",{"tool":38,"command":39},"bunx","bunx skills add MILTONADINA\u002FDevOPs --skill cost-attribution",{"tool":41,"command":42},"pnpm","pnpm dlx skills add MILTONADINA\u002FDevOPs --skill cost-attribution","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs\u002Fblob\u002Fmain\u002Fskills\u002Funiversal\u002Fdevops\u002Fcost-attribution\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"SKILL.md.bundle","OTHER","其他",9651,"https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs\u002Fblob\u002Fmain\u002Fskills\u002Funiversal\u002Fdevops\u002Fcost-attribution\u002FSKILL.md.bundle",[53,60,67,74,79,86],{"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":19},"01M74F7F3HN6J7CSFHBVQAE9S5","karpathy-guidelines","Behavioral guidelines that reduce common LLM coding mistakes. Apply whenever writing, modifying, or reviewing code. Don't assume requirements, don't overcomplicate, don't refactor unrelated code, and define success criteria before implementing. Use this skill on every non-trivial coding task to avoid bloat, silent assumptions, and completion-bias.","https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fsecurity\u002Fmodified-skill\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M74F7D60N9FRWWWHCGZMMB41","unsigned-missing-sig-fixture","Test fixture (F.09) — SKILL.md without an accompanying .sig file. Default install rejects with exit 2; --allow-unsigned --rationale=\"...\" proceeds.","https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Finstall\u002Fsource-skills\u002Funsigned-missing-sig\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M74F7BKGX67Q606QPKZV7TQV","unsigned-mismatched-sig-fixture","Test fixture (F.09) — SKILL.md whose accompanying .sig signs different content. NFR-F3 hash check catches this even with --allow-unsigned.","https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Finstall\u002Fsource-skills\u002Funsigned-mismatched-sig\u002FSKILL.md",[],[],{"skillNo":75,"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":76,"categories":77,"keywords":78,"publishedAt":19},"01M74F793BYMX98EQC5XP4CDZK","https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Finstall\u002Fsource-skills\u002Fsigned\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M74F7481EBD7G5471ZC4S9YB","webhook-idempotency","Defend against double-processing of webhook events across every provider (Stripe, GitHub, Slack, Twilio, SendGrid). Idempotency-key pattern + replay-window enforcement + dedupe-storage strategy. Triggers on any webhook handler authoring (route matching \u002Fwebhook(s)?\u002F, Stripe-Signature \u002F X-Hub-Signature-256 header references). Defense against OWASP ASI02 (Tool Misuse) -- a replayed webhook that re-triggers a destructive tool is the canonical control-flow-level replay attack. Universal across providers; stack-specific signature verification lives in stack-specific skills.","https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs\u002Fblob\u002Fmain\u002Fskills\u002Funiversal\u002Fsecurity\u002Fwebhook-idempotency\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M74F71Q6JKRFJ66G5T98KE8H","semgrep-scan","Run Semgrep static analysis to detect insecure code patterns - SQL injection, XSS, path traversal, weak crypto, broken auth, OWASP Top 10 issues. Use on every file change touching security-sensitive code and as part of the tiered security gate. Complements gitleaks (which catches secrets) by catching insecure logic.","https:\u002F\u002Fgithub.com\u002FMILTONADINA\u002FDevOPs\u002Fblob\u002Fmain\u002Fskills\u002Funiversal\u002Fsecurity\u002Fsemgrep-scan\u002FSKILL.md",[],[]]