factory-ticket

A command for implementing exactly one already-claimed Linear ticket in its prepared worktree. Linear is a tool for tracking development tasks.

In plain words
What is it for?
Use it to implement the specified ticket and run its required verification commands in the assigned worktree.
Why use it?
It prevents the agent from taking another ticket, creating another worktree, or expanding beyond the ticket’s owned files.

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-ticket
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.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,537 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.00013 $0.01537
Opus 5 $0.00006 $0.00768
Sonnet 5 $0.00003 $0.00307
Haiku 4.5 $0.00001 $0.00154

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

Security

Grade A, and why

factory-ticket 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 3d 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-ticket.md · 58 lines

How it starts

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

Implement one ticket: $ARGUMENTS. You are already in its worktree, and the ticket is already claimed for you.

The dispatcher (orchestrator/tick.mjs) has done the setup: the ticket is In Progress, assigned, labelled ai:in-progress + agent:claude-code, and this worktree was created by the repo's own worktree-up.sh with its own branch, ports and database. Do not create another worktree, do not claim another ticket, and do not work anything except this one. This is the dispatched path, so it is always exactly one ticket — the protocol's human-requested ticket bundles (docs/protocol.md §6) never arrive here.

Do

  1. Read the ticket and restate your approach as a comment on it.

  2. Implement, touching only files matching its Owned Paths. Work discovered outside that set becomes a new Triage issue — never a widening of this one.

  3. Verify with the ticket's exact Verification Command and the repo's configured verify command, on the final tree. Run only those two worktree gates: do not run bun test or the repo's full suite as a PR-opening gate. The full suite is CI's job, and concurrent dispatched worktrees make it a load-induced flake source. Never proceed past failing output; never weaken a test to get green.

  4. UX critique after verification and before opening the PR when this introduces or materially changes a user-completable flow, interaction, state transition, error/recovery path, responsive layout, authentication, payment, onboarding, or destructive action. Spawn factory-ux-critic, fix in-scope FIX-FIRST findings, maximum 2 rounds, and file the rest to Triage. Skip it for isolated styling, copy-only edits, static content, icons/assets, and internal/admin-only surfaces unless the ticket identifies UX risk. State UX critique: required or UX critique: skipped — <reason> in the PR.

    The spawn prompt must carry the environment, spelled out — the subagent does not inherit your working directory, and sibling worktrees for other tickets exist right now:

    • worktree: <absolute path> — this worktree's root, written out in full. Never "the current directory".
    • How to launch and reach the app: dev server command and this worktree's port (not the repo default — worktree-up.sh assigned it a non-colliding one), or simulator target / electronAppPath, plus bin/dev-login.sh [role] where the repo has it.

    A returned VERDICT: BLOCKED - environment mismatch or unresponsive shell is a defect in your spawn prompt, not a UX finding: fix the missing or wrong path/launch details and re-spawn once. That re-spawn doesn't count against the 2-round limit — no review happened. If it blocks a second time, record UX critique: blocked — <what the environment did> and continue; do not keep re-spawning.

  5. Never sleep to wait for CI. For the pushed head SHA, select only the CI workflow with gh run list --workflow ci.yml --commit <sha> --json databaseId --limit 1, then wait with gh run watch <run-id> --exit-status --interval 60. The run can lag the push, so retry the workflow-selected lookup for up to about two minutes when it is empty; do not substitute another workflow's run. Before a merge, use gh api repos/<owner>/<repo>/commits/<sha>/check-runs to assert every check run completed green. Sleep-polling is blocked by the harness, and a blocked tool call kills the run. The same rule applies to any wait — poll a condition with a real command, never a fixed sleep.

  6. Push and open a PR against the configured base for this repo in config/repos.yaml, never GitHub's default branch: gh pr create --base <configured-base> --title "..." --body "Fixes <ISSUE-ID>" (append \n\nrun:$FACTORY_RUN_ID to the body when $FACTORY_RUN_ID is set, and omit it in interactive sessions when $FACTORY_RUN_ID is unset). Post the mandatory structured ## Handoff comment on the ticket before transitioning state:

    ## Handoff
    - PR: <url>
    - Verification: `<the ticket's exact command>` — pass, <one-line result summary>
    - UX critique: required — SHIP | required — FIX-FIRST resolved in <n> round(s) | required — NOT-ASSESSED, <what could not be driven> | blocked — <what the environment did> | skipped — <reason>
    - Files: <n> changed, all within Owned Paths   (or: exceptions listed with why)
    - Risks: <what the reviewer should look at first, or "none known">
    

Read the full file on GitHub · 58 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. 3d ago First seen · 58 lines · 13 tokens per session scan A 1547443c3833

Subscribe to this mod's changes

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