tdd-mcp-server: Instructions file for Codex

AGENTS.md

tdd-mcp-server AGENTS.md is an instructions file for Codex, OpenCode from laonayan/tdd-mcp-server. It costs 1,660 tokens per session, scanned A, original, MIT.

Repository instructions for an AI coding agent working on a TypeScript server that supports test-driven development (TDD), a method of writing tests before implementation.

In plain words
What is it for?
Following the repository's OpenSpec change process, running tests, linting, builds, integration checks, and observing execution limits.
Why use it?
They give the agent a required development process, checks to run before commits, and safeguards against unbounded memory use during commands.

Instructions file for CodexOpenCode

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

This is laonayan/tdd-mcp-server's own configuration. It tells Codex and OpenCode how to work on tdd-mcp-server 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 tdd-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to laonayan/tdd-mcp-server. 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/laonayan/tdd-mcp-server/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/laonayan/tdd-mcp-server

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 tdd-mcp-server AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/laonayan/tdd-mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/laonayan/tdd-mcp-server/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,660 This file is loaded in full into every session.
When invoked 1,660 The same file — it is already loaded in full.
Security scan A 1 finding. 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.01660 $0.01660
Opus 5.5 $0.00664 $0.00664
Sonnet 5.5 $0.00332 $0.00332
Haiku 4.5 $0.00166 $0.00166

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

Security

Grade A, and why

tdd-mcp-server AGENTS.md scanned grade A with 1 finding 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 today.

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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **端口与适配器**:`src/core/ports.ts` 定义 `CommandExecutor` 与存储仓储接口;`src/adapters/` 提供 `GuardedCommandExecutor`(**唯一 spawn 网关**,`child_process` 只允许出现在 adapters 与 execution-guard,架构守卫测试锁定)与 `InMemoryStorage`(测试 fake)
AGENTS.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — AI 编码代理工作指引

本仓库是 tdd-mcp-server:为 AI 编程助手提供 TDD 工作流支持的 MCP 服务器(TypeScript, ESM, MCP SDK 1.x)。任何 AI 代理在此仓库工作前请先读本文件。

开发流程(OpenSpec)

本仓库使用 OpenSpec 管理变更,目录在 openspec/:

openspec list                          # 查看进行中的变更
openspec validate --all                # 机器校验 specs 与 changes(质量门之一)

若本机无 openspec 命令:真包是 @fission-ai/openspec(npm 上的 openspec 是无关占位包),可用 pnpm dlx @fission-ai/openspec <cmd> 运行。

流程:/opsx:explore(探索)→ /opsx:propose(提案:proposal/specs/design/tasks 四件套)→ /opsx:apply(逐任务实施,按功能分步提交)→ /opsx:archive(规格合入 openspec/specs/,变更移入 openspec/changes/archive/)。

  • 任何非平凡改动都必须走 openspec 变更流程;规格用中文书写,结构标题与 SHALL 关键词保持英文
  • 归档时把 delta 合入主规格(openspec/specs/mcp-server/spec.md),保持 Requirement 必须至少有一个 #### Scenario:

质量门(每次提交前全部通过)

npm test                    # 单元测试(当前 202 个)
npm run lint                # ESLint 9(0 error;存量 warning 为已记录技术债)
npm run build               # tsc,零错误
./integration-test.sh       # 9 个 stdio 集成场景(需本机 npm 与 node)
openspec validate --all     # 规格校验

CI(GitHub Actions)在 Node 20/24 上执行 build + test + lint。

运行安全:内存限制(强制)

任何需要运行的操作,必须在启动时设置内存限制——禁止无上限占用内存导致整台设备假死。本仓库曾因递归 spawn 测试进程发生过整机冻结事故(每层按 worker 数派生进程,进程树指数膨胀),见 src/services/execution-guard.ts 背景注释与 src/services/__tests__/nested-execution-guard.test.ts 回归用例。

  • npm test 已默认限内存(node --max-old-space-size=2048 ... --maxWorkers=2 --workerIdleMemoryLimit=512MB),直接使用即可
  • 直接调用 node 工具链时必须显式带上限,例如:
    • node --max-old-space-size=2048 node_modules/jest/bin/jest.js --maxWorkers=2 --workerIdleMemoryLimit=512MB
    • node --max-old-space-size=1536 node_modules/typescript/bin/tsc
    • node --max-old-space-size=1536 node_modules/eslint/bin/eslint.js src
  • 运行 integration-test.sh 或任何会派生子进程的脚本前,先 export NODE_OPTIONS="--max-old-space-size=1536",让整棵子进程树的每个 node 进程都被封顶;宁可单进程 OOM 快速失败,也不拖垮整机
  • 服务代码派生测试/覆盖率子进程必须统一走 src/services/execution-guard.ts:注入 TDD_MCP_NESTED_RUN 嵌套标记 + NODE_OPTIONS=--max-old-space-size=<MB>(默认 1024,可用 TDD_MCP_CHILD_MEMORY_LIMIT_MB 覆盖),并在 spawn 前用 isNestedExecution() 拒绝嵌套执行——新增任何 spawn 点都必须接入该守卫
  • 后台运行测试/构建时同样适用上述规则;用管道接 tail 会掩盖真实退出码,判断成败以 $? 或 PIPESTATUS 为准

Read the full file on GitHub · 73 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. today Changed · +5 lines · +282 tokens per session a9c56b5f6f55
  2. 4d ago First seen · 68 lines · 1,378 tokens per session scan A 74d93814dd7a

Subscribe to this mod's changes

tdd-mcp-server AGENTS.md is an instructions file published in the GitHub repository laonayan/tdd-mcp-server (2 stars, last pushed yesterday), licensed MIT. It adds 1,660 tokens to every session, about $0.0066 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-12.

Related

tdd-mcp-server AGENTS.md compared with instructions from other repositories

tdd-mcp-server AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tdd-mcp-server AGENTS.mdlaonayan/tdd-mcp-serverInstructions file2yesterdayMITA1,660Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,086GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file282k3d agoMITA4,335Codex, OpenCode