.github/skills/naming-rules-drift-check/SKILL.md
Re-fetch Azure naming rules for a set of resources and compare against current regex/length/scope values in resourceDefinition.json. Detects when Azure has changed naming constraints. Triggers on: periodic audit, resource validation.
npx skillsauth add aztfmod/terraform-provider-azurecaf naming-rules-drift-checkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
If a specific list is provided, use it. Otherwise, select a batch of resources:
python3 -c "
import json
with open('resourceDefinition.json') as f:
resources = json.load(f)
# Select resources with official namespace (can verify against docs)
official = [r for r in resources if r.get('official', {}).get('resource_provider_namespace')]
for r in official[:20]: # Check 20 at a time
ns = r['official']['resource_provider_namespace']
print(f'{r[\"name\"]}|{ns}|{r[\"min_length\"]}|{r[\"max_length\"]}|{r[\"scope\"]}')
"
For each resource's resource_provider_namespace, look up the naming rules:
URL: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules
Use Microsoft Docs MCP tools (microsoft_docs_fetch) to fetch and parse the rules page. Find the section matching the resource provider namespace.
For each resource, compare:
min_length vs documented minimummax_length vs documented maximumscope vs documented scopedashes vs whether hyphens are documented as validlowercase vs whether only lowercase is documentedvalidation_regex vs pattern derived from documented valid characters## Naming Rules Drift Report
### Drifted Resources (<count>)
| Resource | Field | Current | Azure Docs | Action |
|----------|-------|---------|------------|--------|
| <name> | max_length | 63 | 128 | Update |
### Verified Resources (<count>)
All other checked resources match Azure documentation.
### Summary
- Resources checked: <count>
- Matches: <count>
- Drift detected: <count>
development
Analyze test failure output to identify root cause and suggest fixes. Use when build or test failures occur. Triggers on: test failures, build errors, CI failures.
development
Validate a resource definition end-to-end using terraform test with mock_provider azurerm. Proves the CAF-generated name is accepted by the azurerm provider schema without Azure credentials. Use after provider-build-test succeeds to run the mocked azurerm integration test.
documentation
Analyze changes since the last release tag and determine the appropriate semantic version bump (patch/minor/major) based on CHANGELOG entries and commit types. Triggers on: release preparation, version planning.
testing
Compare two versions of resourceDefinition.json (e.g., branch vs main) and produce a structured change summary. Triggers on: PR review, audit, before/after comparison.