Skip to content

pathak-prashant/cash-framework

Repository files navigation

C.A.S.H. Framework

C.A.S.H. (Constraints, Ambiguity, Sequencing, Heterogeneity) 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.

The problem

Two failure modes recur in AI-assisted architecture:

Failure mode What it looks like Cost
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
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

C.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).

The framework

C — Constraints is a gate, resolved before any scoring:

Gate Fires when Routes to
Latency Sub-100ms budget on the critical path (fastest mainstream LLM TTFT is ~400–600ms) Code
Reproducibility Bit-identical output required (API-served LLMs aren't bit-reproducible even at temperature 0) Code
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
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

A / S / H are votes on whatever the gate doesn't resolve:

Dimension Ask Code when AI when
A — Ambiguity Is the logic deterministic or ambiguous? Explicit, rule-based (scoring, formatting) Nuance, intent, tone, meaning — even in structurally uniform data
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
H — Heterogeneity Combined by structure alone, or synthesized across disparate sources? Joins, merges, aggregations — structure only Correlating heterogeneous, unstructured signals into one conclusion

Decision rule: three voters, no ties. 3-0 → that engine. 2-1Hybrid, 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).

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.

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.

Illustrative cost estimates (worked)

These 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 (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).

Scenario Constraint Estimate
Real-time fraud detection 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)
E-commerce search @ 10M queries/day 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
DevOps incident response ~50 incidents/month $15–$75/month in tokens vs ≈ $4,350/month of engineer time saved by the MTTR reduction
Clinical decision support PHI / HIPAA topology Compliance gating resolves deployment first (BAA-covered or on-prem), so AI-assisted diagnosis is deployable instead of blocked outright

Research grounding

Every operative rule in the skill traces to a checkable source — the full annotated list is in references/research.md:

Worked examples

Seven scenarios in skills/cash-framework/examples/, each ending in a full Decision Matrix and Cost Checkpoint:

Project structure

skills/cash-framework/
  SKILL.md                  # operative instructions the agent follows
  references/
    philosophy.md           # design rationale — why route to code frees AI budget; why these letters
    research.md             # annotated bibliography: every rule → its checkable source
    tco_checklist.md        # the full Cost Checkpoint checklist
  examples/                 # seven worked scenarios (table above)
package.json                 # agent plugin/package manifest
.claude-plugin/, .cursor-plugin/, .codex-plugin/, .kimi-plugin/, .opencode/, .pi/
                              # per-harness plugin manifests and stubs

Installation

Installation 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.

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.

Claude Code

No plugin needed - copy skills/cash-framework/ into your project's .claude/skills/ (or ~/.claude/skills/ for every project).

Or install as a plugin, since this repo ships a marketplace.json:

/plugin marketplace add https://github.com/pathak-prashant/cash-framework
/plugin install cash-framework-skill@cash-framework-skill-marketplace

Antigravity

agy plugin install https://github.com/pathak-prashant/cash-framework

Reinstall with the same command to pick up changes.

Pi

Skills load via the pi.skills entry in package.json, which already points at ./skills.

pi install git:github.com/pathak-prashant/cash-framework

For local development, run Pi with this checkout loaded as a temporary package:

pi -e /path/to/cash-framework

The commands above are not verified here - check your Pi installation's documentation.

Codex CLI

Open 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.

GitHub Copilot

Copilot supports the open Agent Skills standard that SKILL.md already conforms to (name + description frontmatter) — see GitHub's agent skills documentation. Copy skills/cash-framework/ into one of the repo-level skill directories Copilot recognizes:

your-project/
├── .agents/skills/cash-framework/SKILL.md      # cross-tool location
├── .github/skills/cash-framework/SKILL.md      # Copilot-specific
└── .claude/skills/cash-framework/SKILL.md       # already covered above

For every project on your machine, use the global equivalent instead: ~/.agents/skills/cash-framework/ or ~/.copilot/skills/cash-framework/.

If 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:

---
description: 'Apply the C.A.S.H. framework to architecture and build requests.'
applyTo: '**'
---

Cline

Cline 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.

Alternatively, 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.

Cursor & Kimi Code

These typically fetch from their own marketplaces - publish following their plugin guidelines, or paste SKILL.md into custom instructions/rules directly.

Factory Droid

droid plugin marketplace add https://github.com/pathak-prashant/cash-framework
droid plugin install cash-framework-skill@cash-framework

OpenCode

A 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.

About

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.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors