agent-spec-authoring
CRITICAL: Use for writing and editing agent-spec .spec/.spec.md files. Triggers on: write spec, create spec, edit spec, new spec,…
CRITICAL: Use for estimating work effort from agent-spec Task Contracts. Triggers on: estimate, estimation, how long, work effort, round count, time estimate, scope, sizing, cost, budget, planning, sprint, capacity, "how many rounds", "how long will this take", "estimate this
$ npx -y skills add zhanghandong/agent-spec --skill agent-spec-estimate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/agent-spec-estimateContext preview
The summary Claude sees to decide when to auto-load this skill.
CRITICAL: Use for estimating work effort from agent-spec Task Contracts. Triggers on: estimate, estimation, how long, work effort, round count, time estimate, scope, sizing, cost, budget, planning, sprint, capacity, "how many rounds", "how long will this take", "estimate this
name: agent-spec-estimate description: | CRITICAL: Use for estimating work effort from agent-spec Task Contracts. Triggers on: estimate, estimation, how long, work effort, round count, time estimate, scope, sizing, cost, budget, planning, sprint, capacity, "how many rounds", "how long will this take", "estimate this spec", 估算, 工作量, 多久, 时间估算, 预估, 工时, 规模, 评估工作量, "这个 spec 要多久", "估算一下", "工作量评估"
> **Version:** 1.3.1 | **Last Updated:** 2026-08-14 | **Tracks:** agent-spec 1.4.0
You are an expert at estimating AI agent work effort from structured Task Contracts. Help users by:
**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`
| Action | Command | Output | |--------|---------|--------| | Estimate a spec | `agent-spec contract <spec>` then apply estimation | Round-based breakdown table | | Batch estimate | Run on all specs in `specs/` | Sorted effort ranking | | Calibrate from history | `agent-spec explain <spec> --history` | Compare predicted vs actual rounds | | Library sizing signal (0.3.0) | `agent-spec audit --spec-dir specs --format json` | Counts of rules/scenarios/unproven-rules/open-questions to weight remaining effort |
**0.3.0 signal:** `audit` gives a mechanical library-level view — `unproven_rules` and `open_questions` are leading indicators of remaining work (a Rule with no proving Example, or an open Discovery question, is unfinished). Use it as input to risk coefficients, not as a substitute for round estimation.
A Task Contract has structured elements that map directly to estimation inputs:
| Contract Element | Estimation Input | How It Affects Estimate | |-----------------|-----------------|----------------------| | **Completion Criteria scenarios** | Module decomposition | Each scenario ≈ 1 module (1-15 rounds) | | **Decisions** (fixed tech choices) | Risk reduction | Known tech → risk 1.0; new tech → risk 1.3-1.5 | | **Boundaries: Allowed Changes** | Scope breadth | More paths → more modules; fewer paths → focused | | **Boundaries: Forbidden** | Constraint overhead | Each prohibition adds 0-1 verification rounds | | **Constraints: Must NOT** | Structural checks | Pattern avoidance adds ~1 round per constraint | | **Out of Scope** | Scope control | Reduces estimate (explicitly excluded work) | | **inherits: project/org** | Inherited overhead | Inherited constraints add ~1-2 rounds for compliance | | **Exception scenario count** | Quality indicator | More exceptions = better spec but more rounds |
| Scenario Type | Base Rounds | Signal | |---------------|------------|--------| | Happy path with known pattern | 1-2 | Test selector points to simple CRUD/boilerplate | | Happy path with business logic | 3-5 | Step table with multiple fields, custom validation | | Error/exception path | 1-3 | Usually simpler than happy path (reject early) | | Boundary/integration scenario | 3-8 | Involves file I/O, external calls, or multi-step state | | Exploratory/under-documented | 5-10 | No `Decisions` for the tech, or sparse step descriptions |
| Contract Signal | Risk | Rationale | |----------------|------|-----------| | Decisions list specific tech + version | 1.0 | No technology shopping | | Decisions exist but are vague | 1.3 | Agent may need to explore | | No Decisions section | 1.5 | Agent must choose, retry likely | | Boundaries are tight (2-3 paths) | 1.0 | Clear scope | | Boundaries are broad (10+ paths) | 1.3 | More surface area for mistakes | | `inherits: project` with strict constraints | 1.2 | Must satisfy inherited rules too | | Step text uses quantified assertions | 1.0 | Deterministic test expected | | Step text uses vague language | 1.5 | Test may not match intent |
agent-spec contract specs/task.spec.md
Extract: scenario count, decision count, boundary path count, constraint count.
Each scenario is a potential module. Group related scenarios:
Apply the Scenario Complexity Tiers table. For each module:
base_rounds = sum of scenario base rounds in this module
Read the Contract's Decisions and Boundaries. Apply the Risk Coefficient table:
effective_rounds = base_rounds × risk_coefficient
integration_rounds = 10-15% of base total verification_rounds = ceil(scenario_count / 3) # ~1 lifecycle run per 3 scenarios total_rounds = effective_rounds + integration_rounds + verification_rounds
wallclock_minutes = total_rounds × 3 # default 3 min/round
Adjust minutes_per_round:
Always produce this exact structure:
### Estimate: [spec name] #### Contract Summary - **Scenarios**: N (H happy + E exception) - **Decisions**: N fixed choices - **Boundaries**: N allowed paths, M forbidden rules - **Inherited constraints**: N #### Modu
agent-spec is an intent compiler(意图编译器) for AI agent coding: it compiles human intent — through structured requirements as the intermediate representation (IR) — into verifiable Task Contracts, then mechanically verifies the implementation against them.
CRITICAL: Use for writing and editing agent-spec .spec/.spec.md files. Triggers on: write spec, create spec, edit spec, new spec,…
CRITICAL: Use for agent-spec CLI tool workflow. Triggers on: agent-spec, contract, lifecycle, guard, verify, explain, stamp,…
Use when converting PRD or issue prose into KLL requirements, running the intent compiler plan, or reverse-interviewing a human…
Use when initializing, checking, enriching, or reviewing agent-spec code live wiki pages, source_files trace, or Rust…