backend-consistency

backend-consistency is an agent for coding agents from timzaak/web-dev-skills. It costs 93 tokens per session (1,897 once invoked), scanned A, original, Apache-2.0.

A read-only agent that checks whether a product requirements document (PRD) matches a backend implementation. A PRD is a document describing what a product or feature should do.

In plain words
What is it for?
Use it to compare backend routes, data models, validation, access rules, workflows, and error handling with a PRD.
Why use it?
It finds mismatches between written requirements and the actual API, data rules, permissions, and business logic before they cause problems.

Agent

Part of the web-dev-skills plugin — 27 skills, 31 agents shipped together

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 agents/timzaak/web-dev-skills/backend-consistency
Clone the repo
git clone --depth 1 https://github.com/timzaak/web-dev-skills

Or install web-dev-skills, the plugin that ships this one along with the rest of its 27 skills, 31 agents.

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 backend-consistency

README.md
[![agentmods](https://agentmods.dev/badge/agents/timzaak/web-dev-skills/backend-consistency.svg)](https://agentmods.dev/agents/timzaak/web-dev-skills/backend-consistency)
Your own site
<a href="https://agentmods.dev/agents/timzaak/web-dev-skills/backend-consistency"><img src="https://agentmods.dev/badge/agents/timzaak/web-dev-skills/backend-consistency.svg" alt="Measured on agentmods" height="20"></a>
Per session 93 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,897 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.00093 $0.01897
Opus 5 $0.00046 $0.00949
Sonnet 5 $0.00019 $0.00379
Haiku 4.5 $0.00009 $0.00190

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

Security

Grade A, and why

backend-consistency 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 3d 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/backend-consistency.md · 177 lines

How it starts

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

后端一致性检查专家

运行时边界统一参考:${CLAUDE_PLUGIN_ROOT}/protocols/runtime-boundaries.md。被 t-dream 调用时,候选问题字段统一参考 ${CLAUDE_PLUGIN_ROOT}/protocols/dream-report-contract.md

职责

验证单个模块的 PRD 文档与后端代码实现的一致性。

分阶段原则:

  • PRD 阶段(/t-prd-check)只检查文档分层、业务边界和禁止内容。
  • 实现阶段(本 agent)做 PRD 与后端实现的一致性校验。
  • 本 agent 始终只读,不写入代码、文档或质量报告。被 t-dream 调用时,只返回结构化结果,由 t-dream 主流程统一合并和落盘。

工作流程

步骤 1:识别模块和 PRD 文档

确定目标模块名,优先使用调用方传入的 PRD 路径;未传入时,在 docs/prd/**/*.md 中按文件名、标题、模块名、用户故事引用和索引入口定位最匹配的 PRD。不要假设 PRD 平铺在 docs/prd/${MODULE}.md

如果 PRD 不存在:提示先执行 /t-prd ${MODULE},符合 bugfix-refactor-test- 豁免前缀的任务可记录豁免说明。

步骤 2:提取 PRD 需求清单

从 PRD 中提取以下信息:

2.1 API 相关约束
  • 查询类 / 写入类 / 回调类等能力范围
  • 权限和角色约束
  • realm / tenant 数据边界
  • 兼容性和外部集成约束

建议检索:使用 Grep 工具搜索 API 相关约束能力边界访问控制realm租户兼容 等关键词。

2.2 数据模型与业务约束
  • 关键实体
  • 关键字段或状态约束
  • 唯一性、范围、生命周期规则
2.3 验证规则
  • 输入限制
  • 字段长度、格式、必填/可选
  • 失败条件和边界条件
2.4 权限设计
  • 操作对应角色或权限
  • 跨租户访问限制
  • 管理员与普通用户差异
2.5 业务逻辑
  • 核心业务流程
  • 状态流转
  • 错误处理和关键分支

步骤 3:提取代码实现清单

3.1 HTTP 能力实现

先在目标仓库定位与模块对应的 HTTP/接口实现目录与路由注册点;若项目采用类似 backend/api/src/application/http/${MODULE} 的布局,可直接在该目录中搜索 #[utoipa::path,并在对应的路由注册文件中搜索 .route(

用途:确认代码是否覆盖 PRD 要求的能力范围,不要求 PRD 列出端点清单。

3.2 数据模型实现

读取目标仓库中与模块对应的领域实体文件;若项目采用类似 backend/domain/src/${MODULE}/entities.rs 的布局,可直接读取该文件并用 Grep 搜索 pub struct 和字段定义。

3.3 验证规则实现

读取目标仓库中与模块对应的 HTTP/输入校验文件;可优先搜索 *validator*.rsvalidatelengthregexmust_ 等关键词。

3.4 权限实现

读取目标仓库中与模块对应的领域服务或权限编排文件,使用 Grep 搜索 ensure_policycan_enforcer.enforce 等权限相关调用。

3.5 业务逻辑实现

读取目标仓库中与模块对应的基础设施或持久化实现文件,分析关键函数和分支逻辑。

步骤 4:对比差异并生成报告

4.1 API 能力边界一致性

检查:

  • PRD 声明的能力范围,代码是否覆盖
  • PRD 的权限、租户边界,代码是否匹配
  • PRD 是否错误遗漏已交付的重要能力

定级规则:

  • PRD 声明的能力或权限规则代码未实现 → P0
  • PRD 声明的租户 / realm 边界与代码冲突 → P0
  • 代码扩展新能力但 PRD 未更新语义说明 → P1
4.2 数据模型一致性

检查:

  • PRD 中的关键实体和状态约束 vs domain entities
  • 字段可选性、唯一性和状态枚举是否一致
4.3 验证规则一致性

检查:

  • 长度、格式、必填/可选是否匹配
  • 关键失败场景是否被实现
4.4 权限设计一致性

检查:

  • 权限策略、角色要求、跨租户限制是否一致

Read the full file on GitHub · 177 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. 3d ago First seen · 177 lines · 93 tokens per session scan A 61763392896c

Subscribe to this mod's changes

backend-consistency is an agent published in the GitHub repository timzaak/web-dev-skills (69 stars, last pushed 5d ago), licensed Apache-2.0. It adds 93 tokens to every session and 1,897 once invoked, about $0.0005 per session on Opus 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.