factory-audit

factory-audit is a command for coding agents from watt-mind/factory. It costs 15 tokens per session (916 once invoked), scanned A, original, Apache-2.0.

A repository audit that checks whether a project follows a shared set of coding and process conventions, then records missing requirements as Linear work items. Linear is a task-tracking system.

In plain words
What is it for?
Use it to inspect one repository, selected checks, or all configured repositories, recording each result as passed, failed, or not applicable.
Why use it?
It replaces informal claims that a repository follows the rules with checked evidence and a trackable list of gaps.

Command

Part of the core plugin — 13 commands, 4 agents shipped together

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 commands/watt-mind/factory/factory-audit
Clone the repo
git clone --depth 1 https://github.com/watt-mind/factory

Or install core, the plugin that ships this one along with the rest of its 13 commands, 4 agents.

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 factory-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/watt-mind/factory/factory-audit.svg)](https://agentmods.dev/commands/watt-mind/factory/factory-audit)
Your own site
<a href="https://agentmods.dev/commands/watt-mind/factory/factory-audit"><img src="https://agentmods.dev/badge/commands/watt-mind/factory/factory-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 916 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.00015 $0.00916
Opus 5 $0.00008 $0.00458
Sonnet 5 $0.00003 $0.00183
Haiku 4.5 $0.00002 $0.00092

Measured 4d ago against content hash 68f87be9a5d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

factory-audit 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 4d ago.

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.

plugins/core/commands/factory-audit.md · 40 lines

How it starts

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

Audit a repository against the conventions baseline in ~/Develop/hdkiller/docs/guides/project-conventions.md and turn the gaps into tracked work.

Default target is the repo I'm currently in. Interpret $ARGUMENTS as a different repo path, specific check IDs to run in isolation, or all (every repo in config/repos.yaml that exists locally — audit each and report a matrix).

1. Grade every check

Work through the §7 conformance tablePC-01PC-20 — in order. That table is the source of truth for what's required; read it fresh each run rather than from memory, since it changes as the baseline grows.

For each check, record PASS / FAIL / N/A plus the evidence you actually observed: the command you ran and its relevant output, or the file and line. An unverified PASS is worse than a FAIL — it certifies something nobody checked.

Rules that keep the grade honest:

  • Verify against the live repo and the live GitHub settings, not against what AGENTS.md or this guide claims. PC-20 exists precisely because docs drift; when a doc and reality disagree, the doc is the finding. "Live" means origin/<base>, so git fetch --quiet first and follow the floor's Checkout freshness rule — a FAIL graded against a checkout that predates the fix is a fabricated finding, and it gets filed as a ticket for work already done.
  • N/A requires a stated reason grounded in the repo ("no auto-deploy branch", "free private plan blocks branch protection"). Never N/A a check because it's inconvenient or because fixing it is out of scope — that's a FAIL with a filed ticket.
  • PC-03 (runner policy) and PC-18 (missing secrets) are cheap and high-consequence — on private repos cloud runners bill real money; on public repos, fork PR sandboxing requires standard hosted runners or ephemeral isolation, while self-hosted remains for trusted internal lanes. Always check them, even in a partial audit.
  • For PC-17, a workflow that exists but is disabled by a stale if: gate is a FAIL, not a PASS — a gate whose stated precondition has since been met is the most common way a repo loses its strongest test signal without anyone noticing.
  • Read-only. Do not fix anything during grading; grade first, so the report reflects the repo as found.

Read the full file on GitHub · 40 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. 4d ago First seen · 40 lines · 0 tokens per session scan A 68f87be9a5d1

Subscribe to this mod's changes

factory-audit is a command published in the GitHub repository watt-mind/factory (10 stars, last pushed 4d ago), licensed Apache-2.0. It adds 15 tokens to every session and 916 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-31.