common-custom-code-router
Skill4.6k starsChanged 3 months agoMITView on GitHub
Use when adding or updating Azure CLI command module custom code and deciding whether the requested work should use AAZ subclass custom, legacy SDK-backed custom, or legacy non-SDK custom before generating code.
Trending
Quiet this year.thin dataabout the whole repository
Who's talking about Azure/azure-cli
- NixOS/nixpkgs“Build failure: azure-cli”GitHub · Aug 27, 2025 · 39 reactions
- hashicorp/terraform-provider-azuread“azuread_group_role_management_policy throws 403 permission scope not granted error”GitHub · Jun 11, 2024 · 28 reactions
- hashicorp/terraform-provider-azurerm“[preview] Support for mutual TLS and shared ssl policy in application_gateway”GitHub · Mar 29, 2021 · 25 reactions
- A Hacker News story“Azure CLI converts local accounts to MSFT online accounts on Win11”Hacker News · Jul 16, 2024 · 6 points
- A Hacker News story“Azure CLI takes ~700MB of disk space”Hacker News · Nov 30, 2023 · 3 points
The biggest 5 of 5 mentions linking to the repository that our crawl found. Each line is their own headline.
In this repository10 other files it gives its agents.
- common-aaz-custom-code-generationSkill
- common-legacy-non-sdk-custom-code-generationSkill
- common-legacy-sdk-backed-custom-code-generationSkill
- common-live-test-from-helpSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- openspec-update-changeSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 15 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 9
Use this workflow before generating Azure CLI command module custom code when the requested change may fit more than one authoring pattern.
- Distinctive: line 23
Always classify by the requested behavior and local evidence in the target module: generated AAZ assets, command registration style, …
- Distinctive: line 27
Start with the information available in the prompt and editor context:
- Distinctive: line 35
If a required input is missing, infer it from the current file path or nearest existing module pattern.
- Distinctive: line 39
Use narrow searches and nearby reads.
- Very specific: line 42
Read or search the module's __init__.py for load_aaz_command_table.
- Very specific: line 43
Search aaz/latest for generated files matching the target resource/action, such as _create.py, _show.py, _list.py, _delete.py, _update.py, …
- Very specific: line 44
Search commands.py for the target command group and nearby CliCommandType definitions.
- Very specific: line 45
Search custom.py and neighboring files for existing custom classes inheriting generated AAZ command classes.
- Very specific: line 46
Search _client_factory.py and nearby command registrations for reusable cf_* client factories.
- Very specific: line 65
Do not choose this route just because the module has an aaz/ directory.
- Distinctive: line 81
If both AAZ and SDK are viable, prefer the existing command group's dominant style.
- Distinctive: line 98
Use these tie breakers in order:
- Distinctive: line 100
Prefer the dominant style of the target command group.
- Distinctive: line 101
Prefer the nearest sibling command that uses the same resource family and verb.
- Distinctive: line 102
Prefer AAZ subclass custom only when matching generated AAZ command assets already exist and the customization is around that operation.
- Distinctive: line 103
Prefer legacy SDK-backed custom when the SDK operation/client factory is the primary service interface.
- Distinctive: line 104
Prefer legacy non-SDK custom when the behavior is a workflow, local-tool operation, data-plane operation, or diagnostic flow.
- Distinctive: line 105
If still ambiguous, ask one concise question that names the two plausible routes and the missing decision.
- Very specific: line 129
Keep evidence grounded in existing files or in the user's stated intended behavior.
- Very specific: line 133
Do not classify a whole module as AAZ just because aaz/latest exists.
- Distinctive: line 134
Do not classify every non-AAZ custom function as SDK-backed.
- Very specific: line 135
Do not classify commands that call docker, kubectl, helm, raw HTTP, or data-plane APIs as SDK-backed just because they live in custom.py.
- Distinctive: line 136
Do not require an exact existing command when the user is adding a new command.
- Very specific: line 137
Do not edit generated AAZ files under aaz/latest unless the user explicitly asks to modify generated output and understands regeneration …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Common Custom Code Router
Use this workflow before generating Azure CLI command module custom code when the requested change may fit more than one authoring pattern.
The router classifies the work into exactly one primary route:
aaz-subclass-customlegacy-sdk-backed-customlegacy-non-sdk-custom
This skill is a classifier. Do not implement the command while routing unless the route is already clear and the user asked for implementation.
Module-General Scope
Apply this classification across all Azure CLI command modules under src/azure-cli/azure/cli/command_modules. Module names such as acr, acs, or command groups such as aks safeguards are examples only. Do not treat any example module as the scope of this skill.
Always classify by the requested behavior and local evidence in the target module: generated AAZ assets, command registration style, available client factories, handler shape, and neighboring command patterns.
Inputs
Start with the information available in the prompt and editor context:
- target module, such as
acroracs - target command group, such as
acr,acr helm,aks safeguards, or any other module command group - target command or action, such as
show,create,login,check-health, or a new action name - intended behavior or service operation
- current file path, if the user is editing one
If a required input is missing, infer it from the current file path or nearest existing module pattern. Ask the user only when the missing input is a product or API decision, not when it can be discovered from the repository.
Evidence To Gather
Use narrow searches and nearby reads. Prefer the target module only.
- Locate the module root under
src/azure-cli/azure/cli/command_modules/<module>/. - Read or search the module's
__init__.pyforload_aaz_command_table. - Search
aaz/latestfor generated files matching the target resource/action, such as_create.py,_show.py,_list.py,_delete.py,_update.py, or_wait.py. - Search
commands.pyfor the target command group and nearbyCliCommandTypedefinitions. - Search
custom.pyand neighboring files for existing custom classes inheriting generated AAZ command classes. - Search
_client_factory.pyand nearby command registrations for reusablecf_*client factories. - Inspect neighboring commands with the same resource family or command group.
For new commands, do not require an existing exact command. Use the nearest command group, nearest resource family, generated AAZ assets, and intended service operation as evidence.
Route Decision
Route 1: AAZ Subclass Custom
Choose aaz-subclass-custom when the requested work customizes or wraps an AAZ generated command.
Strong signals:
- Matching generated command exists under
aaz/latest/.../_<verb>.py. - Generated file contains
# Code generated by aaz-dev-toolsandclass <Verb>(AAZCommand). - Existing nearby custom code imports from
.aaz.latest...and definesclass XxxCustom(Create|Show|List|Update|Delete|Wait). - The requested change is mainly argument UX, argument schema, pre-validation, post-processing, lifecycle hooks, or a small behavior override around an existing generated operation.
- Code would naturally use
self.ctx.args,has_value,AAZStrArg,AAZResourceGroupNameArg,pre_operations,post_operations, or_build_arguments_schema.
Do not choose this route just because the module has an aaz/ directory. The generated command must match the requested resource/action or the command group must already be AAZ-first.
Route 2: Legacy SDK-Backed Custom
Choose legacy-sdk-backed-custom when the command should be a hand-written function that calls an Azure Python SDK client.
Strong signals:
- Existing command group uses
CliCommandType(..., client_factory=cf_xxx). - Command registration uses
g.command(...),g.show_command(...), org.generic_update_command(...)with anoperations_tmplpointing to a module function. - Handler is or should be a
deffunction incustom.pyor another module file. - The handler takes
clientor can reuse acf_*client factory. - Main behavior is
client.get(...),client.list(...),client.list_by_resource_group(...),client.begin_create...,client.begin_update...,client.begin_delete..., or similar SDK methods. - Code constructs SDK models through
cmd.get_models(...). - The change is CRUD, update, action-on-resource, identity/encryption/network policy, LRO, or
generic_update_commandstyle behavior.
If both AAZ and SDK are viable, prefer the existing command group's dominant style. If the group is mixed and both implementations are equally plausible, ask one question about the intended API source.
Route 3: Legacy Non-SDK Custom
Choose legacy-non-sdk-custom when the command is hand-written but the main behavior is not a simple SDK resource operation.
Strong signals:
- Main behavior uses local tools or subprocesses, such as
docker,podman,kubectl,helm,notary,Popen,subprocess.run, orsubprocess.check_output. - Main behavior uses raw HTTP, data-plane APIs, custom REST calls, external downloads, or
send_raw_request,requests,urlopen, or generated AAZ commands only as internal helpers. - Main behavior orchestrates multiple services, local files, environment variables, credentials, diagnostics, install flows, archive packaging, kubeconfig, or browser/proxy behavior.
- The command may still be registered through
CliCommandType, but a SDK CRUD/action template would not describe the implementation.
Examples include login, check-health, install-cli, browse, repository/data-plane operations, import/export helpers, and local packaging flows.
Tie Breakers
Use these tie breakers in order:
- Prefer the dominant style of the target command group.
- Prefer the nearest sibling command that uses the same resource family and verb.
- Prefer AAZ subclass custom only when matching generated AAZ command assets already exist and the customization is around that operation.
- Prefer legacy SDK-backed custom when the SDK operation/client factory is the primary service interface.
- Prefer legacy non-SDK custom when the behavior is a workflow, local-tool operation, data-plane operation, or diagnostic flow.
- If still ambiguous, ask one concise question that names the two plausible routes and the missing decision.
Output Format
Return a compact routing result before implementation:
route: aaz-subclass-custom | legacy-sdk-backed-custom | legacy-non-sdk-custom
confidence: high | medium | low
evidence:
- "Concrete repo signal, file, symbol, or pattern."
- "Concrete repo signal, file, symbol, or pattern."
resolved_slots:
module_name: "<module or unknown>"
command_group: "<group or unknown>"
operation_module: "<module path or unknown>"
generated_aaz_base: "<class import or not-applicable>"
client_factory: "<cf_xxx or not-applicable>"
primary_service_interface: "aaz | sdk | non-sdk | unknown"
open_questions:
- "Only include if required to proceed."
next_skill: "common-aaz-custom-code-generation | common-legacy-sdk-backed-custom-code-generation | common-legacy-non-sdk-custom-code-generation"Keep evidence grounded in existing files or in the user's stated intended behavior. Do not claim an exact route based only on module name.
Common Mistakes To Avoid
- Do not classify a whole module as AAZ just because
aaz/latestexists. - Do not classify every non-AAZ custom function as SDK-backed.
- Do not classify commands that call
docker,kubectl,helm, raw HTTP, or data-plane APIs as SDK-backed just because they live incustom.py. - Do not require an exact existing command when the user is adding a new command. Use command group style, generated assets, SDK availability, and requested behavior.
- Do not edit generated AAZ files under
aaz/latestunless the user explicitly asks to modify generated output and understands regeneration risk.
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.

