The goal
A Theory-of-Constraints diagnostic for deciding what to automate with AI agents. Before building any automation, skill, Goal, loop, or schedule, it walks Goldratt's Five Focusing Steps over the user's work system to find the real bottleneck, then recommends the single highest-leverage automation aimed at the constraint plus a what-NOT-to-automate list. Use when the user asks "what should I automate", "where do I point my agents", "prioritize my automation backlog", "which workflow should I agentify", "is this worth building", "find my bottleneck", "what's the highest-leverage thing", when they are about to build a Claude Code skill/Goal/loop/schedule and aren't sure it matters, or during a review of their automations. Guards against the common failure of automating busywork (a local optimum) instead of the constraint.
ByGleb KalininBerlin-based technologist @ Claude Code Lab- name:
- the-goal
- description:
- A Theory-of-Constraints diagnostic for deciding what to automate with AI agents. Before building any automation, skill, Goal, loop, or schedule, it walks Goldratt's Five Focusing Steps over the user's work system to find the real bottleneck, then recommends the single highest-leverage automation aimed at the constraint plus a what-NOT-to-automate list. Use when the user asks "what should I automate", "where do I point my agents", "prioritize my automation backlog", "which workflow should I agentify", "is this worth building", "find my bottleneck", "what's the highest-leverage thing", when they are about to build a Claude Code skill/Goal/loop/schedule and aren't sure it matters, or during a review of their automations. Guards against the common failure of automating busywork (a local optimum) instead of the constraint.
The Goal — constraint-first automation
Named after Eliyahu Goldratt's The Goal. The lesson this skill encodes: a local optimum is not a global one. Automating something that feels productive but is not the system's constraint produces no throughput gain. Most wasted automation effort dies here. This skill finds the constraint first, then points exactly one automation at it.
When to use
Use before building anything, and during reviews:
- "What should I automate?" / "Where do I point my agents?" / "What's the highest-leverage thing right now?"
- The user is about to build a Claude Code skill, Goal, loop, schedule, or workflow and isn't sure it matters.
- The user has a pile of half-useful automations and feels busy but stuck.
- A periodic review of where agent effort is going.
If the user already knows their constraint with confidence and just wants to build, skip the diagnosis and go straight to Step 4 (elevate) and the Recommendation.
The core distinction (state this early)
Three ways an automation idea fails, worst first:
- It targets a non-constraint. The worst kind. Even a flawless automation here adds zero throughput; the bottleneck still caps the system. Cut it.
- It optimizes a local metric. Feels productive (inbox zero, faster research) but the global goal does not move.
- "Felt busy" is not "moved the needle." Activity is not throughput. Require a measurable throughput before recommending anything.
Workflow — the Five Focusing Steps
Run as an interactive diagnostic, one focused question at a time. The LLM's job is to elicit the picture and map it to structured inputs; two scripts then do the ranking and the rung selection deterministically, so the core calls aren't free-form vibes. Load references/five-focusing-steps.md for the full method, definitions (throughput / inventory / operating expense in knowledge-work terms, drum-buffer-rope, Herbie) and example walkthroughs.
Optional — cenno mode. If cenno is available and the user prefers panels (or asks to "ask me in panels"), collect the inputs through cenno instead of chat: one StepScore panel per candidate step via ask_sequence (every ordinal + necessary_condition/policy_gate in one panel; falls back to choice 0–3 on older cenno) for the step scores, confirm for the seven rung facts, text for the goal/throughput. The answers feed the same two scripts unchanged. Load references/cenno-mode.md for the control mapping, ask_sequence batching, and how to persist the analysis. Fall back to chat if cenno isn't running — never block.
Step 0 — Define the goal + throughput measure (gate). What is this system for, and what single rate rises when it succeeds (revenue/quarter, products shipped/month, clients served, qualified leads)? No measurable throughput → stop and define one first. Validate it: "reclaimed hours" and "inbox zero" are usually operating-expense reduction or local efficiency, not throughput, unless free capacity is the system's explicit goal. Reject local-efficiency measures here.
- Identify the constraint. Walk the flow from intent to result; list the candidate steps. For each, elicit ordinal evidence (0–3): throughput-sensitivity (would T rise if this step were 2× faster — the decisive one), wait-before, downstream-starvation, capacity-gap, whether it's a policy/approval gate, and how annoying it feels. Also flag
necessary_condition: truefor steps that must be adequate to function but already are (e.g. a sales page that converts) — the scorer then labels them "prerequisite: finish, don't over-invest" instead of lumping them with non-binding traps. Then rank deterministically:
Honor theecho '[{"name":"...","throughput_sensitivity":3,"wait_before":2,"downstream_starvation":3,"capacity_gap":2,"annoyance":1}, ...]' | python3 scripts/score_constraints.pyverdict:insufficient_data→ gather more before deciding;ambiguous→ re-scope or shorten the time window;constraint_found→ proceed. The script flags the annoying-but-non-binding trap automatically. - Exploit it. Before building anything, get the most from the constraint as it is. Often a non-automation fix (stop interrupting it, batch it, remove a hand-off) beats new tooling. Recommend exploitation first.
- Subordinate. Point everything else — including existing automations — at serving the constraint, not at optimizing non-constraints. This often means slowing or ignoring non-constraints (drum-buffer-rope).
- Elevate. Only now add capacity at the constraint with one automation. Pick the rung deterministically (the LLM supplies the yes/no facts; the tree decides):
Seepython3 scripts/recommend_rung.py --recurring --fixed-steps # or --bounded-outcome, --streaming-input, etc.references/autonomy-ladder.mdfor what each rung means. Elevation costs operating expense, so it comes after exploit + subordinate, never before. - Repeat (POOGI). The constraint moves once relieved. Name the likely next constraint and queue it. Warn against inertia: do not keep polishing the old, now-non-binding step.
Guardrails (non-negotiable)
- Never recommend automating a non-constraint. If the user's proposed automation targets a non-constraint, say so plainly and redirect to the constraint.
- Require a measurable throughput before any recommendation. "Make things better" is not a goal.
- Name local optima out loud when seen.
- Exploit and subordinate before elevate. Do not build new tooling prematurely when a cheaper exploitation fix exists.
- One constraint-targeting automation at a time, not a backlog of five.
Output
Produce a short constraint analysis using assets/constraint-analysis-template.md with these sections:
- Goal + throughput measure — the system's purpose and the one number.
- The constraint — where the line stalls, with the evidence that identifies it.
- Exploit — the cheapest non-build fix to try first.
- The one automation — the single recommendation, the autonomy-ladder rung it sits on (Goal/loop/schedule/...), and why it serves the constraint.
- Do NOT automate — the tempting non-constraints to leave alone, named explicitly.
- Next constraint — where the bottleneck will likely move, queued for the repeat step.
Before delivering, run this validity checklist (not just shape):
- throughput is a rate tied to the system goal (not a local-efficiency proxy)
- constraint backed by the scorer's
constraint_foundverdict (or unknowns named) - an exploit fix is offered before the build
- exactly one automation, with its autonomy-ladder rung
- the do-NOT-automate list names the rejected non-constraints
- a next-constraint is queued
End with the call to action: pick the single constraint-targeting automation and define it as a Goal (verifiable end-state + conditions), then build it.
Referenced skills
name-audition— sibling diagnostic; same "a local optimum is not safe" discipline, applied to names. (Cross-reference only; not a handoff.)
Open this reference as its own page
The autonomy ladder — choosing the rung to elevate the constraint
Once Step 4 (elevate) calls for adding capacity, pick the lowest rung that relieves the constraint. Higher rungs cost more operating expense (tokens, maintenance, trust) and carry more risk. Do not climb past what the constraint needs.
Decision rule (compressed)
- Know the end + a fixed input you have now → Goal
- The same constraint task recurs and you re-explain it each time → skill
- New work keeps arriving over time and must be processed as it lands → loop (or, better, a deterministic workflow triggered on a schedule)
- Must run unattended at set times → /schedule → cron → launchd
- Repeatable and worth hardening into a deterministic pipeline → have an agent author a workflow
- The constraint needs always-on or embedded capacity → Agent SDK service
- Must never silently fail → durable execution (Temporal)
The rungs
| Rung | What it is | Use when the constraint is… | Cost / risk |
|---|---|---|---|
| Goal | One autonomous multi-turn run to a verifiable end-state | a bounded, knowable outcome you can describe and check | low; the default first build |
| Skill | A packaged, reusable prompt/procedure invoked by command | a repeated constraint task you keep re-explaining | low; one-time authoring |
| Loop | A recurring run over changing input | a stream of new work that must be handled as it arrives | token-hungry; prefer a deterministic workflow if the steps are fixed |
| /schedule | Time-triggered runs of a Goal/skill | work that must happen at set times, unattended | needs a session/host running; skills run via schedule, not via loop |
| Workflow | Agent solves once, then emits deterministic re-runnable steps | a fixed, repeatable constraint process worth hardening | client feature; can raise token cost — measure |
| Agent SDK | An agent embedded in an app/pipeline | the constraint needs embedded or always-on capacity | highest maintenance; real software |
| Temporal / durable | Crash-proof, retrying, stateful execution | the constraint process must never silently fail | infrastructure; adopt only when reliability is the constraint |
Principles
- Subordinate before you elevate. If protecting the constraint's time or removing a hand-off (Step 2/3) relieves it, build nothing.
- Prefer determinism over recurring LLM loops when the steps are fixed — cheaper, auditable, and the constraint usually wants reliability, not creativity.
- The hybrid endgame: an agent authors the deterministic workflow that then runs the constraint cheaply. "Agent as workflow developer, not workflow executor."
- One rung, one constraint. Build a single thing aimed at Herbie, ship it, then re-run the diagnosis before climbing further.
Open this reference as its own page
Optional: cenno mode (panel-driven elicitation)
Run the diagnostic through cenno panels instead of chat when cenno is available and the user prefers it (or asks to "ask me in panels"). The LLM still owns the logic; cenno only collects the structured inputs, which are piped into scripts/score_constraints.py and scripts/recommend_rung.py exactly as in chat mode. If cenno isn't running, fall back to chat — never block.
Use the cenno skill's ask_user / ask_sequence MCP tools (preferred) or the cenno ask CLI. Load the cenno skill for setup/availability. Honor the cenno skill config defaults (~/.claude/skills/cenno/config.json).
Control mapping (the appropriate widget per input)
| Diagnostic input | cenno control | Returns | Notes |
|---|---|---|---|
| Step 0 — goal + throughput | text |
string | one panel; free text |
| Step 0 — "is throughput a rate tied to the goal?" | confirm |
bool | gate; if no, re-ask the text |
Step 1 — every ordinal 0–3 + necessary_condition / policy_gate, per candidate step |
a2ui StepScore, one per step via ask_sequence |
JSON object per step, keyed like the scorer | preferred; see below |
| Step 1 — fallback on older cenno: each ordinal | choice ["0","1","2","3"] |
the digit as a string | cast to int for the scorer |
| Step 1 — fallback on older cenno: the two flags | confirm |
bool | per candidate step |
Step 1 — verdict ambiguous → re-scope |
choice |
string | offer narrower scopes / time windows |
| Step 4 — the 7 rung facts | confirm ×7 via ask_sequence |
bools | maps 1:1 to recommend_rung.py flags |
| Final — accept the recommended automation? | confirm |
bool | before writing the Goal |
Batch related questions with ask_sequence (keeps one panel up, advances instantly, auto-fills progress dots). Only hand-roll single ask_user calls when the next question depends on the previous answer (e.g. skip a step's scores once it's clearly disqualified).
Best: one StepScore panel per step
cenno's StepScore control (cenno builds after 0.4.1) scores one candidate step on every ordinal plus the two flags in a single panel: the decisive sensitivity question leads full width, the other four sit on an aligned 0–3 grid, and necessary / policy gate are toggle chips beside the Next button. Next stays disabled until every ordinal is scored — 0 is a real "none", never a default. Send one StepScore question per step through ask_sequence (all steps in one panel do not fit cenno's 560px panel; the sequence keeps one panel up and fills the progress dots).
Use the scorer's own keys as the dimension/flag values, so each answer is already a score_constraints.py row minus its name:
{"questions": [
{"title": "Score this step (0 none · 3 high)", "flow": "question", "timeout_s": 300,
"a2ui": [
{ "version": "v0.9", "createSurface": { "surfaceId": "main", "catalogId": "cenno:catalog/v1" } },
{ "version": "v0.9", "updateComponents": { "surfaceId": "main", "components": [
{ "id": "root", "component": "Column", "children": ["s"] },
{ "id": "s", "component": "StepScore", "step": "Audience",
"dimensions": [
{ "value": "throughput_sensitivity", "label": "If this step were 2× faster, would throughput rise?", "decisive": true },
{ "value": "wait_before", "label": "wait before" },
{ "value": "downstream_starvation", "label": "starves next" },
{ "value": "capacity_gap", "label": "capacity gap" },
{ "value": "annoyance", "label": "annoyance" } ],
"flags": [ { "value": "necessary_condition", "label": "necessary" },
{ "value": "policy_gate", "label": "policy gate" } ],
"value": { "path": "/score" }, "doneLabel": "Next",
"selectAction": { "event": { "name": "submit-score",
"context": { "value": { "path": "/score" }, "via": "choice" } } } }
] } },
{ "version": "v0.9", "updateDataModel": { "surfaceId": "main", "path": "/", "value": { "score": {} } } }
]},
{"title": "Score this step (0 none · 3 high)", "a2ui": ["… same envelope, \"step\": \"Offer & landing\" …"]}
]}
Each entry of answers is JSON text for one step, in the order sent — "{\"throughput_sensitivity\":3,\"wait_before\":2,\"downstream_starvation\":3,\"capacity_gap\":2,\"annoyance\":1,\"necessary_condition\":false,\"policy_gate\":false}". JSON.parse it, add "name" from the step you sent, and pipe the array to score_constraints.py unchanged. Fewer answers than steps means a step timed out — re-ask that step rather than scoring it as zeros. Keep labels short (≤ ~12 characters) except the decisive one; to re-open a step, seed /score with its prior object.
Fallback: a cenno build without StepScore (≤ 0.4.1) cannot render it and falls back to a plain prompt, so an answer that does not parse as a JSON object means "old cenno" — switch to the per-step choice flow below for the remaining steps. Never block on the widget.
Per-step scoring — fallback options (no custom control)
Default (robust): choice 0–3. For each candidate step, run an ask_sequence of choice questions, one per dimension:
{"questions": [
{"title": "Audience — if 2x faster, would sales/launch rise? (throughput-sensitivity)",
"input": {"kind": "choice"}, "choices": ["0", "1", "2", "3"], "flow": "question"},
{"title": "Audience — does work pile up / wait before it?",
"input": {"kind": "choice"}, "choices": ["0", "1", "2", "3"]},
{"title": "Audience — must it be adequate but already is? (necessary condition)",
"input": {"kind": "confirm"}}
]}
Nicer (custom 0–3 slider): a2ui Scale. When a real slider reads better, send a rich a2ui payload with a Scale ("min": 0, "max": 3, endpoint labels "none"/"strongly"). See the cenno skill's "Custom scales via a2ui" section for the three-message envelope; reuse it with min:0, max:3.
Assembling and running
Collect answers, cast choice strings to ints, build the scorer input, and run as usual:
echo '[{"name":"Audience","throughput_sensitivity":3,"wait_before":3,"downstream_starvation":3,"capacity_gap":3,"necessary_condition":false,"annoyance":2}, ...]' \
| python3 scripts/score_constraints.py
Then for the rung, feed the seven confirmed booleans:
python3 scripts/recommend_rung.py --json '{"recurring":true,"fixed_steps":true,"unattended_timing":true}'
Output data
When the user wants the result persisted (or cenno logging is on):
- Render the constraint analysis from
assets/constraint-analysis-template.mdand save to the user's drafts folder (e.g.Claude-Drafts/YYYYMMDD-constraint-analysis-<system>.md). - Optionally show the final recommendation back in a cenno
confirmpanel ("Build this as a Goal?") before proceeding. - If the cenno skill config has
log_answers: true, the raw answers are already appended to its log file; the saved analysis is the durable artifact.
Open this reference as its own page
The Five Focusing Steps, adapted to AI automation
From Eliyahu Goldratt's The Goal and the Theory of Constraints (TOC). The book's plant becomes the user's work system; the agents (Claude Code, Codex, Hermes), Goals, loops and schedules are the capacity you can add. The discipline is unchanged: improve the constraint, not the parts around it.
The three measures (translate to knowledge work)
- Throughput (T) — the rate the system produces the thing it exists for. Pick ONE number: revenue/quarter, products shipped/month, clients served, qualified leads, published pieces. Throughput is the goal made countable. Caveat: "reclaimed hours" or "inbox zero" are usually operating-expense reduction or local efficiency, not throughput — count them as T only when free capacity is the system's explicit goal.
- Inventory (I) — work started but not yet converted to throughput: half-done drafts, open loops, untriaged inputs, WIP. High inventory hides the constraint.
- Operating expense (OE) — what it costs to run the system: your hours, tokens, subscriptions, attention.
The TOC objective: increase T while reducing I and OE. Automating something that raises OE (more tokens, more tools to maintain) without raising T is a loss, even if it feels productive.
"Herbie" — the constraint
In the book, a troop of scouts can only hike as fast as Herbie, the slowest boy. Speeding up everyone else just spreads the line; the troop's pace is still Herbie's. For a scoped goal and a chosen time window, focus on the one primary binding constraint. (Complex systems can have several near-binding or interacting constraints; narrowing scope/horizon usually resolves which one binds now. If two score within a hair, re-scope rather than automate both.) Find it before optimizing anything.
The constraint is usually NOT the most annoying step. It is the step where:
- work waits in a queue before it,
- everything downstream starves waiting for it,
- and the global number (T) can't rise until it does.
Common knowledge-work constraints: decisions only the user can make; sales conversations; a review/approval gate; one expert's attention; the user's own context-switching.
The steps
1. Identify the constraint
Walk the flow from intent to delivered result. Ask: where does work pile up? what waits on what? if this step went 2x faster, would T actually rise? The honest answer to the last question finds Herbie. Beware: a freshly relieved constraint moves, so re-identify rather than assume.
2. Exploit the constraint
Wring maximum throughput from the constraint as it is, before spending anything. Usually not an automation:
- stop interrupting it (protect the constraint's time),
- batch or sequence work to keep it fed,
- remove a hand-off or approval that idles it,
- cut low-value work that consumes it. Exploitation is the cheapest win and often enough. Recommend it first.
3. Subordinate everything else to the constraint
Every other step — and every existing automation — should run at the pace and in service of the constraint, not at its own local maximum. This is where most automation effort goes wrong: people optimize a non-constraint (faster email triage) and the line still moves at Herbie's pace. Subordination often means slowing down or ignoring non-constraints, which feels counterintuitive.
Drum-Buffer-Rope:
- Drum — the constraint sets the beat the whole system marches to.
- Buffer — protective time/capacity/WIP ahead of the constraint so it never starves. Size it to the variability of the work; a too-small "just-in-time" buffer starves a variable constraint.
- Rope — release new work only at the rate the constraint can absorb, so inventory doesn't balloon. In practice: schedule and gate agent runs so they feed the constraint just-in-time, not flood it.
4. Elevate the constraint
Only now add capacity. This is where an automation earns its place — pointed squarely at Herbie:
- a Goal that does the constraint's repeatable part autonomously,
- a skill packaging a repeated constraint task,
- a loop/schedule that keeps the constraint fed or clears its queue over time,
- a workflow for a deterministic constraint process,
- an Agent SDK service when the constraint needs always-on capacity.
See
autonomy-ladder.mdfor choosing the rung. Elevation costs OE, so it comes after exploitation and subordination, never before.
5. Repeat — and beware inertia
Relieving the constraint moves it elsewhere (a "process of ongoing improvement," POOGI). Two failure modes to warn against:
- Inertia: continuing to optimize the old constraint that is no longer binding (the classic trap — you fell in love with the automation you built).
- Policy constraints: sometimes the new constraint isn't a step but a rule or habit. Name it. Queue the likely next constraint so the system keeps improving instead of stalling.
Worked example
Goal: grow course revenue. Throughput = launches that sell out.
- Identify: the user automates email triage and research, but launches stall because the sales page + offer never gets finished — that's Herbie. Email was never the constraint.
- Exploit: block protected time for the offer; stop polishing research.
- Subordinate: point research/agents at feeding the offer (proof, testimonials), not at general productivity.
- Elevate: one Goal that drafts and iterates the sales page to a verifiable spec.
- Repeat: once the page ships, the next constraint becomes traffic/audience — queue it.
The mistake the skill prevents: spending the weekend on the email-sorting agent (a real local optimum) while the binding constraint, the unfinished offer, goes untouched.
More in this playbook
Safe to turn on
Use this skill when an agent or person is about to create, change or enable an automation inside someone else's account or a shared environment: "create this workflow", "build it in the customer's account", "turn it on", "go live", "deploy this automation". Produces a proposal the human approves, an automation created in the off state, and a short list of what only the human can finish.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.

