[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69A9B6R5H88HJFEYC0P4R57":3,"skill-same:01M69A9B6R5H88HJFEYC0P4R57":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":17,"ownerHtmlUrl":59,"ownerBlogUrl":60,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M69A9B6R5H88HJFEYC0P4R57","pilotswarm-sdk-builder","PilotSwarm SDK 应用构建","Use when creating or updating an SDK-first app on top of PilotSwarm. Covers the client\u002Fworker split, plugin layering, tool registration, tests, and the DevOps sample structure.","当需要在 PilotSwarm 之上创建或更新以 SDK 优先的应用时使用。涵盖客户端\u002F工作器分离、插件分层、工具注册、测试以及 DevOps 示例结构。","microsoft\u002FPilotSwarm","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69A6RNK492A5JSNBTXANKX5",16,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Ftemplates\u002Fbuilder-agents\u002Fskills\u002Fpilotswarm-sdk-builder\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSAA4FBTWZP6X98STEHG99","智能体开发","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"pilotswarm sdk builder","sdk","builder","when","top","split","client","app","tests","worker","sample","structure","registration","devops","use","tool","first","plugin","2026-11-10 10:12:30",false,"---\nname: pilotswarm-sdk-builder\ndescription: \"Use when creating or updating an SDK-first app on top of PilotSwarm. Covers the client\u002Fworker split, plugin layering, tool registration, tests, and the DevOps sample structure.\"\n---\n\n# PilotSwarm SDK Builder\n\nBuild layered SDK-first applications on top of PilotSwarm.\n\n## Canonical References\n\n- Source quickstart: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fquickstart\u002Flocal.md`\n- SDK guide: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fdeveloper\u002Fbuilding\u002Fsdk-apps.md`\n- SDK agent guide: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fdeveloper\u002Fbuilding\u002Fsdk-agents.md`\n- Plugin architecture: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fdeveloper\u002Fbuilding\u002Fplugins.md`\n- DevOps sample: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Ftree\u002Fmain\u002Fexamples\u002Fdevops-command-center`\n\n## Preferred Structure\n\n```text\nmy-sdk-app\u002F\n├── plugin\u002F\n│   ├── agents\u002F                 # optional named workflows\n│   ├── skills\u002F\n│   ├── .mcp.json\n│   └── session-policy.json\n├── scripts\u002F\n│   ├── run.sh\n│   └── cleanup-local-db.js\n├── src\u002F\n│   ├── tools.ts\n│   ├── worker.ts\n│   ├── client.ts\n│   └── app.ts\n└── test\u002F\n```\n\n## Workflow\n\n1. Run a guided intake before scaffolding.\n2. Separate plugin content from runtime code. Put reusable methods in skills, executable actions in worker tools or MCP servers, and add an agent only for a complex authored workflow or durable named entry point. A package with no agents is valid and discoverable by Base Agent V2 sessions.\n3. Treat `plugin\u002Fagents\u002Fdefault.agent.md` as the app-wide default overlay, not as a replacement for PilotSwarm's embedded framework base. It is **not** a selectable session agent — PilotSwarm excludes it at all three layers (worker, client, TUI). Do not name any other agent file `default`.\n4. Every generated `.agent.md` must include `schemaVersion: 1` and a `version` string. Use `version: 1.0.0` for new agents by default. When editing an existing agent, bump its `version` according to the app's versioning style; prefer SemVer when the app uses it.\n4. Define tools with `defineTool()` in worker-side code.\n5. Register tool handlers on the worker.\n6. Reference those handlers from sessions via `toolNames`.\n7. Keep client session config serializable.\n8. Add `session-policy.json` if the user does not want generic sessions. The policy is enforced in both local and remote modes. If the app should expose SDK-bundled optional agents, add them under `creation.bundledAgents`, for example `\"bundledAgents\": [\"generic-crawler\"]`; app-authored agents and inline custom agents still load independently of that allowlist.\n9. Build `.env.example` and a gitignored `.env` by copying\u002Fadapting the PilotSwarm repo's example env shape when the user wants runnable scaffolding.\n10. Build `.model_providers.example.json` and a gitignored `.model_providers.json` by copying\u002Fadapting the PilotSwarm repo's example model-catalog shape when the scaffold needs a custom model catalog.\n11. Add a checked-in cleanup script that drops database schemas and removes session state (handles both local and remote modes).\n12. Add a local example or test that exercises the intended app flow.\n13. When agents need durable structured memory or cross-agent shared state, use PilotSwarm's built-in facts tools (`store_fact`, `read_facts`, `delete_fact`). They are available to every agent session by default, including system agents, and should be treated as the primary memory mechanism instead of inventing a one-off app-specific table.\n14. When agents need recurring autonomous work, use durable timers: `cron(seconds=N, reason=\"...\")` for fixed intervals, `cron_at(minute=M, hour=H, tz=\"Area\u002FCity\", reason=\"...\")` for wall-clock schedules, and `cron(action=\"cancel\")` \u002F `cron_at(action=\"cancel\")` to stop. Do not build wall-clock jobs by waking every N minutes to check the clock.\n15. When generated agents delegate work, teach them to set `contract.wakeOn`: `any` for chatty work, `material_change` for finite task results and watcher changes, and `completion` only for actual terminal lifecycle outcomes. A finite child's ordinary final reply leaves it alive and idle, so generated parents validate the result and close it explicitly with `complete_agent`. Parent coordination is reactive: qualifying updates wake the parent automatically, so never generate a parent `wait`\u002F`cron` loop whose only action is `check_agents`.\n15. Agents can read their context usage (current tokens, token limit) from the session status `contextUsage` field. Use this for agents that need to manage context window budgets or trigger compaction.\n16. When the scaffold needs downloadable files, use `write_artifact` and include the returned `artifact:\u002F\u002F` link in responses. Files that already exist on the worker upload via `fromFile` (streamed, sha256 in the result); consumers fetch binaries with `read_artifact({toFile})` or adopt them with `fromArtifact`. Reserve inline `content` + `encoding: \"base64\"` for small model-authored binaries, and document that browser hosts download non-text artifacts instead of previewing them inline.\n17. When the app needs to ingest external sources into durable, searchable knowledge or an open knowledge graph, follow the `pilotswarm-knowledge-harvester` skill: enable the optional EnhancedFactStore \u002F GraphStore providers via `horizonConfigFromEnv()`, author a `crawler: true` agent for the crawl→graph→mark loop, and keep reader agents free of crawler frontmatter.\n18. When the app needs stock PostgreSQL runtime storage plus HorizonDB enhanced facts\u002Fsearch\u002Fgraph, follow the `pilotswarm-hybrid-datastore` skill: keep `DATABASE_URL` as the runtime store, add `HORIZON_DATABASE_URL` \u002F `HORIZON_GRAPH_DATABASE_URL` for optional providers, and wire `horizonConfigFromEnv()` into worker, client, and management client.\n\n## Guided Intake Questions\n\nBefore generating files, ask:\n\n1. Should the app allow generic sessions under the default agent, or should usage be steered into named agents through a restrictive session policy?\n2. Which worker connection values should be plugged into `.env` now?\n  `DATABASE_URL` is required; `GITHUB_TOKEN` is optional bootstrap\n  compatibility because provider credentials are runtime CMS state.\n3. If the user has not specified the agent roster, what workflows should the app support so you can derive the first agent set?\n4. Which topology should the scaffold target?\n\t - local-only, using Docker Postgres\n\t - standard remote topology using AKS + PostgreSQL + Blob storage\n\t - custom topology supplied by the user\n\nDo not guess these answers when the user has not provided them. Offer the standard topology choices explicitly so the guided experience stays fast.\n\n## Web API Topology Guidance\n\n- Deployments expose one integration surface: the portal's Web API\n  (`\u002Fapi\u002Fv1` + `\u002Fapi\u002Fv1\u002Fws`). Generated app\u002Fclient code targeting a shared\n  deployment must use `new PilotSwarmClient({ apiUrl })` \u002F\n  `new PilotSwarmManagementClient({ apiUrl })` — never a database URL.\n- Workers always connect direct (`{ store: DATABASE_URL }`); keep that secret\n  on the worker side of the scaffold.\n- Direct `{ store }` client construction is reserved for single-process\n  demos, tests, and cleanup scripts.\n- Facts\u002Fgraph access for clients goes through the Web API data-plane\n  (`createWebFactStore` \u002F `createWebGraphStore`).\n\n## Env File Guidance\n\n- Treat `DATABASE_URL` as the canonical PostgreSQL connection input.\n- Treat `DATABASE_URL` as the canonical runtime PostgreSQL connection input. Do not repurpose it as the HorizonDB facts\u002Fgraph connection in hybrid apps.\n- For hybrid apps, document optional `HORIZON_DATABASE_URL`, `HORIZON_FACTS_SCHEMA`, `HORIZON_GRAPH_DATABASE_URL`, `HORIZON_GRAPH_SCHEMA`, and `HORIZON_EMBED_*` vars in a separate HorizonDB block or `.env.horizondb.example`.\n- The starter\u002Flocal Docker path should continue to run with stock PostgreSQL by default; HorizonDB is an opt-in provider configuration, not a Docker image requirement.\n- If the app needs a custom model catalog, check in a type-only\n  `.model_providers.example.json` and create the real `.model_providers.json`\n  locally from it. Do not put credentials or `defaultModel` in new catalogs.\n  Provision shared\u002Fpersonal runtime providers through the management API or\n  Admin Console, then call `setModelDefault` and `setSystemModelDefault` as\n  needed. Env-backed catalog credentials are legacy bootstrap compatibility.\n- Do not copy a sample `toolCatalog` opt-in without validating the target\n  Chat Completions endpoint. Omit it by default; router names do not enable\n  overflow dispatch. Put an approved policy on the model entry in its\n  provider-type catalog, not in a prompt or environment flag.\n- Do not generate redundant `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, or `PGDATABASE` entries unless the user explicitly needs them.\n- Prefer a checked-in `.env.example` plus a local gitignored `.env`.\n- Prefer a checked-in type-only `.model_providers.example.json` plus a local\n  gitignored `.model_providers.json` containing endpoint\u002Ftype metadata only.\n- Add both `.env` and `.model_providers.json` to `.gitignore` in runnable scaffolds.\n- Align the variable set with the chosen topology: `DATABASE_URL`, optional\n  bootstrap `GITHUB_TOKEN`, optional Horizon\u002Fstorage\u002Fdeployment variables.\n  Do not scaffold `LLM_PROVIDER_TYPE`, `LLM_ENDPOINT`, `LLM_API_KEY`, or\n  `LLM_API_VERSION`; runtime provider instances own those concerns.\n- Only copy secrets from another repo or local file after the user explicitly asks for that behavior.\n\n## Validation Guidance\n\n- When the user wants runnable scaffolding, do more than write files: install dependencies and run a smoke test.\n- Do not treat `--help` output or a dry import as proof that the full app path actually starts.\n- Check the declared runtime requirements and compare them against the current machine.\n- If the scaffold defaults or inferred decisions matter, record them in the generated README.\n\n## Launcher Script Guidance\n\n- Generate a single `scripts\u002Frun.sh` that supports both local and remote modes:\n  - `.\u002Fscripts\u002Frun.sh` or `.\u002Fscripts\u002Frun.sh local` — local mode\n  - `.\u002Fscripts\u002Frun.sh remote` — remote mode connecting to AKS workers\n- Wire `package.json` scripts to point at `run.sh`:\n  - `\"start\": \".\u002Fscripts\u002Frun.sh\"` for local\n  - `\"start:remote\": \".\u002Fscripts\u002Frun.sh remote\"` for remote\n- Use `.env` for local mode and `.env.remote` for remote mode. The script selects the right file based on the mode argument.\n- Include preflight checks (env file exists, plugin dir exists).\n- Make the script executable and verify the executable bit after creation.\n- Keep compatibility workarounds in the launcher or `postinstall` scripts, not scattered across README steps.\n\n## Compatibility Guidance\n\n- If the generated app hits a known dependency issue during setup, isolate the workaround in setup scripts or a clearly documented bootstrap path and explain why it exists.\n- Prefer deterministic fixes that can be re-applied after reinstall, such as `postinstall` or setup-time verification, over one-off manual instructions.\n- Remove or simplify compatibility shims once the upstream dependency is fixed.\n\n## Agent Derivation Guidance\n\n- If the user names agents, scaffold those agents directly.\n- If the user only describes workflows, derive a starter agent set from those workflows and explain the mapping.\n- Keep the first scaffold minimal but coherent; do not invent a large agent roster without justification.\n\n## Guardrails\n\n- Do not assume the client can execute tools.\n- Do not collapse prompts, worker logic, and app wiring into one file unless the user explicitly wants a tiny demo.\n- Prefer plugin files for prompts and skills even in SDK-first apps.\n- Keep session policy and agent restrictions in config files rather than hand-wavy prompt text. The policy is enforced in both local and remote modes.\n- Never use `\"default\"` as an agent name for session-bound agents — PilotSwarm reserves it as a prompt overlay and rejects session creation for it at the client layer.\n- Use the DevOps sample as the reference for the layered split, not as a literal one-size-fits-all template.\n- Assume apps consume `pilotswarm-sdk`, whose built-in framework and management plugins are embedded rather than copied into the app repo.\n- Assume PostgreSQL-backed apps can opt into the built-in facts tools with agent `tools` lists instead of re-implementing fact storage from scratch.\n- Install `pilotswarm-sdk` from a verified public GitHub Release tarball; add\n  matching optional providers when needed. Follow\n  `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fquickstart\u002Fpackages.md`.\n  Pin file specs and lock integrity; restore ignored tarballs before `npm ci`.\n  Never substitute a name-only registry install.\n- If the scaffold documents artifact handoffs, explain both text and binary cases so app builders do not assume artifacts are UTF-8 only.\n\n## Database Cleanup Guidance\n\n- Generate a single cleanup script (`scripts\u002Fcleanup-local-db.js`) that handles both local and remote modes:\n  - `node scripts\u002Fcleanup-local-db.js` — uses `.env` (local)\n  - `node scripts\u002Fcleanup-local-db.js remote` — uses `.env.remote`\n- Parse `sslmode` from the `DATABASE_URL` and pass `ssl: { rejectUnauthorized: false }` to the `pg` client when connecting to Azure PostgreSQL. Follow the pattern in the DevOps sample's cleanup script.\n- Query session IDs from CMS (`copilot_sessions.sessions`) before dropping schemas.\n- In local mode, also remove local files for each session:\n  - Artifact directories at `~\u002F.copilot\u002Fartifacts\u002F\u003CsessionId>\u002F`\n  - Session state dirs at `~\u002F.copilot\u002Fsession-state\u002F\u003CsessionId>\u002F`\n  - Session store archives at `~\u002F.copilot\u002Fsession-store\u002F\u003CsessionId>.tar.gz` and `.meta.json`\n- In remote mode, skip local file cleanup (artifacts live in blob storage).\n- Drop `duroxide` and `copilot_sessions` schemas.\n- In remote mode, print the `kubectl rollout restart` command to recreate schemas.\n- Follow the pattern in PilotSwarm's DevOps sample `scripts\u002Fcleanup-local-db.js`.\n- Document what the cleanup script removes in the generated README.\n","# PilotSwarm SDK Builder\n\nBuild layered SDK-first applications on top of PilotSwarm.\n\n## Canonical References\n\n- Source quickstart: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fquickstart\u002Flocal.md`\n- SDK guide: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fdeveloper\u002Fbuilding\u002Fsdk-apps.md`\n- SDK agent guide: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fdeveloper\u002Fbuilding\u002Fsdk-agents.md`\n- Plugin architecture: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fdeveloper\u002Fbuilding\u002Fplugins.md`\n- DevOps sample: `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Ftree\u002Fmain\u002Fexamples\u002Fdevops-command-center`\n\n## Preferred Structure\n\n```text\nmy-sdk-app\u002F\n├── plugin\u002F\n│   ├── agents\u002F                 # optional named workflows\n│   ├── skills\u002F\n│   ├── .mcp.json\n│   └── session-policy.json\n├── scripts\u002F\n│   ├── run.sh\n│   └── cleanup-local-db.js\n├── src\u002F\n│   ├── tools.ts\n│   ├── worker.ts\n│   ├── client.ts\n│   └── app.ts\n└── test\u002F\n```\n\n## Workflow\n\n1. Run a guided intake before scaffolding.\n2. Separate plugin content from runtime code. Put reusable methods in skills, executable actions in worker tools or MCP servers, and add an agent only for a complex authored workflow or durable named entry point. A package with no agents is valid and discoverable by Base Agent V2 sessions.\n3. Treat `plugin\u002Fagents\u002Fdefault.agent.md` as the app-wide default overlay, not as a replacement for PilotSwarm's embedded framework base. It is **not** a selectable session agent — PilotSwarm excludes it at all three layers (worker, client, TUI). Do not name any other agent file `default`.\n4. Every generated `.agent.md` must include `schemaVersion: 1` and a `version` string. Use `version: 1.0.0` for new agents by default. When editing an existing agent, bump its `version` according to the app's versioning style; prefer SemVer when the app uses it.\n4. Define tools with `defineTool()` in worker-side code.\n5. Register tool handlers on the worker.\n6. Reference those handlers from sessions via `toolNames`.\n7. Keep client session config serializable.\n8. Add `session-policy.json` if the user does not want generic sessions. The policy is enforced in both local and remote modes. If the app should expose SDK-bundled optional agents, add them under `creation.bundledAgents`, for example `\"bundledAgents\": [\"generic-crawler\"]`; app-authored agents and inline custom agents still load independently of that allowlist.\n9. Build `.env.example` and a gitignored `.env` by copying\u002Fadapting the PilotSwarm repo's example env shape when the user wants runnable scaffolding.\n10. Build `.model_providers.example.json` and a gitignored `.model_providers.json` by copying\u002Fadapting the PilotSwarm repo's example model-catalog shape when the scaffold needs a custom model catalog.\n11. Add a checked-in cleanup script that drops database schemas and removes session state (handles both local and remote modes).\n12. Add a local example or test that exercises the intended app flow.\n13. When agents need durable structured memory or cross-agent shared state, use PilotSwarm's built-in facts tools (`store_fact`, `read_facts`, `delete_fact`). They are available to every agent session by default, including system agents, and should be treated as the primary memory mechanism instead of inventing a one-off app-specific table.\n14. When agents need recurring autonomous work, use durable timers: `cron(seconds=N, reason=\"...\")` for fixed intervals, `cron_at(minute=M, hour=H, tz=\"Area\u002FCity\", reason=\"...\")` for wall-clock schedules, and `cron(action=\"cancel\")` \u002F `cron_at(action=\"cancel\")` to stop. Do not build wall-clock jobs by waking every N minutes to check the clock.\n15. When generated agents delegate work, teach them to set `contract.wakeOn`: `any` for chatty work, `material_change` for finite task results and watcher changes, and `completion` only for actual terminal lifecycle outcomes. A finite child's ordinary final reply leaves it alive and idle, so generated parents validate the result and close it explicitly with `complete_agent`. Parent coordination is reactive: qualifying updates wake the parent automatically, so never generate a parent `wait`\u002F`cron` loop whose only action is `check_agents`.\n15. Agents can read their context usage (current tokens, token limit) from the session status `contextUsage` field. Use this for agents that need to manage context window budgets or trigger compaction.\n16. When the scaffold needs downloadable files, use `write_artifact` and include the returned `artifact:\u002F\u002F` link in responses. Files that already exist on the worker upload via `fromFile` (streamed, sha256 in the result); consumers fetch binaries with `read_artifact({toFile})` or adopt them with `fromArtifact`. Reserve inline `content` + `encoding: \"base64\"` for small model-authored binaries, and document that browser hosts download non-text artifacts instead of previewing them inline.\n17. When the app needs to ingest external sources into durable, searchable knowledge or an open knowledge graph, follow the `pilotswarm-knowledge-harvester` skill: enable the optional EnhancedFactStore \u002F GraphStore providers via `horizonConfigFromEnv()`, author a `crawler: true` agent for the crawl→graph→mark loop, and keep reader agents free of crawler frontmatter.\n18. When the app needs stock PostgreSQL runtime storage plus HorizonDB enhanced facts\u002Fsearch\u002Fgraph, follow the `pilotswarm-hybrid-datastore` skill: keep `DATABASE_URL` as the runtime store, add `HORIZON_DATABASE_URL` \u002F `HORIZON_GRAPH_DATABASE_URL` for optional providers, and wire `horizonConfigFromEnv()` into worker, client, and management client.\n\n## Guided Intake Questions\n\nBefore generating files, ask:\n\n1. Should the app allow generic sessions under the default agent, or should usage be steered into named agents through a restrictive session policy?\n2. Which worker connection values should be plugged into `.env` now?\n  `DATABASE_URL` is required; `GITHUB_TOKEN` is optional bootstrap\n  compatibility because provider credentials are runtime CMS state.\n3. If the user has not specified the agent roster, what workflows should the app support so you can derive the first agent set?\n4. Which topology should the scaffold target?\n\t - local-only, using Docker Postgres\n\t - standard remote topology using AKS + PostgreSQL + Blob storage\n\t - custom topology supplied by the user\n\nDo not guess these answers when the user has not provided them. Offer the standard topology choices explicitly so the guided experience stays fast.\n\n## Web API Topology Guidance\n\n- Deployments expose one integration surface: the portal's Web API\n  (`\u002Fapi\u002Fv1` + `\u002Fapi\u002Fv1\u002Fws`). Generated app\u002Fclient code targeting a shared\n  deployment must use `new PilotSwarmClient({ apiUrl })` \u002F\n  `new PilotSwarmManagementClient({ apiUrl })` — never a database URL.\n- Workers always connect direct (`{ store: DATABASE_URL }`); keep that secret\n  on the worker side of the scaffold.\n- Direct `{ store }` client construction is reserved for single-process\n  demos, tests, and cleanup scripts.\n- Facts\u002Fgraph access for clients goes through the Web API data-plane\n  (`createWebFactStore` \u002F `createWebGraphStore`).\n\n## Env File Guidance\n\n- Treat `DATABASE_URL` as the canonical PostgreSQL connection input.\n- Treat `DATABASE_URL` as the canonical runtime PostgreSQL connection input. Do not repurpose it as the HorizonDB facts\u002Fgraph connection in hybrid apps.\n- For hybrid apps, document optional `HORIZON_DATABASE_URL`, `HORIZON_FACTS_SCHEMA`, `HORIZON_GRAPH_DATABASE_URL`, `HORIZON_GRAPH_SCHEMA`, and `HORIZON_EMBED_*` vars in a separate HorizonDB block or `.env.horizondb.example`.\n- The starter\u002Flocal Docker path should continue to run with stock PostgreSQL by default; HorizonDB is an opt-in provider configuration, not a Docker image requirement.\n- If the app needs a custom model catalog, check in a type-only\n  `.model_providers.example.json` and create the real `.model_providers.json`\n  locally from it. Do not put credentials or `defaultModel` in new catalogs.\n  Provision shared\u002Fpersonal runtime providers through the management API or\n  Admin Console, then call `setModelDefault` and `setSystemModelDefault` as\n  needed. Env-backed catalog credentials are legacy bootstrap compatibility.\n- Do not copy a sample `toolCatalog` opt-in without validating the target\n  Chat Completions endpoint. Omit it by default; router names do not enable\n  overflow dispatch. Put an approved policy on the model entry in its\n  provider-type catalog, not in a prompt or environment flag.\n- Do not generate redundant `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`, or `PGDATABASE` entries unless the user explicitly needs them.\n- Prefer a checked-in `.env.example` plus a local gitignored `.env`.\n- Prefer a checked-in type-only `.model_providers.example.json` plus a local\n  gitignored `.model_providers.json` containing endpoint\u002Ftype metadata only.\n- Add both `.env` and `.model_providers.json` to `.gitignore` in runnable scaffolds.\n- Align the variable set with the chosen topology: `DATABASE_URL`, optional\n  bootstrap `GITHUB_TOKEN`, optional Horizon\u002Fstorage\u002Fdeployment variables.\n  Do not scaffold `LLM_PROVIDER_TYPE`, `LLM_ENDPOINT`, `LLM_API_KEY`, or\n  `LLM_API_VERSION`; runtime provider instances own those concerns.\n- Only copy secrets from another repo or local file after the user explicitly asks for that behavior.\n\n## Validation Guidance\n\n- When the user wants runnable scaffolding, do more than write files: install dependencies and run a smoke test.\n- Do not treat `--help` output or a dry import as proof that the full app path actually starts.\n- Check the declared runtime requirements and compare them against the current machine.\n- If the scaffold defaults or inferred decisions matter, record them in the generated README.\n\n## Launcher Script Guidance\n\n- Generate a single `scripts\u002Frun.sh` that supports both local and remote modes:\n  - `.\u002Fscripts\u002Frun.sh` or `.\u002Fscripts\u002Frun.sh local` — local mode\n  - `.\u002Fscripts\u002Frun.sh remote` — remote mode connecting to AKS workers\n- Wire `package.json` scripts to point at `run.sh`:\n  - `\"start\": \".\u002Fscripts\u002Frun.sh\"` for local\n  - `\"start:remote\": \".\u002Fscripts\u002Frun.sh remote\"` for remote\n- Use `.env` for local mode and `.env.remote` for remote mode. The script selects the right file based on the mode argument.\n- Include preflight checks (env file exists, plugin dir exists).\n- Make the script executable and verify the executable bit after creation.\n- Keep compatibility workarounds in the launcher or `postinstall` scripts, not scattered across README steps.\n\n## Compatibility Guidance\n\n- If the generated app hits a known dependency issue during setup, isolate the workaround in setup scripts or a clearly documented bootstrap path and explain why it exists.\n- Prefer deterministic fixes that can be re-applied after reinstall, such as `postinstall` or setup-time verification, over one-off manual instructions.\n- Remove or simplify compatibility shims once the upstream dependency is fixed.\n\n## Agent Derivation Guidance\n\n- If the user names agents, scaffold those agents directly.\n- If the user only describes workflows, derive a starter agent set from those workflows and explain the mapping.\n- Keep the first scaffold minimal but coherent; do not invent a large agent roster without justification.\n\n## Guardrails\n\n- Do not assume the client can execute tools.\n- Do not collapse prompts, worker logic, and app wiring into one file unless the user explicitly wants a tiny demo.\n- Prefer plugin files for prompts and skills even in SDK-first apps.\n- Keep session policy and agent restrictions in config files rather than hand-wavy prompt text. The policy is enforced in both local and remote modes.\n- Never use `\"default\"` as an agent name for session-bound agents — PilotSwarm reserves it as a prompt overlay and rejects session creation for it at the client layer.\n- Use the DevOps sample as the reference for the layered split, not as a literal one-size-fits-all template.\n- Assume apps consume `pilotswarm-sdk`, whose built-in framework and management plugins are embedded rather than copied into the app repo.\n- Assume PostgreSQL-backed apps can opt into the built-in facts tools with agent `tools` lists instead of re-implementing fact storage from scratch.\n- Install `pilotswarm-sdk` from a verified public GitHub Release tarball; add\n  matching optional providers when needed. Follow\n  `https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fdocs\u002Fquickstart\u002Fpackages.md`.\n  Pin file specs and lock integrity; restore ignored tarballs before `npm ci`.\n  Never substitute a name-only registry install.\n- If the scaffold documents artifact handoffs, explain both text and binary cases so app builders do not assume artifacts are UTF-8 only.\n\n## Database Cleanup Guidance\n\n- Generate a single cleanup script (`scripts\u002Fcleanup-local-db.js`) that handles both local and remote modes:\n  - `node scripts\u002Fcleanup-local-db.js` — uses `.env` (local)\n  - `node scripts\u002Fcleanup-local-db.js remote` — uses `.env.remote`\n- Parse `sslmode` from the `DATABASE_URL` and pass `ssl: { rejectUnauthorized: false }` to the `pg` client when connecting to Azure PostgreSQL. Follow the pattern in the DevOps sample's cleanup script.\n- Query session IDs from CMS (`copilot_sessions.sessions`) before dropping schemas.\n- In local mode, also remove local files for each session:\n  - Artifact directories at `~\u002F.copilot\u002Fartifacts\u002F\u003CsessionId>\u002F`\n  - Session state dirs at `~\u002F.copilot\u002Fsession-state\u002F\u003CsessionId>\u002F`\n  - Session store archives at `~\u002F.copilot\u002Fsession-store\u002F\u003CsessionId>.tar.gz` and `.meta.json`\n- In remote mode, skip local file cleanup (artifacts live in blob storage).\n- Drop `duroxide` and `copilot_sessions` schemas.\n- In remote mode, print the `kubectl rollout restart` command to recreate schemas.\n- Follow the pattern in PilotSwarm's DevOps sample `scripts\u002Fcleanup-local-db.js`.\n- Document what the cleanup script removes in the generated README.\n",{"name":5,"description":7},"main","cecafe1ca7a9f2778a6166abdd12f6165d99f777","templates\u002Fbuilder-agents\u002Fskills\u002Fpilotswarm-sdk-builder",10,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 00:36:04",{"source":9,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add microsoft\u002FPilotSwarm --skill pilotswarm-sdk-builder",{"tool":69,"command":70},"bunx","bunx skills add microsoft\u002FPilotSwarm --skill pilotswarm-sdk-builder",{"tool":72,"command":73},"pnpm","pnpm dlx skills add microsoft\u002FPilotSwarm --skill pilotswarm-sdk-builder","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Ftemplates\u002Fbuilder-agents\u002Fskills\u002Fpilotswarm-sdk-builder\u002FSKILL.md",true,[],[78,86,93,100,107,114],{"skillNo":79,"name":80,"nameZh":17,"description":81,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":85},"01M760N7TCZBTY635MYZQ8YAB0","workflow-testing","Load before you test a Workflow with mocked effects — the test, test_respond and test_advance operations, fixtures, interception ids, valid answers, the virtual clock, test evidence and what a test run does not prove.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Ftest-mode-skills\u002Fworkflow-testing\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":87,"name":88,"nameZh":17,"description":89,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":85},"01M760N4RKD6BMYPGHD490SNN2","workflow-tools","Every argument of the Workflow tools, testing a revision, package definitions and the refusals you can fix. Load when a Workflow tool's short description is not enough.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-tools\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":17,"description":96,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":85},"01M760N1P2VTGVE6C4N5WF3FVR","workflow-reference","Field reference for Workflow YAML (root keys, every state type, bindings, outputs, runtime error codes), what the engine guarantees, and a review fan-out example. For design, call load_skill with name workflow-authoring.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-reference\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":17,"description":103,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":85},"01M760MZ5CFSAX4FYMEXZJBGM2","workflow-patterns","Load when one Workflow must run different nodes in its branches at the same time (a different prompt or model for each branch), or loops back to a state (a polling loop). Named branches, the router pattern, examples that compile.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-patterns\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":17,"description":110,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":85},"01M760MWKBDJFEECRFAF3BAVQ2","workflow-authoring","Load before you create, edit, publish or run a Workflow (pilotswarm.dev\u002Fv1) — choosing states, bounded graphs, bindings, typed contracts, agent and parallel states, the lifecycle and failure diagnosis.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-authoring\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":17,"description":117,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":85},"01M760MN4Y9199ARAY85DWD08X","tla-formal-validation","Required for any change to the core orchestrations (the durable session orchestration, session hydration and dehydration, and the Workflow controller and store). Teaches how to model the change in TLA+, update the existing models, run TLC with the repo runner, read the results, turn a counterexample into a fix and a regression test, and record the binding to the code.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftla-formal-validation\u002FSKILL.md",[],[]]