Borrowing it
Nothing to install: this file belongs to jerseycheese/Narraitor. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/jerseycheese/Narraitor/main/.claude/skills/narraitor-prompt-template-governance/SKILL.mdgit clone --depth 1 https://github.com/jerseycheese/NarraitorWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/jerseycheese/narraitor/narraitor-prompt-template-governance)<a href="https://agentmods.dev/skills/jerseycheese/narraitor/narraitor-prompt-template-governance"><img src="https://agentmods.dev/badge/skills/jerseycheese/narraitor/narraitor-prompt-template-governance/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/jerseycheese/narraitor/narraitor-prompt-template-governance"><img src="https://agentmods.dev/badge/skills/jerseycheese/narraitor/narraitor-prompt-template-governance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00089 | $0.01691 |
| Opus 5 | $0.00044 | $0.00846 |
| Sonnet 5 | $0.00018 | $0.00338 |
| Haiku 4.5 | $0.00009 | $0.00169 |
Grade A, and why
narraitor-prompt-template-governance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Narraitor prompt template governance
1. Purpose
Keep every prompt findable, typed, evaluated, and reversible. A prompt is production behavior: it ships through a registry and gates, not as a string edit.
2. When to use
Any create/edit/delete of prompt text; any change to what context a prompt receives; reviewing a PR that touches src/lib/promptTemplates/ or src/lib/promptContext/.
3. When not to use
- Judging output quality of an existing template →
narraitor-ai-quality-discipline(this skill consumes its protocol as the eval gate). - Generation config (temperature/tokens/model) → that's
src/lib/ai/config.ts+ change-control, not template governance.
4. Inputs required
The template diff; the context fields it reads; the eval log (or a plan to produce one).
5. Procedure
The registry (where prompts live — nothing lives elsewhere):
- Narrative templates:
src/lib/promptTemplates/templates/narrative/*(scene, initial scene, action, transition, player-choice, choice-type, skill-acknowledgment, major-event guidelines), registered by id throughsrc/lib/promptTemplates/narrativeTemplateManager.ts→getNarrativeTemplate(id)(throws on unknown id). - Ending templates:
src/lib/promptTemplates/templates/endingTemplates.ts. - Context assembly + token measurement:
src/lib/promptContext/(tokenUtils.tsestimates a string,promptCalibration.tsbuilds the DevTools snapshot,inventoryContextBuilder.tstrims inventory to a caller-suppliedtokenLimit). Nothing here budgets or trims the assembled prompt. - Reference examples:
src/lib/promptTemplates/examples/.
HARD RULE: Prompt experiments may output registered, evaluated templates only. They may not hardcode one-off prompt strings into narrative-generation code paths (generators, routes, components). If you see an inline prompt string outside the registry, that is a defect — file it.
The gates, in order:
G1 INPUT CONTRACT — the template reads only fields of NarrativeTemplateContext
(src/lib/promptTemplates/templates/narrative/context.ts). Need a new field?
Extend the type deliberately; never smuggle data through an existing string field.
G2 LEAKAGE — no feeding the prompt state the narrative shouldn't know:
other characters' hidden info, meta/system state, raw store internals, player-secret
data. toneSettings is opaque to templates (forwarded, never field-accessed) — keep it so.
G3 DETERMINISM EXPECTATIONS — state what varies (prose) vs what must be stable
(structure the parser relies on: headings, JSON shape, choice markers). Changing
stable structure means checking every parser in src/lib/ai/*parse*/*normalize*.
G4 EVAL — run the narraitor-ai-quality-discipline evaluation protocol (its section 5
is the single home of the matrix minimums — cite it, don't restate numbers).
Record in the eval log.
G5 REGRESSION — compare against excerpts saved in earlier eval logs. Old strengths
must survive. WARNING: src/lib/promptTemplates/examples/ is a few-shot library
injected INTO prompts (exampleLibrary.ts) — it is NOT a regression corpus, and
editing it changes live generation behavior.
G6 COST/LATENCY — measure the delta yourself. Nothing enforces a prompt budget, and
no allocator will trim your template back. Components are bounded only where they
are assembled (the caller slices the segment window, getLoreContext defaults to 20
facts, buildInventoryContext trims to a tokenLimit); the assembled whole is never
trimmed. Estimate with estimateTokenCount (src/lib/promptContext/tokenUtils.ts),
then check a real request in the DevTools calibration panel, which
recordRequestCalibration (src/lib/ai/narrativeGenerator.calibration.ts) feeds with
estimated vs provider-reported prompt size. DEFAULT_TOTAL_BUDGET (80000) is that
panel's yardstick, not a ceiling. Only narrativeGenerator and choiceGenerator call
recordRequestCalibration, so the panel is blind to ending templates —
endingGenerator never publishes a snapshot, and a stale narrative reading will sit
there looking like yours. For an ending-template change, estimateTokenCount is the
whole measurement. Put the before/after in the eval log — a template that grows
context grows every turn's cost and the 5-8s prose wait.
G7 INTEGRATION — at least one eval cell through the real /worlds/[id]/play loop and
unit tests green (template __tests__ pin assembly, not prose).
What ships with it
14 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- eval-logs/1681-phrase-variety.md 5.0 KB
- eval-logs/1821-failed-attempts-cost.md 12 KB
- eval-logs/1822-world-clock.md 12 KB
- eval-logs/1829-alignment-and-continuity-round5.md 14 KB
- eval-logs/1829-round6-verification.md 9.8 KB
- eval-logs/1831-ledger-fed-continuity-contract.md 13 KB
- eval-logs/1857-unrecorded-exchange-guard.md 36 KB
- eval-logs/1865-world-description-in-scene.md 7.9 KB
- eval-logs/1882-world-cost.md 50 KB
- eval-logs/1963-delivered-commitments.md 9.5 KB
- eval-logs/1975-ending-open-threads.md 8.4 KB
- eval-logs/1983-turnresolver-integrated-matrix.md 24 KB
- evals/trigger_eval.json 3.8 KB
- templates/eval-log.md 1.0 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 96 lines · 89 tokens per session scan A 0d84aace27c9
narraitor-prompt-template-governance is a skill published in the GitHub repository jerseycheese/Narraitor (30 stars, last pushed today), licensed MIT. It adds 89 tokens to every session and 1,691 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
llm-app-patterns
Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.
prompt-optimization
Improve a prompt on the evaluations workbench through a measured loop. Score the baseline first, then duplicate the target column, form a hypothesis from failing rows, edit the copy's prompt draft, run, compare pass rate and cost, and repeat until the numbers hold. Use when the user asks to optimize or improve a…
enhance-prompt
Transforms vague UI ideas into polished, Stitch-optimized prompts. Enhances specificity, adds UI/UX keywords, injects design system context, and structures output for better generation results.
prompt-engineer
Writes, refactors, and evaluates prompts for LLMs — generating optimized prompt templates, structured output schemas, evaluation rubrics, and test suites. Use when designing prompts for new LLM applications, refactoring existing prompts for better accuracy or token efficiency, implementing chain-of-thought or few-shot…
seedance-vocab-en
This skill should be used when an English Seedance 2.0 prompt needs clearer production wording, less generic prose, or precise vocabulary for camera, lighting, motion, VFX, audio, and constraints. Route blocked prompts through seedance-filter for context and boundary review.
ideogram4
Prompting patterns for Ideogram 4 text-to-image — best-in-class in-image text rendering and exact color/layout control via structured JSON captions. Use when generating images that need legible on-image text (title cards, thumbnails, logos, signage, CTAs), precise brand colors, or controlled spatial layout. Triggers…