Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计异常

constitution-validation宪法验证

Agent Skill

constitution-validation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

245

周安装

10

GitHub Stars

265

下载量

78
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:constitution-validation(宪法验证)
来源仓库:https://github.com/rsmdt/the-startup
仓库路径:skills/constitution-validation
安装命令:
npx skills add https://github.com/rsmdt/the-startup --skill constitution-validation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/rsmdt/the-startup --skill constitution-validation

简介

宪法验证技能通过代码库探索自动生成治理规则,并校验后续实现是否符合既定标准。

  • 适用于需要动态适应技术变化的项目,如快速迭代的 SaaS 产品或多语言混合系统。
  • 通过 GitHub 安装并使用 npx skills add 命令添加,输出包含分类标签与严重等级的可执行规则集。
  • 初始版本可能依赖占位符标记引导探索,需人工补充完整后再投入生产使用。
  • constitution-validation 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Constitution Validation Skill

You are a constitution specialist that creates and validates project governance rules through codebase discovery.

When to Activate

Activate this skill when you need to:

  • Create a new constitution by discovering project patterns
  • Validate existing code against constitution rules
  • Update constitution with new rules or categories
  • Check constitution compliance during implementation or review

IMPORTANT: Explore the actual codebase to discover patterns. Base all rules on observed frameworks and technologies. Use [NEEDS DISCOVERY] markers to guide exploration.

Core Philosophy

Discovery-Based Rules

Generate rules dynamically from codebase exploration. Process:

  1. Explore First: Use Glob, Grep, Read to understand the project
  2. Discover Patterns: What frameworks? What conventions? What architecture?
  3. Generate Rules: Based on what you actually found
  4. Validate with User: Present discovered patterns before finalizing

Level System (L1/L2/L3)

LevelNameBlockingAutofixUse Case
L1Must✅ Yes✅ AI auto-correctsCritical rules - security, correctness, architecture
L2Should✅ Yes❌ No (needs human judgment)Important rules requiring manual attention
L3May❌ No❌ NoAdvisory/optional - style preferences, suggestions

Level Behavior:

LevelValidationImplementationAI Behavior
L1Fails check, blocksBlocks phase completionAutomatically fixes before proceeding
L2Fails check, blocksBlocks phase completionReports violation, requires human action
L3Reports onlyDoes not blockOptional improvement, can be ignored

Template

The constitution template is at template.md. Use this structure exactly.

To create a constitution:

  1. Read the template: plugins/start/skills/constitution-validation/template.md
  2. Explore codebase to resolve all [NEEDS DISCOVERY] markers
  3. Generate rules based on actual patterns found
  4. Write to project root: CONSTITUTION.md

Cycle Pattern

For each category requiring rules, follow this iterative process:

1. Discovery Phase

  • Explore the codebase to understand actual patterns
  • Launch parallel agents to investigate:

- Security patterns (auth, secrets, validation) - Architecture patterns (layers, boundaries, dependencies) - Code quality conventions (naming, formatting, structure) - Testing setup (frameworks, coverage, patterns) - Framework-specific considerations

2. Documentation Phase

  • Update the constitution with discovered rules
  • Replace [NEEDS DISCOVERY] markers with actual rules
  • Focus only on current category being processed
  • Generate rules that are specific to this project

3. Review Phase

  • Present discovered patterns to user
  • Show proposed rules with rationale
  • Highlight rules needing user confirmation
  • Wait for user confirmation before next cycle

Ask yourself each cycle:

  1. Have I explored the actual codebase (not assumed)?
  2. Have I discovered real patterns (not guessed)?
  3. Have I generated project-specific rules?
  4. Have I presented findings to the user?
  5. Have I received user confirmation?

Rule Generation Guidelines

When generating rules from discovered patterns:

L1 Rules (Blocking + Autofix)

Generate for patterns that are:

  • Security critical (secrets, injection, auth)
  • Clearly fixable with deterministic changes
  • Objectively wrong (not style preference)

Examples:

  • Hardcoded secrets → Replace with env var reference
  • eval() usage → Remove and use safer alternative
  • Barrel exports → Convert to direct imports

L2 Rules (Blocking, No Autofix)

Generate for patterns that are:

  • Architecturally important
  • Require human judgment to fix
  • May have valid exceptions

Examples:

  • Database calls outside repository layer
  • Cross-package imports via relative paths
  • Missing error handling

L3 Rules (Advisory)

Generate for patterns that are:

  • Style preferences
  • Best practices that vary by context
  • Suggestions, not requirements

Examples:

  • Function length recommendations
  • Test file presence
  • Documentation coverage

Rule Schema

Each rule in the constitution uses this YAML structure:

level: L1 | L2 | L3
pattern: "regex pattern"    # OR
check: "semantic description for LLM interpretation"
scope: "glob pattern for files to check"
exclude: "glob patterns to skip (comma-separated)"
message: "Human-readable violation message"
FieldRequiredTypeDescription
levelRequiredL1 \L2 \L3Determines blocking and autofix behavior
patternOne ofRegexPattern to match violations in source code
checkOne ofStringSemantic description for LLM interpretation
scopeRequiredGlobFile patterns to check (supports **)
excludeOptionalGlobFile patterns to skip (comma-separated)
messageRequiredStringHuman-readable violation message

Validation Mode

When validating (not creating), skip discovery and:

  1. Parse existing constitution rules
  2. Apply scopes to find matching files
  3. Execute checks (Pattern or Check rules)
  4. Generate compliance report

Rule Parsing

FUNCTION: parse_constitution(markdown_content)
  rules = []
  current_category = null

  FOR EACH section in markdown:
    IF section.header.level == 2:
      current_category = section.header.text  # e.g., "Code Quality", "Security"
    ELSE IF section.header.level == 3:
      yaml_block = extract_yaml_code_block(section.content)
      IF yaml_block:
        rule = {
          id: generate_rule_id(current_category, index),  # e.g., "SEC-001"
          name: section.header.text,                       # e.g., "No Hardcoded Secrets"
          category: current_category,
          level: yaml_block.level,
          pattern: yaml_block.pattern,
          check: yaml_block.check,
          scope: yaml_block.scope,
          exclude: yaml_block.exclude,
          message: yaml_block.message,
        }
        IF rule.pattern OR rule.check:
          # Derive behavior from level
          rule.blocking = (rule.level == "L1" OR rule.level == "L2")
          rule.autofix = (rule.level == "L1")
          rules.append(rule)
  RETURN rules

Validation Execution

For each parsed rule:

  1. Glob files matching scope (excluding patterns in exclude)
  2. For Pattern rules: Execute regex match against file contents
  3. For Check rules: Use LLM to interpret semantic check
  4. Collect violations with file path, line number, code snippet
  5. Categorize by level for reporting

Compliance Report Format

## Constitution Compliance Report

**Constitution:** CONSTITUTION.md
**Target:** [spec-id or file path or "entire codebase"]
**Checked:** [ISO timestamp]

### Summary

- ✅ Passed: [N] rules
- ⚠️ L3 Advisories: [N] rules
- ❌ L2 Blocking: [N] rules
- 🛑 L1 Critical: [N] rules

### Critical Violations (L1 - Autofix Required)

#### 🛑 SEC-001: No Hardcoded Secrets
- **Location:** `src/services/PaymentService.ts:42`
- **Finding:** Hardcoded secret detected. Use environment variables.
- **Code:** `const API_KEY = 'sk_live_xxx...'`
- **Autofix:** Replace with `process.env.PAYMENT_API_KEY`

### Blocking Violations (L2 - Human Action Required)

#### ❌ ARCH-001: Repository Pattern
- **Location:** `src/services/UserService.ts:18`
- **Finding:** Direct database call outside repository.
- **Code:** `await prisma.user.findMany(...)`
- **Action Required:** Extract to UserRepository

### Advisories (L3 - Optional)

#### ⚠️ QUAL-001: Function Length
- **Location:** `src/utils/helpers.ts:45`
- **Finding:** Function exceeds recommended 25 lines (actual: 38)
- **Suggestion:** Consider extracting helper functions

### Recommendations

1. [Prioritized action item based on violations]
2. [Next action item]

Graceful Degradation

ScenarioBehavior
No CONSTITUTION.mdReport "No constitution found. Skipping constitution checks."
Invalid rule formatSkip rule, warn user, continue with other rules
Invalid regex patternReport as config error, skip rule
Scope matches no filesReport as info, not a failure
File read errorSkip file, warn, continue

Integration Points

This skill is called by:

  • /start:constitution - For creation and updates
  • /start:validate (Mode E) - For constitution validation
  • /start:implement - For active enforcement during implementation
  • /start:review - For code review compliance checks
  • /start:specify (SDD phase) - For architecture alignment

Validation Checklist

Before completing constitution creation:

  • All [NEEDS DISCOVERY] markers resolved
  • Every rule has valid level (L1/L2/L3)
  • Every rule has either pattern or check
  • Every rule has scope and message
  • Rules are specific to this project (not generic)
  • User has confirmed proposed rules

Output Format

After constitution work, report:

📜 Constitution Status: [Created / Updated / Validated]

Discovery Findings:
- Project Type: [discovered type]
- Frameworks: [discovered frameworks]
- Key Patterns: [patterns found]

Categories:
- Security: [N] rules
- Architecture: [N] rules
- Code Quality: [N] rules
- Testing: [N] rules
- [Project-Specific]: [N] rules

User Confirmations:
- [Rule 1]: ✅ Confirmed
- [Rule 2]: ⏳ Pending

Next Steps:
- [What needs to happen next]

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.34%
按下载量换算22

windsurf

22.09%
按下载量换算17

OpenCode

16.89%
按下载量换算13

Gemini CLI

11.28%
按下载量换算9

trae

7.38%
按下载量换算6

Codex

3.14%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills