
Agent Spec Estimate
- 10 installs
- 443 repo stars
- Updated August 5, 2026
- zhanghandong/agent-spec
Helps with ai & agent building tasks during AI-assisted development.
About
agent-spec-estimate is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- agent-spec-estimate
- AI & Agent Building
- AI-coding skill
Agent Spec Estimate by the numbers
- 10 all-time installs (skills.sh)
- +1 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #11,937 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/zhanghandong/agent-spec --skill agent-spec-estimateAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 10 |
|---|---|
| repo stars | ★ 443 |
| Last updated | August 5, 2026 |
| Repository | zhanghandong/agent-spec ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Agent Spec Estimate
Version: 1.1.0 | Last Updated: 2026-03-19
You are an expert at estimating AI agent work effort from structured Task Contracts. Help users by:
- Estimating specs: Read a
.spec/.spec.mdfile and produce a round-based effort estimate - Comparing tasks: Rank multiple specs by effort for sprint planning
- Risk assessment: Identify which Contract elements drive uncertainty
- Calibrating: Adjust estimates based on actual lifecycle retry counts
IMPORTANT: CLI Prerequisite Check
Before running any `agent-spec` command, Claude MUST check:
command -v agent-spec || cargo install agent-specIf agent-spec is not installed, inform the user:
agent-specCLI not found. Install with:cargo install agent-spec
Quick Reference
| Action | Command | Output |
|---|---|---|
| Estimate a spec | agent-spec plan <spec> --code . --format json then apply estimation | Round-based breakdown table |
| Estimate (contract only) | agent-spec contract <spec> then apply estimation | Round-based breakdown (no codebase context) |
| Batch estimate | Run on all specs in specs/ | Sorted effort ranking |
| Calibrate from history | agent-spec explain <spec> --history | Compare predicted vs actual rounds |
Core Method
Contract → Rounds Mapping
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 Complexity Tiers
| 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 |
Risk Coefficient from Contract Signals
| 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 |
Estimation Procedure
Step 1: Read the Contract and Codebase Context
# Preferred: plan gives contract + codebase context + task sketch
agent-spec plan specs/task.spec.md --code . --format json
# Alternative: contract only (no codebase awareness)
agent-spec contract specs/task.spec.mdExtract: scenario count, decision count, boundary path count, constraint count. From plan output, also consider: existing file count (less new code needed), existing test count (less test scaffolding), task sketch grouping (parallel vs sequential work).
Step 2: Decompose Scenarios into Modules
Each scenario is a potential module. If plan output is available, use its Task Sketch groups as the starting decomposition — scenarios in the same group share no dependencies and can be estimated together:
- If 3 scenarios all test the same endpoint → 1 module (implementation) + 1 module (tests)
- If scenarios span different subsystems → separate modules
- If Task Sketch has N groups → at least N sequential phases
Step 3: Estimate Rounds per Module
Apply the Scenario Complexity Tiers table. For each module:
base_rounds = sum of scenario base rounds in this moduleStep 4: Apply Risk Coefficients
Read the Contract's Decisions and Boundaries. Apply the Risk Coefficient table:
effective_rounds = base_rounds × risk_coefficientStep 5: Add Integration + Verification Overhead
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_roundsStep 6: Convert to Wallclock Time
wallclock_minutes = total_rounds × 3 # default 3 min/roundAdjust minutes_per_round:
- Fast iteration, agent barely paused: 2 min
- Human reviews each step: 4 min
- Manual testing needed (mobile, hardware): 5 min
Output Format
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
#### Module Breakdown
| # | Module | Scenarios | Base Rounds | Risk | Effective | Notes |
|---|--------|-----------|-------------|------|-----------|-------|
| 1 | ... | S1, S2 | N | 1.x | M | why |
#### Summary
- **Base rounds**: X
- **Integration**: +Y rounds
- **Verification**: +Z rounds (lifecycle retries)
- **Risk-adjusted total**: T rounds
- **Estimated wallclock**: A - B minutes (at N min/round)
#### Risk Factors
1. [specific risk from Contract analysis]
2. [...]
#### Confidence
- HIGH: Contract has specific Decisions, tight Boundaries, quantified steps
- MEDIUM: Some vague areas but overall clear
- LOW: Missing Decisions, broad scope, vague step language
**Evidence rule**: Every number in the estimate table MUST trace back to a specific Contract element (scenario name, decision text, boundary path). Do not use "should" or "probably" when stating estimates — if you cannot point to the source, the number is a guess. Mark it as such and flag the uncertainty.Calibration: Predicted vs Actual
After a task is complete, compare prediction to reality:
agent-spec explain specs/task.spec.md --historyThe retry count from run logs tells you the actual verification rounds. Compare:
predicted_verification_rounds vs actual_retriesIf actual > predicted × 1.5 → the spec had hidden complexity. Note this for future calibration.
Batch Estimation for Sprint Planning
To estimate all active specs:
for spec in specs/task-*.spec.md; do
echo "=== $(basename $spec) ==="
agent-spec contract "$spec" 2>/dev/null | head -20
echo
doneThen apply the estimation procedure to each, and sort by total rounds:
### Sprint Capacity Plan
| Spec | Rounds | Wallclock | Risk | Priority |
|------|--------|-----------|------|----------|
| task-a | 12 | ~36 min | LOW | P0 |
| task-b | 28 | ~84 min | MED | P1 |
| task-c | 45 | ~135 min | HIGH | P2 |
**Total**: 85 rounds ≈ 4.25 hours of agent timeCommon Mistakes
| Mistake | Why It's Wrong | Fix |
|---|---|---|
| Estimating by line count | 500 lines of boilerplate ≠ hard | Estimate by scenario complexity |
| Anchoring to human time | "A developer would take 2 weeks" | Start from rounds, convert last |
| Ignoring exception scenarios | They seem simple but add up | Count ALL scenarios, not just happy path |
| Forgetting verification rounds | Agent must run lifecycle N times | Add ceil(scenarios/3) rounds |
| Missing inherited constraints | project.spec adds hidden work | Check inherits: and count parent constraints |
When NOT to Estimate
| Situation | Why | Alternative |
|---|---|---|
No .spec file yet | Nothing to estimate from | Write the Contract first |
| Spec has lint score < 0.5 | Too vague for reliable estimate | Improve spec quality first |
| Exploratory / vibe coding | No defined "done" | Just start coding, write spec later |
Estimation Examples
Worked examples mapping Task Contracts to round-based estimates.
Example 1: Small Task — Add AI Verifier Skeleton
Contract summary (from task-add-ai-verifier-skeleton.spec):
- Intent: Add minimal AiVerifier with off/stub modes
- Decisions: 3 fixed (off + stub only, uncertain verdict, AiAnalysis evidence)
- Boundaries: 5 allowed paths, 3 forbidden rules
- Scenarios: 3 (1 stub mode, 1 default mode, 1 report output)
Estimation:
| # | Module | Scenarios | Base | Risk | Effective | Notes |
|---|---|---|---|---|---|---|
| 1 | AiVerifier core (mode enum, stub logic) | S1, S2 | 3 | 1.0 | 3 | Decisions are specific, clear pattern |
| 2 | AiAnalysis evidence model | S1 | 2 | 1.0 | 2 | Struct + serialization |
| 3 | Report formatting | S3 | 2 | 1.0 | 2 | Extend existing formatter |
| 4 | CLI flag + gateway wiring | — | 2 | 1.3 | 3 | Cross-module integration |
- Base: 9 rounds
- Integration: +1
- Verification: +1 (3 scenarios / 3)
- Total: 11 rounds ≈ 33 min
- Confidence: HIGH (all decisions fixed, tight boundaries)
Actual: Task completed in ~10 lifecycle runs across 2 sessions. Close to estimate.
---
Example 2: Medium Task — Contract Review Loop (Phase 1)
Contract summary (from task-phase1-contract-review-loop.spec):
- Intent: Add
explainandstampcommands - Decisions: implicit (extend existing CLI pattern)
- Boundaries: 2 crate paths, specs
- Scenarios: 3 (explain text, explain markdown, stamp dry-run)
Estimation:
| # | Module | Scenarios | Base | Risk | Effective | Notes |
|---|---|---|---|---|---|---|
| 1 | ExplainInput + format_explain | S1, S2 | 5 | 1.0 | 5 | Two renderers (text + md) |
| 2 | Explain CLI command | S1, S2 | 2 | 1.0 | 2 | Known clap pattern |
| 3 | Stamp + build_stamp_trailers | S3 | 3 | 1.0 | 3 | Pure function + CLI |
| 4 | Tests | S1-S3 | 3 | 1.3 | 4 | Assert content structure |
- Base: 13 rounds
- Integration: +2
- Verification: +1
- Total: 16 rounds ≈ 48 min
- Confidence: HIGH
---
Example 3: Large Task — Merge 7 Crates into Single Crate
Contract summary (hypothetical spec):
- Intent: Consolidate workspace into single publishable crate
- Decisions: module naming = old crate names, import transformation rules
- Boundaries: ALL src files (very broad)
- Scenarios: would need ~5 (compilation, tests pass, publish dry-run, CI green, specs updated)
Estimation:
| # | Module | Scenarios | Base | Risk | Effective | Notes |
|---|---|---|---|---|---|---|
| 1 | Create module structure | — | 3 | 1.0 | 3 | Mechanical file moves |
| 2 | Transform imports (24 files) | — | 8 | 1.5 | 12 | Many edge cases, sed misses |
| 3 | Fix test modules | — | 3 | 1.5 | 5 | super:: vs crate:: confusion |
| 4 | Update Cargo.toml | — | 1 | 1.0 | 1 | Single manifest |
| 5 | Update 32 spec files | — | 4 | 1.3 | 5 | Boundary paths + selectors |
| 6 | Fix clippy warnings | — | 3 | 1.3 | 4 | dead_code, collapsible_if |
| 7 | Publish to crates.io | — | 2 | 1.3 | 3 | Rebase conflicts possible |
- Base: 24 rounds
- Integration: +4 (rebase conflicts, CI)
- Verification: +3
- Total: 37 rounds ≈ 111 min (~2 hours)
- Confidence: MEDIUM (broad scope, many files)
Actual: Task took ~2 sessions with multiple rebase conflicts. Estimate was reasonable.
---
Estimation Heuristics Summary
| Spec Characteristic | Quick Estimate |
|---|---|
| 1-2 scenarios, tight boundaries, all decisions fixed | 5-10 rounds (~15-30 min) |
| 3-5 scenarios, moderate scope | 12-25 rounds (~36-75 min) |
| 5-10 scenarios, broad scope or missing decisions | 25-50 rounds (~75-150 min) |
| 10+ scenarios or cross-cutting refactor | 50+ rounds (~2.5+ hours) |