Skip to content
mentoor

Turn your team's know-how into an agent skill

For engineers

Capture an expert's know-how, write and test it as an SOP, package it as an agent skill and keep the prompts in a versioned library.

Team know-how becomes a reliable agent skill when you capture it from the expert, write it as a procedure a newcomer can follow, test it, and only then package it, with the prompts that built it kept in a shared library. Skipping to the package is the usual mistake: a skill is only as good as the procedure inside it.

The situation

Tidewell runs a payments API. When an API key leaks, one senior engineer, Marta Kowal, knows what to do. She has done it nine times. The steps live in her head and in a half-finished wiki page. She is going on leave, and the team wants a coding agent to run the procedure with an engineer watching. The team also wants the same know-how usable by people who never open the agent.

This one case uses three skills: SOPs and process docs with AI, packaging agent skills, and building a prompt library.

Step 1: interview before you draft

Do not ask a model to "write a runbook for key rotation". It will produce a generic one that sounds right and skips what only Marta knows. Instead, have the model interview her. Give it a role and a goal, and ask for questions about decisions and exceptions: what do you check first, what makes you stop, who must be told, what has gone wrong before. Record the session, transcribe it, and have the model draft steps from the transcript. Then ask it to list every decision the transcript mentions that the draft leaves out. In Marta's case it finds the one that matters: the old key must not be revoked while the billing-sync job still uses it.

Step 2: write a procedure people can follow

Rewrite each step so it has one action, named inputs, a decision rule and a check that it worked. "Rotate the key and make sure everything is fine" becomes "Create a new key named payments-api-YYYYMMDD in the vault. Check: the vault shows status Active." Put warnings before the step they apply to. Put the exception where the decision is made, not in a footnote.

Step 3: dry-run it twice

Give the draft to a newcomer who has never done a rotation, and to an agent with the tools it would really have. Record where each one gets stuck or improvises. Fix the procedure, not the tester. If the agent invents a command that is not in the document, the document had a gap, or the agent was given too much freedom. Then run it again.

Step 4: package it as a skill

A skill is a folder with a SKILL.md file. The name and description are always visible to the agent. The body and any extra files load only when the task matches. So the description must name the trigger in the words engineers really use ("a key was leaked", "rotate an API key"), and the body should hold short numbered steps. Put deterministic work in a bundled script, such as a search of the logs for the old key's last use, so the agent runs it and does not re-derive it each time. Put long material, such as the contact list, in a separate file the steps point to. Keep the approval points from the SOP: revoking a production key waits for a human yes.

A rule that must apply on every task, such as "never print secrets in logs", belongs in the repo's memory file, not in a skill that loads only sometimes.

Step 5: keep the prompts in a library

The interview prompt, the rewrite prompt and the dry-run prompt will be used again for the next runbook. Save each as a template with placeholders for the expert, the system and the transcript, an owner, a version and a change log. Fence the transcript so that text inside it cannot act as an instruction. Keep a few test cases per prompt, and rerun them after a model update before switching a default.

Step 6: test, share and keep it current

Test that the skill loads. Write prompts that should trigger it and near-misses that should not ("rotate my SSH key for GitHub"). Read the run logs for under-triggering, over-triggering and no improvement over the plain agent. Commit the skill folder to the repo so every change goes through review and every engineer gets the same version. Give the SOP and the skill an owner and a review date, and compare them with recent incident tickets every quarter. Review any third-party skill before you install it: its scripts run with the agent's permissions.

What goes wrong

  • The skill fires on every key-related question, or on none, because the description is vague.
  • The agent revokes the old key first because the skill never said to wait.
  • Nobody owns the skill, the vault changes, and the steps quietly go out of date.
  • A dry run "passes" because the tester guessed the missing step.

Start with one procedure, test it with a newcomer, and widen only when the run logs earn it.

Steps

  1. Interview the expert, then find the missing decisions

    Skill: ops-sop

    Have a model interview Marta about decisions and exceptions, transcribe the session, and draft steps from the transcript. Then ask the model to list every decision in the transcript that the draft leaves out, and check the list with Marta.

    Transcript excerpt and first draft

    Transcript (Marta)

    Before I revoke the old key I check who is still using it. If billing-sync is still calling with it, I wait for the 02:00 window, because revoking mid-run drops invoices.

    First AI draft

    1. Create a new key. 2. Update the services. 3. Revoke the old key. 4. Tell the team.

  2. Rewrite the draft so each step can be followed

    Skill: ops-sop

    One action per step, named inputs, a decision rule where the choice is made, and a check that the step worked. Put the billing-sync exception before the revoke step.

  3. Dry-run it with a newcomer and an agent

    Skill: ops-sop

    Give the SOP to someone who has never rotated a key and to an agent with the real tools. Record where each stalls or improvises, fix the procedure and run it again.

    Dry-run log
    StepNewcomerAgent
    3 Create new keyDoneDone
    5 Notify the usual channelStuck: which channel?Posted in a wrong channel
    7 Revoke old keyDoneRan an unlisted command
  4. Package the SOP as an agent skill

    Skill: harness-skills

    Create a skill folder with a SKILL.md whose description names the trigger in engineers' words. Keep the body to short numbered steps, move the log search into a bundled script and the contact list into a separate file, and keep the human approval before revoking.

    key-rotation/SKILL.md

    skills/key-rotation/SKILL.md

    ---name: key-rotationdescription: Use when an API key was leaked or must be rotated. Creates a new key, checks live usage of the old one, asks for approval, then revokes it.---1. Create the new key. Check: vault shows status Active.2. Run scripts/last_use.sh OLD_KEY_ID. If billing-sync is listed, wait for the 02:00 window.3. Ask the engineer to approve revoking. Do not revoke without a yes.4. Contacts are in references/contacts.md.
  5. Save the prompts as a versioned library

    Skill: prompt-library

    Store the interview, rewrite and dry-run prompts as templates with placeholders, an owner, a version and a change log, plus a few test cases each. Fence the transcript placeholder.

    Library index
    PromptVersionOwnerLast tested
    sop-interview1.1Marta K.2026-11-20
    sop-rewrite1.0Dev Platform2026-11-20
    sop-dry-run1.0Dev Platform2026-11-21
  6. Test triggers, ship by pull request, keep it current

    Skill: harness-skills

    Run matching and near-miss prompts and read the logs. Commit the folder to the repo so changes are reviewed. Give the skill and the SOP an owner and a review date, and compare them with recent incidents each quarter.

Skills this scenario uses

Where to study