scope-audit

Audits git diffs against a declared feature scope to flag out-of-scope file changes.

Updated May 11, 2026
One-click install
npx skills add https://github.com/thachrocky12345/local-agent-train-workstation --skill scope-audit-thachrocky12345
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scope-audit
Source: https://github.com/thachrocky12345/local-agent-train-workstation/tree/main/.claude/skills/scope-audit
Command: npx skills add https://github.com/thachrocky12345/local-agent-train-workstation --skill scope-audit-thachrocky12345

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Implementation work often drifts beyond its intended boundary, causing cross-domain contamination that breaks unrelated features. This Skill enforces the rule "fix one page, don't touch others" by declaring an allowed file set before coding and verifying the actual git diff against it afterward. ## Core Features & Use Cases - Scope Declaration: Maps a feature name (e.g., "attribution portal", "booking checkout") to canonical primary and shared file paths using built-in domain maps for a Django backend and Next.js frontend. - Blast-Radius Audit: Classifies every changed file from git diff as in-scope, shared, violation, or informational, then produces a structured pass/fail report. - Violation & Shared-File Protocols: Offers revert, separate-branch, or justify-in-place options for violations, and evaluates shared-file touches as interface-only, logic change, or incidental. - Pre-Commit Gate: Runs as a pre-commit hook that infers scope from the branch name and blocks commits containing out-of-scope changes. - Use Case: Before committing a checkout fix, run a scope check to discover you accidentally modified a provider profile component, then revert it or move it to a separate PR. ## Quick Start Ask the AI to declare scope for the attribution portal feature, then after implementing run a scope check against the current git diff.

Frequently Asked Questions about scope-audit

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

FAQPage Schema
How do I check which files my branch changed before committing?

Run a scope check to diff your branch against its base using git diff --name-only origin/main...HEAD. Each changed file is classified as in-scope, shared, violation, or informational, and a report with a pass/fail verdict is produced.

How do I enforce that a feature only touches specific files?

Declare the feature scope before implementation, which maps the feature to primary and shared file paths via a domain map. After implementation, the audit flags any changed file outside that declared set as a violation.

Can scope checking run as a pre-commit hook?

Yes, pre-commit mode infers the domain from the branch name and audits staged files via git diff --cached --name-only. It exits with code 1 to block the commit when violations exist and exits 0 when the diff is clean.

What happens when a change legitimately spans multiple domains?

Known overlap patterns like checkout payment flow or GraphQL schema updates allow a primary domain plus approved secondary domains. Files in both the primary and allowed secondary domains are treated as in-scope during the audit.

What should I do when an out-of-scope file violation is found?

You get three options: revert the file with git checkout, move the change to a separate branch and PR, or justify it in place with a documented comment in the PR body. The violation is always surfaced rather than silently blocked.