prd-check

A read-only command that checks whether docs/PRD.md, a product requirements document, follows required structure and formatting rules.

In plain words
What is it for?
Running a PASS/FAIL review of a PRD and listing the exact issues to fix.
Why use it?
It finds missing sections and unfinished placeholders before development starts, without changing the document.

Command for Claude Code

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 commands/snakeying/textum/prd-check
Clone the repo
git clone --depth 1 https://github.com/snakeying/Textum

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,178 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.02178
Opus 5 $0.00000 $0.01089
Sonnet 5 $0.00000 $0.00436
Haiku 4.5 $0.00000 $0.00218

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

Security

Grade A, and why

prd-check 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 2d 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.

outdated/.claude_outdated/commands/prd-check.md · 116 lines

How it starts

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

阶段1c: PRD 校验

读取:docs/PRD.md | 写入:无(只输出 FAIL/PASS;不修改文件) | 模板:N/A

输出 FAIL/PASS 清单;不修改任何文件

输出规则(只读)

  • 不输出 PRD 原文
  • 若存在任何 FAIL
    • 输出 FAIL 清单(F-001 起编号;每条必须包含以下字段):
      • 定位:章节路径 +(尽量)稳定ID(BR-###/FP-###/TBL-###/API-###)或锚点(<!-- PRD#... -->);避免行号
      • 问题:1 句
      • 期望:可机械执行的“替换目标/格式”(能推导就写出来)
      • 影响:H/M/L
      • 修复:只给 1 个动作(通常是“把本 FAIL 清单粘贴给 /prd 并按定位逐条修正” + 本条的最小修改点)
    • 末尾追加:
      • 修正:将 FAIL 清单作为可选输入粘贴给 /prd,逐条修正 docs/PRD.md
      • 重跑:/prd-check
    • 然后结束
  • 否则(无 FAIL):输出 PASS,并在末尾追加:下一步:/scaffold

FAIL 校验项(机械性门禁)

0) 文件存在

  • docs/PRD.md 必须存在

1) 结构完整性(不得缺章)

必须包含以下一级章节(缺失即 FAIL):

  • ## 1. 项目概述
  • ## 2. 范围与假设
  • ## 3. 目标用户与角色
  • ## 4. 权限矩阵(必填)
  • ## 5. 核心功能
  • ## 6. 业务规则(必填)
  • ## 7. 状态与枚举(必填)
  • ## 8. 数据模型(必填)
  • ## 9. 接口设计(必填)
  • ## 10. 非功能需求(必填,可写 N/A)

2) 模板占位符(不得残留)

PRD 中不得出现 fenced code blocks(```);出现即 FAIL

全文不得残留任何模板占位符;命中即 FAIL

机械拦截(任一命中即 FAIL):

  • TBD
  • [...]
  • PRD#API-### / PRD#TBL-### / PRD#BR-###
  • API-### / TBL-### / BR-###(仍为 ### 占位)
  • FP-###(仍为 ### 占位)
  • A/D/O
  • 4XX/5XX

2.5) 角色与权限最小可用性

  • PRD ### 3.1 用户角色 必须包含表格,且至少 1 行数据
  • PRD ## 4. 权限矩阵(必填) 必须包含表格,且至少 1 行数据
  • PRD ## 4. 权限矩阵(必填) 中每行 权限 必须严格为 A / D / O 之一

3) 稳定ID(接口/表)一致性

接口(如适用;无 API 必须写 N/A)

先判断 PRD 是否有接口(必须按 N/A_STRICT 判定):

N/A_STRICT 判定口径(权威;逐字一致;禁止改写):

  • 定位 PRD 小节 ### 9.2 接口清单(必填) 的正文(标题行之后到下一同级小节标题之前)
  • 判定 N/A_STRICT = true 当且仅当:正文去掉空行并 Trim 后仅剩 1 行且该行严格等于 N/A

据此:若 N/A_STRICT = truePRD_HAS_API = false;否则 PRD_HAS_API = true

PRD_HAS_API = false

  • 第 9 节 9.1/9.2/9.3 三个小节正文必须全部满足 N/A_STRICT(仅一行 N/A;不得残留表格/子标题/其它文本)
  • PRD 中不得出现任何 API-### / API-001<!-- PRD#API-... -->

PRD_HAS_API = true

  • PRD 9.2 接口清单:必须至少 1 条接口;每条接口必须有且仅有一个 API-###,且必须是具体数字(API-001 形式);禁止缺失/重复/仍为 API-###
  • PRD 9.3 接口详情:每个详情标题必须包含对应的 API-###
  • PRD 9.3 接口详情:每个接口详情标题行必须以 #### 9.3. 开头(标题级别/前缀固定)
  • PRD 9.3 接口详情:每个详情标题行必须包含对应的锚点 <!-- PRD#API-### -->(具体数字:<!-- PRD#API-001 --> 形式),且锚点 <ID> 必须与标题中的 API-### 一致;禁止缺失/仍为 PRD#API-###
  • 一致性:9.2 中出现的每个 API-### 都必须在 9.3 有对应详情;9.3 中出现的 API-### 也必须在 9.2 清单中存在

Read the full file on GitHub · 116 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. 2d ago First seen · 116 lines · 0 tokens per session scan A c3504ce0d0ae

Subscribe to this mod's changes

prd-check is a command published in the GitHub repository snakeying/Textum (41 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,178 tokens. 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.