Agentsfile

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Oct 28, 2026

Validate AGENTS.md and CLAUDE.md against repo reality: paths, scripts, and commands checked.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

對照儲存庫本身檢查 AGENTS.md 或 CLAUDE.md,標出失效的路徑引用與未定義的 npm、yarn、pnpm 指令碼。

可以做什麼
  • 檢查代理說明檔:對儲存庫根目錄或單一 AGENTS.md/CLAUDE.md 檔案執行一次檢查,得到 VALID、DRIFT 或 MISSING 結論。
  • 核對路徑引用:把反引號中看似相對路徑的片段與實際檔案樹比對。
  • 核對指令碼引用:把提到的 npm、yarn、pnpm 指令碼與 package.json 中的 scripts 比對。
  • 讀取結果:每項問題都附檔案、行號、原文引用與嚴重程度,輸出排序固定、可重現。
適用情境
適合儲存庫依賴 AGENTS.md 或 CLAUDE.md 指引編碼代理,而你想在目錄改名、指令碼刪除或檔案只是空殼之後,發現說明與儲存庫脫節的情況。也適合當作提交前或 CI 式的快速檢查。
執行需求
以本機 stdio 程序執行,可透過 npx 使用 npm 套件,或使用 Docker 映像。不需要憑證、API 金鑰或網路存取,也不會執行目標儲存庫中的任何內容。目標須為儲存庫目錄或單一代理說明檔。
安裝前請注意
唯讀且離線,但檢查僅限存在性:存在的路徑不驗證是否為正確的檔案,存在的指令碼也不驗證是否做到說明所稱的事。路徑辨識是啟發式的,特殊檔名可能漏檢,看似路徑的異常片段可能誤報。只讀取根目錄的 AGENTS.md 和 CLAUDE.md,且只檢查反引號路徑與 npm、yarn、pnpm 指令碼樣式。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agentsfile,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

agentsfile

Agent instruction files rot quietly. This checks them against the repo they describe.

AGENTS.md and CLAUDE.md tell coding agents how a repo works: which files matter, which commands to run, how the project is laid out. Repos move faster than their instruction files. A renamed directory, a deleted script, a guide that was never more than a stub, and the agent following the file wastes its run or invents what the file got wrong. Nothing fails loudly, because nothing ever checked the file against the repo.

agentsfile does that check. It reads the AGENTS.md and CLAUDE.md at a repo root, extracts the backticked paths and the npm, yarn, and pnpm script references, and verifies each one against the actual file tree and the actual package.json. Every finding carries the file, the line, and the exact text it came from. The output is deterministic: sorted findings, no timestamps, the same repo always producing the same report.

What it checks

ruleseveritywhat it means
NO-FILEhighNeither AGENTS.md nor CLAUDE.md exists at the repo root.
PATH-MISSINGmediumA backticked span that looks like a relative path does not exist in the repo, as a file or as a directory.
SCRIPT-MISSINGmediumA referenced script (npm run <name>, npm test, yarn <name>, pnpm <name> and friends) is not defined in package.json scripts.
STUBlowAn agent file exists but is empty or under 5 lines long.
NO-PACKAGE-JSONinfoThere is no package.json at the repo root (or it does not parse), so script references were not checked.

Verdict rules:

  • VALID: no medium or high findings. Low and info findings can be present. Exit code 0.
  • DRIFT: at least one medium or high finding. The agent files disagree with the repo. Exit code 1.
  • MISSING: neither AGENTS.md nor CLAUDE.md exists at the repo root. Exit code 1.
  • Usage errors exit with code 2. A reader that closes the output pipe early makes the process exit 141, never 0.

Script reference details: npm run <name> checks <name> directly. The conventional shorthands npm test and npm start (plus stop and restart) map to the script of the same name. For yarn and pnpm, <manager> <name> and <manager> run <name> check <name>, and the package managers' own builtin subcommands (install, add, publish, and friends) are never treated as scripts.

Usage

CLI

bash
# Check the current reponpx @reneturcios/agentsfile check
# Check another repo, machine readablenpx @reneturcios/agentsfile check ~/src/my-repo --json
# Print the versionnpx @reneturcios/agentsfile --version

Example output:

text
agentsfile check .: DRIFT  files: 2, findings: 2 (high: 0, medium: 2, low: 0, info: 0)  summary: 2 agent file(s) checked; 2 finding(s): 0 high, 2 medium, 0 low, 0 info. Verdict: DRIFT.
AGENTS.md:  [MEDIUM] line 4 PATH-MISSING `src/gone.ts` Referenced path does not exist in the repo: src/gone.ts  [MEDIUM] line 5 SCRIPT-MISSING `npm run deploy` Script referenced but not defined in package.json scripts: deploy
DRIFT: at least one medium or high finding; the agent files disagree with the repo.

With --json the full report is printed as JSON: tool, version, target, verdict, counts (files, findings, and per-severity totals), the findings array, and a one-line summary. Checking needs no credentials and no network, and nothing in the target repo is executed.

The target may also be a single agent instruction file instead of a directory; its own directory is then treated as the repo root and only that file is checked.

MCP server

bash
npx @reneturcios/agentsfile mcp

Add to your MCP client config:

json
{  "mcpServers": {    "agentsfile": {      "command": "npx",      "args": ["-y", "@reneturcios/agentsfile", "mcp"]    }  }}

Tool: check_agents_file(path) returns the full check report for the repo (or single file) at path, as JSON.

Limits, stated plainly

  • Only AGENTS.md and CLAUDE.md at the repo root are read. Nested agent files in subdirectories are not checked in this version.
  • Only two kinds of reference are checked: backticked spans, and npm, yarn, and pnpm script patterns. Commands shown in fenced code blocks are found by the script patterns, but paths in fenced blocks without backticks are not checked, and neither are links, prose mentions, or commands from other toolchains (make, cargo, go, and so on).
  • Path detection is a heuristic, stated honestly: a backticked span counts as a path if it has no spaces, does not start with http, and either contains a slash or ends in a dotted segment that looks like a file extension from a known list (plus a small set of known dotfiles such as .env). Tokens containing characters such as @, :, *, =, or quotes are never treated as paths, so scoped package names and action references are not flagged. The flip side is real: an unusual file name can be missed, and an odd token that happens to look like a path can be flagged. Findings always quote the exact span so a human can judge in one glance.
  • The check is existence only. A path that exists is not checked for being the right file, and a script that exists is not checked for doing what the guide claims it does.
  • The stub rule is a line count (under 5 lines), not a quality judgment. A short file that is genuinely complete will still be reported at low severity, which never changes the verdict on its own.

來源:README.md,提交 1c596b5

工具

1

check_agents_file

Validate a repo's AGENTS.md and CLAUDE.md (or a single agent instruction file) against the repo itself: backticked paths that do not exist, npm scripts named in the file that package.json does not define, and commands referenced that have no matching bin or script. Verdict VALID, DRIFT, or MISSING with file and line evidence.

輸入參數path必填

版本歷史

1
  1. v0.1.0最新Oct 25, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分