model-based-agentic-software-engineering AGENTS.md

A set of working instructions for using multiple coding agents to edit a book safely in parallel. It explains how to coordinate separate work areas, combine changes, and handle automatically generated files.

In plain words
What is it for?
Use it when making large editorial changes across a book repository with several agents. It covers parallel drafting, combining edits from separate work areas, checking source files, and cleanup.
Why use it?
It prevents agents from overwriting each other or conflicting over generated website files. It also avoids unreliable manual merges when many files are rebuilt.

Instructions file for CodexOpenCode

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 instructions/davisjam/model-based-agentic-software-engineering/agents-md
Clone the repo
git clone --depth 1 https://github.com/davisjam/model-based-agentic-software-engineering

Made for: Codex, OpenCode.

Per session 2,202 This file is loaded in full into every session.
When invoked 2,202 The same file — it is already loaded in full.
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.02202 $0.02202
Opus 5 $0.01101 $0.01101
Sonnet 5 $0.00440 $0.00440
Haiku 4.5 $0.00220 $0.00220

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

Security

Grade A, and why

model-based-agentic-software-engineering AGENTS.md 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 yesterday.

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.

AGENTS.md · 144 lines

How it starts

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

AGENTS.md — running editorial folds on the MAGE book with a fleet

This file is the operational playbook for making large editorial changes to the book (book/) with dispatched agents. It extends CLAUDE.md §"Working on this repo with a fleet" (single-live-writer + parallel drafting), which you should read first. Where CLAUDE.md states the rules, this file gives the worked process — the one that lands a multi-part copyedit pass in one sitting without serializing on main and without a merge that fights 100 generated files.

The method has four patterns. Use them together: draft in parallel → fold in parallel worktrees → merge by source-checkout → resolve the model layer once at the end.


0. The one fact everything follows from

main has a single-live-writer rule for exactly one reason: the pre-commit hook rebuilds the site and force-stages the regenerated .html + derived book-models/* on every commit, so two agents committing to the same branch collide on those generated files. Everything else about the book is deterministic from source. That single fact is what makes the patterns below safe:

  • Two folds on separate worktree branches never collide (separate git indexes).
  • Two folds touching disjoint source trees (different Parts / the appendices) never conflict on content — only on regenerated files, which you never merge, you rebuild.
  • A PDF renders from the working tree, not from HEAD — so you can build a review PDF from staged-but-uncommitted source.

1. Pattern — disjoint-worktree parallel folds

When several folds touch disjoint source trees (e.g. Part II prose, Part III prose, appendices), run them concurrently in separate git worktrees instead of serially on main.

Setup, per fold:

  1. git worktree add -b <fold>-fold <path> HEAD (branch from current main; put <path> in a scratch dir).
  2. Copy the drafts into the worktree. book/_design/drafts/ is gitignored, so a fresh worktree checkout does not contain the EDIT-MAP or the authored figures. Without this the agent has nothing to fold: cp -r book/_design/drafts/<effort>-<date> <worktree>/book/_design/drafts/ (they stay untracked in the worktree — the hook never stages them).
  3. Dispatch the fold agent with its CWD = the worktree and a brief that says: you are on branch <fold>-fold, confirm with git branch --show-current, do NOT touch main, other folds run concurrently on disjoint trees — ignore them.

Read the full file on GitHub · 144 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. yesterday First seen · 144 lines · 2,202 tokens per session scan A dafbd893dd27

Subscribe to this mod's changes

model-based-agentic-software-engineering AGENTS.md is an instructions file published in the GitHub repository davisjam/model-based-agentic-software-engineering (18 stars, last pushed yesterday), licensed MIT. It adds 2,202 tokens to every session, about $0.0110 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-30.