factory-garden

factory-garden is a command for Claude Code from watt-mind/factory. It costs 26 tokens per session (2,363 once invoked), scanned A, original, Apache-2.0.

A repository-cleanup command that finds spreading anti-patterns, removes bad examples, and replaces prose warnings with deterministic checks. It can also create limited pull requests for the fixes.

In plain words
What is it for?
It scans recent repository changes, identifies patterns that are spreading, and applies root-cause cleanup within a bounded run. It can produce a report, tickets, or pull requests.
Why use it?
It prevents agents and developers from copying fragile workarounds such as unjustified type escapes, disabled lint rules, and race-condition patches. The checks explain the underlying fix instead of relying on warnings people may overlook.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: model in frontmatter; mentions AGENTS.md.

Part of the core plugin — 38 skills, 22 commands, 5 agents, 1 hook shipped together

Good fit It scans recent repository changes, identifies patterns that are spreading, and applies root-cause cleanup within a bounded run. It can produce a report, tickets, or pull requests.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/watt-mind/factory/factory-garden
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.

Clone the repo
git clone --depth 1 https://github.com/watt-mind/factory

Made for: Claude Code.

Or install core, the plugin that ships this one along with the rest of its 38 skills, 22 commands, 5 agents, 1 hook.

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-garden

README.md
[![agentmods](https://agentmods.dev/badge/commands/watt-mind/factory/factory-garden/github.svg)](https://agentmods.dev/commands/watt-mind/factory/factory-garden)
Your own site
<a href="https://agentmods.dev/commands/watt-mind/factory/factory-garden"><img src="https://agentmods.dev/badge/commands/watt-mind/factory/factory-garden/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 factory-garden

Your own site · 80×15
<a href="https://agentmods.dev/commands/watt-mind/factory/factory-garden"><img src="https://agentmods.dev/badge/commands/watt-mind/factory/factory-garden.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,363 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.
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.00026 $0.02363
Opus 5.5 $0.00010 $0.00945
Sonnet 5.5 $0.00005 $0.00473
Haiku 4.5 $0.00003 $0.00236

Measured 14d ago against content hash 762f806d546b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

factory-garden 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 14d 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-garden.md · 105 lines

How it starts

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

Tend a repository like a garden: find anti-patterns that are actively spreading, remove bad exemplars at the source, and replace decaying prose warnings with deterministic checks whose error messages teach the root-cause fix.

Coding agents replicate whatever patterns already live in the tree. One unjustified eslint-disable, as any, setTimeout(..., 0) race bandaid, HACK workaround alibi, or bypassed adapter quickly becomes ten across subsequent PRs, while prose warnings in AGENTS.md go unread under context pressure.

The operator is AFK by default. Execute bounded gardening work to completion without pausing for mid-run confirmation prompts. Default target is the current repository (resolved from config/repos.yaml). Interpret $ARGUMENTS as an optional repo path or name, an area/glob filter, --since 14d (default window: 14d or the last 30 merged PRs), --report-only, --tickets-only, or an explicit direct-PR cap (default: at most 2 PRs per run).

1. Establish fresh baseline (read-only on main checkout)

Enforce the floor's Checkout freshness rule before reading a single file as evidence:

git fetch --quiet
git rev-list --count HEAD..origin/<base>
git rev-list --count origin/<base>..HEAD
git status --porcelain
  • Resolve <base> from config/repos.yaml (never @{upstream} or GitHub's default branch).
  • Fail closed if git fetch or git rev-list exits non-zero: report freshness as unknown and read origin/<base> directly rather than trusting the working tree.
  • Fast-forward (git pull --ff-only) only when the checkout is behind, not ahead, and clean. If dirty or ahead, leave the checkout untouched and inspect origin/<base> directly (git log origin/<base>, git grep <pattern> origin/<base>, git show origin/<base>:<path>).
  • Record origin/<base>@<sha> — every finding in your report and filed tickets must cite that ref. Never edit files inside the main checkout.

2. Survey for weeds (evidence over aesthetics)

Read the full file on GitHub · 105 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. 14d ago First seen · 105 lines · 26 tokens per session scan A 762f806d546b

Subscribe to this mod's changes

factory-garden is a command published in the GitHub repository watt-mind/factory (24 stars, last pushed today), licensed Apache-2.0. It adds 26 tokens to every session and 2,363 once invoked, about $0.0001 per session on Opus 5.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-11-16.

Related

factory-garden compared with commands from other repositories

factory-garden next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
factory-gardenwatt-mind/factoryCommand24todayApache-2.0A26Claude Code
code-review-swarmruvnet/rufloCommand83ktodayMITA0Claude Code
pr-managerruvnet/rufloCommand83ktodayMITA0Claude Code
self-healingruvnet/rufloCommand83ktodayMITA0Claude Code
code-reviewruvnet/rufloCommand83ktodayMITA0Claude Code
afrjayvee/aigonCommand271mo agoApache-2.0A21Claude Code
quality-reviewshawnclybor/clybor-claude-toolingCommand69d agoMITA29Claude Code