AgentsOpen SourceFreeActiveMachine-verified· intermediate · ~15 min setup

Voyager pattern: validate a procedural skill store before you trust a saved skill

Capture a working routine as a named, described skill entry and validate the skill-library structure, so saved skills are findable and reviewable before an agent reuses them.

by Shilpa Mitra· verified today· v1.0.0

Run this workflow

CI-verified, 2/2 fixtures passing.

Build this with your agent

One copy-paste hands Claude Code, Codex, or Cursor the full recipe, steps included, nothing to fetch.

Intended Use

Any agent project where the same task recurs and working code should survive across runs. CI validates the skill-library JSON: a version field is set, the skills array is non-empty, and each skill has a slug, description, language, and non-trivial code. The retrieval and execution of a skill by a live agent are fenced.

Not for

  • Running Voyager itself, it is a Minecraft research project and not a general-purpose library
  • Trusting saved skills without review, a skill that worked on the one run that produced it may be brittle in a different context; review before you reuse
  • One-off agent tasks where nothing repeats and the skill store would stay empty

The Stack

Tested Against

Voyager pattern (node@20), 2026-07

Side effects & data flow

Network
none, local only
Writes
./skill-library.json
Credentials
none required

Prerequisites

  • Node 20+

Steps

  1. 1

    Capture a skill and validate the library structure

    After a task succeeds, save the working script under a descriptive slug with a language tag. CI checks the library has at least one skill entry with all required fields and non-trivial code. Retrieving and running a skill by an agent is fenced.

    cat > skill-library.json <<'JSON'
    {
      "version": 1,
      "skills": [
        {
          "slug": "deploy-vercel-preview",
          "description": "Deploy a Vercel preview branch from a git checkout and return the preview URL",
          "language": "shell",
          "tags": ["deploy", "vercel", "ci"],
          "code": "git checkout -b preview/$1 && vercel --yes --env NEXT_PUBLIC_ENV=preview 2>&1 | tail -1"
        }
      ]
    }
    JSON
    node -e '
    const fs = require("fs");
    const lib = JSON.parse(fs.readFileSync("skill-library.json", "utf8"));
    function bad(m) { console.error("BAD: " + m); process.exit(1); }
    if (typeof lib.version !== "number") bad("version must be a number");
    if (!Array.isArray(lib.skills) || lib.skills.length === 0) bad("skills must be a non-empty array");
    for (const s of lib.skills) {
      if (!s.slug || typeof s.slug !== "string") bad("each skill must have a string slug");
      if (!s.description || s.description.length < 10) bad("skill " + s.slug + " needs a real description (>=10 chars)");
      if (!s.language) bad("skill " + s.slug + " must declare a language");
      if (!s.code || s.code.length < 10) bad("skill " + s.slug + " must have non-trivial code (>=10 chars)");
    }
    console.log("skill-library OK: " + lib.skills.length + " skill(s) validated (" + lib.skills.map(function(s){return s.slug;}).join(", ") + ")");
    '
  2. 2

    Retrieve and reuse skills by agent (the execution step, not checked by CI)

    At task time, embed the task description, find the closest-matching skill by cosine similarity or keyword search, and inject the code as a starting point. After success, upsert the (possibly improved) code back. The match scoring and execution are fenced.

Eval, 2 fixtures

Last passed: verified today
  • library-okcontainstimeout 30s · max $0

    Expected: skill-library OK: 1 skill(s) validated (deploy-vercel-preview)

  • clean-exitexit_codetimeout 30s · max $0

    Expected: 0

Results

Voyager showed that saving working code under a description and retrieving it later compounds: harder tasks build from primitives instead of starting from scratch. In practice this is a JSON store and a similarity search, not a magical library — but it is underdone in most agent projects.

Did this work for you?

Our CI checks the setup runs. You tell us if the whole thing worked. Tell us straight.

Related workflows

Liked this workflow?

Get new verified workflows in WebAfterAI, three issues a week (Tue, Thu, Sat).