factorio-docs-mcp AGENTS.md

factorio-docs-mcp AGENTS.md is an instructions file for Codex, OpenCode from hjfmailbox/factorio-docs-mcp. It costs 1,130 tokens per session, scanned A, original, MIT.

Repository instructions for a Factorio documentation MCP server, a tool that helps developers search official Factorio mod documentation locally. It also compares documentation between game versions to help with mod upgrades.

In plain words
What is it for?
Use them when changing documentation synchronisation, version indexes, search, the MCP server, or migration support for Factorio mods.
Why use it?
They preserve the project’s architecture and recovery process when coding work is interrupted. They also clarify which layer handles downloading, indexing, or searching documentation.

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/hjfmailbox/factorio-docs-mcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/hjfmailbox/factorio-docs-mcp

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 factorio-docs-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/hjfmailbox/factorio-docs-mcp/agents-md.svg)](https://agentmods.dev/instructions/hjfmailbox/factorio-docs-mcp/agents-md)
Your own site
<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>
Per session 1,130 This file is loaded in full into every session.
When invoked 1,130 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.01130 $0.01130
Opus 5 $0.00565 $0.00565
Sonnet 5 $0.00226 $0.00226
Haiku 4.5 $0.00113 $0.00113

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

Security

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.

AGENTS.md · 62 lines

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

上下文/进度恢复(上下文丢失时必读)

当会话上下文被压缩或清空、或你对自己此前的执行状态没有记忆时,不要凭记忆猜测进度,按以下顺序恢复:

  1. 读进度台账 docs/superpowers/PROGRESS.md——任务状态表、决策记录、断点都在里面(唯一事实源)。
  2. 对照 git log 验证台账记载的上个提交真实存在,防止台账与实际脱节。
  3. 读当前任务的计划 docs/superpowers/plans/2026-07-29-factorio-docs-mcp.md规格 docs/superpowers/specs/2026-07-29-factorio-docs-mcp-design.md
  4. 从台账标记的第一个未完成任务继续,绝不重复已完成任务

每次完成一个任务,必须同步更新 PROGRESS.md 并随代码提交,保证任何时刻都能从 git 恢复断点。

架构约束(必须遵守)

  • 三层边界sync/ 只写 raw/index/ 只读写 index.dbmcp/ 只读 index.db。数据流向单向,禁止各层的数据处理逻辑跨层耦合(如 mcp 层读取 raw 文件并解析、sync 的下载逻辑直接拼 SQL 写库)。
  • 组合根例外:编排入口(sync/orchestrate.tscli.tsmcp.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 或平台用户数据目录解析,禁止硬编码路径。

Read the full file on GitHub · 62 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 · 62 lines · 1,130 tokens per session scan A 253efd04cf70

Subscribe to this mod's changes

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.

Related

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

microsoft/vscode · 6,785 tokens

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.

github/spec-kit · 7,104 tokens

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.

openai/codex · 5,182 tokens

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.

langchain-ai/langchain · 4,345 tokens

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

microsoft/vscode · 5,001 tokens

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.

vercel/next.js · 7,296 tokens