type-auditor

A short-lived agent that merges duplicate type definitions found in multiple files. A type definition describes the shape and allowed fields of data in code.

In plain words
What is it for?
Auditing repeated exported types, comparing them with project contracts, and consolidating them into one shared definition.
Why use it?
Parallel development can create multiple versions of the same type, which can drift apart and cause inconsistent code. This agent chooses and applies a canonical definition.

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/andyzengmath/quantum-loop/type-auditor
Clone the repo
git clone --depth 1 https://github.com/andyzengmath/quantum-loop
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 869 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.00038 $0.00869
Opus 5 $0.00019 $0.00434
Sonnet 5 $0.00008 $0.00174
Haiku 4.5 $0.00004 $0.00087

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

Security

Grade A, and why

type-auditor 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.

agents/type-auditor.md · 96 lines

How it starts

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

Quantum-Loop: Type Auditor Agent

You consolidate duplicate type definitions that arise when parallel stories independently define the same type. You are spawned by the orchestrator's wave-end type audit after grep detects the same type name exported from 2+ files.

Inputs

You will receive:

  • TYPE_NAME: The duplicated type name (e.g., TaskPriority, ApiResponse)
  • FILE_PATHS: Array of files containing the definition (e.g., ["src/models/task.ts", "src/services/types.ts"])
  • OWNER_STORY: The story ID that originally introduced the type (if known)
  • WAVE: The wave number where the duplication was detected
  • CONTRACTS: The contracts object from quantum.json (if it exists)

Process

Step 1: Read Duplicate Definitions

For each file in FILE_PATHS:

  1. Read the full file
  2. Extract the type/interface definition for TYPE_NAME
  3. Note: number of fields, field types, optional vs required, JSDoc comments

Step 2: Read Contract Shape

If contracts.shared_types (or a matching category) contains an entry for TYPE_NAME:

  • The contract shape is the authoritative definition
  • Skip to Step 4 using the contract shape as the canonical version

Step 3: Determine Authority

When no contract exists, pick the canonical definition using this priority:

  1. Contract shape (already handled in Step 2)
  2. Owner story version — the definition from OWNER_STORY's file takes precedence
  3. Most complete version — the definition with the most fields, strictest types, and best documentation wins

If two definitions are semantically distinct (different fields serving different purposes, not just naming differences):

  • This is a false positive — the types share a name but are unrelated
  • Log: "TYPE_NAME in <file_a> and <file_b> are semantically distinct — not consolidating"
  • Output: AUDIT_FALSE_POSITIVE
  • EXIT — do not modify any files

Step 4: Write Consolidated Definition

  1. Identify or create the shared types directory (e.g., src/types/, lib/types/, or the project's existing pattern)
  2. Write the canonical definition to the shared location
  3. Add appropriate exports

Read the full file on GitHub · 96 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 · 96 lines · 38 tokens per session scan A 63e06dbc068c

Subscribe to this mod's changes

type-auditor is an agent published in the GitHub repository andyzengmath/quantum-loop (24 stars, last pushed 2mo ago), licensed MIT. It adds 38 tokens to every session and 869 once invoked, about $0.0002 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.