{"id":"19399da3-e44d-45af-a6f9-500c0042b281","slug":"cash-framework","kind":"skill","name":"cash-framework","summary":"C.A.S.H. (Constraints, Ambiguity, Sequencing, Heterogeneity) is an agent skill and Orchestration Router that evaluates system components and routes them to traditional code, an LLM call, or a hybrid.","owner":"pathak-prashant","repoUrl":"https://github.com/pathak-prashant/cash-framework","license":"Apache-2.0","licenseTier":"permissive","trust":"community","stars":1,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-07-12T07:45:22.000Z","addedAt":"2026-10-21T11:12:06.555Z","logoUrl":"https://avatars.githubusercontent.com/u/86124369?u=e249b7800be2c7efc1a6ffb7fcad8ccae87a7140&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["developer-tools","communication"],"tags":["architecture","claude-code","decision-matrix"],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-23T04:35:02.584Z","sample":false,"url":"https://conduits.dev/tools/cash-framework","language":"JavaScript","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# C.A.S.H. Framework\n\nC.A.S.H. (**C**onstraints, **A**mbiguity, **S**equencing, **H**eterogeneity) is an agent skill that evaluates each component of a proposed system and routes it to traditional code, an LLM call, or a hybrid of both. It is an **Orchestration Router**, not an AI gatekeeper: hard operational constraints (latency, reproducibility, explainability, compliance topology) gate first, then three dimensions vote — producing a Decision Matrix with a stated, arithmetic-backed cost justification for every AI or Hybrid recommendation.\n\n## The problem\n\nTwo failure modes recur in AI-assisted architecture:\n\n| Failure mode | What it looks like | Cost |\n| :--- | :--- | :--- |\n| **Over-applying AI** | An LLM call on the hot path, or on deterministic plumbing that a function already handles perfectly | Latency blown past SLA, token spend that scales with traffic instead of staying flat, non-reproducible output where the requirement is bit-identical |\n| **Under-applying AI** | Regex chains and hand-rolled rule engines standing in for tasks that are inherently ambiguous (intent, sentiment, root-cause synthesis) | Ever-growing edge-case handling, brittle heuristics, a quality ceiling templates can't clear |\n\nC.A.S.H. addresses both in a single evaluation pass. The evaluation is deliberately **neutral** — the skill contains no \"champion AI\" instruction, because framing an evaluator measurably biases its verdicts (see Research grounding below).\n\n## The framework\n\n**C — Constraints** is a **gate**, resolved before any scoring:\n\n| Gate | Fires when | Routes to |\n| :--- | :--- | :--- |\n| Latency | Sub-100ms budget on the critical path (fastest mainstream LLM TTFT is ~400–600ms) | Code |\n| Reproducibility | Bit-identical output required (API-served LLMs aren't bit-reproducible even at temperature 0) | Code |\n| Explainability | A reviewer must know *why* this decision — not merely that it was logged. Traceability alone (logging, per EU AI Act Art. 12) does **not** fire the gate; nor does a genuinely advisory output — one an accountable human is equipped to verify and realistically positioned to override | Code |\n| Privacy / topology | PII/PHI/regulated data **and** no compliant deployment path (BAA-covered, on-prem, or pre-call redaction). Unstated topology in a sensitive domain → the skill must ask, not assume | Code |\n\n**A / S / H** are **votes** on whatever the gate doesn't resolve:\n\n| Dimension | Ask | Code when | AI when |\n| :--- | :--- | :--- | :--- |\n| **A — Ambiguity** | Is the logic deterministic or ambiguous? | Explicit, rule-based (scoring, formatting) | Nuance, intent, tone, meaning — even in structurally uniform data |\n| **S — Sequencing** | Is the sequence of steps fixed at design time or decided at runtime? | Steps and order known upfront, however much design-time branching | The plan is assembled at runtime from intermediate results |\n| **H — Heterogeneity** | Combined by structure alone, or synthesized across disparate sources? | Joins, merges, aggregations — structure only | Correlating heterogeneous, unstructured signals into one conclusion |\n\n**Decision rule**: three voters, no ties. **3-0** → that engine. **2-1** → **Hybrid**, and the minority dimension names the AI's pipeline position (minority A→AI: AI interprets before code; S→AI: AI plans, code executes; H→AI: AI synthesizes after code assembles).\n\n**Day-2 rule**: the matrix is a design-time verdict, and its inputs drift. SKILL.md defines re-evaluation triggers — ruleset growth on a Code component, ~3× cost overrun or a failed cache assumption on an AI component, model deprecation, SLA or topology change — each prompting a component-level re-vote, not a system redesign.\n\n> **Why these letters?** Each dimension asks exactly what its name says, the three voting axes ask distinct questions (logic-ambiguity to A, workflow dynamism to S, data shape to H — distinct questions, though H-synthesis usually co-occurs with A-ambiguous; the 2-1 mechanics survive the correlation), and the strongest routing signal — hard constraints — sits first in the acronym as a gate. The full design reasoning is in [`references/philosophy.md`](skills/cash-framework/references/philosophy.md).\n\n## Illustrative cost estimates (worked)\n\nThese are **estimates, not measurements** — each is derived in the linked example as `tokens/call × calls/day × per-MTok price`, with model tier and cache assumptions stated, against [Anthropic list pricing](https://platform.claude.com/docs/en/pricing) (retrieved July 2026). Re-derive before budgeting. The code side is held to the same arithmetic standard: infrastructure common to both designs cancels, and only the incremental cost decides (worked in the e-commerce example).\n\n| Scenario | Constraint | Estimate |\n| :--- | :--- | :--- |\n| **[Real-time fraud detection](skills/cash-framework/examples/fraud_detection.md)** | 50ms SLA on the transaction path | Hot path routes to code — **$0 tokens** on millions of transactions/day; async AI pattern analysis + investigation reports ≈ **tens of dollars/day** (arithmetic in the example) |\n| **[E-commerce search @ 10M queries/day](skills/cash-framework/examples/ecommerce_search.md)** | Per-query LLM cost at scale | A frontier LLM on every query ≈ **$54K–$180K/day** (1–2 calls/query, ~500–800 in + 100–200 out tokens, Sonnet/Opus-tier rates); small-model + cached + embeddings design ≈ **$1.5K–$2.5K/day**, lower with self-hosted small models |\n| **[DevOps incident response](skills/cash-framework/examples/devops_incident_response.md)** | ~50 incidents/month | ≈ **$15–$75/month** in tokens vs ≈ **$4,350/month** of engineer time saved by the MTTR reduction |\n| **[Clinical decision support](skills/cash-framework/examples/clinical_decision_support.md)** | PHI / HIPAA topology | Compliance gating resolves deployment first (BAA-covered or on-prem), so AI-assisted diagnosis is deployable instead of blocked outright |\n\n## Research grounding\n\nEvery operative rule in the skill traces to a checkable source — the full annotated list is in [`references/research.md`](skills/cash-framework/references/research.md):\n\n- **Code-first premise** — Zinkevich, [Rules of ML, Rule #1](https://developers.google.com/machine-learning/guides/rules-of-ml); Anthropic, [Building Effective Agents](https://www.anthropic.com/engineering/building-effective-agents) (also the source of the workflow-vs-agent split behind the S dimension).\n- **Neutrality (no advocacy instruction)** — Sharma et al., [Towards Understanding Sycophancy in Language Models](https://arxiv.org/abs/2310.13548) (ICLR 2024); Turpin et al., [Language Models Don't Always Say What They Think](https://arxiv.org/abs/2305.04388) (NeurIPS 2023).\n- **Reproducibility gate** — Thinking Machines, [Defeating Nondeterminism in LLM Inference](https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/).\n- **Explainability vs traceability** — [EU AI Act, Article 12 (record-keeping)](https://artificialintelligenceact.eu/article/12/).\n- **Latency gate** — e.g. [LLM latency benchmarks](https://aimultiple.com/llm-latency-benchmark) (fastest mainstream TTFT ≈ 400–600ms).\n- **Skill structure** — Anthropic, [skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices).\n\n## Worked examples\n\nSeven scenarios in [`skills/cash-framework/examples/`](skills/cash-framework/examples/), each ending in a full Decision Matrix and Cost Checkpoint:\n\n- **[Fantasy Football Team Drafter](skills/cash-framework/examples/fantasy_football.md)** — code for stats and rule enforcement, AI for drafting strategy (a genuine 3-0 AI verdict on the drafting component)\n- **[Customer Support Router](skills/cash-framework/examples/customer_support_router.md)** — code routes and delivers, AI classifies intent and reads tone\n- **[CI/CD with AI Code Review](skills/cash-framework/examples/cicd_ai_code_review.md)** — fail-fast-with-code, AI reviews\n- **[Real-Time Fraud Detection](skills/cash-framework/examples/fraud_detection.md)** — the C gate in action: 50ms SLA routes the hot path to code; AI finds patterns rules can't\n- **[E-Commerce Search & Personalization](skills/cash-framework/examples/ecommerce_search.md)** — all three Hybrid pipeline positions at 10M queries/day, with the worked cost arithmetic\n- **[Clinical Decision Support](skills/cash-framework/examples/clinical_decision_support.md)** — compliance-topology gating: PHI-bound components to code, AI-assisted diagnosis where the deployment permits\n- **[DevOps Incident Response](skills/cash-framework/examples/devops_incident_response.md)** — the S dimension in practice: AI plans remediation, code validates and executes\n\n## Project structure\n\n```\nskills/cash-framework/\n  SKILL.md                  # operative instructions the agent follows\n  references/\n    philosophy.md           # design rationale — why route to code frees AI budget; why these letters\n    research.md             # annotated bibliography: every rule → its checkable source\n    tco_checklist.md        # the full Cost Checkpoint checklist\n  examples/                 # seven worked scenarios (table above)\npackage.json                 # agent plugin/package manifest\n.claude-plugin/, .cursor-plugin/, .codex-plugin/, .kimi-plugin/, .opencode/, .pi/\n                              # per-harness plugin manifests and stubs\n```\n\n## Installation\n\nInstallation differs by harness. If you use more than one, install the skill separately for each one. The repository lives at [github.com/pathak-prashant/cash-framework](https://github.com/pathak-prashant/cash-framework).\n\n> Plugin systems evolve quickly - only the Claude Code commands below have been verified against a current release. Treat the rest as illustrative and check each tool's plugin docs.\n\n### Claude Code\n\nNo plugin needed - copy `skills/cash-framework/` into your project's `.claude/skills/` (or `~/.claude/skills/` for every project).\n\nOr install as a plugin, since this repo ships a `marketplace.json`:\n\n```bash\n/plugin marketplace add https://github.com/pathak-prashant/cash-framework\n/plugin install cash-framework-skill@cash-framework-skill-marketplace\n```\n\n### Antigravity\n\n```bash\nagy plugin install https://github.com/pathak-prashant/cash-framework\n```\n\nReinstall with the same command to pick up changes.\n\n### Pi\n\nSkills load via the `pi.skills` entry in `package.json`, which already points at `./skills`.\n\n```bash\npi install git:github.com/pathak-prashant/cash-framework\n```\n\nFor local development, run Pi with this checkout loaded as a temporary package:\n\n```bash\npi -e /path/to/cash-framework\n```\n\nThe commands above are not verified here - check your Pi installation's documentation.\n\n### Codex CLI\n\nOpen the plugin search interface and install from `https://github.com/pathak-prashant/cash-framework` if supported, or paste `skills/cash-framework/SKILL.md` into your custom instructions.\n\n### GitHub Copilot\n\nCopilot supports the open **Agent Skills** standard that `SKILL.md` already conforms to (name + description frontmatter) — see [GitHub's agent skills documentation](https://docs.github.com/en/copilot/concepts/agents/about-agent-skills). Copy `skills/cash-framework/` into one of the repo-level skill directories Copilot recognizes:\n\n```text\nyour-project/\n├── .agents/skills/cash-framework/SKILL.md      # cross-tool location\n├── .github/skills/cash-framework/SKILL.md      # Copilot-specific\n└── .claude/skills/cash-framework/SKILL.md       # already covered above\n```\n\nFor every project on your machine, use the global equivalent instead: `~/.agents/skills/cash-framework/` or `~/.copilot/skills/cash-framework/`.\n\nIf your Copilot version predates Agent Skills support, fall back to pasting `SKILL.md` into `.github/copilot-instructions.md` (repo-wide) or into a scoped `.github/instructions/cash-framework.instructions.md` file with the required frontmatter:\n\n```yaml\n---\ndescription: 'Apply the C.A.S.H. framework to architecture and build requests.'\napplyTo: '**'\n---\n```\n\n### Cline\n\nCline also reads the `.agents/skills` layout from the section above - copy `skills/cash-framework/` into `.agents/skills/cash-framework/` (workspace) or `~/.agents/skills/cash-framework/` (global, available to every project) and it shows up under Cline's Skills panel, toggleable per-skill.\n\nAlternatively, paste the contents of `skills/cash-framework/SKILL.md` into a `.clinerules` file at your project root, or into `.clinerules/cash-framework.md` if you keep rules split across multiple files.\n\n### Cursor & Kimi Code\n\nThese typically fetch from their own marketplaces - publish following their plugin guidelines, or paste `SKILL.md` into custom instructions/rules directly.\n\n### Factory Droid\n\n```bash\ndroid plugin marketplace add https://github.com/pathak-prashant/cash-framework\ndroid plugin install cash-framework-skill@cash-framework\n```\n\n### OpenCode\n\nA stub ships at `.opencode/plugins/cash-framework-skill.js` - it's a placeholder that does **not** yet load the skill. Wire it to OpenCode's plugin API, or paste `SKILL.md` into your OpenCode rules. The Pi extension stub at `.pi/extensions/cash-framework-skill.ts` is in the same state.\n"}