/meta-planning-ai-planning:meta-planning-ai-planningfrom meta-planning-ai-planning
Provides specification frameworks for AI features: model calls, prompts, retrieval, tool calling, agent loops, evals, with templates for approach tier, model pinning, output contracts, budgets, failure modes, and eval design.
Ships in meta-planning-ai-planning. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Quick Guide: Default to the lowest tier that meets the requirement — most features are one well-built call — and name the requirement behind every tier above it. Pin the model id, give every output a contract the code checks on receipt, state budgets in tokens and money, give each failure the feature can hit a row, and fix eval thresholds before the first run. Two provider facts shape the answers: a schema-constrained output mode guarantees shape only for a response that completed and was not refused, so the contract's remaining work is truncation, refusals and values; and reasoning tokens bill as output and count against the output ceiling, so a ceiling sized for the visible answer can run out before one appears.
Detailed Resources:
A section belongs in the spec only when the feature has its artifact; one filled in for completeness reads to the implementer as something to build.
<critical_requirements>
Name the requirement that rules out the simpler tier before specifying a chain, retrieval or a loop. Each tier up adds cost, latency and failure rows, and a known step sequence run as a loop buys non-determinism and no capability.
Pin the model id in configuration, name its fallback, and list what forces a re-eval. A floating alias changes quality with no deploy, and a fallback nobody named becomes an unhandled exception on the first 5xx.
Give every model output a contract — mechanism, schema, the validation that runs on receipt, and a repair-or-reject rule. Provider-side enforcement covers shape for a completed, unrefused response and nothing more, so truncation, refusals and wrong values reach the consumer unless the spec stops them.
State budgets as numbers, counting reasoning tokens as output and cached input at its cached rate. An adjective cannot be implemented or reviewed, and a cost line that leaves out either is wrong — low without the reasoning, high without the cache.
Mark every untrusted input and bound what it can reach. Delimiting lowers the odds that an injected instruction is followed without preventing it, so the prompt gets adversarial eval cases and its tools get only the access the task needs.
</critical_requirements>
Auto-detection: AI feature spec, LLM feature spec, model selection, pinned model id, model fallback, prompt version, system prompt, untrusted input, prompt injection, structured output contract, repair or reject, refusal handling, token budget, reasoning tokens, prompt caching, retrieval design, chunk size, re-ranking, tool contract, agent loop, step budget, eval plan, eval threshold, LLM-as-judge
Applies to:
Handled elsewhere:
Non-determinism is the material; contracts are what make it buildable. A model's output cannot be trusted by construction, so every boundary — schema, budget, failure behaviour, eval threshold — is decided in the spec, or production decides it implicitly.
<decision_framework>
Two independent questions, both answered for every feature:
Where does the knowledge the task needs live?
├─ In the model or the request → nothing to add
├─ A bounded set that fits the window → inline it, cached where the provider caches
├─ A large or growing corpus → retrieval
└─ A live system of record → a tool call, not retrieval
Who decides the sequence of steps?
├─ There is one step → single call
├─ Several, known in advance → fixed chain orchestrated in code — cheaper, debuggable, evaluable
└─ Several, chosen by the model as it goes → agentic loop, with every guard in Pattern 9
The answers combine — retrieval feeding a single call, a tool call inside a fixed chain — and most features answer "in the request" and "one step". Specify a higher tier only by naming the requirement that forces it, and record each rejected alternative with its reason. Fitting the window is a limit, not evidence of use: quality falls as input grows well before the limit, so the eval set — not the token count — decides whether inlining holds.
Is the output an action against a tool or system, a record to consume, or actions followed by a record?
├─ An action → tool calling, with strict (schema-constrained) arguments where the provider offers them
├─ A record → the first the provider offers:
│ 1. a schema-constrained output mode
│ 2. a single submit tool with strict arguments
│ 3. JSON mode — valid JSON, schema unchecked
│ 4. delimited text + strict parser, with the widest eval coverage
└─ Actions, then a record → one tool per action; the final record through a terminal final-answer tool,
or the provider's schema-constrained output on the last turn
Every branch validates on receipt. Constrained decoding enforces only the schema subset the provider supports — ranges, lengths and formats outside it move to the validator — on a response that completed and was not refused, and it never checks whether a value is true.
</decision_framework>
The proportionality record: the tier chosen, the requirement that rules out the one below, the alternatives rejected.
**Selected approach:** fixed code-orchestrated chain — classify, then summarize long tickets
**Why not simpler:** one call cannot skip summarizing the short majority without paying for it
**Why not a loop:** the step sequence is known in advance
**Why not retrieval:** the label taxonomy fits in the system prompt
Template: examples/core.md
Score candidates against the requirement — capability on the eval set with the smallest tried first, context, latency, cost, output mechanism, availability, data handling — and record the table.
**Primary:** [pinned id] — configured at [config file], never inline
**Fallback chain:** [id] on 429 / 5xx / timeout, then [documented failure response]
**Re-eval trigger:** model id, prompt version or retrieval parameters change; the snapshot retires
Pinned snapshots retire on a published schedule, so the spec names who re-runs the eval at migration.
Template: examples/core.md
Every prompt is named, located, versioned and trust-annotated.
**Module:** `prompts/triage-classify.v1.ts` — version logged with every call
| Variable | Source | Untrusted? |
| -------- | ------------------ | ---------- |
| body | inbound ticket | yes |
| taxonomy | `config/labels.ts` | no |
Template: examples/core.md
The mechanism from the decision framework, the schema with what the provider enforces and what the validator enforces, and the repair-or-reject rule.
| Situation | Policy |
| ------------------ | ---------------------------------------------------------------------- |
| Shape violation | one repair attempt with the validator's error appended, then reject |
| Semantic violation | reject at once — a repair attempt tends to launder the bad value |
| Truncated | reject, or retry once with a higher ceiling — never parse the fragment |
| Refusal | the refusal policy in Pattern 6 — never the repair loop |
Streamed partial JSON is buffered and validated on completion; nothing acts on a fragment.
Template: examples/core.md
Per call and per user request, in tokens, money and milliseconds, with the overflow rule — what is shed first, never the system prompt.
| Budget | Ceiling |
| --------------------------------- | ------------------------------------ |
| Output tokens per call | [reasoning + visible] |
| Model calls per user request | [n, including repairs and fallbacks] |
| Cost per request | [$, at an assumed cache-hit rate] |
| p95 latency / time to first token | [ms] |
Observability names what is logged per call (model id, prompt version, token counts, latency, cost, outcome, correlation id), the trace spans, what is redacted field by field, and what alerts.
Template: examples/core.md
A row per failure the feature can hit, with its detection signal and required behaviour. Each row becomes a success criterion with a mocked trigger.
| Failure | Detection | Required behaviour |
| ------------ | -------------------------------- | ----------------------------------------------------------------------------- |
| Rate limited | 429 with a rate-limit error code | wait out retry-after if sent, else backoff with jitter; capped; then fallback |
| Quota spent | 429 with a quota or spend code | fail at once — waiting never clears it |
| Incomplete | output ceiling reached | reject; never parse the fragment |
| Refusal | the provider's refusal signal | surface it, or a fallback model the provider documents — the spec picks |
Default behaviour for every row: reference.md. Template: examples/core.md
A dataset with a location and case count, named metrics with thresholds fixed before the first run, a grading method per metric, the regression set, and the model id, prompt version and retrieval parameters recorded with every run.
| Metric | Threshold | Grading |
| -------------------- | ----------------------------- | ------------------------------------------------ |
| Label accuracy | ≥ 0.90 on 400 cases | deterministic |
| Injection resistance | every case, in each of 5 runs | deterministic |
| Summary groundedness | ≥ 0.95 | model-graded, checked against human raters first |
Template: examples/core.md
Chunking, retrieval mode, top-k and re-ranking, access filters and freshness — plus four behaviours the spec decides: empty retrieval, low-similarity retrieval, citations, and whether the model may answer from its own knowledge when retrieval finds nothing.
| Parameter | Value |
| -------------- | ---------------------------------------------------- |
| Split boundary | structural (headings) where the corpus has structure |
| Retrieval mode | hybrid — queries carry error codes |
| Top-k | retrieve wide, re-rank to the n the eval set picks |
| Access filters | tenant and permission, inside the retrieval query |
Access control lives in the query, against a permission-aware store or a partition. A filter applied after the search returns fewer than k results for a small tenant, and a filter asked of the model is not enforcement. Retrieved text is untrusted input, including what an upload or an insider put into the corpus.
Starting values: reference.md. Template: examples/retrieval-and-agents.md
Every tool is read-only or mutating; a mutating one names its idempotency strategy, whether it needs confirmation, and whether it may run again after an ambiguous failure. Every loop names six guards.
| Guard | Value |
| --------------------- | ------------------------------------------------------------- |
| Step budget | [max model turns] |
| Token budget | [cumulative ceiling across the loop] |
| Wall-clock budget | [elapsed limit] |
| Termination | [every condition, including success] |
| Repetition guard | [behaviour on identical consecutive tool calls] |
| Partial-result policy | [what is returned, flagged as truncated, when a budget trips] |
State carried between steps is named exactly; nothing else persists.
Template: examples/retrieval-and-agents.md
<red_flags>
Breaks in production:
Surprising behaviour:
</red_flags>
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub agents-inc/skills --plugin meta-planning-ai-planningOther plugins' skills for the same job