skill-comply
affaan-m/ECC
透過在多個提示嚴格度層級生成情境、執行代理程式、分類工具呼叫,並報告包含完整時間軸的合規率,自動衡量編碼代理程式是否遵循技能、規則或代理程式定義。
...展開全部skill-comply: 自動化合規性衡量
透過以下方式,衡量編碼代理是否確實遵循技能、規則或代理定義:
- 從任何 .md 檔案自動產生預期行為序列(規格)
- 自動生成提示嚴格程度遞減的場景(支持性 → 中立 → 競爭性)
- 執行
claude -p並透過 stream-json 擷取工具呼叫追蹤紀錄 - 利用大型語言模型(而非正規表達式)將工具呼叫與規格步驟進行比對分類
- 以確定性方式檢查時間順序
- 生成包含規格、提示詞和時間軸的自包含報告
支援的目標
- 技能(
skills/*/SKILL.md):工作流程技能,例如 search-first、TDD 指南 - 規則(
rules/common/*.md):強制性規則,例如 testing.md、security.md、git-workflow.md - 代理程式定義(
agents/*.md):代理程式是否會在預期時被呼叫(目前尚未支援內部工作流程驗證)
何時觸發
- 使用者執行
/skill-comply - 使用者詢問「這條規則是否確實被遵循?」
- 新增規則/技能後,用以驗證代理程式是否符合規範
- 作為品質維護的一部分,定期執行
使用方法
# 完整執行
uv run python -m scripts.run ~/.claude/rules/common/testing.md
# 模擬執行(無成本,僅包含規格與情境)
uv run python -m scripts.run --dry-run ~/.claude/skills/search-first/SKILL.md
# 自訂模型
uv run python -m scripts.run --gen-model haiku --model sonnet
關鍵概念:提示獨立性
衡量即使提示語未明確支援,技能/規則是否仍能被遵循。
報告內容
報告內容完整自成一體,包含:
- 預期行為序列(自動生成的規格說明)
- 情境提示(各嚴格程度層級所提出的要求)
- 各情境的合規分數
- 附有大型語言模型(LLM)分類標籤的工具呼叫時間軸
進階功能(可選)
對於熟悉「hook」功能的使用者,報告中還會針對合規度較低的步驟提供「hook」提升建議。此為參考資訊——主要價值在於合規狀況的可視性本身。
---
name: skill-comply
description: Automatically measures whether coding agents follow skills, rules, or agent definitions by generating scenarios at multiple prompt strictness levels, running agents, classifying tool calls, and reporting compliance rates with full timelines.
---
# skill-comply: Automated Compliance Measurement
Measures whether coding agents actually follow skills, rules, or agent definitions by:
1. Auto-generating expected behavioral sequences (specs) from any .md file
2. Auto-generating scenarios with decreasing prompt strictness (supportive → neutral → competing)
3. Running `claude -p` and capturing tool call traces via stream-json
4. Classifying tool calls against spec steps using LLM (not regex)
5. Checking temporal ordering deterministically
6. Generating self-contained reports with spec, prompts, and timelines
## Supported Targets
- **Skills** (`skills/*/SKILL.md`): Workflow skills like search-first, TDD guides
- **Rules** (`rules/common/*.md`): Mandatory rules like testing.md, security.md, git-workflow.md
- **Agent definitions** (`agents/*.md`): Whether an agent gets invoked when expected (internal workflow verification not yet supported)
## When to Activate
- User runs `/skill-comply <path>`
- User asks "is this rule actually being followed?"
- After adding new rules/skills, to verify agent compliance
- Periodically as part of quality maintenance
## Usage
```bash
# Full run
uv run python -m scripts.run ~/.claude/rules/common/testing.md
# Dry run (no cost, spec + scenarios only)
uv run python -m scripts.run --dry-run ~/.claude/skills/search-first/SKILL.md
# Custom models
uv run python -m scripts.run --gen-model haiku --model sonnet <path>
```
## Key Concept: Prompt Independence
Measures whether a skill/rule is followed even when the prompt doesn't explicitly support it.
## Report Contents
Reports are self-contained and include:
1. Expected behavioral sequence (auto-generated spec)
2. Scenario prompts (what was asked at each strictness level)
3. Compliance scores per scenario
4. Tool call timelines with LLM classification labels
### Advanced (optional)
For users familiar with hooks, reports also include hook promotion recommendations for steps with low compliance. This is informational — the main value is the compliance visibility itself.
所有檔案
21 個檔案安裝 skill-comply
請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/affaan-m/ECC/tree/main/skills/skill-comply # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
