Narraitor: Skill for Claude Code

.claude/skills/narraitor-prompt-template-governance/SKILL.md

narraitor-prompt-template-governance is a skill for Claude Code from jerseycheese/Narraitor. It costs 89 tokens per session (1,691 once invoked), scanned A, original, MIT.

A set of rules for storing, changing, testing, and releasing AI prompt templates in the Narraitor project. It treats prompts as tracked application behavior rather than loose text.

In plain words
What is it for?
Use it when adding, editing, or reviewing Narraitor prompt templates, especially changes involving their registry, inputs, evaluations, or regression checks.
Why use it?
It prevents prompt changes from being hidden in code, receiving the wrong input, leaking context, or breaking earlier behavior without detection.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is jerseycheese/Narraitor's own configuration. It tells Claude Code how to work on Narraitor itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Narraitor configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/jerseycheese/Narraitor/main/.claude/skills/narraitor-prompt-template-governance/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/jerseycheese/Narraitor

Made for: Claude Code.

Wrote 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.

agentmods badge for narraitor-prompt-template-governance

README.md
[![agentmods](https://agentmods.dev/badge/skills/jerseycheese/narraitor/narraitor-prompt-template-governance/github.svg)](https://agentmods.dev/skills/jerseycheese/narraitor/narraitor-prompt-template-governance)
Your own site
<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.

agentmods 80×15 button for narraitor-prompt-template-governance

Your own site · 80×15
<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>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,691 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 12d ago against content hash 0d84aace27c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

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.

.claude/skills/narraitor-prompt-template-governance/SKILL.md · 96 lines

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 through src/lib/promptTemplates/narrativeTemplateManager.tsgetNarrativeTemplate(id) (throws on unknown id).
  • Ending templates: src/lib/promptTemplates/templates/endingTemplates.ts.
  • Context assembly + token measurement: src/lib/promptContext/ (tokenUtils.ts estimates a string, promptCalibration.ts builds the DevTools snapshot, inventoryContextBuilder.ts trims inventory to a caller-supplied tokenLimit). 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).

Read the full file on GitHub · 96 lines

Changes

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.

  1. 12d ago First seen · 96 lines · 89 tokens per session scan A 0d84aace27c9

Subscribe to this mod's changes

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.

Related

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.

davila7/claude-code-templates · 54 tokens

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…

langwatch/langwatch · 105 tokens

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.

google-labs-code/stitch-skills · 41 tokens

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…

Jeffallan/claude-skills · 93 tokens

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.

Emily2040/seedance-2.0 · 61 tokens

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…

digitalsamba/claude-code-video-toolkit · 99 tokens