Skills served from the repo

Classification: Internal-Only

Skills served from the repo #

A skill is a SKILL.md plus its references/*.md files, the same shape claude.ai uses. tofie’s sales role reads the tofie-sales-rep skill from this repo, so every model (Claude, GPT, Gemini) and every environment gets the same text.

Ship a new version #

You need Doppler access to the nigari project, which holds the prompt encryption key.

  1. Download the skill from claude.ai. You get a .zip or .skill file.

  2. If you work in a Coder workspace, copy the file into it (drag it into the editor’s file tree, or coder scp).

  3. Import it:

    mise run ai-skill-import -- ~/Downloads/tofie-sales-rep.zip
    

    In a Coder workspace the default Doppler token cannot read nigari, so prefix the command with env -u DOPPLER_TOKEN after doppler login.

  4. Rebuild the library and restart the dev server:

    mise run ts-ai-build
    
  5. Try a sales conversation locally, then commit libs/typescript/ai/skills.json and libs/typescript/ai/prompts_encrypted/skills/.

The import names the version after today’s date (2026-11-27, then 2026-11-27.2 for a second one that day) and starts serving it. It accepts a .zip, a .skill, an unpacked skill folder, or one markdown file with ## Reference: <name> headings. Importing the same content twice adds nothing.

The import refuses a skill that writes the brand with a capital, since the casing check in CI cannot read encrypted files. Fix it in claude.ai, or pass --lowercase-brand to import it lowercased.

skills.json can also name a phrase each of a skill’s files must keep (mustContain). For tofie-sales-rep the pricing reference must mention list_pricing_plans, so a copy that has lost the “prices come from the live price list” rule is refused. --allow-missing imports it anyway. A line that must keep a capitalised brand word carries brand-casing: allow, as in the rest of the repo.

Before serving a download, compare it with the version being served (the decrypted copies sit side by side under libs/typescript/ai/prompts/skills/<name>/). The served tofie-sales-rep tells tofie that prices come from the live price list; a copy edited separately in claude.ai may say otherwise.

Only SKILL.md and references/*.md are kept. Anything else in the download (a PDF, a script) is listed as left out, and tofie is told those files are not available.

Choose the version served #

mise run ai-skill-list                                   # * marks the one served
mise run ai-skill-use -- tofie-sales-rep 2026-11-27      # serve another imported version
mise run ai-skill-remove -- tofie-sales-rep 2026-11-20   # drop one that is not served
mise run ai-skill-import -- new.zip --no-activate        # import without serving it yet
mise run ai-skill-import -- new.zip --version 2026-q4    # pick the version name
mise run ai-skill-import -- new.zip --lowercase-brand    # lowercase the brand on the way in

skills.json records which version is served, so switching or rolling back is a one-line change in a pull request. It takes effect on the next build and deploy.

Every imported version ships in the build (about 90 KB each for tofie-sales-rep), so remove versions you will not go back to.

How it works #

Piece Where
Which version is served, and each version’s checksum libs/typescript/ai/skills.json
Encrypted skill files, committed libs/typescript/ai/prompts_encrypted/skills/<name>/<version>/
Decrypted copy, never committed libs/typescript/ai/prompts/skills/<name>/<version>/
Import, use, remove, list libs/typescript/ai/scripts/skill.ts
Bakes the versions into the build libs/typescript/ai/scripts/generate-skills.ts
Read side (getSkill, skillPrompt, readSkillReference) libs/typescript/ai/src/skills.ts
Which role reads which skill REPO_SKILL_BY_ROLE in apps/tofu-web/src/server/ai/roles/index.ts
The tool the model reads references with apps/tofu-web/src/server/ai/tools/skill-reference.ts

At build time the skill files are decrypted with the other prompts and baked into the library. At run time the role’s system prompt gets the skill’s instructions, and the model reads references by calling read_skill_reference with their names, several per call.

Reference text stays on the server. The browser and the saved conversation get a short placeholder in its place, so the text is not visible in the network tab and is not resent on later turns; the model reads a reference again when it needs it. A turn that pauses for the browser (a page to open, a card to answer) gets its own reads back when it resumes.

When the skill is not in the build #

A build without the decrypt key has no skills. The sales role then runs on its prompt and tools alone, on whichever model answers.

tofu-web no longer uses a copy hosted at Anthropic: only Claude could load one, and only from the workspace it was uploaded to. The older webapp chat still does. Its hosted copy is uploaded from the served version here by apps/webapp/scripts/upload-sales-skill.ts, so re-run that script after importing a new version. The repo holds no plain-text copy of the skill.

Troubleshooting #

  • prompts/skills/... does not match skills.json during a build: your decrypted copy is older than the committed one. Run mise run ai-prompts-decrypt-files-force.
  • GPG_RECIPIENT_AI_LIB is not set: the import was not run through mise, or Doppler cannot read nigari.
  • tofie still answers from the old version: rebuild with mise run ts-ai-build and restart the dev server; apps read the library from its build output.

Give another role a skill #

Import the skill, then add the role to REPO_SKILL_BY_ROLE. Nothing else is needed: the orchestrator adds the instructions and the reference tool for any role listed there.