Communitygithub.com

skill-comply:自动化合规性测量

可视化技能、规则和智能体定义是否被实际遵循——自动以3种提示严格级别生成场景,运行智能体,分类行为序列,并报告带有完整工具调用时间线的合规率。当你需要检查智能体是否真正遵循给定的技能、规则和定义时使用,而不是想当然地认为它们会遵循。

skill-comply:自动化合规性测量 是什么?

skill-comply 是一个用于验证编码智能体(如 Claude Code)是否严格遵守其配置的技能、规则或智能体定义的工具。与仅假设合规不同,它通过从任意 Markdown 文件中自动生成预期的行为序列(规范),然后以三种递减的提示严格程度(支持性 → 中性 → 竞争性)创建测试场景,系统地测量实际遵从性。该工具通过 `claude -p` 运行这些场景,使用流式 JSON 捕获详细的工具调用轨迹,并利用大语言模型(而非正则表达式)将每个工具调用分类到对应的规范步骤。生成的报告是完全自包含的,包含规范、每个场景的提示、逐步的合规得分以及带 LLM 分类标签的完整时间线。它特别适用于在添加新规则或技能后快速验证合规性,或在对智能体行为产生怀疑时进行检查,支持的平台包括定义技能(`skills/*/SKILL.md`)、强制性规则(`rules/common/*.md`)以及智能体定义(`agents/*.md`)。

兼容平台✓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):工作流技能,如 search-first、TDD 指南
  • 规则 (rules/common/*.md):强制性规则,如 testing.md、security.md、git-workflow.md
  • 智能体定义 (agents/*.md):检查智能体是否在预期时被调用(内部工作流验证尚不支持)

何时激活

  • 用户运行 /skill-comply <path>
  • 用户询问“这条规则是否真的被遵循了?”
  • 在添加新规则/技能后,验证智能体合规性
  • 定期作为质量维护的一部分

用法

# 完整运行
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 <path>

关键概念:提示独立性

测量一条技能/规则是否在提示未明确支持时仍然被遵循。

报告内容

报告是自包含的,包括:

  1. 预期的行为序列(自动生成的规范)
  2. 场景提示(每个严格级别下提出的问题)
  3. 每个场景的合规得分
  4. 带有 LLM 分类标签的工具调用时间线

高级(可选)

对于熟悉钩子(hooks)的用户,报告还针对合规性较低的步骤包含钩子推广建议。这仅供参考——主要价值在于合规性的可视化本身。

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.

相关技能