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.
npx agentmods add instructions/akopichin/afm/agents-mdgit clone --depth 1 https://github.com/akopichin/afmWrote 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.
[](https://agentmods.dev/instructions/akopichin/afm/agents-md)<a href="https://agentmods.dev/instructions/akopichin/afm/agents-md"><img src="https://agentmods.dev/badge/instructions/akopichin/afm/agents-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.22790 | $0.22790 |
| Opus 5 | $0.11395 | $0.11395 |
| Sonnet 5 | $0.04558 | $0.04558 |
| Haiku 4.5 | $0.02279 | $0.02279 |
Grade B, and why
afm AGENTS.md scanned grade B 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 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
# codex / ~/.codex/config.toml decides Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
Image requirements: `jq`, `curl` (both present in `Dockerfile.runtime`). How it starts
The opening of the file, as written. The whole thing — 644 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AFM Development Guide
Working directory: .afm and --dir
By default afm stores runs, flows, and config under .afm/ in the working directory. The parent directory is resolved in PersistentPreRunE (cmd/afm/main.go) with priority flag > env > .: the --dir persistent flag, else the AFM_DIR env variable, else the current directory. All subcommands read the effective .afm path via fmDir() (filepath.Join(rootDir, ".afm")); state.FindLatestRunDir(base, flowName) takes the runs base as an explicit argument instead of hardcoding the path.
Project root for agents: flow.root_dir. afm assumes the afm-root (the parent of .afm/) == the project root. When that isn't true (e.g. Docker: sources in /workspace, .afm/ in another directory), agents — inheriting the CWD of the afm process — resolve relative project paths (docs/arch/…) against the wrong root, and stages diverge: one writes a file, another can't find it. The root_dir field in flow.yaml (flow.Flow.RootDir) sets the agents' CWD: a relative path is resolved from the afm-root in cmd/afm/run.go, then threaded through orchestrator.Options.RootDir → executor.Config.Dir → cmd.Dir in executor.run. Empty → previous behavior (inherit CWD). AFM_STAGE_DIR (dialog files) stays anchored to the afm-root regardless of root_dir.
Attributing agent_action to a stage. Agent tool-action events get their stageID from the OnAction closure of the per-stage runner (runnerFor, runner_factory.go). The injected o.runner (tests, empty stageID) is used ONLY when opts.Runner != nil and the stage has no command of its own; in production every stage always gets a per-stage runner with the correct s.ID — otherwise the stage badge in the dashboard's event feed disappeared (EventFeedPanel.tsx renders the badge only when stageId is non-empty).
State persistence & run lifecycle (reliability core)
The event log .afm/runs/<run_id>/events.jsonl is the single trusted source of truth. state.json is a derived cache (it carries last_seq); read paths (afm check, run lookup) read state from the log via state.LoadRunState (no flock), not trusting the snapshot.
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.
- 3d ago First seen · 644 lines · 22,790 tokens per session scan B 13049241e054
afm AGENTS.md is an instructions file published in the GitHub repository akopichin/afm (11 stars, last pushed 6d ago), licensed MIT. It adds 22,790 tokens to every session, about $0.1140 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
next.js AGENTS.md
Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.