Enforce Rules Format

zernie/vigiles/.claude/skills/enforce-rules-format

作者 zernie1d562c69566f无许可证15 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Validate that all rules have proper enforcement classification (enforce/check/guidance)

仅含说明AI & Agents
AI 生成的概览

验证项目指令文件中的规则是否具有正确的执行分类,并修复缺失的分类。

功能
该技能检查项目的指令文件,判断其使用基于规范的(v2)还是手写的(v1)规则格式。随后检查每条规则是否被分类为强制执行、检查或仅指导,用汇总表报告缺失的标注,并提出修复建议,例如将规则映射到 linter 规则或标记为仅指导。它还会建议将 v1 文件迁移为类型化规范,并运行验证命令报告结果。
适用场景
适用于审计或整理 CLAUDE.md、AGENTS.md、.cursorrules 或规范文件中的规则定义,尤其是规则可能缺少执行标注时。适合希望将规则与 linter 执行关联或明确标记为仅指导的项目。
运行要求
需要可检查的项目指令文件;对于 v2 项目,需要可通过 npx 使用的 vigiles CLI,以运行 compile、discover 和 check 命令。该技能不附带脚本,并在做出更改前询问用户。

Validate that every rule in the project's instruction files has a proper enforcement classification, and fix any that are missing.

Instructions

Step 1: Detect Format

Check which format the project uses:

v2 (spec-based): Look for CLAUDE.md.spec.ts or any *.spec.ts files. If found, this is a v2 project — rules must use enforce(), check(), or guidance().

v1 (hand-written): Look for CLAUDE.md, AGENTS.md, .cursorrules. If found without a spec file, this is a v1 project — rules need **Enforced by:** or **Guidance only** annotations.

Step 2: Validate

For v2 specs:

The TypeScript type system already prevents unannotated rules — you can't create a rule without calling enforce(), check(), or guidance(). So focus on:

  1. Do enforce() rules reference real linter rules? Run npx vigiles compile to check.
  2. Are there guidance rules that COULD be enforce()? Check linter configs for matching rules.
  3. Are there check() assertions that could be delegated to a linter? Suggest enforce() instead.
bash
npx vigiles compilenpx vigiles discover

For v1 hand-written files:

Scan for ### headings. Each must have one of:

  • **Enforced by:** \linter/rule-name``
  • **Guidance only** — reason
  • <!-- vigiles-disable -->

Report missing annotations with a summary table.

Step 3: Fix Issues

For each issue found:

  1. Check the project's linter configuration for matching rules
  2. Suggest enforce("linter/rule") (v2) or **Enforced by:** \linter/rule`` (v1)
  3. If no linter rule exists, suggest guidance() (v2) or **Guidance only** (v1)
  4. Ask the user before making changes

Step 4: Suggest Migration

If the project uses v1 format, suggest migrating to v2 specs for type safety:

Your rules could benefit from type-safe specs. Run the adopt-spec skill to convert your CLAUDE.md to a typed .spec.ts file.

Step 5: Verify

Run the appropriate command:

bash
# v2npx vigiles compile && npx vigiles check
# validatenpx vigiles check

Report the validation result.

来源与署名

来源:zernie/vigiles位于.claude/skills/enforce-rules-format提交1d562c6

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 zernie/vigiles 的技能

Linter Docs

zernie

Deep linter reference for authoring or debugging a vigiles enforce() rule — plugin tables, AST selectors, type-aware rules, auto-fix, and edge cases for ESLint, Ruff, Pylint, RuboCop, Stylelint, and Clippy. Use when you need the exact rule name or config for a specific linter, not for running a linter. (JVM/Go linters — detekt, ktlint, Checkstyle, golangci-lint — and Cedar have no deep-dive file yet; their reference lives in docs/linter-support.md.)

待分类15今天更新

Debug My Harness

zernie

通过读取本地 .vigiles/runs.jsonl 飞行记录账本来诊断智能体框架的异常行为。

AI & Agents15今天更新

Review Docs

zernie

Review the README or a documentation page from several real reader points of view at once. Fans out one parallel reviewer per audience — Claude Code newcomer, power user, plugin/skill author, skeptical senior engineer, non-running decision-maker — each scoring it x/5 and naming concrete, line-level fixes. Use when asked to review, critique, grade, or "get to N/5" the README or any front-door doc, or to check how a doc reads for real users. Not for code review (use /code-review for that).

待分类15今天更新

Adopt Spec

zernie

将现有的手写 CLAUDE.md 转换为使用 vigiles 规范库的类型化 CLAUDE.md.spec.ts。

AI & Agents15今天更新

Pr To Lint Rule

zernie

把反复出现的散文式代码审查规则合成为自定义 lint 规则,并由独立健全性测试把关,不通过则弃用。

Software Development15今天更新

Deep Research

zernie

Use when the user asks to research a topic in depth, map a competitive/market landscape, run a multi-source investigation, or "fan out" parallel research agents — anything where many findings must be gathered and then NOT lost. Enforces durable, detail-preserving research (write full findings to disk; keep a full appendix beside the synthesis).

待分类15今天更新