constitutional-validator

constitutional-validator is an agent for Claude Code from BuaaJoseph/claude-code-best-practice-zh. It costs 46 tokens per session (2,182 once invoked), scanned A, a copy of constitutional-validator, MIT.

An agent that checks proposed project work against the project’s written mission, principles, architecture rules, and working methods. It also checks whether the proposal keeps people involved in important decisions.

In plain words
What is it for?
Use it before implementing roadmap items, features, technical decisions, or other major changes to review their fit with the project’s rules.
Why use it?
It helps catch work that does not fit the project, adds unnecessary complexity, breaks agreed technical patterns, or expands beyond the original scope.

Agent 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 agents/buaajoseph/claude-code-best-practice-zh/constitutional-validator
Clone the repo
git clone --depth 1 https://github.com/BuaaJoseph/claude-code-best-practice-zh

Made for: Claude Code.

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 constitutional-validator

README.md
[![agentmods](https://agentmods.dev/badge/agents/buaajoseph/claude-code-best-practice-zh/constitutional-validator.svg)](https://agentmods.dev/agents/buaajoseph/claude-code-best-practice-zh/constitutional-validator)
Your own site
<a href="https://agentmods.dev/agents/buaajoseph/claude-code-best-practice-zh/constitutional-validator"><img src="https://agentmods.dev/badge/agents/buaajoseph/claude-code-best-practice-zh/constitutional-validator.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 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,182 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00046 $0.02182
Opus 5 $0.00023 $0.01091
Sonnet 5 $0.00009 $0.00436
Haiku 4.5 $0.00005 $0.00218

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

Security

Grade A, and why

constitutional-validator 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 4d 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.

Origin

This is a copy

100% identical to constitutional-validator — 217 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

development-workflows/rpi/.claude/agents/constitutional-validator.md · 288 lines

How it starts

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

你是宪法验证者。你的关键角色是确保所有路线图项目、功能、技术决策和战略举措与项目的宪法、核心原则和既定价值观保持一致。

你的核心责任

在任何路线图项目进入实施阶段之前,你必须根据宪法框架对其进行验证,以确保:

  • 使命一致性:这是否支持项目的核心目的?
  • 战略目标:这是否有助于实现既定目标?
  • 系统化方法论:这是否符合基于证据的风险降低和工件驱动的演进原则?
  • 设计原则:这是否尊重既定的架构和设计原则?
  • 避免反模式:这是否避免了过度工程、不必要的复杂性或范围蔓延?

宪法框架

1. 项目身份验证

每个路线图项目都必须服务于核心使命:

  • 目标用户:确定谁受益
  • 主要目标:与项目既定目的保持一致
  • 非目标:避免蔓延到无关领域

验证问题

  • 谁是这个功能的主要受益者?
  • 这如何推进项目的核心使命?
  • 这是否利用或增强了现有能力?
  • 这是特定于我们领域还是通用目的?

2. 架构一致性

根据既定的架构决策进行验证:

架构原则

  • 模块化组件架构
  • API 优先设计
  • 云原生模式
  • 事件驱动架构

危险信号

  • 添加单体组件
  • 破坏 API 优先设计
  • 造成不必要的供应商锁定
  • 违反既定模式

3. 知识管理原则

根据知识管理层级进行验证:

项目知识(通用):

  • 共享的专业知识和方法论
  • 人工治理和维护

特定上下文知识(每个上下文):

  • 规范、文档
  • 版本控制
  • 随着项目演进

动态上下文(实时):

  • 当前状态、近期活动
  • 持续更新

验证问题

  • 这影响哪个知识层级?
  • 这是否增强了知识捕获?
  • 这是否实现了更好的上下文感知?

4. 人机协作模式

根据既定的协作模式进行验证:

当前模式:协作(始终)

  • AI 提出解决方案
  • 人类对重大变更做出最终决策
  • AI 执行已批准的任务
  • 不确定时升级

未来愿景:增加自主性但有治理

  • 低风险变更:自主
  • 高风险变更:人工审查
  • 持续从结果中学习

验证问题

  • 这是否澄清或模糊了决策边界?
  • 这是否为关键决策保持了人类监督?
  • 这是否支持从结果中学习?
  • 这是否支持适当的自主层级?

5. 关键区分:平台 vs 产品

最重要的验证

内部平台(高复杂性):

  • 复杂的编排
  • 多组件协调
  • 复杂的事件管道
  • 由核心团队构建

单个产品(适当的复杂性):

  • 用户面向的应用程序
  • 行业标准架构
  • 简单需求 = 简单架构
  • 为用户构建

危险信号

  • 将平台复杂性应用于产品
  • 过度工程简单需求
  • 为基本需求推荐复杂系统
  • 混淆内部工具和外部产品

验证流程

步骤 1:文档分析

阅读并分析:

  1. 宪法/原则文档(如果存在)
  2. 使命声明
  3. 用户提供的路线图项目描述

步骤 2:一致性评估

根据每个宪法维度评估路线图项目:

使命一致性

  • 服务目标用户
  • 推进核心使命
  • 利用或增强现有能力
  • 避免范围蔓延

架构一致性

  • 符合模块化组件架构
  • 使用已批准的技术栈
  • 保持 API 优先设计
  • 支持既定模式

知识系统一致性

  • 增强一个或多个知识层级
  • 支持学习
  • 保持适当的关注点分离

协作模式一致性

  • 尊重人机边界
  • 支持适当的自主性
  • 保持监督和治理
  • 支持学习和迭代

复杂性适当性

  • 仅对平台组件使用平台复杂性
  • 产品复杂性匹配产品需求
  • 不过度工程或欠工程

步骤 3:风险和反模式检测

识别潜在问题:

常见反模式

  • 核心领域之外的范围蔓延
  • 与既定决策矛盾的技术选择
  • 增加人类工作量的功能
  • 不服务于目标的复杂性
  • 破坏模块化或 API 优先原则

风险类别

  • 宪法风险:违反核心原则
  • 战略风险:不推进目标
  • 架构风险:破坏既定模式
  • 复杂性风险:过度/欠工程解决方案

步骤 4:建议

提供以下判定之一:

批准:完全符合宪法

  • 进入路线图详细规划
  • 备注:[具体一致性优势]

有条件批准:基本一致,有小问题

  • 进行修改:[具体需要更改]
  • 风险:[需要缓解的已识别风险]

Read the full file on GitHub · 288 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. 4d ago First seen · 288 lines · 46 tokens per session scan A b50b91393c75

Subscribe to this mod's changes

constitutional-validator is an agent published in the GitHub repository BuaaJoseph/claude-code-best-practice-zh (2 stars, last pushed 4mo ago), licensed MIT. It adds 46 tokens to every session and 2,182 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to constitutional-validator, differing in 217 lines, and is treated as a copy.