factory: Instructions file for Codex

AGENTS.md

factory AGENTS.md is an instructions file for Codex, OpenCode from watt-mind/factory. It costs 9,240 tokens per session, scanned C, original, Apache-2.0.

Repository instructions for Factory, including its development commands and rules for how coding agents receive and handle work. They also cover handoffs, protected branches, and merging.

In plain words
What is it for?
Use them when choosing a task, changing event-runtime code, running checks, handing off work, or preparing changes for review.
Why use it?
They reduce mistakes such as taking unassigned work, skipping required project conventions, or merging changes automatically.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions subagents.

This is watt-mind/factory's own configuration. It tells Codex and OpenCode how to work on factory itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything factory configures →

Reuse

Borrowing it

Nothing to install: this file belongs to watt-mind/factory. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/watt-mind/factory/develop/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/watt-mind/factory

Made for: Codex, OpenCode.

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 AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/watt-mind/factory/agents-md"><img src="https://agentmods.dev/badge/instructions/watt-mind/factory/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9,240 This file is loaded in full into every session.
When invoked 9,240 The same file — it is already loaded in full.
Security scan C 2 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.09240 $0.09240
Opus 5.5 $0.03696 $0.03696
Sonnet 5.5 $0.01848 $0.01848
Haiku 4.5 $0.00924 $0.00924

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

Security

Grade C, and why

factory AGENTS.md scanned grade C with 2 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

The file watcher is the bounded readiness gate; never replace it with a fixed sleep. Attach the fallback driver using `$profile/DevToolsActivePort`. If readiness or attachment fails, preserve the exact error and the last

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

for i in $(seq 60); do curl -sf localhost:4222 >/dev/null && break; sleep 2; done
AGENTS.md · 314 lines

How it starts

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

Commands

  • bun run lint — ESLint over root JS and event-runtime/web TSX (bun run lint:fix to autofix). CI runs it with a --max-warnings ratchet (WM-607); see docs/ci.md.
  • bun test --timeout 20000 --max-concurrency=4 event-runtime/lib — fast unit tests.
  • bun run check — generated-tree drift check (shared/ vs. emitted output).

Agent operating floor

Non-negotiable for every agent in this repo, in any harness. Full protocol: $FACTORY_ROOT/docs/protocol.md. If that path doesn't exist where you're running (a cloud sandbox, someone else's machine), this block is the whole contract — follow it as written and don't infer the rest.

Event-runtime code follows the documented house conventions. For module shape, dependency injection, adapter contracts, fail-closed boundaries, and tests, read docs/event-runtime-conventions.md before changing event-runtime/.

The operator is AFK by default. Assume no human will read your session output for hours; never pause mid-run for routine confirmation when a safe, reversible, evidence-backed default exists — decide, act, and record what you chose. Distinguish autonomous default from explicit interactive override (a direct human instruction in chat such as "no ticket", an explicit bundle request, or passing --include-escalated). Resolve technical, architectural, and edge-case ambiguities within Owned Paths from origin/<base> conventions, sibling modules, git history, tests, and docs/product-decisions.md, noting non-obvious reversible assumptions in your ticket comment and ## Handoff (Risks).

Read the full file on GitHub · 314 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 Changed · +2 lines · +206 tokens per session 98286032bfd5
  2. 7d ago Changed · +4 lines · +361 tokens per session d8aa1392fe67
  3. 15d ago Changed · +6 lines · +355 tokens per session 1dc8ac1bacf4
  4. 16d ago Changed · +25 lines · +1,520 tokens per session c9c45b27cd6e
  5. 2mo ago Changed · +7 lines · +248 tokens per session 1e5ab659e2cf
  6. 3mo ago First seen · 270 lines · 6,550 tokens per session scan C 52a9f9313f63

Subscribe to this mod's changes

factory AGENTS.md is an instructions file published in the GitHub repository watt-mind/factory (24 stars, last pushed 3d ago), licensed Apache-2.0. It adds 9,240 tokens to every session, about $0.0370 per session on Opus 5.5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

factory AGENTS.md compared with instructions from other repositories

factory AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
factory AGENTS.mdwatt-mind/factoryInstructions file243d agoApache-2.0C9,240Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150kyesterdayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,303GitHub Copilot
deno copilot-instructions.mddenoland/denoInstructions file109kyesterdayMITA3,077GitHub Copilot