kickstart-generate
Skill65 starsChanged 3 months agoMITView on GitHub
Generation phase playbook — create all deployment artifacts.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- vscode-aks-tools-release-prSkill
- kickstart-acr-integrationSkill
- kickstart-bicep-authoringSkill
- kickstart-cluster-statusSkill
- kickstart-collaborator-voiceSkill
- kickstart-configure-infraSkill
- kickstart-deploySkill
- kickstart-designSkill
- kickstart-discoverSkill
- kickstart-file-generationSkill
- kickstart-github-pr-conventionsSkill
- kickstart-handoffSkill
- kickstart-phase-accelerationSkill
- kickstart-pim-activationSkill
- kickstart-reviewSkill
- kickstart-safeguard-checklistSkill
- kickstart-samplesSkill
- kickstart-security-hardeningSkill
- kickstart-workload-identitySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 4 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
- Very specific: line 9
Create all deployment artifacts and write them to the workspace.
- Distinctive: line 13
Use the per-service structure map from Discovery (build context, entry point, existing Dockerfile path).
- Very specific: line 15
Reuse existing Dockerfiles: If a service already ships a working Dockerfile, use it as-is (or amend in place) — do not generate a parallel …
- Very specific: line 34
Every resource kickstart generates carries a marker so it can be identified later — both by a human reading the repo and by kubectl queries …
- Very specific: line 49
Never put either in spec.selector or in a Service selector.
- Distinctive: line 104
Use actual resource names from the Configure phase.
- Very specific: line 105
Never use :latest tags.
- Distinctive: line 108
All K8s manifests must comply with AKS deployment safeguards (restricted pod security, no privileged, no hostPath) and must pre-satisfy the …
- Very specific: line 109
Prefer az acr build for image builds instead of docker build.
- Very specific: line 110
After writing all files, confirm with user via vscode_askQuestions.
- Very specific: line 114
Do not hand off unbuilt artifacts.
- Distinctive: line 122
If the build fails or the source→destination map does not resolve the entry point, fix the Dockerfile/paths and rebuild — do not proceed to …
- Very specific: line 124
Keep .dockerignore tight: the entire build context is uploaded to ACR on every build.
- Very specific: line 127
All artifacts written, ACR build permissions confirmed, every Dockerfile builds via az acr build, and the final-stage source→destination …
≈ “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.
Files
Generate Phase
Create all deployment artifacts and write them to the workspace. Follow /kickstart-file-generation for the batch-write order: compute ALL contents first, write all files, then report.
Build from the structure map, not assumptions
Use the per-service structure map from Discovery (build context, entry point, existing Dockerfile path). Never assume the app sits at the repo root.
- Reuse existing Dockerfiles. If a service already ships a working
Dockerfile, use it as-is (or amend in place) — do not generate a parallel one. Only author a Dockerfile for services that lack one. - Cross-check every
COPY/ADD. Each source must resolve to a real file/dir inside that service's build context, and the destination must match where the entry point runs (e.g.WORKDIR /app+COPY . /apponly if the entry point is at the context root). Usesearch/codebaseto confirm sources exist before writing the Dockerfile; flag and fix any mismatch. - Set the run target from the real entry point (
CMD/ENTRYPOINT), not a guessed filename.
Domain playbooks
Load these for detailed patterns as you author each artifact:
/kickstart-bicep-authoring— Bicep template structure and conventions/kickstart-workload-identity— federated credentials, service-account wiring, pod labels/kickstart-acr-integration— attaching ACR to the cluster (no pull secrets)
Artifacts
Dockerfile: Multi-stage build, pinned base image (never :latest), non-root user, .dockerignore. COPY/ADD paths validated against the build context; CMD runs the real entry point.
K8s Manifests (k8s/): namespace.yaml, deployment.yaml (resource requests and limits, probes, runAsNonRoot, Workload Identity labels, env from ConfigMap/Secret), service.yaml (ClusterIP), httproute.yaml (Gateway API, not Ingress). See /kickstart-workload-identity.
Stamp generated resources with kickstart provenance
Every resource kickstart generates carries a marker so it can be identified later — both by a human reading the repo and by kubectl queries against a live cluster.
Kubernetes objects — a label for identity, an annotation for the version:
metadata:
labels:
app.kubernetes.io/managed-by: aks-kickstart
annotations:
kickstart.aks.azure.com/version: "v1"Rules for placement, which matter more than the choice of field:
- Put both on the object's own
metadata(Deployment, Service, HTTPRoute, ServiceAccount, ConfigMap...), not onspec.template.metadata. Anything on the pod template — label or annotation — changes the pod-template hash and forces a full rollout on the next version bump. (kubectl rollout restartworks precisely by writing a pod-template annotation.) - Never put either in
spec.selectoror in a Service selector.spec.selectoris immutable after creation, and a version in a selector would make the Deployment un-updatable. It also collides with the unique-selector safeguard (A9). app.kubernetes.io/managed-byis the convention already used elsewhere in this extension, and its neutral prefix keeps it clear of the reservedkubernetes.azure.com/*namespace blocked by safeguard A4. The version stays an annotation rather than a label: it's read, never selected on, and label values reject+, so it can't hold a semver with build metadata if this later tracks a real release.
Dockerfile — OCI labels in the final stage. Use a kickstart-specific key for the generator version; org.opencontainers.image.version means the application's version, not the tool's:
LABEL org.opencontainers.image.source="<repo url, if known>" \
com.azure.aks.kickstart.generated="true" \
com.azure.aks.kickstart.version="v1"Bicep — Azure resources take tags:
tags: {
'managed-by': 'aks-kickstart'
'kickstart-version': 'v1'
}The version is the literal string v1 — it versions the kickstart artifact contract (this label/annotation scheme and the shape of what kickstart emits), not the extension release. Write v1 verbatim; do not substitute the extension version, a semver, or a date. It changes only when the generated-artifact contract changes in a way consumers need to detect.
Generate safeguard-compliant manifests up front
AKS Automatic enforces Deployment Safeguards, and several of them mutate your manifest on apply. If you don't emit these yourself, the cluster silently rewrites the object and the Phase 7 kubectl get/diff output won't match what you generated. Emit all of the following by default — see /kickstart-safeguard-checklist for the authoritative rule list and mutation outcomes.
- CPU + memory
requestson every container (mutating if omitted), alongside limits:resources: requests: { cpu: 100m, memory: 128Mi } limits: { cpu: 500m, memory: 512Mi } topologySpreadConstraintsor pod anti-affinity (mutating if omitted). Prefer topology spread:topologySpreadConstraints: - maxSkew: 1 topologyKey: kubernetes.io/hostname whenUnsatisfiable: ScheduleAnyway labelSelector: matchLabels: { app: <service> }- Readiness and liveness probes on every container — use the real health path and port from the structure map, never a guessed
/healthz. - Unique Service selectors — each Service must select exactly one workload. In a monorepo do not reuse
app: <appName>across services; useapp: <serviceName>(orapp.kubernetes.io/name+app.kubernetes.io/component) so no two Services overlap. - No AKS-specific labels — never set
kubernetes.azure.com/*labels on your own objects. (azure.workload.identity/*labels and annotations are fine and required.) - No reserved system-pool taints — never configure
CriticalAddonsOnlyon a user node pool. Also do not add a matching toleration to app pods: a toleration permits, but does not force, scheduling onto a matching tainted node and is inappropriate for ordinary workloads. - CSI StorageClass for any PVC — set
storageClassNameexplicitly to a CSI class (managed-csi,managed-csi-premium,azurefile-csi); never rely on an in-tree or unset default. - Pinned image tags — no
:latestanywhere, including init containers and sidecars. - Allowed images only — every image must come from the Phase 2 ACR (
<acr>.azurecr.io/...) if the cluster restricts registries; flag any third-party image (Redis, Postgres, RabbitMQ) that would need importing viaaz acr import. - Never edit individual nodes — no node-targeted manifests,
kubectl label node,kubectl taint node, or node-namenodeSelector. Use node pools instead.
Bicep (infra/main.bicep): AKS Automatic + ACR + Managed Identity + federated credential. Parameterized, pinned API versions. ARM resource IDs follow /subscriptions/{sub}/resourceGroups/{rg}/providers/{ns}/{type}/{name}. See /kickstart-bicep-authoring and /kickstart-acr-integration.
GitHub Actions (.github/workflows/deploy.yml): OIDC auth (no secrets), build+push to ACR, deploy to AKS, minimal permissions, environment protection. Use federated credentials with azure/login@v2.
Rules
- Use actual resource names from the Configure phase.
- Never use
:latesttags. - Honor each service's build context and entry point from the structure map; reuse existing Dockerfiles instead of duplicating them.
- Stamp every generated resource with the kickstart provenance marker above (object metadata only — never the pod template or a selector).
- All K8s manifests must comply with AKS deployment safeguards (restricted pod security, no privileged, no hostPath) and must pre-satisfy the mutating safeguards above so the cluster doesn't rewrite them on apply.
- Prefer
az acr buildfor image builds instead ofdocker build. - After writing all files, confirm with user via
vscode_askQuestions.
Validate the build (before exit)
Do not hand off unbuilt artifacts. Build every Dockerfile with az acr build on the ACR remote task builders. Prefer this over docker build so validation does not depend on a local daemon and uses the same build-and-push path as deployment.
- Preflight ACR permissions before the first build. Invoke
aks.checkDeploymentPermissionsviavscode/runCommandwith the Phase 2 resource names,probeScope: "user", andsilent: true. Inspect theacr-pushandacr-tasksprobes. If either fails, offer its included remediation; if role assignment returns 403, follow/kickstart-pim-activation. Do not wait until Pre-Deploy to surface an ACR permission failure. - Build in ACR from the service's own build context. This catches missing
COPY/ADDsources:az acr build --registry <acr> --image kickstart-validate/<svc>:check -f <dockerfilePath> <buildContext> - Verify the final image layout from the Dockerfile. Reconcile every final-stage
COPY/ADDdestination withWORKDIRandCMD/ENTRYPOINT, then present that source→destination map in Review. Do not injectRUN test -finto the final stage: distroless andscratchimages have no shell, and a path-existence check does not prove the entry point landed in the intended directory. - If the build fails or the source→destination map does not resolve the entry point, fix the Dockerfile/paths and rebuild — do not proceed to Review with a broken image.
Keep .dockerignore tight: the entire build context is uploaded to ACR on every build.
Exit Criteria
All artifacts written, ACR build permissions confirmed, every Dockerfile builds via az acr build, and the final-stage source→destination map resolves the entry point. Announce: "Artifacts generated and build-validated — moving to Review."
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.

