This guide walks you through the IDD demo hands-on. You will run Phase A (baseline, clarification-heavy) and Phase B (IDD pipeline), then compare the results.
The same prompt — Build me a patient risk calculator. — drives both phases.
The only difference is what context the engine has when it receives it.
- Phase A: no engineering context. The engine must ask clarifying questions to resolve intent.
- Phase B:
skills/idd-pipeline/loaded. The engine extracts structured intent and generates architecture, code, and a measurement report in one pass.
The ICR (Intent Compression Ratio) and token amplification numbers make the gap measurable.
- This repository cloned locally
- One AI engine available: Codex, Claude Code, Cortex Code, or Opencode
- For local simulation:
uv syncandtask api(starts the ICR lab API onlocalhost:8080) - For browser simulation: https://icr-lab.streamlit.app (no setup needed)
Phase A evidence is deterministic — you do not run the vague prompt through a live agent. Instead you call the ICR lab simulation, which returns the canonical token counts, interaction rounds, and requirements coverage for Clarification Heavy mode.
- Open https://icr-lab.streamlit.app
- In the Task field enter:
(The trailing period is required for catalog lookup.)
Build me a patient risk calculator. - Select Clarification Heavy, Assumption Led, and Intent Optimized modes.
- Set Assumption Accuracy to
0.85(strong model, industry standard). - Click Run Simulation.
- Note the token counts, interaction rounds, ICR, wrong assumptions, and requirements coverage.
task api # starts ICR lab on localhost:8080Then send the canonical request:
curl -s -X POST http://localhost:8080/simulate \
-H "Content-Type: application/json" \
-d @demo-workflows/phase-a-request.json | jq .Save the response — you will use it as the Phase A baseline in Step 3:
mkdir -p generated/reports
curl -s -X POST http://localhost:8080/simulate \
-H "Content-Type: application/json" \
-d @demo-workflows/phase-a-request.json \
> generated/reports/phase-a-simulation.jsonKey numbers to note from token_metrics["Clarification Heavy"]:
| Metric | Meaning |
|---|---|
total_tokens |
Tokens consumed across all clarification rounds |
interaction_rounds |
How many back-and-forth exchanges were needed |
icr |
Intent Compression Ratio — 0.0 means zero operations achieved |
token_amplification |
Overhead multiplier vs Intent Optimized baseline |
Start Codex, Claude Code, Cortex Code, or Opencode in the repository root.
Load the skill context for your engine:
| Engine | Context to load |
|---|---|
| Cortex Code | $idd-pipeline or load skills/idd-pipeline/SKILL.md |
| Claude Code | Load skills/idd-pipeline/idd-foundation.md → skills/idd-pipeline/SKILL.md → skills/idd-pipeline/adapters/claude/adapter.md |
| Codex | Load skills/idd-pipeline/idd-foundation.md → skills/idd-pipeline/SKILL.md → skills/idd-pipeline/adapters/codex/adapter.md |
Build me a patient risk calculator.
With the IDD skill loaded, the engine will:
- Extract structured intent — resolves the four requirements from the vague prompt
- Synthesize architecture — produces a component diagram in
generated/architecture/ - Generate code — writes the Streamlit app to
generated/code/ - Run ICR analysis — compares Phase A baseline against the optimized prompt tokens
- Compute token economics — saves savings hypothesis to
generated/reports/
You should see all four requirements met in a single interaction round.
After Phase B completes, compare all three simulation modes:
| Metric | Clarification Heavy | Assumption Led (0.85) | Intent Optimized |
|---|---|---|---|
| Interaction rounds | 6 | 3 | 1 |
| Requirements met | 0 / 4 | 4 / 4 | 4 / 4 |
| Total tokens | 5,246 | 4,273 | 2,090 |
| ICR | 0.0 | 0.489 | 1.0 (best) |
| Token amplification | 2.51× | 2.04× | 1.0× (baseline) |
| Est. cost | $0.156 | $0.127 | $0.060 |
| Wrong assumptions | 0 | 1 | 0 |
Key insight: Assumption Led at 85% accuracy still costs 2× more than Intent Optimized and required 2 extra correction rounds. Even a strong model pays a penalty for guessing.
The IDD pipeline extracts and delivers all four requirements from the vague prompt:
- Input form: age, prior admissions count, department (select), primary diagnosis code
- Weighted risk score:
(prior_admissions × 0.4) + (age_factor × 0.3) + (diagnosis_factor × 0.3) - Color-coded badge: HIGH (score ≥ 0.7), MEDIUM (0.4–0.69), LOW (< 0.4)
- Per-factor formula breakdown below the badge — each factor labeled with its weight
The vague prompt carries none of these in its ~7 tokens. The compressed intent carries all four in ~60 tokens. ICR = (operations_achieved / total_tokens) × 1000 — the pipeline closes that gap.
The ICR lab simulation covers six modes:
| Mode | Description | Interaction rounds | Natural completion |
|---|---|---|---|
| Verbose Prompting | Lengthy, redundant context; over-specified | 2 | 100% |
| Clarification Heavy | Vague prompt, no skill — stalls before execution | 5–8 | 0% |
| Context Aware | Structured context, minimal redundancy | 3 | 100% |
| Intent Optimized | Compressed, precise intent + skill | 1 | 100% |
| Over Compressed | Too terse; model misinterprets, retries needed | 5 | 50% |
| Assumption Led | Model proceeds on guesses, corrects wrong ones | 1–4 | 100% |
assumption_accuracy (float 0.0–1.0, default 1.0) controls Assumption Led only.
At 1.0 all assumptions are correct (1 round). Below 1.0 the engine adds correction
rounds and degrades requirements coverage deterministically — lower accuracy models
produce more rounds and higher cost. The demo uses 0.85 (strong model, industry standard)
to show that even accurate models pay a correction-round penalty — Assumption Led becomes
3 rounds, $0.127 vs $0.060 for Intent Optimized (2.12× the cost), with 1 wrong assumption
requiring correction before the right answer is reached.
This demo contrasts Clarification Heavy (Phase A) with Intent Optimized (Phase B).
Assumption Led at 0.85 sits in between — it gets the right answer but only after wasting
tokens on wrong-assumption correction.
skills/idd-pipeline/SKILL.md— full pipeline sequenceschemas/— artifact contracts the pipeline enforcesgenerated/reports/— ICR analysis and token economics output- ICR Lab source
- Measuring Intent Compression Ratio
- ICR and Token Economics