# Enforce Rules Format

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

- **Type:** Skill
- **Install:** `agentstack add skill-zernie-vigiles-enforce-rules-format`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [zernie](https://agentstack.voostack.com/s/zernie)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [zernie](https://github.com/zernie)
- **Source:** https://github.com/zernie/vigiles/tree/main/.claude/skills/enforce-rules-format
- **Website:** https://vigiles.sh

## Install

```sh
agentstack add skill-zernie-vigiles-enforce-rules-format
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

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 compile
npx vigiles discover
```

**For v1 hand-written files:**

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

- `**Enforced by:** \`linter/rule-name\``
- `**Guidance only** — reason`
- ``

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
# v2
npx vigiles compile && npx vigiles check

# validate
npx vigiles check
```

Report the validation result.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [zernie](https://github.com/zernie)
- **Source:** [zernie/vigiles](https://github.com/zernie/vigiles)
- **License:** MIT
- **Homepage:** https://vigiles.sh

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-zernie-vigiles-enforce-rules-format
- Seller: https://agentstack.voostack.com/s/zernie
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
