CLAUDE.md or AGENTS.md Audit: Cut, Rewrite as Checkable Rules, Move to Skills

Turns a pasted CLAUDE.md or AGENTS.md into a shorter file of verifiable rules and names which procedures belong in skills.

You get: Working code with an explanation

More like this

The prompt

Installs to .agents/skills/claude-md-or-agents-md-audit-cut-rewrite-as-checkable-rules-move/

mkdir -p .agents/skills/claude-md-or-agents-md-audit-cut-rewrite-as-checkable-rules-move && curl -sL "https://prompts-gpt.com/prompts/claude-md-or-agents-md-audit-cut-rewrite-as-checkable-rules-move-to-skills/raw" -o .agents/skills/claude-md-or-agents-md-audit-cut-rewrite-as-checkable-rules-move/SKILL.md
SKILL.md
Preview
---
name: claude-md-or-agents-md-audit-cut-rewrite-as-checkable-rules-move
description: "Turns a pasted CLAUDE.md or AGENTS.md into a shorter file of verifiable rules and names which procedures belong in skills."
---

# CLAUDE.md or AGENTS.md Audit: Cut, Rewrite as Checkable Rules, Move to Skills

Turns a pasted CLAUDE.md or AGENTS.md into a shorter file of verifiable rules and names which procedures belong in skills.

## Prompt

```
You are a reviewer of agent instruction files for Claude Code. Audit the file below and make it shorter and enforceable. If you need repo context to judge a rule, such as which linter or CI checks already exist, ask me at most two short questions first. Rules: 1) Cut rules that are vague, duplicated, contradicted by another rule, or already enforced by a linter, formatter or CI. 2) Rewrite every surviving rule so it states the trigger, the required action and how to verify it with a command or code search. 3) Flag any procedure of more than five steps or used only for one kind of task as a skill candidate. 4) Keep the reason for a rule only when it prevents a real mistake. Output: a table with columns Original rule, Verdict (keep, cut, rewrite, move to skill), and Reason; the rewritten file in one code block; a list of skill candidates with a proposed name and a one-sentence trigger description; line counts before and after; risks of the cuts; and next actions.

{paste your CLAUDE.md or AGENTS.md here}
```

## Usage Notes

Use it when your instruction file has grown long and Claude Code seems to ignore parts of it. Paste the full file, and run it inside the repo so Claude Code can check rules against real config.

Example output

AI-written example
Original ruleVerdictReason
"Write clean, readable code"CutVague and not checkable.
"Use 2-space indent and single quotes"CutPrettier already enforces this in CI.
"Never use any"Cut@typescript-eslint/no-explicit-any is set to error.
"Be careful with the database"CutVague. The migration rule below covers the real risk.
"Run tests before committing"RewriteIt has no trigger or check.
"Use pnpm, not npm"RewriteA lockfile search can verify it.
"Use named exports" and "Default export everything in /app"RewriteThe two rules contradict each other.
"Don't touch src/generated/"KeepIt prevents a real mistake, and git diff can verify it.
9-step release checklistMove to skillMore than five steps and used only for releases.
7-step DB migration walkthroughMove to skillMore than five steps and used only for schema changes.
# AGENTS.md

## Rules
- When you change any file in `src/`, run `pnpm test --changedSince=main` before reporting the task done. It must exit 0.
- Install and run scripts with `pnpm` only. Verify: `git ls-files | grep -E 'package-lock.json|yarn.lock'` returns nothing.
- Use named exports everywhere except files named `page.tsx`, `layout.tsx` or `route.ts` under `src/app/`. Verify: `grep -rn "export default" src --include=*.ts --include=*.tsx --exclude={page,layout,route}.*` returns nothing.
- Never edit `src/generated/`. It is overwritten by `pnpm codegen`, so manual edits are lost. Verify: `git diff --name-only | grep '^src/generated/'` returns nothing. To change it, edit `schema.graphql` and run `pnpm codegen`.
- When a task needs a schema change, use the `db-migration` skill.
- When asked to cut a release, use the `release` skill.

Skill candidates

  • release: Use when the user asks to cut, tag or publish a new version.
  • db-migration: Use when a task adds, alters or removes a database table or column.

Line counts: before 62, after 14 (77% shorter).

**Risks

Generated from this prompt by AI. Your results will vary.

Tips and common edits

Use it when your instruction file has grown long and Claude Code seems to ignore parts of it. Paste the full file, and run it inside the repo so Claude Code can check rules against real config.

Questions about this prompt

More in Claude Code

Recurring Workflow to SKILL.md with Trigger, Steps and Verification

Claude Code interviews you briefly about a repeated workflow and writes a complete SKILL.md with a precise trigger description, steps, supporting files and a verification step.

Lean CLAUDE.md Generator from Repo Inspection

Claude Code inspects your repository and writes a CLAUDE.md under 200 lines with verified commands first, checkable conventions, anti-patterns and the reasons behind key decisions.

Codex Writes an AGENTS.md for This Repository From the Real Setup

Has Codex inspect your repository and write a short, accurate AGENTS.md with the real build, test and lint commands, conventions and boundaries, checked by actually running them.

Conventional Commit and PR Description Writer Skill (SKILL.md)

A ready-to-save SKILL.md that makes your coding agent write Conventional Commits messages and pull request descriptions from the staged diff, never from guesses.

Pre-Merge Code Review Checklist Skill (SKILL.md)

A save-ready SKILL.md that has your coding agent review a branch before merge: correctness, security, tests and migrations, with findings ranked by severity and no style nitpicks.

Write a SKILL.md From a Workflow You Keep Repeating

Interviews you about a task you do over and over, then writes a complete, save-ready SKILL.md with a trigger description, steps, output format and stop conditions.

Agent Run Post-Mortem: Trace Root Cause and Prompt or Tool Fixes

Analyzes a pasted agent trace to find the first real failure and proposes exact prompt rewrites or tool changes, each with a test.

Characterization Tests Before a Refactor

Writes tests that lock in a module's current behavior, including edge cases and quirks, so you can refactor safely.

Checkpoint and Rollback Manager with Compensation Steps and Failure Injection Tests

Guides Claude Code to implement checkpoint snapshots, rollback modes, and compensating actions for side-effecting agent phases, then prove them with failure-injection tests. Helps you decide the rollback strategy per phase.

Claude Code Behavior-Preserving Refactor with Characterization Tests and Staged Commits

Guides Claude Code to refactor a module safely by first pinning current behavior with characterization tests, then applying small reversible steps with verification after each. Delivers a diff, risk register, and rollback plan.

Claude Code Feature Implementation Plan and Build from a Ticket with Repo Convention Discovery

Has Claude Code investigate how similar features are built in the repository, produce an implementation plan with acceptance tests, then implement it in verified increments. Surfaces risks, open questions, and next actions before and after coding.

Claude Code Hook Writer: Auto-Run Lint, Typecheck or Tests After Edits

Produces a PostToolUse hook entry for settings.json, the script it calls and a concrete procedure to test that the check runs after file edits.