sanity-check-linter
Skill25 starsChanged 5 months agoMITView on GitHub
Run the Policy Linter CLI against a temporary test policy to confirm a recent code change behaves end-to-end. Triggers: "sanity check the linter", "run the linter against a test policy", "verify the linter still works", "smoke test the linter".
In this repository4 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- implement-linter-ruleSkill
- review-linter-ruleSkill
- triage-linter-ruleSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 10 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run the linter CLI against a temporary policy to confirm a code change is structurally sound end-to-end before committing.
- Distinctive: line 12
After adding a new linter rule.
- Distinctive: line 13
After modifying the engine, expression model, or rule dispatch.
- Distinctive: line 14
Before declaring a non-trivial change complete.
- Distinctive: line 16
Not needed for doc-only changes, test-only changes, or version bumps.
- Very specific: line 20
Check for an existing global install before touching anything.
- Distinctive: line 47
Create two temporary policy files for the changed rule:
- Distinctive: line 70
Run the linter against both policies under each scenario relevant to the change.
- Distinctive: line 84
No findings appear from rule sets that weren't selected.
- Very specific: line 87
Delete the temporary files: Remove-Item sanity-check.json, sanity-check-suppressed.json.
- Very specific: line 89
If step 1 found a feed install to restore, reinstall it: dotnet tool install -g <id> --version <version>.
- Distinctive: line 93
Not a replacement for unit tests.
- Distinctive: line 94
Not a coverage tool. The test policy is intentionally minimal - pick one that exercises the change you're verifying.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Sanity-Check the Policy Linter
Run the linter CLI against a temporary policy to confirm a code change is structurally sound end-to-end before committing. This is distinct from unit tests - it verifies rule discovery, dispatch, rule-set filtering, and output formatting.
When to use
- After adding a new linter rule.
- After modifying the engine, expression model, or rule dispatch.
- Before declaring a non-trivial change complete.
Not needed for doc-only changes, test-only changes, or version bumps.
Flow
Check for an existing global install before touching anything. List installed tools and find any that provides the
policylintercommand or whose id ends in.PolicyLinter.Cli:dotnet tool list -gdotnet tooldoesn't record where a tool came from, so you can't tell a local build from a feed install by inspection. Record the id and version. Unless the current task already said it's fine to overwrite an existing install, show the user the id and version, tell them it will be removed, and ask whether it's a real install from a feed (restore it afterwards) or a disposable local build (don't). Wait for confirmation.Uninstall the existing tool (repeat for the new id too, if it differs):
dotnet tool uninstall -g <existing-id>Pack and install the CLI as a global tool from a clean build:
dotnet pack src/PolicyLinter.Cli/PolicyLinter.Cli.csproj --configuration Release -o <output-path> dotnet tool install -g Microsoft.Azure.Policy.PolicyLinter.Cli --add-source <output-path> --no-cacheList the available rule sets to confirm rule discovery works:
policylinter --list-rule-setsCreate two temporary policy files for the changed rule:
- One that triggers the rule.
- One that differs only in the condition that should suppress the rule.
The deny-VM example below triggers a default rule (
HardCodedPolicyEnforcementEffect), which gives you a guaranteed finding to confirm the CLI ran end-to-end. Adjust it to exercise the change you just made, then create the matching suppression case.@" { "properties": { "policyType": "Custom", "mode": "All", "displayName": "Sanity-check policy", "description": "Temporary policy for linter sanity-check.", "policyRule": { "if": { "field": "type", "equals": "Microsoft.Compute/virtualMachines" }, "then": { "effect": "deny" } } } } "@ | Out-File -FilePath sanity-check.json -Encoding UTF8Run the linter against both policies under each scenario relevant to the change. At minimum, run the default rule set. If the change touches a non-default rule set or rule-set filtering, run those too:
policylinter sanity-check.json policylinter sanity-check-suppressed.json policylinter sanity-check.json --rule-set <RuleSetName> policylinter sanity-check-suppressed.json --rule-set <RuleSetName> policylinter sanity-check.json --rule-set <RuleSetName> --rule-set default policylinter sanity-check-suppressed.json --rule-set <RuleSetName> --rule-set default- For each run, verify:
- The CLI exits without an error.
- Findings from the rule you changed appear (or are absent) as expected.
- No findings appear from rule sets that weren't selected.
- Clean up:
- Delete the temporary files:
Remove-Item sanity-check.json, sanity-check-suppressed.json. - Uninstall the sanity-check build:
dotnet tool uninstall -g Microsoft.Azure.Policy.PolicyLinter.Cli. - If step 1 found a feed install to restore, reinstall it:
dotnet tool install -g <id> --version <version>.
- Delete the temporary files:
What this skill is not
- Not a replacement for unit tests. Unit tests exercise rule logic against precise inputs; this confirms end-to-end glue.
- Not a coverage tool. The test policy is intentionally minimal - pick one that exercises the change you're verifying.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

