pilotswarm-azure-deployer
Skill14 starsChanged 8 months agoMITView on GitHub
Use when packaging and deploying a PilotSwarm-based app to Azure or AKS. Covers remote worker parity, environment/config wiring, manifests, and rollout constraints.
- Reads credentials
We split this skill into the rules it gives an agent
31 rules. About 0 are common, 18 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Keep real identifiers/credentials private.
- Distinctive: line 45
Ensure remote workers package the same plugin files and worker code used locally.
- Distinctive: line 46
Ensure remote portal images package the app plugin metadata needed for branding, agent creation, and session policy.
- Distinctive: line 49
Write manifests, model-catalog/env guidance, and rollout instructions that match the actual app layout.
- Very specific: line 51
If deployment work edits plugin/agents/*.agent.md, preserve schemaVersion: 1 and bump the agent version according to the app's versioning …
- Very specific: line 55
When the app targets AKS, prefer a checked-in .env.example plus a local, gitignored .env copy.
- Very specific: line 83
If documentation uses shell exports or source .env.remote, require explicit quoting for semicolon-bearing values before recommending …
- Very specific: line 115
When an app uses the hybrid datastore, consult pilotswarm-hybrid-datastore and document the two store targets separately:
- Distinctive: line 125
Keep the Docker image unchanged.
- Very specific: line 132
verify DATABASE_URL connectivity and runtime migrations separately from HorizonDB provider initialization
- Distinctive: line 134
verify HorizonDB extension allow-listing before declaring enhanced facts/graph ready
- Very specific: line 138
keep portal env focused on runtime/branding/auth unless the app process itself initializes clients that need Horizon facts access
- Distinctive: line 143
When the app includes the shipped browser portal:
- Very specific: line 147
keep portal branding in plugin.json.portal, using plugin.json.tui only as a fallback or shared source when that matches the user's intent
- Distinctive: line 148
treat portal auth as an optional provider add-on rather than a built-in Entra requirement
- Distinctive: line 150
if Entra is selected, document:
- Very specific: line 156
update copilot-runtime-secrets with the canonical PORTAL_AUTH_* and PORTAL_AUTHZ_* keys.
- Distinctive: line 157
if another provider such as AWS IAM is requested, keep the deployment contract separate from Entra-specific steps and call out which …
- Distinctive: line 161
verify the portal pod can start with the app plugin mounted or copied into the image
- Distinctive: line 162
verify the portal service resolves live endpoints before declaring the rollout healthy
- Very specific: line 163
verify GET /api/health and GET /api/portal-config against the live ingress URL
- Very specific: line 164
if the rollout briefly returns 502 or 503, confirm whether the new pod is still registering or whether the container is crashlooping before …
- Very specific: line 165
when the portal still shows default PilotSwarm branding after rollout, inspect PLUGIN_DIRS, packaged plugin contents, and …
- Very specific: line 202
Always set RUST_LOG in the worker deployment manifest:
- Distinctive: line 221
Do not assume local plugin directories magically exist in deployed workers.
- Distinctive: line 222
Do not assume local plugin directories magically exist in deployed portal pods.
- Distinctive: line 223
Prefer explicit packaging and env configuration over vague operational guidance.
- Distinctive: line 224
Call out orchestration determinism and database reset requirements when relevant.
- Distinctive: line 226
Call out that clean AKS restarts will immediately recreate built-in system sessions, so a truly empty session list is transient.
- Distinctive: line 227
Keep deployment docs aligned with the user's actual folder structure and commands.
- Very specific: line 228
If cluster access crosses AKS boundaries, consult the pilotswarm-aks-identity skill.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
Deployment scope
This template scaffolds the user's own application's deployment. It does not
operate the PilotSwarm repository's managed Azure environment. When working in
that repository, follow .github/DEPLOYMENT.md and its Actions-only deployment
path. For local tests and installing the provider CI system, see
docs/developer/contributing/local-ci-and-tests.md in the PilotSwarm source.
Keep real identifiers/credentials private; document architecture and secret names.
PilotSwarm Azure Deployer
Prepare PilotSwarm-based apps for Azure deployment, especially AKS worker and browser-portal deployments.
Canonical References
- Source quickstart:
https://github.com/microsoft/PilotSwarm/blob/main/docs/quickstart/local.md - AKS deployment guide:
https://github.com/microsoft/PilotSwarm/blob/main/docs/developer/deploy/aks.md - Configuration guide:
https://github.com/microsoft/PilotSwarm/blob/main/docs/developer/reference/configuration.md - Plugin architecture:
https://github.com/microsoft/PilotSwarm/blob/main/docs/developer/building/plugins.md - DevOps sample:
https://github.com/microsoft/PilotSwarm/tree/main/examples/devops-command-center
Preferred Outputs
deploy/
├── Dockerfile.worker
├── Dockerfile.portal
├── k8s/
│ ├── namespace.yaml
│ ├── worker-deployment.yaml
│ ├── portal-deployment.yaml
│ └── configmaps-secrets.md
└── README.mdWorkflow
- Confirm the app's worker entrypoint, portal entrypoint, plugin paths, and required env vars.
- Ensure remote workers package the same plugin files and worker code used locally.
- Ensure remote portal images package the app plugin metadata needed for branding, agent creation, and session policy.
- Configure database and blob storage explicitly.
- For hybrid datastore apps, keep
DATABASE_URLon stock PostgreSQL for runtime state and add HorizonDB only throughHORIZON_DATABASE_URL/HORIZON_GRAPH_DATABASE_URL.
- Write manifests, model-catalog/env guidance, and rollout instructions that match the actual app layout.
- Call out reset/versioning constraints when orchestration behavior changes — but never bake a reset into a deploy path. Deploy scripts must be non-destructive by default; any database reset belongs in a separate, explicitly-invoked script gated by an unambiguous flag (e.g.
--i-understand-this-deletes-all-data) and is run only when the user explicitly asks for a wipe. - If deployment work edits
plugin/agents/*.agent.md, preserveschemaVersion: 1and bump the agentversionaccording to the app's versioning style. Packaging-only changes should preserve existing agent versions.
Environment And Azure Resource Checklist
When the app targets AKS, prefer a checked-in .env.example plus a local,
gitignored .env copy. Document at least:
- checked-in
.model_providers.example.jsonwhen the app uses a custom model catalog - local gitignored
.model_providers.jsoncreated from that example for the real runtime catalog GITHUB_TOKENDATABASE_URL- optional hybrid datastore vars:
HORIZON_DATABASE_URL,HORIZON_FACTS_SCHEMA,HORIZON_GRAPH_DATABASE_URL,HORIZON_GRAPH_SCHEMA, andHORIZON_EMBED_* - app-specific schema names if the shared PostgreSQL server hosts other PilotSwarm apps
- Azure subscription, tenant, resource group, and region
- control-cluster name, namespace, and worker pod label
- workload-cluster name and namespace
- storage account/container for session dehydration or artifacts
- container registry and image names/tags
- workload identity client ID, service account name/namespace, and federated credential name
- portal ingress host, auth provider, and redirect URI inputs when the browser portal is deployed
Model/provider guidance:
.model_providers.example.jsonis the checked-in shareable template.- The real
.model_providers.jsonshould stay local and gitignored because it may contain user-specific endpoint URLs even when keys remain env-backed. - New model catalogs contain provider types/models only. Provision runtime
provider credentials from
.env,.env.remote, or Kubernetes secrets through the management API, then set ordinary/system defaults explicitly. Env references inside catalogs are legacy bootstrap compatibility only. - For AKS deployments, keep the live Kubernetes secret exactly in sync with local
.env.remotefor worker-facing vars: not more, not less. If a key is present locally, it should be present in AKS; if it is absent locally, it should be absent in AKS. - Removing a provider key from AKS only changes selectors after the secret is refreshed and the workers restart.
- For Kubernetes secret creation, prefer
kubectl create secret generic ... --from-env-file=.env.remotewhen values contain semicolons or other shell-significant characters, especiallyAZURE_STORAGE_CONNECTION_STRING. - If documentation uses shell exports or
source .env.remote, require explicit quoting for semicolon-bearing values before recommending--from-literal.
Also call out the Azure resources the user must provision:
- Azure Database for PostgreSQL
- HorizonDB for enhanced facts/search/graph when the app opts into the hybrid datastore
- control AKS cluster
- user-assigned managed identity for control-plane pods
- federated identity credential
- Azure Storage account
- Azure Container Registry
- public ingress / DNS path for the browser portal when it is exposed
- worker AKS cluster + namespace (three-tier only — see
pilotswarm-three-tierskill)
Web API Seam Guidance
- The deployed portal is the only client-facing surface: it hosts
/api/v1+/api/v1/wsand performs datastore operations on behalf of all callers.DATABASE_URL/ blob /HORIZON_*secrets go ONLY to worker and portal pods. - Client connect story to document in rollout notes: TUI
pilotswarm remote --api-url <url>; SDKnew PilotSwarmClient({ apiUrl }); MCPpilotswarm-mcp --api-url <url>; Entra deployments sign in interactively or viaPILOTSWARM_API_TOKEN. - Post-rollout validation:
GET /api/v1/healthreturns{ ok, started, mode, apiVersion };GET /api/v1/bootstraplists models and creatable agents.
Portal Deployment Guidance
Hybrid Datastore Deployment Guidance
When an app uses the hybrid datastore, consult pilotswarm-hybrid-datastore and
document the two store targets separately:
DATABASE_URLpoints to stock PostgreSQL and remains the runtime store for Duroxide, CMS/session catalog, and default facts fallback.HORIZON_DATABASE_URLpoints to the HorizonDB enhanced facts/search store.HORIZON_GRAPH_DATABASE_URLpoints to the HorizonDB graph store. It may be the same HorizonDB database asHORIZON_DATABASE_URL, butHORIZON_FACTS_SCHEMAandHORIZON_GRAPH_SCHEMAmust be distinct.
Keep the Docker image unchanged. Hybrid mode is selected by Kubernetes secrets and worker/client options, not by a custom image. If HorizonDB is not configured, the same deployment should run as stock-PostgreSQL PilotSwarm with enhanced facts, graph tools, and harvester agents disabled.
Validation steps:
- verify
DATABASE_URLconnectivity and runtime migrations separately from HorizonDB provider initialization - verify HorizonDB extension allow-listing before declaring enhanced facts/graph ready
- refresh Kubernetes secrets and restart workers after changing any
HORIZON_*value - keep portal env focused on runtime/branding/auth unless the app process itself initializes clients that need Horizon facts access
Portal Deployment Guidance
When the app includes the shipped browser portal:
- package the same app plugin into the portal image that the worker uses for prompts, agent metadata, and session policy
- set
PLUGIN_DIRSin the portal deployment so the web process can resolveplugin.json.portal,plugin.json.tui, and user-creatable agents - keep portal branding in
plugin.json.portal, usingplugin.json.tuionly as a fallback or shared source when that matches the user's intent - treat portal auth as an optional provider add-on rather than a built-in Entra requirement
- document
PORTAL_AUTH_PROVIDER=none|entra|<custom>explicitly - if Entra is selected, document:
PORTAL_AUTH_PROVIDER=entraPORTAL_AUTH_ENTRA_TENANT_IDPORTAL_AUTH_ENTRA_CLIENT_IDPORTAL_AUTHZ_ADMIN_GROUPS/PORTAL_AUTHZ_USER_GROUPSas comma-delimited email allowlists when admission gating is enabled- SPA redirect URI registration for the portal ingress URL
- update
copilot-runtime-secretswith the canonicalPORTAL_AUTH_*andPORTAL_AUTHZ_*keys; do not rely on legacyENTRA_*aliases - if another provider such as AWS IAM is requested, keep the deployment contract separate from Entra-specific steps and call out which browser-side login flow and server-side validation hooks must be supplied
Portal Validation Guidance
- verify the portal pod can start with the app plugin mounted or copied into the image
- verify the portal service resolves live endpoints before declaring the rollout healthy
- verify
GET /api/healthandGET /api/portal-configagainst the live ingress URL - if the rollout briefly returns
502or503, confirm whether the new pod is still registering or whether the container is crashlooping before calling it healthy - when the portal still shows default PilotSwarm branding after rollout, inspect
PLUGIN_DIRS, packaged plugin contents, andplugin.json.portalbefore assuming the UI code is wrong
Worker Observability
PilotSwarm's TUI Node Map and Sequence Diagram views depend on two things:
1. Worker Node ID
The worker entrypoint must pass workerNodeId to PilotSwarmWorker so CMS
events are tagged with the node that processed them. Without this, the TUI
Node Map shows all sessions under (unknown).
In AKS, use the pod hostname:
import os from "node:os";
const worker = new PilotSwarmWorker({
store: STORE,
workerNodeId: os.hostname(),
// ... other options
});os.hostname() returns the pod name in Kubernetes (e.g.
myapp-worker-749f4fb8b8-5nh7h). The TUI truncates this to the last 5
characters for the column header.
2. RUST_LOG level
Orchestration log lines ([orch], [turn N], [activity], [runTurn])
are emitted by the duroxide runtime at INFO level via ctx.traceInfo().
If RUST_LOG is not set, duroxide defaults to warn, and these logs
are silently dropped. The TUI will show empty node columns and sessions
stuck in the "(unknown)" column.
Always set RUST_LOG in the worker deployment manifest:
env:
- name: RUST_LOG
value: "duroxide=info,duroxide_pg=info,warn"This enables info-level logs from the duroxide runtime and Postgres provider
while keeping everything else at warn. The TUI's parseSeqEvent function
matches these patterns to populate the Node Map, Sequence Diagram, and
per-orchestration log views.
Without this, kubectl logs will only show Rust-level WARN entries
(e.g., "Dropping orphan queue messages") but none of the SDK-level
orchestration lifecycle events the TUI needs.
Guardrails
- Do not assume local plugin directories magically exist in deployed workers.
- Do not assume local plugin directories magically exist in deployed portal pods.
- Prefer explicit packaging and env configuration over vague operational guidance.
- Call out orchestration determinism and database reset requirements when relevant.
- NO RESETS unless the user explicitly asks. Deploy scripts never reset data; resets live in separate explicitly-invoked scripts behind an unambiguous confirmation flag.
- Call out that clean AKS restarts will immediately recreate built-in system sessions, so a truly empty session list is transient.
- Keep deployment docs aligned with the user's actual folder structure and commands.
- If cluster access crosses AKS boundaries, consult the
pilotswarm-aks-identityskill. - Never reuse or modify existing Azure resources without explicit user approval.
In this repository50 other files it gives its agents.
- packages/sdk/examples/repo-workspaces/seed/home/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-repair-loopSkill
- duroxide-orchestration-versioningSkill
- editorial-standardsSkill
- finance-research-standardsSkill
- valuation-methodsSkill
- pilotswarm-architectureSkill
- deployment-safetySkill
- incident-responseSkill
- add-activitySkill
- add-eventSkill
- add-testSkill
- add-toolSkill
- agent-versioningSkill
- azure-ps-test-runner-vmSkill
- debug-orchestrationSkill
- debug-testSkill
- horizondb-idiosyncrasiesSkill
- horizon-facts-eval-sweepSkill
- investigate-duroxide-runtimeSkill
- pilotswarm-aks-deploySkill
- pilotswarm-aks-resetSkill
- pilotswarm-new-env-deploySkill
- pilotswarm-perfSkill
- pilotswarm-portal-app-regSkill
- pilotswarm-portal-auth-assignmentsSkill
- pilotswarm-releaseSkill
- pilotswarm-tuiSkill
- pilotswarm-vpn-client-profileSkill
- schema-migrationSkill
- notesSkill
- share-a-fileSkill
- cost-latency-analysisSkill
- graph-debugSkill
- orchestration-session-lifecycleSkill
- resourcemgrSkill
- sweeperSkill
- canvas-appsSkill
- html-visualsSkill
- pilotswarm-agent-versioningSkill
- pilotswarm-aks-identitySkill
- pilotswarm-azure-lessonsSkill
- pilotswarm-cli-builderSkill
- pilotswarm-duroxide-versioningSkill
- pilotswarm-hybrid-datastoreSkill
- pilotswarm-knowledge-harvesterSkill
- pilotswarm-portal-builderSkill
- pilotswarm-sdk-builderSkill
- pilotswarm-three-tierSkill
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.

