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/hjfmailbox/factorio-docs-mcp/agents-mdgit clone --depth 1 https://github.com/hjfmailbox/factorio-docs-mcpWrote 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/hjfmailbox/factorio-docs-mcp/agents-md)<a href="https://agentmods.dev/instructions/hjfmailbox/factorio-docs-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/hjfmailbox/factorio-docs-mcp/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.01130 | $0.01130 |
| Opus 5 | $0.00565 | $0.00565 |
| Sonnet 5 | $0.00226 | $0.00226 |
| Haiku 4.5 | $0.00113 | $0.00113 |
Grade A, and why
factorio-docs-mcp 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 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.
How it starts
The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — Factorio Docs MCP
本文件是本项目对 AI 编码助手约束与指南的唯一事实源。CLAUDE.md 仅通过 @AGENTS.md 引用本文件,禁止在两处重复维护。
项目概述
同步 Factorio 官方 mod API 文档到本地,并通过 MCP server 辅助 mod 开发与跨大版本升级迁移。能力范围:检索 + 版本对比(不做 mod 源码扫描)。
设计文档:docs/superpowers/specs/2026-07-29-factorio-docs-mcp-design.md
上下文/进度恢复(上下文丢失时必读)
当会话上下文被压缩或清空、或你对自己此前的执行状态没有记忆时,不要凭记忆猜测进度,按以下顺序恢复:
- 读进度台账
docs/superpowers/PROGRESS.md——任务状态表、决策记录、断点都在里面(唯一事实源)。 - 对照
git log验证台账记载的上个提交真实存在,防止台账与实际脱节。 - 读当前任务的计划
docs/superpowers/plans/2026-07-29-factorio-docs-mcp.md与规格docs/superpowers/specs/2026-07-29-factorio-docs-mcp-design.md。 - 从台账标记的第一个未完成任务继续,绝不重复已完成任务。
每次完成一个任务,必须同步更新 PROGRESS.md 并随代码提交,保证任何时刻都能从 git 恢复断点。
架构约束(必须遵守)
- 三层边界:
sync/只写raw/;index/只读写index.db;mcp/只读index.db。数据流向单向,禁止各层的数据处理逻辑跨层耦合(如 mcp 层读取 raw 文件并解析、sync 的下载逻辑直接拼 SQL 写库)。 - 组合根例外:编排入口(
sync/orchestrate.ts、cli.ts、mcp.ts)是组合根,允许为「串联三层」而调用各层的公开接口(如编排器调用buildVersion建索引)。但组合根只负责编排,不得在其中新增属于某一层的具体数据处理逻辑(如下载细节、SQL、解析规则)。 - 检索接口:所有检索必须经过
SearchProvider接口,禁止在 MCP 工具内直接写 SQL。 - 数据保真:
api_entries.data列必须原样存储官方 JSON 子树,禁止裁剪字段。
已知技术债 / 重构提醒
- 编排逻辑当前寄生于
sync/orchestrate.ts:它作为组合根同时调用 sync 下载与 index 建库,功能正确但归属不纯粹。当未来编排逻辑变复杂时(如增加并发同步、断点续传、多阶段流水线、更细的失败恢复),应将其重构到中立位置(如src/app/),使sync/回归「只写 raw/」的字面纯粹。 目前按 YAGNI 暂不重构。
数据源纪律
- 仅使用官方数据源:
lua-api.factorio.com(runtime/prototype JSON + archive.zip)、wube/factorio-data(含 changelog.txt)。 - 禁止引入社区/第三方数据作为 API 事实来源。
- 同步必须增量:已有版本数据只增不改;单版本失败不得影响其他版本。
语言与交互
- 与用户交互使用中文(专业名词、代码标识符除外)。
- 代码注释使用中文,遵循周边代码风格。
操作规则
- 修改任何文件之前,必须先 READ 该文件。 禁止在未读取文件的情况下直接执行 Edit 或 Write(即使全局配置已有此规则,此处重复以确保生效)。
测试要求
- 测试框架:Vitest。
- 新功能先写测试再实现(TDD)。
- L3 迁移知识的 breaking 判定规则变更时,必须同步更新召回测试 fixture。
- 运行测试:
npm test;类型检查:npm run typecheck; lint:npm run lint。
工程约定
- Node.js ≥ 22(依赖内置
node:sqlite),TS 严格模式 + ESM。 - 构建:
tsup(单包双 bin:fdocs/fdocs-mcp)。 - Lint/Format:Biome,提交前必须通过。
- 数据目录由
FACTORIO_DOCS_DATA或平台用户数据目录解析,禁止硬编码路径。
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 · 62 lines · 1,130 tokens per session scan A 253efd04cf70
factorio-docs-mcp AGENTS.md is an instructions file published in the GitHub repository hjfmailbox/factorio-docs-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 1,130 tokens to every session, about $0.0056 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.
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.