Installation

Install as Agent Plugin Recommended
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install pulumi-setup-agent-automation@skills-hub

Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled). Plugin pulumi-setup-agent-automation v1.0.0 follows the Agent Plugins spec.

Install with the gh extension
gh skills-hub install pulumi-setup-agent-automation

Don't have the extension? Run gh extension install samueltauil/skills-hub first.

Download and extract to your repository:

.github/skills/pulumi-setup-agent-automation/

Extract the ZIP to .github/skills/ in your repo. The folder name must match pulumi-setup-agent-automation for Copilot to auto-discover it.

Skill Files (6)

SKILL.md 2.5 KB
---
name: pulumi-setup-agent-automation
description: Create a schedule or event trigger for an existing Pulumi Agent, or pause or resume an automation. Use when the user requests recurring or event-driven agent work, says yes to a proposed schedule or trigger, or asks to pause or resume an automation.
---

# Set up agent automation

An automation runs a saved Pulumi Agent on a schedule or in response to events. Creating an automation does not create a new agent or start a one-time task.

## Create a schedule or event trigger

Read [Configure automation](references/configure-automation.md).

Confirm the organization, saved agent, per-run instructions, schedule or event, and CLI connections. Reuse choices the user already supplied and ask about anything needed to complete the request. If the user declined automation, leave the agent available for manual invocation.

Check the agent's `pausedAt` field. A paused agent starts no new runs even when its automation is active. Setting up or resuming an automation must not resume the agent.

Use the [API contract](references/cli-contract.md) for operations and request fields. For webhooks, read [Webhook secrets](references/webhook-secrets.md) before creating the automation.

## Pause or resume an existing automation

1. Discover and describe the read and pause operations in the [API contract](references/cli-contract.md). Read the automation by organization and ID.
2. For resume, verify the bound agent, its pause state, and the caller's invocation access. A missing or unreadable agent does not prevent an authorized automation pause.
3. If the automation already has the requested state, report it. Otherwise call `UpdateAgentAutomationV2Paused` with only the requested `paused` value.
4. Read back the automation to verify its state and unchanged rule. After resume, also report whether the agent is paused.

Pausing stops future recurrence; it does not cancel tasks already created. Resuming an automation does not resume its agent.

## Verify and report

Return the automation ID, bound agent, saved schedule or trigger, and automation state. If the agent is paused, say that it cannot start new runs.

Saving configuration does not prove that a webhook was delivered or a task completed. Do not trigger a test run unless requested.

For an uncertain create response or mismatched saved configuration, follow [Recovery](references/recovery.md). If a required API or decision is unavailable, preserve the draft and explain what is needed to continue.
use_cases.yaml 0.7 KB
queries:
  - "Schedule my existing Pulumi Agent to review checkout costs every Monday at 09:00 UTC."
  - "Add a stack event trigger to this saved Pulumi Agent."
  - "Pause automation automation-123 in my Pulumi organization even if its saved agent is unavailable."
  - "Resume the automation for my existing Pulumi Agent after verifying its access."
  - "Set up a weekly automation for my paused Pulumi Agent, leaving the agent paused."
  - "Resume automation automation-123 and tell me whether its agent is still paused."
  - "Yes, set up the weekly schedule you proposed for my existing Pulumi Agent."
  - "Schedule my existing Pulumi Agent to review costs every Monday without CLI connections."
references/
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](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.
configure-automation.md 3.2 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](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](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](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](recovery.md). Keep the agent if automation setup fails.
recovery.md 1.3 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, follow [Pause or resume](../SKILL.md#pause-or-resume-an-existing-automation).

## 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.
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.

License (Apache-2.0)

View full license text
Licensed under the Apache License, Version 2.0. See https://github.com/pulumi/agent-skills/blob/main/LICENSE