maintain-agent-instructions

Validates and reconciles agent instruction files against a machine-readable policy model.

2|Updated Jul 18, 2026
One-click install
npx skills add https://github.com/Arasz/ai-badger --skill maintain-agent-instructions-arasz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maintain-agent-instructions
Source: https://github.com/Arasz/ai-badger/tree/main/features/common/skills/maintain-agent-instructions
Command: npx skills add https://github.com/Arasz/ai-badger --skill maintain-agent-instructions-arasz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Agent instruction files like CLAUDE.md, copilot-instructions.md, and AGENTS.md drift apart over time, and manual review cannot reliably catch inconsistencies. This Skill replaces eyeball checks with scriptable validation and drift detection driven by a machine-readable model in .ai-badger/agent-instructions/. ## Core Features & Use Cases - Validation: Runs validate-agent-instructions.mjs to check required files, directories, headings, frontmatter, and required/forbidden patterns against model.json. - Drift Detection: Runs check-agent-drift.mjs to verify that non-negotiable invariants and review categories actually appear in the instruction files that must mention them. - Auxiliary Linters: Includes constraint_count_lint.py to cap invariant list length and reasoning_scaffold_lint.py to flag chain-of-thought anti-patterns in instruction files. - Use Case: When CI fails on agent instruction checks, run both scripts from the project root, fix only the reported files and rules, update the model if shared policy changed, and rerun until both pass. ## Quick Start Run the validation and drift-check scripts from the project root and reconcile any reported agent instruction files against the model in .ai-badger/agent-instructions/.

Frequently Asked Questions about maintain-agent-instructions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check agent instruction files for drift?

Run check-agent-drift.mjs from the project root with Node 18+. It reads model.json from .ai-badger/agent-instructions and verifies that each invariant and review category appears in every file listed in its mustAppearIn array, exiting non-zero on failures.

How to validate CLAUDE.md and copilot-instructions.md consistency?

Run validate-agent-instructions.mjs from the project root. It checks required files, directories, headings, frontmatter fields, and required or forbidden regex patterns defined in model.json, reporting precise file and rule failures.

Does this work with GitHub Copilot coding agent?

Yes. Copilot CLI and coding agent read .github/copilot-instructions.md, .github/instructions/*.instructions.md, AGENTS.md, and CLAUDE.md. The validation scripts are plain command-line checks, so Copilot-driven automation or CI can run them without Claude-specific APIs.

Why does the drift check reject my regex pattern?

Patterns over 500 characters or containing a quantifier applied to a group are refused because they backtrack catastrophically and Node has no regex timeout. Rewrite the pattern without a quantifier after a closing parenthesis.

When should I not use this skill?

Skip it for a single-file typo fix, when no drift exists and CI checks pass, or when authoring brand-new policy from scratch. The scripts reconcile existing files against a model; they do not create policy content.