factory

A command that checks an issue tracker for a ticket a person has authorized, claims one ticket, and sends it to the appropriate workflow.

In plain words
What is it for?
Use it to route raw tickets to specification, backlog grooming, bug investigation, or implementation of an already approved specification.
Why use it?
It provides a human-triggered way to process queued work without a background service and does not build or merge changes itself.

Command

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/prabhdeepsingh/claude-plugins/factory
Clone the repo
git clone --depth 1 https://github.com/PrabhdeepSingh/claude-plugins
Per session 108 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 14,179 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.00108 $0.14179
Opus 5 $0.00054 $0.07089
Sonnet 5 $0.00022 $0.02836
Haiku 4.5 $0.00011 $0.01418

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

Security

Grade A, and why

factory 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 2d 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.

sonu/commands/factory.md · 392 lines

How it starts

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

/factory — the queue frontend

Contract: this command is the human-triggered replacement for a polling daemon. It resolves the tracker, shows what is authorized, claims one ticket, and hands it to the workflow that owns that stage. It contains no build phases of its own — implementation is /sonu:build, review is the skills build already runs, and merging is /sonu:ship. It never applies a trigger, and it merges only by delegation: the ship route (Phase 6) hands a human-authorized ticket to /sonu:ship, where the human's factory-ready-to-ship trigger is the merge authorization. Outside that route, it never merges.

Two front doors reach the same build engine. Describe work in chat and /sonu:build runs its own design gate. Route work through a ticket and this command claims it, then invokes that same /sonu:build — with the design gate already satisfied by the human-approved spec.

Apply this to $ARGUMENTS — the text typed after the command. If that token appears literally or is empty, run the default pass in Phase 3.

Shell discipline — every Bash call is a fresh shell. No variable survives between snippets. Each fence below declares what it uses; substitute literal values where a snippet says to. Never drop a leading declaration because "it was set earlier" — it was not, and an empty variable here fails silently: an empty ticket id turns a claim into a no-op that reads as success.


Phase 0 — Resolve the tracker

Load Skill(sonu:ticket-lifecycle) and resolve the configured tracker from .sonu/factory-config.md, falling back to ~/.sonu/factory-config.md. Read only the resolved tracker's adapter.

CONFIG=""
if [ -f .sonu/factory-config.md ]; then CONFIG=".sonu/factory-config.md"
elif [ -f "$HOME/.sonu/factory-config.md" ]; then CONFIG="$HOME/.sonu/factory-config.md"
fi
# Three outcomes, never two — a config that exists but cannot be read must NOT
# report "no config" (that message sends the user to re-init a file they have).
if [ -z "$CONFIG" ]; then
  echo "STOP: no factory config — run /sonu:factory init"
elif [ -s "$CONFIG" ] && sed -n '2,/^---$/p' "$CONFIG"; then
  echo "config: $CONFIG"
else
  echo "STOP: config exists at $CONFIG but is empty or could not be read — fix it before running a pass"
fi

Read the full file on GitHub · 392 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. 2d ago First seen · 392 lines · 108 tokens per session scan A a73dbbf605a0

Subscribe to this mod's changes

factory is a command published in the GitHub repository PrabhdeepSingh/claude-plugins (3 stars, last pushed 2d ago), licensed MIT. It adds 108 tokens to every session and 14,179 once invoked, about $0.0005 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.