Installation
Install as Agent Plugin
Recommended
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install pulumi-create-agent@skills-hub
Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled).
Plugin pulumi-create-agent v1.0.0 follows the Agent Plugins spec.
Install with the gh extension
gh skills-hub install pulumi-create-agent Don't have the extension? Run gh extension install samueltauil/skills-hub first.
Download and extract to your repository:
.github/skills/pulumi-create-agent/ Extract the ZIP to .github/skills/ in your repo. The folder name must match pulumi-create-agent for Copilot to auto-discover it.
Skill Files (8)
SKILL.md 4.4 KB
---
name: pulumi-create-agent
description: Create a reusable Pulumi Agent with saved instructions, a role, and selected integrations. Use when the user asks to create, define, or set up a new Pulumi Agent.
---
# Create a Pulumi Agent
Create a saved agent definition. Starting a task or configuring automation is a separate action.
## Discover and resolve
Confirm the target organization and current login with `pulumi whoami -v`. Do not infer the organization from the current stack or repository. Read [CLI contract](references/cli-contract.md) for operation discovery, request fields, and integration selection.
Check existing agents before choosing a name. If the name is taken, show the existing agent and ask how to proceed.
Resolve these settings from the user's request and project context:
- Name, display name, responsibility, resource scope, and expected output.
- Saved instructions, including relevant team requirements. These replace organization AI preferences, so include requirements the agent must retain.
- An organization role the caller may assign. Check its grants and exclude built-in Admin and Billing Manager roles. Instructions and deprecated `permissionMode` do not restrict authority.
- Connected MCP integrations. Set the selection explicitly, including `[]` for none; omission inherits all organization integrations.
- Approval mode. If unresolved, propose manual approval and explain that unattended runs may wait for a person.
Local files and uncommitted changes are not automatically available to the remote agent. Check that it can reach the repositories and connections needed for its responsibility. MCP selection does not control separate CLI credentials.
Ask only for missing choices. If a required API is unavailable or access cannot be verified, save a local draft with the known settings, complete instructions, and remaining questions. Explain the blocker without changing the requested access.
## Tell the user, then create
Show the complete configuration and literal instructions that will be saved:
```text
Organization:
Name and display name:
Responsibility and resource scope:
Role:
MCP integrations:
Approval mode:
Saved instructions:
[complete text]
```
Keep the instructions within the requested responsibility and resource boundary. For work outside that boundary, tell the agent to report the dependency and request a revised responsibility.
Submit exactly the displayed values using the request-file workflow in [CLI contract](references/cli-contract.md). If creation is already authorized and all choices are resolved, proceed without asking again.
## Verify the result
Read the returned agent ID and check active roster membership. Compare the saved name, display name, purpose, instructions, role, integrations, and approval mode with the proposal.
If values differ, report the saved result and the mismatch before making another change. Do not recreate or delete the agent as a rollback.
If the create response is lost, check the agent list and retrieve candidates before retrying. Follow all pages. A matching name alone does not prove the agent came from this request; use returned resource or request identifiers where available. If the outcome remains uncertain, report it rather than creating another agent. Do not treat a failed or incomplete listing as proof that creation failed.
Return the verified agent ID, organization, and saved configuration. Creation confirms the settings, not that the agent has successfully completed a task.
## Address automation
After creation, ask unless the user already supplied a preference:
“Would you like to set up automation for this agent: a schedule, an event trigger, or no automation for now?”
An unanswered automation choice does not block agent creation. Leave that choice pending if no answer is available.
If the user requested a schedule or trigger, continue with [Configure automation](references/configure-automation.md). If they declined, acknowledge manual invocation without asking again. Keep the created agent if automation setup fails.
For an explicitly requested first task, read [Requested immediate task](references/additional-outcomes.md). A one-time task does not answer the recurring-automation question.
Load automation details only when needed: [API contract](references/automation-cli-contract.md) for commands, [webhook secrets](references/automation-webhook-secrets.md) before webhook creation, and [recovery](references/automation-recovery.md) after an uncertain or mismatched result.
use_cases.yaml 0.9 KB
queries:
- "Create a reusable Pulumi Agent to investigate failed deployments in my checkout project."
- "Help me create a Pulumi Agent with saved instructions, a read-only role, and selected integrations."
- "Create a Pulumi Agent for cost reviews and ask me whether to add a schedule."
- "Set up a new Pulumi Agent that my team can assign infrastructure investigations to."
- "Check whether the public CLI supports creating a reusable Pulumi Agent, then help me configure one."
- "Create a Pulumi Agent and let me choose from the integrations already connected to my organization."
- "Help me create a Pulumi Agent; if you cannot list connected integrations, save the configuration as a draft and explain what is missing."
- "Help me create a Pulumi Agent with a role it can actually use; exclude unsupported built-in roles."
- "Create a reusable Pulumi Agent without MCP integrations, then start a first task without CLI connections."
references/
additional-outcomes.md 1.6 KB
# Start a first task
Use this procedure only when the user asks for an immediate task in addition to creating the agent.
Discover and describe `CreateTasks`, `GetTask`, `ListTasks`, and `GetTaskEvents` on the target backend. Use the verified organization and saved agent ID. Keep the task within the agent's responsibility.
Choose which CLI connections the task may use, separately from the agent's role and MCP integrations. Set `cliIntegrations` explicitly: omitting it enables all configured CLI connections; `[]` enables none. Use the requested connections and explain this default before submission. If the API cannot apply the selection, keep the task as a draft.
Write the task message, agent ID, and CLI selection to a JSON request file using the described schema. Submit with `--input` and retain the returned `taskId`.
Read the task back to verify its agent binding and status. Use task events to check the initial message if `GetTask` does not expose it. Report any field, such as CLI selection, that the API does not return rather than claiming it was verified. Check execution within a bounded wait and distinguish task creation from successful completion.
If creation times out, use task list and get operations to reconcile the outcome before retrying. Follow all pages and use returned identifiers where available; matching text alone does not establish which request created a task. If the result remains uncertain, report the candidate IDs and states without retrying or cancelling them.
Keep the created agent if task setup fails. Resume only the unfinished step. A first task does not replace the creation skill's question about recurring automation.
automation-cli-contract.md 2.6 KB
# Automation API
Discover operations with `pulumi api list --filter AgentAutomation --output=json`. Refresh once with `--refresh-spec` if one is missing. Describe each operation needed for the task before using its fields.
| Operation | Purpose |
| --- | --- |
| `CreateAgentAutomationV2` | Create a schedule or trigger |
| `GetAgentAutomationV2` | Read saved configuration by `orgName` and `automationID` |
| `ListAgentAutomationsV2` | Check existing automations; follow continuation tokens |
| `UpdateAgentAutomationV2Paused` | Pause or resume future recurrence |
## Request fields
| Field | Meaning |
| --- | --- |
| `orgName` | Explicit organization parameter |
| `task.agentDefinitionId` | Saved agent ID; omission or an empty value can select another execution identity |
| `task.message` | A `user_message` event containing the literal task instructions; use the described schema for required event fields |
| `kind` | `scheduled` or `triggered` |
| `scheduleCron` | Five-field UTC cron; production minimum interval is ten minutes |
| `trigger` | Typed event rule. For `stack_operation`, supply operations, results, stacks, and `quietPeriodSeconds` |
| `task.cliIntegrations` | Omitted enables all organization CLI connections; `[]` enables none; a populated list selects connection instances by `catalogId` and `name` |
| `notificationTargets` | Destinations for run notifications |
Confirm accepted values and limits with describe. The bound agent supplies its role, approval mode, and MCP integrations on each turn. CLI connections are separate. If the API cannot express the requested cadence, access selection, or activation state, retain a draft rather than substituting another configuration.
## Create and read back
Write the resolved settings to `automation.json` using a JSON serializer. For schedules and stack-event triggers:
```sh
pulumi api CreateAgentAutomationV2 -F orgName=ORG --input automation.json --dry-run --output=json
```
Replace `ORG` with the verified organization. Compare the request with the chosen settings, then omit `--dry-run` to create. Use the returned ID with `GetAgentAutomationV2`, passing `orgName` and `automationID`.
Webhook requests and responses may contain secrets. Use [Webhook secrets](automation-webhook-secrets.md) instead of displaying their dry-run output.
## Pause or resume
Write `{"paused": true}` to a request file to pause, or `{"paused": false}` to resume. Call `UpdateAgentAutomationV2Paused` with that file and the verified `orgName` and `automationID`, then read back the state and unchanged rule.
This changes future recurrence, not tasks already created. It does not make an active-only create operation initially paused.
automation-recovery.md 1.4 KB
# Automation recovery
Keep the agent and known automation IDs. Fix only the unfinished step; do not recreate the agent or delete it as a rollback.
## Saved settings differ
Report the automation ID, requested versus saved values, and active or paused state. An active automation may run with the saved settings. Ask whether to pause that ID unless the pause is already authorized.
For an authorized pause, use skill `pulumi-setup-agent-automation`. If it is not installed, retain the ID and pending pause request and explain that the recovery procedure is unavailable.
## Create response was lost
Use `ListAgentAutomationsV2` and `GetAgentAutomationV2` to check whether creation succeeded. Follow all relevant pages. Use returned request or resource identifiers where available; a matching name or configuration alone does not establish which request created it.
If the outcome remains uncertain, report candidate IDs and states without retrying, adopting, or automatically pausing them. Explain that active candidates may run and ask whether the user wants a specific ID paused. A failed or incomplete read is not proof that nothing was created.
## Resume later
Retain the draft, confirmed IDs, and unresolved choices. Resume the incomplete step after the required decision or access is available. Distinguish saved configuration from sender setup and actual task execution.
automation-webhook-secrets.md 0.9 KB
# Webhook secrets
Arrange delivery of webhook credentials to the sender before creating the automation.
Keep signing credentials and response secrets out of chat, command arguments, and dry-run output. Read request credentials directly from an authorized private source into a protected request file.
## Capture the response
Disable shell tracing, set `umask 077`, and create a unique directory with `mktemp -d`. Redirect create stdout to a new file there. Extract only the ID and other nonsecret fields for reporting; transfer the secret directly to the authorized sender configuration without printing the complete response.
If protected capture or required sender setup is unavailable, keep a draft and explain what is missing before creation.
Report which sender setup steps are complete. Delivery permission is separate from the agent's access to investigate the event.
cli-contract.md 3.2 KB
# Agent creation API
## Discover operations
Check `pulumi version` and `pulumi api --help`. Confirm the backend and account with `pulumi whoami -v`; if authentication is missing, resolve it before reading organization data.
Use `pulumi api list` to discover operations and `pulumi api describe OPERATION --output=json` to inspect their parameters and response fields. Refresh the catalog once with `--refresh-spec` if an operation is missing.
| Operation | Purpose |
| --- | --- |
| `ListAgentDefinitions` | Find existing names and verify active roster membership |
| `CreateAgentDefinition` | Create the saved agent |
| `GetAgentDefinition` | Read the returned ID and verify saved settings |
| `ListRolesByOrgIDAndUXPurpose` | Read organization roles with `uxPurpose=role` |
| `GetRole` | Check the selected role's grants using `roleID` |
| `ListAgentIntegrations` | Find connected MCP integrations |
Use explicit `orgName` parameters. Follow pagination where present. Exclude built-in Admin and Billing Manager roles and verify the caller may assign the selected role; holding a role alone does not establish assignment authority.
## Select integrations
Read `ListAgentIntegrations` for the organization. Its `integrations` array includes unconnected catalog entries too: offer only entries with `configured: true`.
Map selected `integrationId` values to `enabledIntegrations: [{"id": "SELECTED_ID"}]`. Set `enabledIntegrations: []` for no MCP integrations. Omitting the field inherits all organization integrations. Credential-field labels and help text describe connection setup; they do not mean an integration is connected.
This workflow selects existing connections. It does not configure new ones.
### If integration discovery is unavailable
If discovery, describe, or the integration read fails, stop before creation and save the configuration as a local draft. Preserve the requested selection, identify the failed operation, and explain what is needed to continue. A missing operation, denied access, and a timeout are different failures; none means the organization has no integrations.
Do not substitute internal endpoints, guessed IDs, all integrations, or an empty selection. Resume from verification when the API or access is available.
## Build and submit the request
Use the described schema to map the proposal to `name`, `displayName`, `purpose`, `customInstructions`, `roleId`, `enabledIntegrations`, and `approvalMode`. Check accepted values and limits. Obtain missing team instructions from the user when no supported read exists.
Write the exact displayed values to a JSON file with a JSON serializer, then pass it through `--input`:
```sh
pulumi api CreateAgentDefinition -F orgName=ORG --input agent.json --dry-run --output=json
```
Replace `ORG` with the verified organization. Compare the dry-run body with the proposal, then omit `--dry-run` to create the agent. Dry-run checks request construction, not server authorization.
Read the response using the described response shape, retain the returned agent ID, and verify it with `GetAgentDefinition` and the active roster. A GET alone may return a deleted definition. Follow the creation skill's recovery guidance if the request times out or saved values differ.
configure-automation.md 3.3 KB
# Configure automation
## 1. Verify the agent
Confirm the organization and saved agent ID. Read the agent and check active roster membership; do not bind an uncertain or deleted identity. Reuse the creation workflow's verified settings when available.
Check `pausedAt`. A paused agent starts no new runs even when its automation is active. Report that state without resuming the agent.
Read [API contract](automation-cli-contract.md) and discover the operations needed for setup. If a required API or access is unavailable, keep the agent and save an automation draft explaining the blocker.
## 2. Resolve the rule
Use the user's choices and ask for missing details:
- **Schedule:** cadence, time, and named time zone. The API uses UTC cron, so resolve whether the user wants fixed UTC time or local wall-clock time through daylight-saving changes.
- **Event:** source, target stacks or other identifiers, filters, and quiet period. For stack events, the first matching event dispatches immediately; `quietPeriodSeconds` groups later events with that task rather than delaying the first dispatch.
- **Task:** per-run instructions, expected output, event context, and notification destinations. Keep these instructions separate from the agent's reusable instructions.
- **CLI connections:** set `task.cliIntegrations` to the requested connections. Omission enables all organization CLI connections; `[]` enables none. This is separate from the agent's role and MCP integrations.
Check creation's activation behavior. If the user requires an initially paused automation and the API creates active resources only, save a draft instead. Creating and immediately pausing leaves a window in which it can run. A paused agent is not a substitute for a paused automation. Manual approval can also leave unattended work waiting for a person.
For webhooks, read [Webhook secrets](automation-webhook-secrets.md) before preparing the request. Event delivery credentials do not establish the agent's access to investigate the event.
## 3. Prepare and create
List existing automations, following pagination. If the name is already used, show the existing ID and state and resolve whether the user means that automation or a new one.
Build the JSON request using the [API contract](automation-cli-contract.md). Include the saved agent ID, complete task message, selected CLI connections, rule, and notifications. The agent supplies its role, approval mode, and MCP integrations; task-level overrides do not narrow those settings.
Inspect the dry-run request before submission, except for secret-bearing webhook requests, which use protected handling. Show a proposal if choices remain unresolved or the user asked to review it. Otherwise, create the already-authorized automation once and retain its ID.
## 4. Verify and report
Read the automation and verify list membership, agent binding, task message, CLI selection, rule, notifications, and paused state. Check the agent's pause state separately. If a field is not returned, report that verification limit.
Return the IDs and saved configuration, plus any remaining sender setup. Do not report successful execution from configuration alone or send a test event unless requested.
For a lost response or differing saved values, follow [Recovery](automation-recovery.md). Keep the agent if automation setup fails.
License (Apache-2.0)
Apache-2.0
Source: pulumi/agent-skills
View full license text
Licensed under the Apache License, Version 2.0. See https://github.com/pulumi/agent-skills/blob/main/LICENSE