[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7929EE3ZEA1SDCFZX2RHSRE":3,"skill-same:01M7929EE3ZEA1SDCFZX2RHSRE":61},{"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":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M7929EE3ZEA1SDCFZX2RHSRE","langchain-cost-tuning",null,"Control LangChain 1.0 AI spend with accurate streaming token accounting,\nmodel tiering, provider-specific cache hit tuning, per-tenant budgets,\nand retry dedup. Use when AI spend grows faster than traffic, a cost\nregression lands, or you need per-tenant budget enforcement.\nTrigger with \"langchain cost\", \"langchain token accounting\",\n\"langchain per-tenant budget\", \"langchain model tiering\",\n\"prompt cache savings\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--langchain-py-pack--langchain-cost-tuning\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: langchain-cost-tuning\ndescription: |\n  Control LangChain 1.0 AI spend with accurate streaming token accounting,\n  model tiering, provider-specific cache hit tuning, per-tenant budgets,\n  and retry dedup. Use when AI spend grows faster than traffic, a cost\n  regression lands, or you need per-tenant budget enforcement.\n  Trigger with \"langchain cost\", \"langchain token accounting\",\n  \"langchain per-tenant budget\", \"langchain model tiering\",\n  \"prompt cache savings\".\nallowed-tools: Read, Write, Edit, Bash(python:*), Bash(redis-cli:*)\nversion: 2.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ntags: [saas, langchain, langgraph, python, langchain-1.0, cost, tokens, budget]\ncompatible-with: claude-code, codex\n---\n\n# LangChain Cost Tuning (Python)\n\n## Overview\n\nAn engineer shipped a new research agent Tuesday. By Friday the Anthropic\nbill had grown 6x while traffic grew 1.4x. The cost dashboard — wired to\n`on_llm_end` — showed spend up maybe 2x. Reconciling against the provider\nconsole on Monday surfaced two compounding bugs: (1) the agent's `ChatOpenAI`\nfallback kept the default `max_retries=6`, so each logical call billed as up\nto **7 requests** (P30); (2) retry middleware was registered *below* token\naccounting, so every retry fired `on_llm_end` twice — the aggregator summed\nboth emissions while LangSmith deduped them by generation ID, undercounting\nthe dashboard by ~50% against actual billed rate (P25).\n\nThe fix took an afternoon: cap retries at 2, tag retries with a stable\n`request_id`, and migrate token accounting to `AIMessage.usage_metadata` read\nfrom `astream_events(version=\"v2\")`. Finding the bug took a week. This skill\nis that week compressed into a runbook.\n\nCost tuning for a LangChain 1.0 production app has five levers, each with a\nsharp failure mode:\n\n- **Token accounting** — `on_llm_end` lags streams by 5-30s (P01); retries double-count (P25); Anthropic cache savings aggregate per-call, never per-session (P04).\n- **Retry discipline** — `max_retries=6` default on `ChatOpenAI` (P30); Anthropic 50 RPM tier throttles cached and uncached calls against the same budget (P31).\n- **Agent loop caps** — `create_react_agent` defaults to `recursion_limit=25`; vague prompts burn a session's budget before `GraphRecursionError` surfaces (P10).\n- **Caching** — `InMemoryCache` ignores bound tools in the cache key and returns wrong answers (P61); `RedisSemanticCache` ships with a 0.95 threshold that hits \u003C5% of the time (P62).\n- **Model tiering** — Running `claude-opus-4-5` on intent classification is 30-60x more expensive than `claude-haiku-4-5` for a task the cheaper model solves at equal quality.\n\nPin: `langchain-core 1.0.x`, `langchain-anthropic 1.0.x`, `langchain-openai 1.0.x`.\nPain-catalog anchors: P01, P04, P10, P23, P25, P30, P31, P61, P62.\n\n## Prerequisites\n\n- Python 3.10+\n- `langchain-core >= 1.0, \u003C 2.0`\n- At least one provider package: `pip install langchain-anthropic langchain-openai`\n- `redis-py >= 5.0` for budget middleware (optional; in-process dict works for dev)\n- Provider console access (Anthropic, OpenAI) to reconcile `usage_metadata`\n  against billed spend — you will need this to verify any instrumentation fix\n\n## Instructions\n\n### Step 1 — Read `usage_metadata`, never `response_metadata[\"token_usage\"]`\n\nLangChain 1.0 standardizes all provider usage into `AIMessage.usage_metadata`.\n`response_metadata[\"token_usage\"]` still exists as a compatibility shim but its\nshape is provider-specific (Anthropic nests under `usage`, OpenAI flat, Gemini\nuses different keys). Code that reads it directly will break when you switch\nproviders or when a provider SDK upgrades.\n\n```python\nfrom langchain_core.messages import AIMessage\n\ndef read_usage(msg: AIMessage) -> dict:\n    \"\"\"Canonical shape: input_tokens, output_tokens, input_token_details,\n    output_token_details. Safe across Anthropic, OpenAI, Gemini.\"\"\"\n    meta = msg.usage_metadata or {}\n    details_in = meta.get(\"input_token_details\", {}) or {}\n    details_out = meta.get(\"output_token_details\", {}) or {}\n    return {\n        \"input\": meta.get(\"input_tokens\", 0),\n        \"output\": meta.get(\"output_tokens\", 0),\n        \"cache_read\": details_in.get(\"cache_read\", 0),       # Anthropic\n        \"cache_creation\": details_in.get(\"cache_creation\", 0),\n        \"reasoning\": details_out.get(\"reasoning\", 0),        # OpenAI o1\u002Fo3\n    }\n```\n\nInclude `reasoning` in your output-billable total for o1\u002Fo3. A call with\n`output_tokens=500` and `reasoning=2000` actually bills 2500 output tokens.\n\n### Step 2 — Stream-accurate aggregation via `astream_events(version=\"v2\")`\n\n`on_llm_end` fires once after the stream closes, so dashboards lag by stream\nduration (P01). Anthropic populates `usage_metadata` on the `message_start` and\n`message_delta` events; OpenAI populates only the final chunk. Both show up as\n`on_chat_model_stream` events in `astream_events`.\n\n```python\nasync def metered_invoke(chain, inputs, meter):\n    async for event in chain.astream_events(inputs, version=\"v2\"):\n        if event[\"event\"] == \"on_chat_model_stream\":\n            chunk = event[\"data\"][\"chunk\"]\n            if getattr(chunk, \"usage_metadata\", None):\n                meter.record(\n                    run_id=event[\"run_id\"],\n                    usage=chunk.usage_metadata,\n                )\n```\n\nSee [Token Accounting Pitfalls](references\u002Ftoken-accounting-pitfalls.md) for\nthe full streaming-delta behavior across providers and reconciliation against\nprovider dashboards.\n\n### Step 3 — Dedup retries on `run_id`, not prompt hash\n\nRetry middleware runs the model twice on transient errors. Both emit usage\nevents. If the aggregator keys on prompt hash, it looks like one call cost\ntwice as much. If it keys on `run_id` (LangChain assigns one per generation\nattempt), you can attach a stable `request_id` at the chain level and dedupe\non that (P25).\n\n```python\nfrom uuid import uuid4\n\nclass RetryAwareMeter:\n    def __init__(self):\n        self._seen: set[str] = set()\n        self.totals = {\"input\": 0, \"output\": 0, \"cache_read\": 0}\n\n    def record(self, run_id: str, usage: dict, request_id: str | None = None):\n        # Keep only the last emission per logical request.\n        # On retry: same request_id, different run_id -> overwrite.\n        key = request_id or run_id\n        if key in self._seen:\n            # Retry emission — subtract prior, add new (last wins).\n            prior = self._prior_by_key.get(key, {})\n            for k in self.totals:\n                self.totals[k] -= prior.get(k, 0)\n        self._seen.add(key)\n        self._prior_by_key[key] = usage\n        self.totals[\"input\"]  += usage.get(\"input_tokens\", 0)\n        self.totals[\"output\"] += usage.get(\"output_tokens\", 0)\n        details = usage.get(\"input_token_details\", {}) or {}\n        self.totals[\"cache_read\"] += details.get(\"cache_read\", 0)\n```\n\nInject `request_id` via `config={\"metadata\": {\"request_id\": str(uuid4())}}` on\neach invoke. The meter reads `event[\"metadata\"][\"request_id\"]` alongside\n`run_id`.\n\nAlternative: place token accounting **above** retry middleware in the chain —\nretries happen inside, so only the successful attempt emits. This is simpler\nbut makes retries invisible to observability, which you usually want to see.\n\n### Step 4 — Model tiering: draft cheap, finalize expensive\n\nMost chains have a structural split: a cheap \"understand the request\" call and\nan expensive \"produce the final artifact\" call. Running the expensive model on\nboth roughly triples cost for no quality gain.\n\n**Per-1M pricing snapshot, 2026-04** (verify current prices before shipping at\nhttps:\u002F\u002Fwww.anthropic.com\u002Fpricing and https:\u002F\u002Fopenai.com\u002Fapi\u002Fpricing\u002F):\n\n| Model | Input $\u002F1M | Output $\u002F1M | Cache read $\u002F1M | Role |\n|---|---|---|---|---|\n| `claude-haiku-4-5` | $1.00 | $5.00 | $0.10 | Draft, classify, route |\n| `claude-sonnet-4-6` | $3.00 | $15.00 | $0.30 | Finalize, reason, extract |\n| `claude-opus-4-5` | $15.00 | $75.00 | $1.50 | High-stakes, long-horizon |\n| `gpt-4o-mini` | $0.15 | $0.60 | n\u002Fa (prefix cache only) | Draft, classify |\n| `gpt-4o` | $2.50 | $10.00 | n\u002Fa | Finalize |\n| `gpt-o3-mini` | $1.10 | $4.40 | n\u002Fa | Reasoning, planning |\n\nAnthropic cache reads cost **10% of input**. Cache creation costs **125% of\ninput**. Break-even is ~4 uses of a cached prefix. See\n[Cache Economics](references\u002Fcache-economics.md).\n\n**Decision tree:**\n\n```\ninput\n  └── intent classification \u002F routing\n      └── gpt-4o-mini OR claude-haiku-4-5        (~$0.15-$1 per 1M in)\n  └── generation \u002F reasoning\n      ├── single-pass, low-stakes\n      │   └── gpt-4o-mini                         (draft)\n      ├── single-pass, high-stakes (extraction, contracts)\n      │   └── claude-sonnet-4-6                   (finalize)\n      ├── multi-step reasoning\n      │   └── gpt-o3-mini OR claude-sonnet-4-6    (plan)\n      └── mission-critical long-horizon\n          └── claude-opus-4-5                     (expensive, used sparingly)\n```\n\nTiering is **wrong** when quality degrades silently — high-stakes extraction on\nHaiku misses entities the Sonnet would catch. Always evaluate both tiers on a\ngold set before committing. See [Model Tiering](references\u002Fmodel-tiering.md)\nfor the evaluation harness and a worked draft-then-finalize chain.\n\n### Step 5 — Aggregate Anthropic cache usage per session and tenant (P04)\n\n`usage_metadata[\"input_token_details\"][\"cache_read\"]` reports per-call. To see\nwhether caching is paying for itself you need to aggregate per-session or\nper-tenant and compare against cache-creation cost.\n\n```python\nclass CacheLedger:\n    def __init__(self, tenant_id: str):\n        self.tenant_id = tenant_id\n        self.read = 0           # billed at 0.1x input rate\n        self.creation = 0       # billed at 1.25x input rate\n        self.uncached_input = 0 # billed at 1.0x input rate\n\n    def ingest(self, usage: dict):\n        details = usage.get(\"input_token_details\", {}) or {}\n        self.read     += details.get(\"cache_read\", 0)\n        self.creation += details.get(\"cache_creation\", 0)\n        total_input = usage.get(\"input_tokens\", 0)\n        self.uncached_input += total_input - self.read - self.creation\n\n    def savings_vs_no_cache(self, price_per_1m_input: float) -> float:\n        # What we paid with cache vs. paying full price on all input.\n        actual = (self.uncached_input * 1.00\n                  + self.creation      * 1.25\n                  + self.read          * 0.10) * price_per_1m_input \u002F 1_000_000\n        naive  = (self.uncached_input + self.creation + self.read) * price_per_1m_input \u002F 1_000_000\n        return naive - actual\n```\n\nPersist `CacheLedger` to Redis or Postgres keyed by `(tenant_id, day)`. If\nsavings is negative over a 24h window, caching is costing more than it saves —\nyour cached prefix is either too short or hit too rarely. See\n[Cache Economics](references\u002Fcache-economics.md).\n\n### Step 6 — Cache keys must include bound tools (P61)\n\n`set_llm_cache(InMemoryCache())` hashes the prompt string only. A chain that\nbinds different tool sets will return wrong answers from the cache. This is\nthe most dangerous cache failure mode — it silently returns semantically\nincorrect responses rather than missing.\n\n**Do not use `InMemoryCache` on any chain that calls `bind_tools()`.** Use\n`SQLiteCache` or `RedisSemanticCache` with a composite key:\n\n```python\nimport hashlib, json\n\ndef tool_aware_key(prompt: str, tools: list) -> str:\n    tools_fingerprint = hashlib.sha256(\n        json.dumps([t.args_schema.model_json_schema() for t in tools],\n                   sort_keys=True).encode()\n    ).hexdigest()[:16]\n    return f\"{tools_fingerprint}:{hashlib.sha256(prompt.encode()).hexdigest()}\"\n```\n\nCross-reference: `langchain-middleware-patterns` covers cache-key layering in\nmiddleware order (redact → cache → model) to avoid cross-tenant PII leaks.\n\n### Step 7 — Tune semantic-cache threshold; ship a calibrated value, not the default (P62)\n\n`RedisSemanticCache` defaults to `score_threshold=0.95`. On real workloads this\nhits under 5% of the time. Production-tuned values land between 0.85 and 0.90.\nShip with a calibrated threshold, not the default:\n\n1. Collect 200 real query pairs labeled \"should return same answer\" (positive)\n   and \"should return different answer\" (negative).\n2. Embed both sides of each pair with your embedding model.\n3. For thresholds in `[0.80, 0.82, 0.84, …, 0.95]`, compute:\n   - hit rate (% positive pairs above threshold)\n   - false positive rate (% negative pairs above threshold)\n4. Pick the lowest threshold where FPR \u003C 2%.\n5. Ship with a daily audit: sample 1% of cache hits, log to review queue.\n\nIf the curve flattens above 0.92 on positives, your embeddings are too weak\nfor semantic caching — consider exact-match `SQLiteCache` instead. See\n[Cache Economics](references\u002Fcache-economics.md) for the calibration worksheet.\n\n### Step 8 — Per-tenant budget middleware: soft warn, hard refuse\n\nA single runaway tenant will consume the pack if left uncapped. LangChain 1.0\nmiddleware slots cleanly in front of the model call; back it with a Redis\ncounter keyed per tenant per day.\n\n```python\n# Sketch — see references\u002Fper-tenant-budgets.md for the full middleware class.\nasync def budget_check(tenant_id: str, estimated_tokens: int) -> str:\n    day_key = f\"budget:{tenant_id}:{date.today().isoformat()}\"\n    used = int(await redis.get(day_key) or 0)\n    soft = TENANT_SOFT_CAPS[tenant_id]  # alert only\n    hard = TENANT_HARD_CAPS[tenant_id]  # refuse\n    projected = used + estimated_tokens\n    if projected > hard:\n        raise BudgetExceeded(tenant_id, used, hard)\n    if projected > soft:\n        emit_alert(tenant_id, used, soft)\n    return day_key  # caller increments on completion\n```\n\nGrace period: on hard-cap hit, allow in-flight calls (they already billed) but\nreject new ones. Reset counter on UTC day boundary. See\n[Per-Tenant Budgets](references\u002Fper-tenant-budgets.md) for full middleware\nclass, Redis schema, alert wiring, and grace-period semantics.\n\n### Step 9 — Cap agent recursion (P10, P23)\n\n`create_react_agent` defaults to `recursion_limit=25`. Agents on vague prompts\nloop until limit, then raise `GraphRecursionError` — but every loop billed.\nCap at 5-10 for interactive, 10-15 for batch. If you use `trim_messages` on the\nloop to control context, pass `include_system=True` and `start_on=\"human\"` so\nthe trimmer does not drop the system prompt under pressure (P23).\n\nPair this with Step 8's budget middleware — the budget is the hard stop even\nif the recursion cap is generous. Cross-reference: `langchain-langgraph-agents`\nfor routing patterns that terminate early on repeated tool calls.\n\n## Output\n\n- Canonical token read via `usage_metadata`, including reasoning and cache fields\n- Streaming-accurate aggregation via `astream_events(version=\"v2\")` on `on_chat_model_stream`\n- Retry-aware meter that dedupes on `request_id`\n- Model-tier decision tree with 2026-04 per-1M price snapshot\n- `CacheLedger` that reports Anthropic cache savings per session\u002Ftenant\n- Tool-aware cache keys for tool-binding chains\n- Semantic-cache threshold calibrated (0.85-0.90) against a gold set\n- Per-tenant budget middleware with soft and hard caps, Redis-backed\n- `recursion_limit` set to match the workload, not the default 25\n\n## Error Handling\n\n| Error \u002F symptom | Cause | Fix |\n|---|---|---|\n| Dashboard lags provider console by minutes on streaming calls | `on_llm_end` fires at stream close (P01) | Migrate to `astream_events(version=\"v2\")` + `on_chat_model_stream` (Step 2) |\n| Dashboard shows ~50% of billed spend | Retry middleware double-emits `on_llm_end`, aggregator sums both (P25) | Dedupe on `request_id` (Step 3), or move accounting above retry middleware |\n| Cache hits return wrong answer for tool-binding chain | `InMemoryCache` hashes prompt only, ignores tools (P61) | Switch to `SQLiteCache` \u002F `RedisSemanticCache` with tool-aware key (Step 6) |\n| `RedisSemanticCache` hit rate \u003C 5% on similar queries | Default `score_threshold=0.95` too strict (P62) | Calibrate to 0.85-0.90 against a gold pair set (Step 7) |\n| Cost spike then `GraphRecursionError: Recursion limit of 25 reached` | Agent loops on vague prompt (P10) | Set `recursion_limit=5-10`; add budget middleware (Step 8) |\n| Agent loses persona mid-conversation after many turns | `trim_messages` dropped system prompt (P23) | Pass `include_system=True, start_on=\"human\"` |\n| `max_retries=6` billing 7 requests per logical call | `ChatOpenAI` default (P30) | Set `max_retries=2`; log every retry via callback to verify |\n| 429 on cache reads while input-token budget shows headroom | Anthropic 50 RPM throttles cached and uncached together (P31) | Budget RPM at client level (semaphore); separate monitors for read vs uncached |\n| \"Cache savings\" metric always zero | `input_token_details.cache_read` reset per call (P04) | Aggregate via `CacheLedger` keyed per session\u002Ftenant (Step 5) |\n\n## Examples\n\n### Reconciling a 6x cost spike\n\nA team saw Anthropic spend 6x over a week with traffic up 1.4x. The dashboard\nshowed only 2x. Root cause: `max_retries=6` on a flaky downstream API (P30)\nplus retry middleware double-emit (P25) undercounting on the dashboard.\n\nFix sequence: (1) set `max_retries=2`, (2) attach `request_id` metadata at\nchain entry, (3) migrate meter to `astream_events` with `run_id` dedup. After\nthe fix, dashboard matched billed spend within 1%.\n\nSee [Token Accounting Pitfalls](references\u002Ftoken-accounting-pitfalls.md) for\nthe full reconciliation procedure against provider console CSVs.\n\n### Draft-then-finalize chain, measured savings\n\nA document-extraction chain runs `claude-haiku-4-5` to extract a rough outline,\nthen `claude-sonnet-4-6` to validate and fill missing fields. On a 10K-doc\nbatch:\n\n- Sonnet-only: ~$14\u002F1K docs\n- Haiku draft + Sonnet finalize: ~$4.20\u002F1K docs\n- Quality on the gold set: equivalent (F1 within 0.01)\n\nThe draft step burned 80% of the input tokens on the cheaper model.\n\nSee [Model Tiering](references\u002Fmodel-tiering.md) for the full chain, the gold\nset, and the evaluation harness.\n\n### Per-tenant runaway\n\nOne tenant's prompt template had an accidental double-interpolation of the\nmessage history that grew context unboundedly each turn. Spend 400x'd overnight. The per-tenant\nbudget middleware (Step 8) hit hard cap at 10x normal, alerted on soft cap at\n5x, refused new requests, allowed in-flight calls to complete.\n\nSee [Per-Tenant Budgets](references\u002Fper-tenant-budgets.md) for the full\nmiddleware, alert wiring, and grace-period semantics.\n\n## Resources\n\n- Pair skill: `langchain-performance-tuning` (latency, throughput, cache hit\n  rate) — this skill focuses on spend, not speed; reference each other on cache\n  tuning\n- Related: `langchain-middleware-patterns` (cache-key order, retry telemetry),\n  `langchain-langgraph-agents` (recursion caps, early termination),\n  `langchain-rate-limits` (RPM\u002FITPM budgeting, companion to Step 4)\n- [LangChain Python: `usage_metadata`](https:\u002F\u002Fpython.langchain.com\u002Fapi_reference\u002Fcore\u002Fmessages\u002Flangchain_core.messages.ai.UsageMetadata.html)\n- [LangChain Python: `astream_events` v2](https:\u002F\u002Fpython.langchain.com\u002Fdocs\u002Fhow_to\u002Fstreaming\u002F#using-stream-events)\n- [Anthropic pricing](https:\u002F\u002Fwww.anthropic.com\u002Fpricing) — verify current rates before shipping\n- [OpenAI pricing](https:\u002F\u002Fopenai.com\u002Fapi\u002Fpricing\u002F) — verify current rates before shipping\n- [Anthropic prompt caching](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Fdocs\u002Fprompt-caching)\n- Pack pain catalog: `docs\u002Fpain-catalog.md` (P01, P04, P10, P23, P25, P30, P31, P61, P62)\n","# LangChain Cost Tuning (Python)\n\n## Overview\n\nAn engineer shipped a new research agent Tuesday. By Friday the Anthropic\nbill had grown 6x while traffic grew 1.4x. The cost dashboard — wired to\n`on_llm_end` — showed spend up maybe 2x. Reconciling against the provider\nconsole on Monday surfaced two compounding bugs: (1) the agent's `ChatOpenAI`\nfallback kept the default `max_retries=6`, so each logical call billed as up\nto **7 requests** (P30); (2) retry middleware was registered *below* token\naccounting, so every retry fired `on_llm_end` twice — the aggregator summed\nboth emissions while LangSmith deduped them by generation ID, undercounting\nthe dashboard by ~50% against actual billed rate (P25).\n\nThe fix took an afternoon: cap retries at 2, tag retries with a stable\n`request_id`, and migrate token accounting to `AIMessage.usage_metadata` read\nfrom `astream_events(version=\"v2\")`. Finding the bug took a week. This skill\nis that week compressed into a runbook.\n\nCost tuning for a LangChain 1.0 production app has five levers, each with a\nsharp failure mode:\n\n- **Token accounting** — `on_llm_end` lags streams by 5-30s (P01); retries double-count (P25); Anthropic cache savings aggregate per-call, never per-session (P04).\n- **Retry discipline** — `max_retries=6` default on `ChatOpenAI` (P30); Anthropic 50 RPM tier throttles cached and uncached calls against the same budget (P31).\n- **Agent loop caps** — `create_react_agent` defaults to `recursion_limit=25`; vague prompts burn a session's budget before `GraphRecursionError` surfaces (P10).\n- **Caching** — `InMemoryCache` ignores bound tools in the cache key and returns wrong answers (P61); `RedisSemanticCache` ships with a 0.95 threshold that hits \u003C5% of the time (P62).\n- **Model tiering** — Running `claude-opus-4-5` on intent classification is 30-60x more expensive than `claude-haiku-4-5` for a task the cheaper model solves at equal quality.\n\nPin: `langchain-core 1.0.x`, `langchain-anthropic 1.0.x`, `langchain-openai 1.0.x`.\nPain-catalog anchors: P01, P04, P10, P23, P25, P30, P31, P61, P62.\n\n## Prerequisites\n\n- Python 3.10+\n- `langchain-core >= 1.0, \u003C 2.0`\n- At least one provider package: `pip install langchain-anthropic langchain-openai`\n- `redis-py >= 5.0` for budget middleware (optional; in-process dict works for dev)\n- Provider console access (Anthropic, OpenAI) to reconcile `usage_metadata`\n  against billed spend — you will need this to verify any instrumentation fix\n\n## Instructions\n\n### Step 1 — Read `usage_metadata`, never `response_metadata[\"token_usage\"]`\n\nLangChain 1.0 standardizes all provider usage into `AIMessage.usage_metadata`.\n`response_metadata[\"token_usage\"]` still exists as a compatibility shim but its\nshape is provider-specific (Anthropic nests under `usage`, OpenAI flat, Gemini\nuses different keys). Code that reads it directly will break when you switch\nproviders or when a provider SDK upgrades.\n\n```python\nfrom langchain_core.messages import AIMessage\n\ndef read_usage(msg: AIMessage) -> dict:\n    \"\"\"Canonical shape: input_tokens, output_tokens, input_token_details,\n    output_token_details. Safe across Anthropic, OpenAI, Gemini.\"\"\"\n    meta = msg.usage_metadata or {}\n    details_in = meta.get(\"input_token_details\", {}) or {}\n    details_out = meta.get(\"output_token_details\", {}) or {}\n    return {\n        \"input\": meta.get(\"input_tokens\", 0),\n        \"output\": meta.get(\"output_tokens\", 0),\n        \"cache_read\": details_in.get(\"cache_read\", 0),       # Anthropic\n        \"cache_creation\": details_in.get(\"cache_creation\", 0),\n        \"reasoning\": details_out.get(\"reasoning\", 0),        # OpenAI o1\u002Fo3\n    }\n```\n\nInclude `reasoning` in your output-billable total for o1\u002Fo3. A call with\n`output_tokens=500` and `reasoning=2000` actually bills 2500 output tokens.\n\n### Step 2 — Stream-accurate aggregation via `astream_events(version=\"v2\")`\n\n`on_llm_end` fires once after the stream closes, so dashboards lag by stream\nduration (P01). Anthropic populates `usage_metadata` on the `message_start` and\n`message_delta` events; OpenAI populates only the final chunk. Both show up as\n`on_chat_model_stream` events in `astream_events`.\n\n```python\nasync def metered_invoke(chain, inputs, meter):\n    async for event in chain.astream_events(inputs, version=\"v2\"):\n        if event[\"event\"] == \"on_chat_model_stream\":\n            chunk = event[\"data\"][\"chunk\"]\n            if getattr(chunk, \"usage_metadata\", None):\n                meter.record(\n                    run_id=event[\"run_id\"],\n                    usage=chunk.usage_metadata,\n                )\n```\n\nSee [Token Accounting Pitfalls](references\u002Ftoken-accounting-pitfalls.md) for\nthe full streaming-delta behavior across providers and reconciliation against\nprovider dashboards.\n\n### Step 3 — Dedup retries on `run_id`, not prompt hash\n\nRetry middleware runs the model twice on transient errors. Both emit usage\nevents. If the aggregator keys on prompt hash, it looks like one call cost\ntwice as much. If it keys on `run_id` (LangChain assigns one per generation\nattempt), you can attach a stable `request_id` at the chain level and dedupe\non that (P25).\n\n```python\nfrom uuid import uuid4\n\nclass RetryAwareMeter:\n    def __init__(self):\n        self._seen: set[str] = set()\n        self.totals = {\"input\": 0, \"output\": 0, \"cache_read\": 0}\n\n    def record(self, run_id: str, usage: dict, request_id: str | None = None):\n        # Keep only the last emission per logical request.\n        # On retry: same request_id, different run_id -> overwrite.\n        key = request_id or run_id\n        if key in self._seen:\n            # Retry emission — subtract prior, add new (last wins).\n            prior = self._prior_by_key.get(key, {})\n            for k in self.totals:\n                self.totals[k] -= prior.get(k, 0)\n        self._seen.add(key)\n        self._prior_by_key[key] = usage\n        self.totals[\"input\"]  += usage.get(\"input_tokens\", 0)\n        self.totals[\"output\"] += usage.get(\"output_tokens\", 0)\n        details = usage.get(\"input_token_details\", {}) or {}\n        self.totals[\"cache_read\"] += details.get(\"cache_read\", 0)\n```\n\nInject `request_id` via `config={\"metadata\": {\"request_id\": str(uuid4())}}` on\neach invoke. The meter reads `event[\"metadata\"][\"request_id\"]` alongside\n`run_id`.\n\nAlternative: place token accounting **above** retry middleware in the chain —\nretries happen inside, so only the successful attempt emits. This is simpler\nbut makes retries invisible to observability, which you usually want to see.\n\n### Step 4 — Model tiering: draft cheap, finalize expensive\n\nMost chains have a structural split: a cheap \"understand the request\" call and\nan expensive \"produce the final artifact\" call. Running the expensive model on\nboth roughly triples cost for no quality gain.\n\n**Per-1M pricing snapshot, 2026-04** (verify current prices before shipping at\nhttps:\u002F\u002Fwww.anthropic.com\u002Fpricing and https:\u002F\u002Fopenai.com\u002Fapi\u002Fpricing\u002F):\n\n| Model | Input $\u002F1M | Output $\u002F1M | Cache read $\u002F1M | Role |\n|---|---|---|---|---|\n| `claude-haiku-4-5` | $1.00 | $5.00 | $0.10 | Draft, classify, route |\n| `claude-sonnet-4-6` | $3.00 | $15.00 | $0.30 | Finalize, reason, extract |\n| `claude-opus-4-5` | $15.00 | $75.00 | $1.50 | High-stakes, long-horizon |\n| `gpt-4o-mini` | $0.15 | $0.60 | n\u002Fa (prefix cache only) | Draft, classify |\n| `gpt-4o` | $2.50 | $10.00 | n\u002Fa | Finalize |\n| `gpt-o3-mini` | $1.10 | $4.40 | n\u002Fa | Reasoning, planning |\n\nAnthropic cache reads cost **10% of input**. Cache creation costs **125% of\ninput**. Break-even is ~4 uses of a cached prefix. See\n[Cache Economics](references\u002Fcache-economics.md).\n\n**Decision tree:**\n\n```\ninput\n  └── intent classification \u002F routing\n      └── gpt-4o-mini OR claude-haiku-4-5        (~$0.15-$1 per 1M in)\n  └── generation \u002F reasoning\n      ├── single-pass, low-stakes\n      │   └── gpt-4o-mini                         (draft)\n      ├── single-pass, high-stakes (extraction, contracts)\n      │   └── claude-sonnet-4-6                   (finalize)\n      ├── multi-step reasoning\n      │   └── gpt-o3-mini OR claude-sonnet-4-6    (plan)\n      └── mission-critical long-horizon\n          └── claude-opus-4-5                     (expensive, used sparingly)\n```\n\nTiering is **wrong** when quality degrades silently — high-stakes extraction on\nHaiku misses entities the Sonnet would catch. Always evaluate both tiers on a\ngold set before committing. See [Model Tiering](references\u002Fmodel-tiering.md)\nfor the evaluation harness and a worked draft-then-finalize chain.\n\n### Step 5 — Aggregate Anthropic cache usage per session and tenant (P04)\n\n`usage_metadata[\"input_token_details\"][\"cache_read\"]` reports per-call. To see\nwhether caching is paying for itself you need to aggregate per-session or\nper-tenant and compare against cache-creation cost.\n\n```python\nclass CacheLedger:\n    def __init__(self, tenant_id: str):\n        self.tenant_id = tenant_id\n        self.read = 0           # billed at 0.1x input rate\n        self.creation = 0       # billed at 1.25x input rate\n        self.uncached_input = 0 # billed at 1.0x input rate\n\n    def ingest(self, usage: dict):\n        details = usage.get(\"input_token_details\", {}) or {}\n        self.read     += details.get(\"cache_read\", 0)\n        self.creation += details.get(\"cache_creation\", 0)\n        total_input = usage.get(\"input_tokens\", 0)\n        self.uncached_input += total_input - self.read - self.creation\n\n    def savings_vs_no_cache(self, price_per_1m_input: float) -> float:\n        # What we paid with cache vs. paying full price on all input.\n        actual = (self.uncached_input * 1.00\n                  + self.creation      * 1.25\n                  + self.read          * 0.10) * price_per_1m_input \u002F 1_000_000\n        naive  = (self.uncached_input + self.creation + self.read) * price_per_1m_input \u002F 1_000_000\n        return naive - actual\n```\n\nPersist `CacheLedger` to Redis or Postgres keyed by `(tenant_id, day)`. If\nsavings is negative over a 24h window, caching is costing more than it saves —\nyour cached prefix is either too short or hit too rarely. See\n[Cache Economics](references\u002Fcache-economics.md).\n\n### Step 6 — Cache keys must include bound tools (P61)\n\n`set_llm_cache(InMemoryCache())` hashes the prompt string only. A chain that\nbinds different tool sets will return wrong answers from the cache. This is\nthe most dangerous cache failure mode — it silently returns semantically\nincorrect responses rather than missing.\n\n**Do not use `InMemoryCache` on any chain that calls `bind_tools()`.** Use\n`SQLiteCache` or `RedisSemanticCache` with a composite key:\n\n```python\nimport hashlib, json\n\ndef tool_aware_key(prompt: str, tools: list) -> str:\n    tools_fingerprint = hashlib.sha256(\n        json.dumps([t.args_schema.model_json_schema() for t in tools],\n                   sort_keys=True).encode()\n    ).hexdigest()[:16]\n    return f\"{tools_fingerprint}:{hashlib.sha256(prompt.encode()).hexdigest()}\"\n```\n\nCross-reference: `langchain-middleware-patterns` covers cache-key layering in\nmiddleware order (redact → cache → model) to avoid cross-tenant PII leaks.\n\n### Step 7 — Tune semantic-cache threshold; ship a calibrated value, not the default (P62)\n\n`RedisSemanticCache` defaults to `score_threshold=0.95`. On real workloads this\nhits under 5% of the time. Production-tuned values land between 0.85 and 0.90.\nShip with a calibrated threshold, not the default:\n\n1. Collect 200 real query pairs labeled \"should return same answer\" (positive)\n   and \"should return different answer\" (negative).\n2. Embed both sides of each pair with your embedding model.\n3. For thresholds in `[0.80, 0.82, 0.84, …, 0.95]`, compute:\n   - hit rate (% positive pairs above threshold)\n   - false positive rate (% negative pairs above threshold)\n4. Pick the lowest threshold where FPR \u003C 2%.\n5. Ship with a daily audit: sample 1% of cache hits, log to review queue.\n\nIf the curve flattens above 0.92 on positives, your embeddings are too weak\nfor semantic caching — consider exact-match `SQLiteCache` instead. See\n[Cache Economics](references\u002Fcache-economics.md) for the calibration worksheet.\n\n### Step 8 — Per-tenant budget middleware: soft warn, hard refuse\n\nA single runaway tenant will consume the pack if left uncapped. LangChain 1.0\nmiddleware slots cleanly in front of the model call; back it with a Redis\ncounter keyed per tenant per day.\n\n```python\n# Sketch — see references\u002Fper-tenant-budgets.md for the full middleware class.\nasync def budget_check(tenant_id: str, estimated_tokens: int) -> str:\n    day_key = f\"budget:{tenant_id}:{date.today().isoformat()}\"\n    used = int(await redis.get(day_key) or 0)\n    soft = TENANT_SOFT_CAPS[tenant_id]  # alert only\n    hard = TENANT_HARD_CAPS[tenant_id]  # refuse\n    projected = used + estimated_tokens\n    if projected > hard:\n        raise BudgetExceeded(tenant_id, used, hard)\n    if projected > soft:\n        emit_alert(tenant_id, used, soft)\n    return day_key  # caller increments on completion\n```\n\nGrace period: on hard-cap hit, allow in-flight calls (they already billed) but\nreject new ones. Reset counter on UTC day boundary. See\n[Per-Tenant Budgets](references\u002Fper-tenant-budgets.md) for full middleware\nclass, Redis schema, alert wiring, and grace-period semantics.\n\n### Step 9 — Cap agent recursion (P10, P23)\n\n`create_react_agent` defaults to `recursion_limit=25`. Agents on vague prompts\nloop until limit, then raise `GraphRecursionError` — but every loop billed.\nCap at 5-10 for interactive, 10-15 for batch. If you use `trim_messages` on the\nloop to control context, pass `include_system=True` and `start_on=\"human\"` so\nthe trimmer does not drop the system prompt under pressure (P23).\n\nPair this with Step 8's budget middleware — the budget is the hard stop even\nif the recursion cap is generous. Cross-reference: `langchain-langgraph-agents`\nfor routing patterns that terminate early on repeated tool calls.\n\n## Output\n\n- Canonical token read via `usage_metadata`, including reasoning and cache fields\n- Streaming-accurate aggregation via `astream_events(version=\"v2\")` on `on_chat_model_stream`\n- Retry-aware meter that dedupes on `request_id`\n- Model-tier decision tree with 2026-04 per-1M price snapshot\n- `CacheLedger` that reports Anthropic cache savings per session\u002Ftenant\n- Tool-aware cache keys for tool-binding chains\n- Semantic-cache threshold calibrated (0.85-0.90) against a gold set\n- Per-tenant budget middleware with soft and hard caps, Redis-backed\n- `recursion_limit` set to match the workload, not the default 25\n\n## Error Handling\n\n| Error \u002F symptom | Cause | Fix |\n|---|---|---|\n| Dashboard lags provider console by minutes on streaming calls | `on_llm_end` fires at stream close (P01) | Migrate to `astream_events(version=\"v2\")` + `on_chat_model_stream` (Step 2) |\n| Dashboard shows ~50% of billed spend | Retry middleware double-emits `on_llm_end`, aggregator sums both (P25) | Dedupe on `request_id` (Step 3), or move accounting above retry middleware |\n| Cache hits return wrong answer for tool-binding chain | `InMemoryCache` hashes prompt only, ignores tools (P61) | Switch to `SQLiteCache` \u002F `RedisSemanticCache` with tool-aware key (Step 6) |\n| `RedisSemanticCache` hit rate \u003C 5% on similar queries | Default `score_threshold=0.95` too strict (P62) | Calibrate to 0.85-0.90 against a gold pair set (Step 7) |\n| Cost spike then `GraphRecursionError: Recursion limit of 25 reached` | Agent loops on vague prompt (P10) | Set `recursion_limit=5-10`; add budget middleware (Step 8) |\n| Agent loses persona mid-conversation after many turns | `trim_messages` dropped system prompt (P23) | Pass `include_system=True, start_on=\"human\"` |\n| `max_retries=6` billing 7 requests per logical call | `ChatOpenAI` default (P30) | Set `max_retries=2`; log every retry via callback to verify |\n| 429 on cache reads while input-token budget shows headroom | Anthropic 50 RPM throttles cached and uncached together (P31) | Budget RPM at client level (semaphore); separate monitors for read vs uncached |\n| \"Cache savings\" metric always zero | `input_token_details.cache_read` reset per call (P04) | Aggregate via `CacheLedger` keyed per session\u002Ftenant (Step 5) |\n\n## Examples\n\n### Reconciling a 6x cost spike\n\nA team saw Anthropic spend 6x over a week with traffic up 1.4x. The dashboard\nshowed only 2x. Root cause: `max_retries=6` on a flaky downstream API (P30)\nplus retry middleware double-emit (P25) undercounting on the dashboard.\n\nFix sequence: (1) set `max_retries=2`, (2) attach `request_id` metadata at\nchain entry, (3) migrate meter to `astream_events` with `run_id` dedup. After\nthe fix, dashboard matched billed spend within 1%.\n\nSee [Token Accounting Pitfalls](references\u002Ftoken-accounting-pitfalls.md) for\nthe full reconciliation procedure against provider console CSVs.\n\n### Draft-then-finalize chain, measured savings\n\nA document-extraction chain runs `claude-haiku-4-5` to extract a rough outline,\nthen `claude-sonnet-4-6` to validate and fill missing fields. On a 10K-doc\nbatch:\n\n- Sonnet-only: ~$14\u002F1K docs\n- Haiku draft + Sonnet finalize: ~$4.20\u002F1K docs\n- Quality on the gold set: equivalent (F1 within 0.01)\n\nThe draft step burned 80% of the input tokens on the cheaper model.\n\nSee [Model Tiering](references\u002Fmodel-tiering.md) for the full chain, the gold\nset, and the evaluation harness.\n\n### Per-tenant runaway\n\nOne tenant's prompt template had an accidental double-interpolation of the\nmessage history that grew context unboundedly each turn. Spend 400x'd overnight. The per-tenant\nbudget middleware (Step 8) hit hard cap at 10x normal, alerted on soft cap at\n5x, refused new requests, allowed in-flight calls to complete.\n\nSee [Per-Tenant Budgets](references\u002Fper-tenant-budgets.md) for the full\nmiddleware, alert wiring, and grace-period semantics.\n\n## Resources\n\n- Pair skill: `langchain-performance-tuning` (latency, throughput, cache hit\n  rate) — this skill focuses on spend, not speed; reference each other on cache\n  tuning\n- Related: `langchain-middleware-patterns` (cache-key order, retry telemetry),\n  `langchain-langgraph-agents` (recursion caps, early termination),\n  `langchain-rate-limits` (RPM\u002FITPM budgeting, companion to Step 4)\n- [LangChain Python: `usage_metadata`](https:\u002F\u002Fpython.langchain.com\u002Fapi_reference\u002Fcore\u002Fmessages\u002Flangchain_core.messages.ai.UsageMetadata.html)\n- [LangChain Python: `astream_events` v2](https:\u002F\u002Fpython.langchain.com\u002Fdocs\u002Fhow_to\u002Fstreaming\u002F#using-stream-events)\n- [Anthropic pricing](https:\u002F\u002Fwww.anthropic.com\u002Fpricing) — verify current rates before shipping\n- [OpenAI pricing](https:\u002F\u002Fopenai.com\u002Fapi\u002Fpricing\u002F) — verify current rates before shipping\n- [Anthropic prompt caching](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Fdocs\u002Fprompt-caching)\n- Pack pain catalog: `docs\u002Fpain-catalog.md` (P01, P04, P10, P23, P25, P30, P31, P61, P62)\n",{"name":5,"tags":24,"author":33,"license":15,"version":34,"description":35,"allowed-tools":36,"compatible-with":37},[25,26,27,28,29,30,31,32],"saas","langchain","langgraph","python","langchain-1.0","cost","tokens","budget","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","2.0.0","Control LangChain 1.0 AI spend with accurate streaming token accounting,\nmodel tiering, provider-specific cache hit tuning, per-tenant budgets,\nand retry dedup. Use when AI spend grows faster than traffic, a cost\nregression lands, or you need per-tenant budget enforcement.\nTrigger with \"langchain cost\", \"langchain token accounting\",\n\"langchain per-tenant budget\", \"langchain model tiering\",\n\"prompt cache savings\".\n","Read, Write, Edit, Bash(python:*), Bash(redis-cli:*)","claude-code, codex","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--langchain-py-pack--langchain-cost-tuning",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill langchain-cost-tuning",{"tool":53,"command":54},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill langchain-cost-tuning",{"tool":56,"command":57},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill langchain-cost-tuning","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--langchain-py-pack--langchain-cost-tuning\u002FSKILL.md",true,[],[62,69,76,83,90,98],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":94,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]