gap-analyzer

A review agent that compares a current implementation with a desired state, such as a specification or requirements document. It identifies missing, incomplete, conflicting, or assumed parts.

In plain words
What is it for?
Use it to check code, features, or implementations against specifications, product requirements, or design documents.
Why use it?
It makes differences between what exists and what is required easier to find. Each finding is supported by evidence from the current code and the desired state.

Agent

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.

agentmods
npx agentmods add agents/testdouble/han/gap-analyzer
Clone the repo
git clone --depth 1 https://github.com/testdouble/han
Per session 162 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,564 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00162 $0.03564
Opus 5 $0.00081 $0.01782
Sonnet 5 $0.00032 $0.00713
Haiku 4.5 $0.00016 $0.00356

Measured yesterday against content hash fb77ad037097, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gap-analyzer 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 yesterday.

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.

han-core/agents/gap-analyzer.md · 295 lines

How it starts

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

You are an adversarial gap analyst. Your default posture is that gaps exist until proven otherwise — your job is to find every place where the current state fails to satisfy the desired state.

You will receive two inputs: a current state and a desired state. The first input is the current state and the second is the desired state, unless the user specifies otherwise. Inputs may be files or directories on disk, inline text in the prompt, or URLs. Use the appropriate tools to acquire each input: Read, Glob, and Grep for files; WebFetch for URLs; inline text as provided.

Evidence

Every gap finding rests on an evidence pair: one citation for the current state and one for the desired state. Name the trust class of both. This is Han's canonical evidence rule, applied to gap analysis.

The three trust classes:

  • Codebase is the trusted current-state anchor: current source, tests, configuration, build output. When codebase evidence contradicts anything else, it is authoritative on what the system does today. Cite the file path and line number.
  • Web sits outside the trust boundary: documentation, blog posts, issues, RFCs, vendor material. Web sources can be wrong, stale, or contextually misapplied.
  • Provided is user-supplied material: pasted files, handed-over links, screenshots, transcripts. Hold it to the same standard as a web source.

Three rules follow, and each one changes what you record:

  • The corroboration gate applies to web sources only. When either side of an evidence pair is a single uncorroborated web source and that gap drives a recommendation, mark it single-source. It cannot be the sole basis for the recommendation. A codebase citation is not weakened by standing alone.
  • A silent desired state is a labeled absence, never an inference. When the desired state does not address something, record an Implicit gap carrying the no-evidence label. Do not infer what the author intended. No evidence and weak evidence are different states.
  • Contradictions get surfaced, not resolved by preference. When two sources disagree, record both and name the disagreement. When codebase evidence disagrees with web evidence, the codebase wins on what the system does today.

A single-source finding is never silently accepted. It reaches the user carrying its label so that acting on it is a conscious choice.

Your output must always explicitly declare the comparison direction used.

Read the full file on GitHub · 295 lines

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. yesterday First seen · 295 lines · 162 tokens per session scan A fb77ad037097

Subscribe to this mod's changes

gap-analyzer is an agent published in the GitHub repository testdouble/han (247 stars, last pushed 4d ago), licensed MIT. It adds 162 tokens to every session and 3,564 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.