agent-spec: Skill for Claude Code

.claude/skills/agent-spec-authoring/SKILL.md

agent-spec-authoring is a skill for Claude Code from ZhangHanDong/agent-spec. It costs 172 tokens per session (4,303 once invoked), scanned A, original, MIT.

A guide for writing and editing agent-spec files, which are detailed task contracts for coding agents. It covers requirements, limits, decisions, examples, and checks for completion.

In plain words
What is it for?
Use it to create or improve .spec and .spec.md files, write behavior-driven scenarios, define acceptance criteria, and troubleshoot specification quality.
Why use it?
It helps turn a vague coding request into a precise description that can be reviewed and checked consistently. This reduces misunderstandings about what the finished work must do.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is ZhangHanDong/agent-spec's own configuration. It tells Claude Code how to work on agent-spec itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-spec configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ZhangHanDong/agent-spec. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ZhangHanDong/agent-spec/main/.claude/skills/agent-spec-authoring/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ZhangHanDong/agent-spec

Made for: Claude Code.

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-authoring

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhanghandong/agent-spec/agent-spec-authoring"><img src="https://agentmods.dev/badge/skills/zhanghandong/agent-spec/agent-spec-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 172 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,303 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Memory Poisoning · line 149
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
How audits are shown
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.00172 $0.04303
Opus 5 $0.00086 $0.02152
Sonnet 5 $0.00034 $0.00861
Haiku 4.5 $0.00017 $0.00430

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

Security

Grade A, and why

agent-spec-authoring 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 10d 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.

.claude/skills/agent-spec-authoring/SKILL.md · 452 lines

How it starts

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

Agent Spec Authoring

Version: 3.2.0 | Last Updated: 2026-03-19

You are an expert at writing agent-spec Task Contracts. Help users by:

  • Creating specs: Scaffold new .spec.md files with correct structure (.spec also supported)
  • Editing specs: Improve intent, constraints, boundaries, scenarios
  • Writing scenarios: BDD-style with proper test selectors and step tables
  • Debugging specs: Fix lint warnings, improve quality scores
  • Self-hosting: Maintain specs for the agent-spec project itself

IMPORTANT: CLI Prerequisite Check

Before running any agent-spec command, Claude MUST check:

command -v agent-spec || cargo install agent-spec

If agent-spec is not installed, inform the user:

agent-spec CLI not found. Install with: cargo install agent-spec

Core Philosophy

A Contract is not a vague Issue — it's a precise specification that shifts the review point:

Traditional:  Human reviews 500 lines of code diff (slow, error-prone)
agent-spec:   Human writes 50-80 lines of Contract (fast, high-value)
              Machine verifies code against Contract (deterministic)

Writing a Contract is the highest-value human activity in the agent-spec workflow. You're defining "what is correct" — the machine handles "is the code correct".

Quick Reference

Section Chinese Header English Header Purpose
Intent ## 意图 ## Intent What to do and why
Constraints ## 约束 ## Constraints Must / Must NOT rules
Decisions ## 已定决策 / ## 决策 ## Decisions Fixed technical choices
Boundaries ## 边界 ## Boundaries Allowed / Forbidden / Out-of-scope
Acceptance Criteria ## 验收标准 / ## 完成条件 ## Acceptance Criteria / ## Completion Criteria BDD scenarios
Out of Scope ## 排除范围 ## Out of Scope Explicitly excluded items

Hard Syntax Rules

  • Use exactly one supported section header per line. Good: ## Intent or ## 意图. Bad: ## Intent / 意图.
  • Write scenarios as bare DSL lines under the acceptance section. Good: Scenario: / 场景:. The parser accepts Markdown-heading forms like ### Scenario: for compatibility, but authoring should avoid emitting them by default.
  • Do not invent extra top-level sections such as ## Architecture, ## Milestones, or ## Quality inside a task spec. Put that information into Intent, Decisions, Boundaries, or an external document.
  • After drafting or editing a spec, always run agent-spec parse <spec> and then agent-spec lint <spec> --min-score 0.7.

Read the full file on GitHub · 452 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 452 lines · 172 tokens per session scan A c447e62667a7

Subscribe to this mod's changes

agent-spec-authoring is a skill published in the GitHub repository ZhangHanDong/agent-spec (454 stars, last pushed 11d ago), licensed MIT. It adds 172 tokens to every session and 4,303 once invoked, about $0.0009 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-30.