agent-spec-writer

agent-spec-writer is a skill for Claude Code from kirill-sviridov/agent-dev-skills. It costs 77 tokens per session (1,878 once invoked), scanned A, original, MIT.

A guide for writing a complete specification before generating a LangGraph agent. The specification describes what the agent should do clearly enough for a code-generation tool or developer to implement it.

In plain words
What is it for?
Use it before building a new LangGraph agent, especially when choosing its behavior, inputs, outputs, tools, and known implementation patterns.
Why use it?
It turns a vague request into defined requirements and reduces the chance that generated code solves the wrong problem.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the agent-dev-skills plugin — 4 skills shipped together

Good fit Use it before building a new LangGraph agent, especially when choosing its behavior, inputs, outputs, tools, and known implementation patterns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kirill-sviridov/agent-dev-skills/agent-spec-writer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kirill-sviridov/agent-dev-skills --skill agent-spec-writer
Clone the repo
git clone --depth 1 https://github.com/kirill-sviridov/agent-dev-skills

Made for: Claude Code.

Or install agent-dev-skills, the plugin that ships this one along with the rest of its 4 skills.

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 agent-spec-writer

README.md
[![agentmods](https://agentmods.dev/badge/skills/kirill-sviridov/agent-dev-skills/agent-spec-writer/github.svg)](https://agentmods.dev/skills/kirill-sviridov/agent-dev-skills/agent-spec-writer)
Your own site
<a href="https://agentmods.dev/skills/kirill-sviridov/agent-dev-skills/agent-spec-writer"><img src="https://agentmods.dev/badge/skills/kirill-sviridov/agent-dev-skills/agent-spec-writer/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 agent-spec-writer

Your own site · 80×15
<a href="https://agentmods.dev/skills/kirill-sviridov/agent-dev-skills/agent-spec-writer"><img src="https://agentmods.dev/badge/skills/kirill-sviridov/agent-dev-skills/agent-spec-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,878 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.
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.00077 $0.01878
Opus 5 $0.00039 $0.00939
Sonnet 5 $0.00015 $0.00376
Haiku 4.5 $0.00008 $0.00188

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

Security

Grade A, and why

agent-spec-writer 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 11d 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.

plugins/agent-dev-skills/skills/agent-spec-writer/SKILL.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Spec Writer

Use this BEFORE a code-generation step (e.g. write_langgraph_agent(...) from a local codegen MCP tool). The goal is to turn a vague ask ("I want an agent that...") into a complete spec the model can't reinterpret "its own way."

This skill is a codegen-tool add-on, but it is fully useful without one. (Optional — the write_langgraph_agent calls below assume a local code-generation MCP tool; without it, write the spec using the same sections and code the agent yourself from it.) When there is no codegen tool, skip step 3 of the algorithm and item 1 of the Output check, and replace section 8 with inline notes on known patterns.

When to use

  • The user framed the task in one phrase and asked to "build an agent."
  • You're about to call a codegen tool, but the spec in your head is fuzzy.
  • The last generation produced "the wrong thing" — the typical cause is an under-specified spec.

When NOT to use

  • The task is a small edit to an existing agent (use /debug-langgraph-agent / edit directly).
  • The stack isn't chosen yet — run /agent-tech-chooser first.
  • It's not a LangGraph agent (e.g. a simple single-turn LLM call — write raw SDK straight away).

Algorithm

  1. Confirm the stack = LangGraph. If in doubt — run /agent-tech-chooser first.
  2. Run the user's request through the 9 sections below. Each section must get a concrete answer. If the answer is "depends on the user" — ask a clarifying question before generating.
  3. Cross-check against RAG (if available): search_agent_knowledge("<agent pattern> example") — find 1-2 close patterns and mention them in section 8 (optional — assumes a local knowledge-retrieval MCP tool; if there's no such tool, skip this and note the known pattern to lean on instead).
  4. Assemble the final spec in the format below and feed it as task= into your codegen tool (or code it yourself from the spec).

The 9 mandatory spec sections

## 1. Agent goal (1-2 sentences)
What it does from the user's point of view. No architecture details.
Example: "Classifies a user comment as safe/spam/toxic and returns the
matching response handler."

## 2. Input / output
- Input: <type/schema>
- Output: <type/schema, always with an example>
Example:
- Input: {"comment": str}
- Output: {"label": Literal["safe","spam","toxic"], "response": str}

## 3. State schema (hint, not final code)
List the keys, types, and whether reducers are needed.
Example:
- messages: list[AnyMessage], reducer = add_messages
- label: str | None (overwrite)
- artifacts: list[dict], reducer = operator.add

## 4. Tools (if any)
For each tool: name, signature, what it does, when to call it, what it returns.
If there are no tools — write "Tools: none".
Example:
- check_service_health(service: str) -> dict — pings the service, returns
  {"status": "up"|"down", "latency_ms": int}. Call when the user asks about
  availability.

## 5. Control flow (pattern)
One of: ReAct loop (create_agent) / workflow with conditional_edges /
supervisor + specialists / swarm / map-reduce (Send) / HITL with interrupt.
Briefly describe "how execution flows."

## 6. Model provider
- init_chat_model("<provider>:<model>")
- Do NOT invent the model name or pull it "from memory" — it goes stale faster
  than the skill. Resolution order: 1) the user specified it explicitly;
  2) it's in the project config/env (`AGENT_MODEL` or an existing constant) —
  take it from there; 3) otherwise ask the user, offering to confirm the
  provider's current small model. In the spec, reference the env/constant,
  not a literal. If the project goes through an OpenAI-compatible proxy,
  `OPENAI_BASE_URL` / `OPENAI_API_KEY` come from the project environment —
  don't hardcode them in the spec.

## 7. Production flags
- Checkpointer: InMemorySaver (dev/test only) / AsyncPostgresSaver (prod) / none
- Durability: sync / async (default) / exit — for HITL with interrupt don't pick exit
- HITL: interrupt in which node / none
- Structured output: response_format=<Schema> directly (auto → ProviderStrategy
  on models with native support; ToolStrategy(<Schema>) — for the rest) / none
- Streaming: graph.stream(stream_mode="messages") / none
- Node timeouts: add_node(..., timeout=N) or TimeoutPolicy(run_timeout=, idle_timeout=)
  (LangGraph 1.2+, async nodes only) / none
- Retry: is a retry decorator needed around the LLM call
- LangSmith tracing: on (LANGSMITH_TRACING=true) / off

## 8. Reference patterns from RAG (if RAG is available)
1-3 lines on which pattern cards from your knowledge store apply.
Example: "See distilled/repo__react-agent.md for the ReAct structure,
distilled/lc_blog_multi_agent_workflows.md for conditional_edges."
If RAG is unavailable — 1-3 lines on which known pattern to lean on.

## 9. Acceptance criteria / evals
3-5 "input → expected output" pairs — these double as test cases for the generation.
Example:
- {"comment": "great service!"} → label="safe"
- {"comment": "BUY CRYPTO AT THIS LINK"} → label="spam"
- {"comment": "you're an idiot"} → label="toxic", response contains a polite refusal

Read the full file on GitHub · 131 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. 11d ago First seen · 131 lines · 77 tokens per session scan A 5a41d453edd6

Subscribe to this mod's changes

agent-spec-writer is a skill published in the GitHub repository kirill-sviridov/agent-dev-skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 77 tokens to every session and 1,878 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-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens