spec-backfill

spec-backfill is a skill for Claude Code, Codex from liza-mas/liza. It costs 18 tokens per session (2,069 once invoked), scanned A, original, Apache-2.0.

A repository-analysis skill that rebuilds missing specifications from source code, documentation, and version history, then tracks them over time.

In plain words
What is it for?
Use it to create specifications for an existing codebase, update stale specifications, document selected files, and maintain progress across sessions.
Why use it?
It helps reveal user-facing behavior that was never documented and find places where the code and specifications no longer match.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to create specifications for an existing codebase, update stale specifications, document selected files, and maintain progress across sessions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/liza-mas/liza/spec-backfill
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 liza-mas/liza --skill spec-backfill
Clone the repo
git clone --depth 1 https://github.com/liza-mas/liza

Made for: Claude Code, Codex.

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 spec-backfill

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/liza-mas/liza/spec-backfill"><img src="https://agentmods.dev/badge/skills/liza-mas/liza/spec-backfill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,069 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 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 Excessive Agency · line 52
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00018 $0.02069
Opus 5 $0.00009 $0.01035
Sonnet 5 $0.00004 $0.00414
Haiku 4.5 $0.00002 $0.00207

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

Security

Grade A, and why

spec-backfill 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.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/detect-stale.sh, scripts/update-mapping.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/spec-backfill/SKILL.md · 230 lines

How it starts

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

Objective

Reconstruct specifications from a repository's codebase, existing documentation, and git history. You're doing archaeology — finding the features buried in code and docs, then surfacing them as structured specs.

A spec is warranted when code implements user-facing functionality or business logic. Not every module needs a spec. Your job is to find the functional boundaries and document them.

Maintain state in files so work isn't lost if the conversation ends.

Entry Point

  1. Check for existing session state (specs/spec-backfill-state.yaml) — if present, offer to resume from cursor position (see references/session-state-schema.md)
  2. Check for existing mapping (specs/spec-mapping.yaml) — determines phase:
    • No mapping → First Run
    • Mapping exists → Incremental
    • User specifies files → Targeted

Phases

Three modes of operation. The agent runs the phase that matches the situation.

Phase When Steps
First run No spec-mapping.yaml exists Classify → Map → Gaps → Generate → Verify
Incremental Mapping exists, detect drift Detect stale → Reconcile → Generate if needed
Targeted User picks specific files/modules Classify targets → Map → Generate → Verify

Phase: First Run

1. CLASSIFY CODE
   - Scan codebase, classify each path:
     functional (needs spec) | architectural (needs ADR) | utility (needs neither)
   - Judgment call: "If a PM asked 'what does this do for users?',
     would there be a meaningful answer?" If yes → functional.
   - Show classification to user for validation

2. MAP CODE TO SPECS
   - For each functional path: does a spec exist? Check alignment.
   - No spec → gap. Spec conflicts with code → conflict.
   - Conflict types: code-ahead | spec-ahead | semantic-mismatch | stale-spec
   - Output: coverage report per references/report-format.md

3. ASK — surface unknowns, prioritize gaps
   - "I found N code paths without specs. Which are highest priority?"
   - Never generate without confirmation.

4. GENERATE SPECS (per gap, one at a time)
   - Extract observable behavior from code
   - Identify inputs, outputs, side effects, business rules
   - Ask user for: purpose, user story, acceptance criteria
   - Generate spec only after confirmation
   - Templates: references/spec-templates.md

5. VERIFY
   - All functional code has spec mapping
   - No relevant legacy content dropped (diff old vs new, surface differences)
   - No internal contradictions
   - Cross-references valid (ADRs, code paths)
   - Archive superseded specs to _archive after confirmation

6. PERSIST
   - Update spec-mapping.yaml (including SHAs) per references/mapping-schema.md
   - Update changelog
   - Output report per references/report-format.md

Read the full file on GitHub · 230 lines

Files

What ships with it

6 files 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 · 230 lines · 18 tokens per session scan A 6d59e4c48895

Subscribe to this mod's changes

spec-backfill is a skill published in the GitHub repository liza-mas/liza (382 stars, last pushed yesterday), licensed Apache-2.0. It adds 18 tokens to every session and 2,069 once invoked, about $0.0001 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.