Anatomy of a skill
This started with a surprise, not with a plan. I needed a survey of the state of the art on a topic I was considering working on, so I ran deep-research, a skill that ships with Claude Code, and it came back with a report I didn't expect from a single run —27 sources, 123 claims extracted, 25 verified, and of those 18 confirmed and 7 refuted— with an executive summary, caveats, and open questions. What struck me wasn't the volume (I already covered the 109 agents in the previous post) but that all of it came out of a single skill. I wanted to see how it was built. It wasn't easy to find: it doesn't live in .claude/skills/ or in ~/.claude. It's compiled into the Claude Code binary as a bundled workflow, and a comment in the code tells its origin: "Ported from bughunter architecture". It's 349 lines of JavaScript. Reading them was the research. How a prompt is written Inside there are three prompts, and all three follow the same shape: a role in the title, the context (the original question plus the specific input), a task as a numbered checklist, an explicit decision criterion, and the output format. The verifier is the clearest one: const VERIFY_PROMPT = (claim, v) => "## Adversarial Claim Verifier (voter " + (v + 1) + "/3)\n\n" + "Be SKEPTICAL. Try to REFUTE this claim. ≥2/3 refutations kill it.\n\n" + "## Claim under review\n\"" + claim.claim + "\"\n" + "**Supporting quote:** \"" + claim.quote + "\"\n\n" + "## Checklist\n" + "1. Is the claim actually supported by the quote, or is it an overreach?\n" + "2. WebSearch for contradicting evidence.\n" + "3. Is the source quality sufficient for the claim's strength?\n" + "4. Is the claim outdated?\n" + "5. Is this a marketing claim / cherry-picked benchmark / forum speculation?\n\n" + "**refuted=false** ONLY if: well-supported, current, and source quality matches claim strength.\n" + "Default to refuted=true if uncertain.\n\nStructured output only. Evidence MUST be specific." It's exactly the framework I use when I review one of my own prompts —role, context, task, format, constraints— but with two details I don't usually include: the decision criterion is written as a rule (refuted=false only if…) and ties resolve by default toward the conservative side ("Default to refuted=true if uncertain"). A prompt that doesn't say what to do when in doubt leaves that decision to the model, and that's where the tidy-but-unfounded answers show up. How a skill is built A skill is more than a long prompt. What I saw in the file falls into six pieces: 1. Trigger metadata. The meta declares the name, the description, and the five phases, but the key is whenToUse: it's what the model reads to decide whether to invoke the skill, and it includes a prior instruction —if the question is underspecified, ask two or three clarifying questions before starting. 2. Tuning constants at the top. No magic numbers buried in the code: const VOTES_PER_CLAIM = 3 const REFUTATIONS_REQUIRED = 2 const MAX_FETCH = 15 const MAX_VERIFY_CLAIMS = 25 3. One schema per agent. Each of the five agent types returns JSON validated against a schema. That's what makes the pipeline composable: one agent's output is the next one's typed input. 4. Prompts as functions. SEARCH_PROMPT(angle), FETCH_PROMPT(source, angle), VERIFY_PROMPT(claim, v): they take the input and return the text. The prompt isn't copied, it's instantiated. 5. Explicit orchestration. Search and fetch go through pipeline(): each angle moves on to fetching its sources as soon as it's done, without waiting for the others. Before verification there's a barrier —and the comment says so: "Barrier here is intentional"— because the pool of claims has to be complete before it can be ranked. Then, nested parallel(): 25 claims × 3 votes. 6. Defensive design. Every early exit (no claims, everything refuted, failed synthesis) returns a useful result with stats instead of throwing. A null vote counts as an abstention, not as a free pass: const survives = valid.length >= REFUTATIONS_REQUIRED && refuted < REFUTATIONS_REQUIRED And the final result carries agentCalls: the skill computes its own cost (1 + angles + sources + claims × 3 + 1). That's where the 109 came from. Trimming the pattern The proof that I understood the pattern was reusing it. A couple of later runs on that same topic got cut off by the session limit before verification, and instead of repeating them in full I wrote reverify-linea-c: same meta, same constants, same verdict schema, and the same three-vote verifier, but with no Scope, Search, or Fetch —those phases were replaced by an array of 22 already-extracted claims. The whole skeleton inherited, one array of my own. All 22 came back confirmed. What I take away: a good skill isn't a long prompt, it's a short, well-formed prompt, instantiated many times by an orchestration that knows where to wait and where not to, and that measures what it spends. And it reads in an afternoon.
This is a summary aggregated from Dev.to. Read the complete article on the original site:
Read full article at Dev.to