Home / Market / skeleton first

skeleton first

Prove a data/AI/agent workflow end to end on a tiny sample, find cheap wins, then scale in cost-gated steps within budget.

skill★ 507780 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: skeleton-first description: "Prove a data/AI/agent workflow end to end on a tiny sample, find cheap wins, then scale in cost-gated steps within budget." category: workflow risk: safe source: self source_type: self date_added: "2026-10-11" author: Dan He tags: [llm, cost, pipeline, etl, rag, dbt, snowflake, budget, data-engineering] tools: [claude, codex, cursor]

---

Skeleton first: prove the workflow cheaply, then scale

Agents tend to build every stage at full size before anything has run end to end. In data and AI work that fails expensively: a wrong prompt runs over a whole table, a wrong grain is discovered after twenty models exist, a big warehouse burns credits on a query that returns the wrong answer.

This skill changes the order of work:

  1. Make the whole path work on the smallest possible input with the cheapest settings.
  2. Prove it with a test.
  3. Scale up in cost-gated rungs, measuring and projecting cost before each one.
  4. Only then add features, one at a time, re-running the tests after each.

When to Use

Skip it for: one-file fixes, a single query, work already proven at full scale, or when the user explicitly says to go straight to full scale (then still state the projected cost first).

Step 0 - Define "it works" before building

Write down, and show the user in 3-5 lines:

If the user has not given a budget, propose one and say so.

Step 1 - Write the ladder

Plan the work as rungs. Each rung adds exactly one thing and has a gate.

| Rung | Adds | Input size | Gate to pass | | --- | --- | --- | --- | | L0 skeleton | every stage, stubbed or minimal | 1 record | test passes end to end | | L1 | real logic in the weakest stage | 10 records | test passes, cost per record measured | | L2 | scale | ~1% or 100 records | quality spot-check, projected full cost under budget | | L3 | full run | 100% | totals reconcile, test still passes | | L4+ | one feature each | as needed | all previous tests still pass |

Show the ladder to the user before building unless the task is small. Keep it short.

Step 2 - Build L0, the walking skeleton

Not allowed until L0 passes: a second source, a second model or table, parallelism, tuning, UI, abstractions, handling edge cases that have not been seen yet.

Step 3 - Scale up in cost-gated rungs

At every rung:

  1. Run on the rung's input size.
  2. Record: records in/out, errors, wall time, cost (tokens, credits, API calls).
  3. Project the next rung: cost per record x next size, time per record x next size.
  4. Gate: continue only if the test passes, errors are understood, and the projection is under budget.

When the projection is over budget, the budget is a constraint to design around, not a reason to hand the job back. First look for a cheaper path that still passes the test: remove redundancy found in the sample, send less per record (relevant sections, truncation), cache, use a cheaper model or a free local method for part of the work. Prove the cheaper path on the same small rung, re-project, and continue if it fits. Stop and report to the user with the numbers and options only when no cheaper path passes the test, or when it would change what the user asked for in a way they would likely care about (say which trade-off you made either way).

Grow by roughly 10x per rung (1 -> 10 -> 100 or 1% -> full). Never jump from the skeleton straight to the full run.

Keep a run log in the working folder (e.g. RUNLOG.md):

| Rung | Input | Result | Errors | Time | Cost | Projected next | Decision | | --- | --- | --- | --- | --- | --- | --- | --- |

Step 4 - Add features one at a time

Cost levers

General

Snowflake / Cortex Code

LLM / RAG / agents

Reporting at each gate

Tell the user, briefly:

Anti-patterns

Example

User: "Tag all 400 tickets in tickets.csv with a category using our LLM endpoint."

Step 0  path: CSV -> 1 LLM call -> tagged.csv | test: 10 hand-checked tickets correct | budget: $2 (proposed)
Sample: 3 tickets have empty bodies (API bills then errors) -> skip; only 220 of 400 texts are unique -> cache by hash
Spent so far:
L0  1 ticket    pass   $0.004
L1  10 tickets  10/10  $0.04   -> full run projected $0.88 (with dedupe) < $2, continue
L2  100         12/12  $0.25   -> continue
L3  400         pass   $0.88 total (naive run would have cost $1.60)

Limitations

Done means