Communitygithub.com

skill-comply: 自動化遵循度衡量

視覺化技能、規則與代理定義是否確實被遵循——自動以三種提示嚴格程度生成情境、執行代理、分類行為序列,並搭配完整工具呼叫時間軸產出遵循率報告。當你需要確認代理是否真的遵循所給的技能、規則與定義,而非假設它們有做到時使用。

skill-comply: 自動化遵循度衡量 是什麼?

這是一個針對 AI 代理(如 Claude Code)的遵循度衡量技能。它能從任何 .md 檔案(技能、規則或代理定義)自動產生預期的行為序列(規格),並以此為基準,以三種不同的提示嚴格程度(支持性 → 中立 → 競爭性)產生測試情境。接著,它會使用 `claude -p` 指令執行代理,並透過 `stream-json` 擷取完整的工具呼叫軌跡。最後,它會利用 LLM(而非正規表達式)對工具呼叫進行分類,以確定性方式檢查時序順序,並產生一份包含規格、提示與時間軸的完整報告。這項技能的價值在於提供客觀、可重現的證據,證明代理是否真的遵循原本設定的指引,而不是假設它們有做到。支援的技能包括任何 skill 目錄下的 SKILL.md、rules/common 目錄下的規則檔案,以及 agents 目錄下的代理定義檔案。若需要全面驗證品質,建議在新增規則或技能後執行此技能。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/skill-comply

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

skill-comply: 自動化遵循度衡量 是做什麼的?

衡量編碼代理是否確實遵循技能、規則或代理定義,方法如下:

  1. 從任何 .md 檔案自動產生預期的行為序列(規格)
  2. 自動產生提示嚴格程度逐漸降低的情境(支持性 → 中立 → 競爭性)
  3. 執行 claude -p 並透過 stream-json 擷取工具呼叫軌跡
  4. 使用 LLM(而非正規表達式)對工具呼叫進行分類以比對規格步驟
  5. 以確定性方式檢查時序順序
  6. 產生內含規格、提示與時間軸的獨立報告

支援的目標

  • 技能 (skills/*/SKILL.md):工作流程技能,例如搜尋優先、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 <路徑>

核心概念:提示獨立性

衡量一項技能或規則是否在提示未明確支援的情況下仍被遵循。

報告內容

報告為獨立格式,包含:

  1. 預期的行為序列(自動產生的規格)
  2. 情境提示(每個嚴格程度下的提問內容)
  3. 每個情境的遵循度分數
  4. 附有 LLM 分類標籤的工具呼叫時間軸

進階功能(選擇性)

對於熟悉 hook 的使用者,報告還會針對遵循度較低的步驟提供 hook 晉升建議。此為參考資訊——主要價值仍在於遵循度的可視化本身。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相關技能