agentleFS
Microsoft AzureKnown publisherAzure/vscode-aks-tools/skills/kickstart-handoff/SKILL.md

kickstart-handoff

Skill65 starsChanged 3 months agoMITView on GitHub

Pre-deploy check playbook — verify cluster, ACR, permissions, and tooling before deployment.

  • Installs packages

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ensure cluster, ACR, permissions, and tooling are all ready before deploying.

    line 9
  2. Distinctive:

    If already confirmed ready in a prior status check, skip.

    line 13
  3. Distinctive:

    If that prints a role-assignment id, the registry is already attached — report "✓ Registry already attached" and skip to 6d.

    line 37
  4. Very specific:

    Do NOT assume the user is Owner.

    line 39
  5. Very specific:

    If that fails ("Are you an Owner on this subscription?"), assign the role directly (reuse $KUBELET_ID from the check above):

    line 42
  6. Very specific:

    If that also fails (403 — user lacks roleAssignments/write), follow /kickstart-pim-activation to check for PIM-eligible roles and guide …

    line 46
  7. Very specific:

    If missing: az aks install-cli.

    line 54
  8. Very specific:

    If allPassed === true: render markdown and proceed to Confirm.

    line 94
  9. Very specific:

    If az role assignment create then returns 403 (user lacks Microsoft.Authorization/roleAssignments/write), follow /kickstart-pim-activation …

    line 96
  10. Very specific:

    If acrName is omitted (no ACR in scope), the three ACR probes are skipped and the report says so.

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pre-Deploy Check

Ensure cluster, ACR, permissions, and tooling are all ready before deploying. Follow this strict order.

6a. Cluster Readiness

If already confirmed ready in a prior status check, skip. Otherwise:

az aks show --name <cluster> --resource-group <rg> --subscription <sub> --query "provisioningState" --output tsv
  • Succeeded: continue.
  • Creating: az aks wait --name <cluster> --resource-group <rg> --subscription <sub> --created --interval 30 --timeout 600
  • Failed: offer retry or a different cluster via vscode_askQuestions.

6b. Cluster Metadata Detection

Record cluster properties to gate subsequent checks:

az aks show --name <cluster> --resource-group <rg> --subscription <sub> --query "{sku:sku.tier, azureRbac:aadProfile.enableAzureRBAC, localAccountsDisabled:disableLocalAccounts}" --output json

For existing clusters, use these flags to determine behavior. For new AKS Automatic clusters expect sku=Automatic, azureRbac=true, localAccountsDisabled=true.

6c. ACR Attachment

First, check whether the registry is already attached — when the cluster was created through the Kickstart cluster-setup view, it already granted the cluster's kubelet identity AcrPull on the registry, so this step is usually a no-op:

KUBELET_ID=$(az aks show --name <cluster> --resource-group <rg> --subscription <sub> --query "identityProfile.kubeletidentity.objectId" --output tsv)
az role assignment list --assignee "$KUBELET_ID" --role "AcrPull" --scope "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.ContainerRegistry/registries/<acr>" --query "[].id" --output tsv

If that prints a role-assignment id, the registry is already attached — report "✓ Registry already attached" and skip to 6d. Otherwise attach it now.

Do NOT assume the user is Owner. az aks update --attach-acr requires Owner/Account Admin/Co-Admin on the subscription. Try approaches in order:

  1. az aks update --name <cluster> --resource-group <rg> --attach-acr <acr> --subscription <sub>
  2. If that fails ("Are you an Owner on this subscription?"), assign the role directly (reuse $KUBELET_ID from the check above):
    az role assignment create --assignee "$KUBELET_ID" --role "AcrPull" --scope "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.ContainerRegistry/registries/<acr>"
  3. If that also fails (403 — user lacks roleAssignments/write), follow /kickstart-pim-activation to check for PIM-eligible roles and guide activation. If none eligible, print an admin hand-off block with the exact az role assignment create command.

6d. kubelogin

AKS Automatic disables local accounts.

which kubelogin

If missing: az aks install-cli. If that fails: brew install Azure/kubelogin/kubelogin or https://github.com/Azure/kubelogin/releases. Never use az aks get-credentials --admin (will fail). Never suggest az aks command invoke (same user identity, same Forbidden error).

6e–6g. Permission Probes (preferred — single call)

Invoke the bundled VS Code command aks.checkDeploymentPermissions via vscode/runCommand. It runs all five remaining permission gates against the Azure ARM API (no kubectl / az acr build round-trip) and returns a self-contained markdown report you can render directly in chat.

Args:

{
  "subscriptionId": "<sub>",
  "resourceGroup": "<rg>",
  "clusterName": "<cluster>",
  "acrName": "<acr>"
}

Returns:

{
  cancelled: boolean,
  allPassed?: boolean,
  scope?: { clusterScopeId, acrScopeId? },
  probes?: Array<{ id, label, status: "pass" | "fail" | "unknown", reason, recommendedRoles?, remediation? }>,
  markdown: string  // render verbatim
}

Probes performed:

IDGateRequired role on fail
cluster-user6e — can download kubeconfig (listClusterUserCredential)Azure Kubernetes Service Cluster User Role
aks-dataplane-write6f — can create K8s workloads on the clusterAzure Kubernetes Service RBAC Writer
acr-push6g — user can push images to the ACRAcrPush
acr-tasks6g — user can run az acr build server-sideContainer Registry Tasks Contributor
acr-pull-kubeletCluster's kubelet identity can pull from the ACRAcrPull

How to use the result:

  • If allPassed === true: render markdown and proceed to Confirm.
  • For any failing probe, the included remediation is a ready-to-run az role assignment create command. Offer to run it.
  • If az role assignment create then returns 403 (user lacks Microsoft.Authorization/roleAssignments/write), follow /kickstart-pim-activation — that skill calls aks.checkRoleAssignmentPermissions to surface PIM-eligible roles or generate an admin hand-off block.
  • If acrName is omitted (no ACR in scope), the three ACR probes are skipped and the report says so.

Fallback (only if the command is unavailable in this build): fall back to the manual probes —

az aks get-credentials --resource-group <rg> --name <cluster> --overwrite-existing
kubectl auth can-i get namespaces
kubectl auth can-i create deployments --namespace <namespace>
az acr build --registry <acr> --image kickstart-probe:probe --file /dev/null /dev/null 2>&1 | head -5

With the same remediation roles as listed in the table above.

Confirm

Confirm readiness via vscode_askQuestions: "Yes, deploy" (recommended), "Review artifacts first", "Not yet".

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.