AgentSkillsCN

tenet-governance

当您处理架构准则——这些项目约束往往需要人工判断来加以验证时,可调用此技能。该技能为您提供了关于准则格式、严重程度分级、验证标准以及验证模式的指导。在 AGENTS.md 中设置、管理或验证准则时,可调用此技能。

SKILL.md
--- frontmatter
name: tenet-governance
description: Use when working with architectural tenets - project constraints that require human judgment to verify. This skill provides guidance on tenet format, severity levels, validation criteria, and verification patterns. Load when setting up, managing, or verifying tenets in AGENTS.md.
user-invocable: false

Tenet Governance

Guidance for managing architectural tenets - constraints that must be followed in all work on a codebase.

Overview

Tenets are architectural constraints that require human judgment to verify. They differ from linting rules:

TenetsLinting Rules
Architectural boundariesCode style
"Domain must not import infrastructure""Use 2-space indentation"
Require judgment to verifyMachine-checkable
Few (3-7 per project)Many (hundreds)
Project-specific decisionsIndustry conventions

Quick Reference

Tenet Format

markdown
### T<N>. <Name>

<Description: 2-4 sentences explaining constraint and rationale>

**Severity:** <critical | high | medium | low>

**Evidence:**
- `<file:line>` - <observation>

Severity Levels

LevelMeaningVerification Behavior
criticalBreaks system invariantsAlways fail
highCauses significant tech debtFail by default
mediumReduces code qualityWarn by default
lowGuideline, not requirementInfo only

Exception Syntax

Table (in AGENTS.md):

markdown
## Tenet Exceptions

| File | Tenet | Reason | Approved |
|------|-------|--------|----------|
| `src/legacy/adapter.go` | T1 | Legacy integration | 2024-01-15 |

Inline (in code):

go
// governor:ignore T1 - Legacy adapter, tracking in #123
import "infrastructure/db"

Two Operations

Validation (setup/manage): Is this tenet grounded in reality?

  • Search codebase for evidence supporting the tenet
  • Output: SUPPORTED, WEAK_EVIDENCE, NOT_SUPPORTED, CONTRADICTED

Verification (verify): Does this code follow the tenets?

  • Analyze code against existing tenets
  • Output: COMPLIANT or VIOLATED with confidence scores

Confidence Scoring

ScoreCriteriaExample
90-100Explicit violationForbidden import present
70-89Likely violationPattern suggests violation
50-69Possible violationAmbiguous code
1-49UncertainProbably false positive

Good Tenet Characteristics

  1. Actionable: "X must/must not Y" format
  2. Evidence-based: Grounded in actual codebase patterns
  3. Architectural: About structure, not style
  4. Persistent: Unlikely to change frequently
  5. Verifiable: Can determine compliance with reasonable effort

Reference Documentation

For detailed specifications and examples: