Enforcement Audit Skill
This skill runs a structured compliance audit for a specific technology against its instruction file. It replaces the individual enforce.* prompts with a single parameterised workflow.
Technology Resolution
Resolve the technology from the user's input ($ARGUMENTS). Match against the table below to determine the instruction file, file patterns, rule prefix, and output paths.
| Technology |
Instruction file |
File patterns |
Rule prefix |
Inventory path |
Plan path |
| python |
python.instructions.md |
*.py, pyproject.toml, uv.lock, requirements*.txt |
PY |
.copilot/analysis/python-inventory.md |
.copilot/analysis/python-instructions-alignment-plan.md |
| typescript |
typescript.instructions.md |
*.ts, *.tsx, *.js, package.json, tsconfig.json |
TS |
.copilot/analysis/typescript-inventory.md |
.copilot/analysis/typescript-instructions-alignment-plan.md |
| go |
go.instructions.md |
*.go, go.mod, go.sum |
GO |
.copilot/analysis/go-inventory.md |
.copilot/analysis/go-instructions-alignment-plan.md |
| docker |
docker.instructions.md |
Dockerfile, Dockerfile.*, compose.yaml, compose.*.yaml |
DF |
.copilot/analysis/docker-inventory.md |
.copilot/analysis/docker-instructions-alignment-plan.md |
| rust |
rust.instructions.md |
*.rs, Cargo.toml, Cargo.lock |
RS |
.copilot/analysis/rust-inventory.md |
.copilot/analysis/rust-instructions-alignment-plan.md |
| shell |
shell.instructions.md |
*.sh, *.bash, *.zsh |
SH |
.copilot/analysis/shell-inventory.md |
.copilot/analysis/shell-instructions-alignment-plan.md |
| makefile |
makefile.instructions.md |
Makefile, *.mk |
MK |
.copilot/analysis/makefile-inventory.md |
.copilot/analysis/makefile-instructions-alignment-plan.md |
| terraform |
terraform.instructions.md |
*.tf, *.tfvars |
TF |
.copilot/analysis/terraform-inventory.md |
.copilot/analysis/terraform-instructions-alignment-plan.md |
| reactjs |
reactjs.instructions.md |
*.jsx, *.tsx, *.js, *.ts |
RJS |
.copilot/analysis/reactjs-inventory.md |
.copilot/analysis/reactjs-instructions-alignment-plan.md |
| tauri |
tauri.instructions.md |
*.rs, *.ts, *.tsx, *.js, *.jsx |
TAU |
.copilot/analysis/tauri-inventory.md |
.copilot/analysis/tauri-instructions-alignment-plan.md |
| playwright-python |
playwright-python.instructions.md |
*.py |
PPW |
.copilot/analysis/playwright-python-inventory.md |
.copilot/analysis/playwright-python-instructions-alignment-plan.md |
| playwright-typescript |
playwright-typescript.instructions.md |
*.ts, *.tsx |
PTW |
.copilot/analysis/playwright-typescript-inventory.md |
.copilot/analysis/playwright-typescript-instructions-alignment-plan.md |
If the technology is not in this table, inform the user and list the supported technologies.
Mandatory Preparation
Before starting the audit:
- Read the constitution for non-negotiable rules, if you have not done already.
- Read the instruction file for the resolved technology (from the table above, located in
.github/instructions/).
- Note the reference identifiers (e.g.
[PY-QR-001]) - you must assess compliance against each of them.
- Read the architecture overview instructions and adopt the approach for gathering supporting evidence.
Goal
Enumerate every artefact of the resolved technology in the repository, detect any discrepancies against the instruction file, plan the refactor/rework workstream, implement the required changes, and confirm compliance.
Discovery (run before writing)
A. Enumerate scope
- Run
git ls-files with the file patterns from the table above (and include glue files such as Makefile, CI configs) to capture the full footprint.
- Categorise each file by role (entrypoints, libraries, tests, configuration, tooling, etc.).
- Record locations that declare tooling to ensure instructions apply consistently.
B. Load enforcement context
- Re-read the relevant sections of the instruction file for the features present.
- Note any repository ADRs or docs that explicitly override defaults; if none exist, assume the instructions are fully binding.
- Summarise any uncertainties as Unknown from code - verify {topic} with maintainers before proceeding.
Steps
Note: On subsequent runs, check whether the artefacts produced by earlier executions (inventory and alignment plan) already exist and parse them so progress is cumulative rather than duplicated.
1) Build the artefact matrix
- Produce a table in the inventory path (from the table above) listing each file/folder, its role, and key instruction tags that apply.
- Highlight high-risk areas where divergence is most likely.
2) Detect discrepancies against instructions
- For each artefact and file, scan for violations of the instruction tags.
- Assess each artefact and file against compliance of each reference identifier from the instruction file.
- Capture findings with precise evidence links, formatted as
- Evidence: [path/to/file](path/to/file#L10-L40) - violates [{PREFIX}-XXX-NNN] because ... (using the rule prefix from the table).
- Record unknowns explicitly using Unknown from code - {action}.
3) Plan refactoring and rework
- Group findings into actionable workstreams.
- For each workstream, provide: objective, files to touch, specific instruction tags satisfied, order of execution (prioritise safety-critical fixes first).
- Store the plan in the plan path from the table above for traceability.
4) Implement the changes (iterative, safe batches)
- Execute the plan in small batches, keeping commits narrowly scoped and referencing instruction tags.
- Prefer refactors that move logic into shared modules, add missing tooling config, or adjust CLIs/APIs to match the contract.
- Update docs, Makefiles, CI, and configuration to keep guidance, automation, and behaviour in sync.
5) Validate quality gates and behavioural parity
- After each batch, run
make lint and make test; iterate until all pass with zero errors or warnings.
- If additional technology-specific checks exist, run them when the touched areas require it.
- Document any failures and fixes in the plan file; unresolved issues must be tracked as blockers.
6) Summarise outcomes and next steps
- Produce a final enforcement report (append to the plan file) covering: resolved discrepancies, remaining gaps, follow-up actions.
- Confirm there are no lingering Unknown from code items; if any remain, turn them into explicit follow-ups.
- Share the plan/report with maintainers (e.g. via PR description).
Output Requirements
- Use concrete evidence links for every finding or change request.
- Reference instruction identifiers when explaining discrepancies or fixes.
- Keep activities broken into the steps above; do not skip steps even if the code appears compliant.
- Prefer automation (scripts, linters) over manual spot checks where feasible.
- Maintain ASCII-only text unless the repository already contains Unicode in the touched files.
- When information is missing, record Unknown from code - {suggested action} instead of guessing.
Examples
- example-01-happy-path.md - a full
python audit producing the inventory and alignment plan, implementing fixes across five workstreams, and validating with make lint and make test.
1---2name: enforcement-audit3description: Run a compliance audit against a technology instruction file, detecting discrepancies, planning workstreams, implementing fixes, and validating quality gates.4license: MIT5---67# Enforcement Audit Skill89This skill runs a structured compliance audit for a specific technology against its instruction file. It replaces the individual `enforce.*` prompts with a single parameterised workflow.1011## Technology Resolution1213Resolve the technology from the user's input (`$ARGUMENTS`). Match against the table below to determine the instruction file, file patterns, rule prefix, and output paths.1415| Technology | Instruction file | File patterns | Rule prefix | Inventory path | Plan path |16| --------------------- | --------------------------------------- | -------------------------------------------------------------- | ----------- | ------------------------------------------------------ | ------------------------------------------------------------------------ |17| python | `python.instructions.md` | `*.py`, `pyproject.toml`, `uv.lock`, `requirements*.txt` | PY | `.copilot/analysis/python-inventory.md` | `.copilot/analysis/python-instructions-alignment-plan.md` |18| typescript | `typescript.instructions.md` | `*.ts`, `*.tsx`, `*.js`, `package.json`, `tsconfig.json` | TS | `.copilot/analysis/typescript-inventory.md` | `.copilot/analysis/typescript-instructions-alignment-plan.md` |19| go | `go.instructions.md` | `*.go`, `go.mod`, `go.sum` | GO | `.copilot/analysis/go-inventory.md` | `.copilot/analysis/go-instructions-alignment-plan.md` |20| docker | `docker.instructions.md` | `Dockerfile`, `Dockerfile.*`, `compose.yaml`, `compose.*.yaml` | DF | `.copilot/analysis/docker-inventory.md` | `.copilot/analysis/docker-instructions-alignment-plan.md` |21| rust | `rust.instructions.md` | `*.rs`, `Cargo.toml`, `Cargo.lock` | RS | `.copilot/analysis/rust-inventory.md` | `.copilot/analysis/rust-instructions-alignment-plan.md` |22| shell | `shell.instructions.md` | `*.sh`, `*.bash`, `*.zsh` | SH | `.copilot/analysis/shell-inventory.md` | `.copilot/analysis/shell-instructions-alignment-plan.md` |23| makefile | `makefile.instructions.md` | `Makefile`, `*.mk` | MK | `.copilot/analysis/makefile-inventory.md` | `.copilot/analysis/makefile-instructions-alignment-plan.md` |24| terraform | `terraform.instructions.md` | `*.tf`, `*.tfvars` | TF | `.copilot/analysis/terraform-inventory.md` | `.copilot/analysis/terraform-instructions-alignment-plan.md` |25| reactjs | `reactjs.instructions.md` | `*.jsx`, `*.tsx`, `*.js`, `*.ts` | RJS | `.copilot/analysis/reactjs-inventory.md` | `.copilot/analysis/reactjs-instructions-alignment-plan.md` |26| tauri | `tauri.instructions.md` | `*.rs`, `*.ts`, `*.tsx`, `*.js`, `*.jsx` | TAU | `.copilot/analysis/tauri-inventory.md` | `.copilot/analysis/tauri-instructions-alignment-plan.md` |27| playwright-python | `playwright-python.instructions.md` | `*.py` | PPW | `.copilot/analysis/playwright-python-inventory.md` | `.copilot/analysis/playwright-python-instructions-alignment-plan.md` |28| playwright-typescript | `playwright-typescript.instructions.md` | `*.ts`, `*.tsx` | PTW | `.copilot/analysis/playwright-typescript-inventory.md` | `.copilot/analysis/playwright-typescript-instructions-alignment-plan.md` |2930If the technology is not in this table, inform the user and list the supported technologies.3132## Mandatory Preparation3334Before starting the audit:35361. Read the [constitution](../../../.specify/memory/constitution.md) for non-negotiable rules, if you have not done already.372. Read the instruction file for the resolved technology (from the table above, located in `.github/instructions/`).383. Note the reference identifiers (e.g. `[PY-QR-001]`) - you must assess compliance against each of them.394. Read the [architecture overview instructions](../../instructions/includes/architecture-baseline.include.md) and adopt the approach for gathering supporting evidence.4041## Goal4243Enumerate every artefact of the resolved technology in the repository, detect any discrepancies against the instruction file, plan the refactor/rework workstream, implement the required changes, and confirm compliance.4445## Discovery (run before writing)4647### A. Enumerate scope48491. Run `git ls-files` with the file patterns from the table above (and include glue files such as `Makefile`, CI configs) to capture the full footprint.502. Categorise each file by role (entrypoints, libraries, tests, configuration, tooling, etc.).513. Record locations that declare tooling to ensure instructions apply consistently.5253### B. Load enforcement context54551. Re-read the relevant sections of the instruction file for the features present.562. Note any repository ADRs or docs that explicitly override defaults; if none exist, assume the instructions are fully binding.573. Summarise any uncertainties as **Unknown from code - verify {topic} with maintainers** before proceeding.5859## Steps6061> **Note:** On subsequent runs, check whether the artefacts produced by earlier executions (inventory and alignment plan) already exist and parse them so progress is cumulative rather than duplicated.6263### 1) Build the artefact matrix64651. Produce a table in the inventory path (from the table above) listing each file/folder, its role, and key instruction tags that apply.662. Highlight high-risk areas where divergence is most likely.6768### 2) Detect discrepancies against instructions69701. For each artefact and file, scan for violations of the instruction tags.712. Assess each artefact and file against compliance of each reference identifier from the instruction file.723. Capture findings with precise evidence links, formatted as `- Evidence: [path/to/file](path/to/file#L10-L40) - violates [{PREFIX}-XXX-NNN] because ...` (using the rule prefix from the table).734. Record unknowns explicitly using **Unknown from code - {action}**.7475### 3) Plan refactoring and rework76771. Group findings into actionable workstreams.782. For each workstream, provide: objective, files to touch, specific instruction tags satisfied, order of execution (prioritise safety-critical fixes first).793. Store the plan in the plan path from the table above for traceability.8081### 4) Implement the changes (iterative, safe batches)82831. Execute the plan in small batches, keeping commits narrowly scoped and referencing instruction tags.842. Prefer refactors that move logic into shared modules, add missing tooling config, or adjust CLIs/APIs to match the contract.853. Update docs, Makefiles, CI, and configuration to keep guidance, automation, and behaviour in sync.8687### 5) Validate quality gates and behavioural parity88891. After each batch, run `make lint` and `make test`; iterate until all pass with zero errors or warnings.902. If additional technology-specific checks exist, run them when the touched areas require it.913. Document any failures and fixes in the plan file; unresolved issues must be tracked as blockers.9293### 6) Summarise outcomes and next steps94951. Produce a final enforcement report (append to the plan file) covering: resolved discrepancies, remaining gaps, follow-up actions.962. Confirm there are no lingering **Unknown from code** items; if any remain, turn them into explicit follow-ups.973. Share the plan/report with maintainers (e.g. via PR description).9899## Output Requirements100101- Use concrete evidence links for every finding or change request.102- Reference instruction identifiers when explaining discrepancies or fixes.103- Keep activities broken into the steps above; do not skip steps even if the code appears compliant.104- Prefer automation (scripts, linters) over manual spot checks where feasible.105- Maintain ASCII-only text unless the repository already contains Unicode in the touched files.106- When information is missing, record **Unknown from code - {suggested action}** instead of guessing.107108## Examples109110- [example-01-happy-path.md](./examples/example-01-happy-path.md) - a full `python` audit producing the inventory and alignment plan, implementing fixes across five workstreams, and validating with `make lint` and `make test`.