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.
curl -O https://raw.githubusercontent.com/WW-AI-Lab/any2markdown/main/AGENTS.mdgit clone --depth 1 https://github.com/WW-AI-Lab/any2markdownWrote 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/ww-ai-lab/any2markdown/agents-md)<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.
<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>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.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 |
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.
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.mddocs/*.md对应专题文档openspec/project.md(项目约定变更)
- 涉及新增能力、破坏性变更、架构级调整时,先按
openspec/AGENTS.md走 proposal 流程,再实现代码。
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.
- 2mo ago First seen · 66 lines · 829 tokens per session scan A e58d0e46c78e
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.
any2markdown AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| any2markdown AGENTS.mdWW-AI-Lab/any2markdown | Instructions file | 52 | 9mo ago | MIT | A | 829 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| vscode model-prompts.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 2,022 | GitHub Copilot |