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.
curl -O https://raw.githubusercontent.com/ZhangHanDong/agent-spec/main/.claude/skills/agent-spec-tool-first/SKILL.mdgit clone --depth 1 https://github.com/ZhangHanDong/agent-specWrote 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.
[](https://agentmods.dev/skills/zhanghandong/agent-spec/agent-spec-tool-first)<a href="https://agentmods.dev/skills/zhanghandong/agent-spec/agent-spec-tool-first"><img src="https://agentmods.dev/badge/skills/zhanghandong/agent-spec/agent-spec-tool-first/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.
<a href="https://agentmods.dev/skills/zhanghandong/agent-spec/agent-spec-tool-first"><img src="https://agentmods.dev/badge/skills/zhanghandong/agent-spec/agent-spec-tool-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
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 →
- medium System Prompt Leakage · line 532 Skill contains patterns that could indirectly extract system prompts through rephrasing, translation, summarization, or side-channel techniques.Fix: Guard against indirect extraction by refusing to summarize, translate, or rephrase system instructions. Add explicit anti-extraction clauses.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00165 | $0.09039 |
| Opus 5 | $0.00082 | $0.04519 |
| Sonnet 5 | $0.00033 | $0.01808 |
| Haiku 4.5 | $0.00016 | $0.00904 |
Grade A, and why
agent-spec-tool-first 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 611 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Spec Tool-First Workflow
Version: 3.7.0 | Last Updated: 2026-07-22 | Tracks agent-spec: 1.2.0 (stability promise)
You are an expert at using agent-spec as a CLI tool for contract-driven AI coding. Help users by:
- Planning: Render task contracts with
contract, generate plan context withplan - Implementing: Follow contract Intent, Decisions, Boundaries
- Verifying: Run
lifecycle/guardto check code against specs - Reviewing: Use
explainfor human-readable summaries,stampfor git trailers - Debugging: Interpret verification failures and fix code accordingly
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-specCLI not found. Install with:cargo install agent-spec
Core Mental Model
The key shift: Review point displacement. Human attention moves from "reading code diffs" to "writing contracts".
Traditional: Write Issue (10%) → Agent codes (0%) → Read diff (80%) → Approve (10%)
agent-spec: Write Contract (60%) → Agent codes (0%) → Read explain (30%) → Approve (10%)
Humans define "what is correct" (Contract). Machines verify "is the code correct" (lifecycle). Humans do final "Contract Acceptance" — not Code Review.
Quick Reference
| Command | Purpose | When to Use |
|---|---|---|
agent-spec init |
Scaffold new spec | Starting a new task |
agent-spec contract <spec> |
Render Task Contract | Before coding - read the execution plan |
agent-spec lint <files> |
Spec quality check | After writing spec, before giving to Agent |
agent-spec plan <spec> --code . |
Generate plan context | Before coding - codebase scan + task sketch |
agent-spec lifecycle <spec> --code . |
Full lint + verify pipeline | After edits - main quality gate |
agent-spec guard --spec-dir specs --code . |
Repo-wide check | Pre-commit / CI - all specs at once |
agent-spec explain <spec> --format markdown |
PR-ready review summary | Contract Acceptance - paste into PR |
agent-spec explain <spec> --history |
Execution history | See how many retries the Agent needed |
agent-spec stamp <spec> --dry-run |
Preview git trailers | Before committing - traceability |
agent-spec graph --spec-dir specs |
Dependency graph (DOT) | After writing specs - visualize deps & critical path |
agent-spec requirements graph --gate |
Validate KLL requirements and dependency graph | After importing PRD/issue requirements |
agent-spec wiki status |
Check stale code live wiki articles | Session start / before broad source reading |
agent-spec wiki query <text> |
Search tracked live wiki articles | Before opening many source files |
agent-spec wiki check |
Live wiki lint + worktree status gate | Pre-commit / CI for tracked wiki |
agent-spec atlas build/tree/query/search/explore/context/flow/impact/affected/refs/impls/status/check/scip-gen |
Rust graph with scored retrieval, bounded context projection, explainable paths, reverse impact, identity, and independent syn/SCIP/MIR freshness; scip-gen invokes rust-analyzer for the optional SCIP overlay |
Build before querying; use --frozen for review, and never infer tests from affected filenames |
agent-spec atlas benchmark validate/plan/summarize/score |
Validate offline evaluation inputs and gate query-quality observations | Evaluate correctness before performance; default tests do not invoke a model or network |
agent-spec atlas benchmark agent-plan/agent-gate |
Compile and gate matched Read/Grep, Atlas primitive, and context arms | Real execution is opt-in; a checked-in plan is not adoption evidence |
agent-spec atlas benchmark serving-plan/serving-gate |
Compile and gate direct/worker burst trials | Keep worker serving opt-in until real evidence is accepted |
agent-spec atlas provider validate/conformance |
Validate external Code Graph providers and run the F1 conformance matrix | Conformance proves adapter behavior, not language quality |
agent-spec verify <spec> --code . |
Raw verification only | When you want verify without lint gate |
agent-spec checkpoint status |
VCS-aware status | Check uncommitted state |
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.
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.
- 9d ago First seen · 611 lines · 165 tokens per session scan A 009b8a6485c4
agent-spec-tool-first is a skill published in the GitHub repository ZhangHanDong/agent-spec (454 stars, last pushed 10d ago), licensed MIT. It adds 165 tokens to every session and 9,039 once invoked, about $0.0008 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.
Other skills, from other repositories
comet-native
A workflow for managing Native changes in Comet, where requirements, progress, and acceptance results are saved in project files. It uses the Comet command-line runtime to move through defined work stages.
comet
Comet — OpenSpec + Superpowers dual-star development workflow. Start with /comet for automatic phase detection and dispatch to subcommands. Five phases: open → design → build → verify → archive.
subagent-driven-development
Use when executing implementation plans with independent tasks in the current session.
comet-hotfix
A quick workflow for fixing an existing bug in Comet, a tool that manages structured code changes. It moves through opening the change, building, checking, and archiving it.
comet-verify
A workflow for verifying a Comet change after its coding tasks are complete. Comet is a tool that tracks structured software changes through stages.
comet-verify
Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify implementation matches design, handle development branch.