any2markdown: Instructions file for Codex

AGENTS.md

any2markdown AGENTS.md is an instructions file for Codex, OpenCode from WW-AI-Lab/any2markdown. It costs 829 tokens per session, scanned A, original, MIT.

Repository instructions for any2markdown, a service that converts PDF, Word, and Excel files into Markdown through MCP tools or a web API. MCP is a standard way for AI assistants to call tools.

In plain words
What is it for?
Building, testing, and extending file conversion, image extraction, document checks, batch processing, and basic document structure analysis.
Why use it?
They explain the project layout, required Python version, and rules for changing the document-conversion service.

Instructions file for CodexOpenCode

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

This is WW-AI-Lab/any2markdown's own configuration. It tells Codex and OpenCode how to work on any2markdown 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 any2markdown configures →

Reuse

Borrowing it

Nothing to install: this file belongs to WW-AI-Lab/any2markdown. 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/WW-AI-Lab/any2markdown/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/WW-AI-Lab/any2markdown

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ww-ai-lab/any2markdown/agents-md"><img src="https://agentmods.dev/badge/instructions/ww-ai-lab/any2markdown/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 829 This file is loaded in full into every session.
When invoked 829 The same file — it is already loaded in full.
Security scan A 0 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.00829 $0.00829
Opus 5.5 $0.00332 $0.00332
Sonnet 5.5 $0.00166 $0.00166
Haiku 4.5 $0.00083 $0.00083

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

Security

Grade A, and why

any2markdown 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 2mo 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 · 66 lines

What it actually says

OpenSpec Instructions

These instructions are for AI assistants working in this project.

Always open @/openspec/AGENTS.md when the request:

  • Mentions planning or proposals (words like proposal, spec, change, plan)
  • Introduces new capabilities, breaking changes, architecture shifts, or big performance/security work
  • Sounds ambiguous and you need the authoritative spec before coding

Use @/openspec/AGENTS.md to learn:

  • How to create and apply change proposals
  • Spec format and conventions
  • Project structure and guidelines

Keep this managed block so 'openspec update' can refresh the instructions.

项目定位与目标

any2markdown 是一个文档转 Markdown 服务,当前实现目标是:

  • 同时提供 MCP 与 RESTful API 两种调用方式;
  • 支持 PDF、Word(docx/doc)、Excel(xlsx/xls) 转换;
  • 提供图片提取、文档校验、批量转换、基础结构分析能力;
  • 统一由 src/any2markdown_mcp/ 下处理器与工具层实现核心逻辑。

代码结构速览

  • src/any2markdown_mcp/server.py:FastMCP 入口,注册 MCP 工具与 REST 路由。
  • src/any2markdown_mcp/tools/:MCP 工具函数层(参数协议、响应组装)。
  • src/any2markdown_mcp/processors/:文档处理核心逻辑(PDF/Word/Excel)。
  • src/any2markdown_mcp/api/:REST API Handler 与请求/响应模型。
  • src/any2markdown_mcp/config.py:环境变量与默认配置。

代码规范与工程约束

Python 与风格

  • Python 版本基线:>=3.10,<3.14(推荐 3.13,见 pyproject.toml)。
  • 行宽按 88 字符控制(Black/isort 配置已定义)。
  • 新增或修改函数优先补全类型注解,保持 mypy 严格配置兼容。
  • 保持异步接口一致性:工具与处理链路使用 async。

功能与接口约束

  • 输入文件类型受 allowed_file_types 限制:pdf/docx/doc/xlsx/xls。
  • 默认最大文件大小:100MB(max_file_size)。
  • 默认服务端口:3000,MCP 路径:/mcp,REST 前缀:/api/v1。
  • 转换接口默认 include_content=false,避免在响应中返回大文本正文。

资源与运行约束

  • 首次 PDF 能力使用可能触发模型下载,依赖 ~/.cache/marker 与 HuggingFace/Torch 缓存目录。
  • 项目当前文档中存在“规划态”和“实现态”混合内容;修改功能时应同步更新文档,避免与实际代码偏离。
  • 仓库当前未包含 tests/ 目录;如新增测试需与现有 pytest 配置保持一致。

修改原则(给协作代理)

  • 优先做“最小可验证改动”,避免无关重构。
  • 变更接口或配置项时,至少同步更新以下文档之一:
    • README.md
    • docs/*.md 对应专题文档
    • openspec/project.md(项目约定变更)
  • 涉及新增能力、破坏性变更、架构级调整时,先按 openspec/AGENTS.md 走 proposal 流程,再实现代码。
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. 2mo ago First seen · 66 lines · 829 tokens per session scan A e58d0e46c78e

Subscribe to this mod's changes

any2markdown AGENTS.md is an instructions file published in the GitHub repository WW-AI-Lab/any2markdown (52 stars, last pushed 9mo ago), licensed MIT. It adds 829 tokens to every session, about $0.0033 per session on Opus 5.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.

Related

any2markdown AGENTS.md compared with instructions from other repositories

any2markdown AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
any2markdown AGENTS.mdWW-AI-Lab/any2markdownInstructions file529mo agoMITA829Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot