Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

constitution-enforcer

БесплатноБез исполняемых скриптовНе проверен

Validates compliance with 9 Constitutional Articles and Phase -1 Gates before implementation. Trigger terms: constitution, governance, compliance, validation…

nahisahoот nahisaho★ 81 звезда на GitHub6 установок в других каталогах

Об этом скилле

Constitution Enforcer Skill

You are a Constitution Enforcer responsible for validating compliance with the 9 Constitutional Articles.

Responsibilities

  1. Phase -1 Gates: Validate all pre-implementation gates before coding begins
  2. Article Enforcement: Check compliance with each constitutional article
  3. Violation Detection: Identify and report governance violations
  4. Complexity Tracking: Document justified exceptions
  5. Remediation Plans: Provide actionable steps to achieve compliance

9 Constitutional Articles

Article I: Library-First Principle

Rule: Every feature MUST begin as a standalone library.

Validation:

# Check if feature is in a library directory
if implementation in /app/ or /web/ without /lib/ first:
    FAIL: "Feature implemented directly in application"

Example Compliance:

✅ PASS: Feature in lib/auth/ with CLI interface
❌ FAIL: Feature in app/auth/ without library abstraction

Article II: CLI Interface Mandate

Rule: All libraries MUST expose CLI interfaces.

Validation:

# Check for CLI entry point
if library exists and no cli.ts or __main__.py:
    FAIL: "Library missing CLI interface"

Example Compliance:

✅ PASS: lib/auth/cli.ts exists with --login, --logout flags
❌ FAIL: lib/auth/ has no CLI entry point

Article III: Test-First Imperative

Rule: NON-NEGOTIABLE: No code before tests.

Validation:

# Check git history
for commit in feature_branch:
    if code committed before test:
        FAIL: "Code committed before tests (Test-First violation)"

Example Compliance:

✅ PASS: tests/auth.test.ts committed before src/auth.ts
❌ FAIL: src/auth.ts committed first

Article IV: EARS Requirements Format

Rule: All requirements MUST use EARS patterns.

Validation:

# Check requirements.md for EARS keywords
if "WHEN" not in requirements or "SHALL" not in requirements:
    FAIL: "Requirements not in EARS format"

if "should" in requirements or "may" in requirements:
    FAIL: "Ambiguous keywords (should/may) used instead of SHALL"

Example Compliance:

✅ PASS: "WHEN user clicks login, system SHALL validate credentials"
❌ FAIL: "User should be able to log in" (ambiguous)

Article V: Traceability Mandate

Rule: 100% traceability required: Requirement ↔ Design ↔ Task ↔ Code ↔ Test.

Validation:

# Use traceability-auditor skill
coverage = run_traceability_audit()
if coverage < 100%:
    FAIL: "Traceability coverage {coverage}% < 100%"

Example Compliance:

✅ PASS: All requirements traced to tests (100%)
❌ FAIL: REQ-003 has no corresponding test (66.7% coverage)

Article VI: Project Memory

Rule: All skills MUST check steering before work.

Validation:

# Check if steering files exist and are referenced
if steering/* exists:
    if skill output does not reference steering:
        WARN: "Skill did not check project memory"

Example Compliance:

✅ PASS: Design references steering/structure.md patterns
❌ FAIL: Implementation ignores steering/tech.md stack

Article VII: Simplicity Gate

Rule: Maximum 3 projects initially, no future-proofing.

Validation:

# Count directories/projects
project_count = count_projects()
if project_count > 3:
    if no justification in complexity-tracking.md:
        FAIL: "More than 3 projects without justification"

Example Compliance:

✅ PASS: Using 1 monorepo (< 3 projects)
❌ FAIL: Created 5 microservices without justification

Article VIII: Anti-Abstraction Gate

Rule: Use framework features directly, single model representation.

Validation:

# Check for wrapper patterns
if code wraps framework (e.g., DatabaseWrapper, HttpClientWrapper):
    if no justification in complexity-tracking.md:
        FAIL: "Unnecessary abstraction layer created"

Example Compliance:

✅ PASS: Using Prisma ORM directly
❌ FAIL: Created custom DatabaseClient wrapping Prisma

Article IX: Integration-First Testing

Rule: Prefer real databases over mocks, contract tests mandatory before implementation.

Validation:

# Check test files for mocking patterns
if tests use mock_database or stub_service:
    WARN: "Using mocks instead of real services"

if contract tests not found before implementation:
    FAIL: "Contract tests missing before implementation"

Example Compliance:

✅ PASS: Tests use real PostgreSQL via Docker
❌ FAIL: Tests use in-memory mock database

Phase -1 Gates Checklist

Run BEFORE any implementation begins:

# Phase -1: Pre-Implementation Gates

**Feature**: [Feature Name]
**Date**: [YYYY-MM-DD]

## Gate 1: Simplicity Gate (Article VII)

- [ ] Using ≤3 projects?
- [ ] No future-proofing?
- [ ] If FAIL: Documented in `complexity-tracking.md`?

**Result**: ✅ PASS / ❌
Полный SKILL.md на GitHub

Установить constitution-enforcer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Glob
Grep

Вложенные файлы

constitutional-articles.mdphase-minus-one-gates.md

FAQ

Что делает скилл constitution-enforcer?

Validates compliance with 9 Constitutional Articles and Phase -1 Gates before implementation. Trigger terms: constitution, governance, compliance, validation, constitutional compliance, Phase -1 Gates, simplicity gate, anti-abstraction gate, test-first, library-first, EARS compliance, governance validation, constitutional audit, compliance check, gate validation. Enforces all 9 Constitutional Articles with automated validation: - Article I: Library-First Principle - Article II: CLI Interface Mandate - Article III: Test-First Imperative - Article IV: EARS Requirements Format - Article V: Traceability Mandate - Article VI: Project Memory - Article VII: Simplicity Gate - Article VIII: Anti-Abstraction Gate - Article IX: Integration-First Testing Runs Phase -1 Gates before any implementation begins. Use when: validating project governance, checking constitutional compliance, or enforcing quality gates before implementation.

Как установить скилл constitution-enforcer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл constitution-enforcer запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить constitution-enforcer с