Generated banner for Pulumi Context API
Generated logo for Pulumi Context API

Pulumi Context API

PulumiOfficialPublished by Pulumi

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • No issues found

From the author

Query the Pulumi Context API, a graph query interface over an organization's infrastructure in Pulumi Cloud. Use when a question is about relationships or reachability across resources and stacks: the impact of a change ("what breaks if I change this?", blast radius), what depends on a resource or a stack's outputs, which provider instances manage which resources and at what versions, orphaned or unreferenced resources, or references that cross stacks and cloud accounts, including resources Pulumi doesn't manage. Don't load it for finding a single resource by name, type, or property (Resource Search covers that), or for update history and failure debugging (use skill `pulumi-debug-failed-operation`).
— the description by Pulumi

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The pulumi-context-api skill enables agents to interact with the Pulumi Context API, a graph-based interface for analyzing infrastructure relationships within Pulumi Cloud. Unlike standard resource searches that focus on individual items, this skill allows for complex queries regarding resource dependencies, blast radius analysis, and cross-stack references. It provides a structured approach to fetching schema primers and executing graph queries to understand the interconnected nature of cloud resources, including those managed outside of Pulumi.

What it does

  • Fetches the current graph schema to understand available fields and query capabilities.
  • Executes graph queries to map dependencies between resources and stacks.
  • Performs impact analysis to determine the blast radius of potential infrastructure changes.
  • Identifies orphaned or unreferenced resources across cloud accounts.
  • Determines which provider instances manage specific resources and their versions.
  • Validates query completeness using fidelity signals and pagination tokens.

When to use it

  • When you need to understand the impact of a change on dependent resources.
  • When identifying what depends on a specific stack's outputs.
  • When mapping relationships that cross multiple stacks or cloud accounts.
  • When searching for unreferenced or orphaned infrastructure components.
  • When the question involves graph-based reachability rather than simple resource lookup.

Advantages

  • Provides a holistic view of infrastructure as a connected graph.
  • Enables complex dependency analysis that standard search tools cannot perform.
  • Includes resources discovered by Pulumi even if not directly managed by it.
  • Ensures query accuracy by requiring a fresh schema primer for every session.
  • Supports programmatic handling of large datasets through pagination.

Usage examples

“What resources would be impacted if I delete this specific database stack?”
The agent uses the Context API to traverse the dependency graph and identifies all downstream resources and stacks that rely on the database's outputs.
“Find all orphaned resources in my production environment that are not referenced by any stack.”
The agent queries the graph for resources lacking incoming dependency edges and reports the list of unreferenced infrastructure.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/pulumi/pulumi-context-api/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip pulumi-context-api.zip -d .agents/skills

Documentation by Pulumi

Query the Pulumi Context API

The Context API answers questions about an organization's cloud infrastructure as a graph: what exists, what depends on what, what a change would affect. It covers resources found through Pulumi Discovery, not just Pulumi-managed ones.

Prefer it over Resource Search whenever the question involves relationships. Resource Search finds individual resources but cannot follow edges, so answering "what depends on X" with repeated searches is slow and usually incomplete.

Public preview, for organizations on the Enterprise and Business Critical editions, and a role granting resources:search (the default Member and Admin roles do).

First: is a graph tool already in the session?

If one is — graph_query and get_graph_schema, under whatever prefix the server registers them — call it and skip Steps 1 and 2. Compose the selector from the graph_query tool's own description, which carries the grammar; the tool resolves the organization and credentials itself and drains pagination for you. When that description is not enough, get_graph_schema returns the live field vocabulary and limits, and will serve the full Step 1 primer when asked for it. Step 3 still governs what you do with the result.

Steps 1 and 2 are the path for an agent that has a shell and no such tool.

Step 1: fetch the primer, always

Needs Pulumi CLI v3.243.0 or newer and an active pulumi login.

pulumi api GetGraphQuerySchema --output=markdown

This returns a self-contained guide to composing selectors — vocabulary, edge types, engine caps, worked examples, pagination, completeness rules, the gates that deny a query, and the traps that produce a confident wrong answer instead of an error. It is served by the deployment that answers your queries, so it is the contract, and it moves between schema versions. This skill bootstraps you to it and stops there; everything below defers to it. Fetch it fresh in every session — a primer remembered from earlier may describe a schema this deployment no longer serves.

The operation takes no organization; one schema covers every org the login can reach. --output=json on it returns the same contract as a machine-readable payload, useful for reading limits or fieldValues programmatically, but compose from the markdown.

Read it in full — never truncate it with head, tail, or a byte cap. A clipped primer means malformed selectors and rejected queries.

If this call fails

You have no primer yet, so handle it here rather than looking it up there:

ResponseMeaning
401 Unauthorizedno active pulumi login, or an expired token
404 Not Found, detail-freea wrong path, or a deployment without the endpoint
503 Service Unavailabletransient — retry

Entitlement gates are per-organization, so they cannot appear on this call — they surface in Step 2, by which point the primer's "When it denies you" table is in hand. If pulumi api doesn't know GetGraphQuerySchema at all, that is not a gate: run pulumi api list --refresh-spec to refresh the cached spec, then retry the fetch.

Step 2: query

pulumi api GraphQuery -F orgName=<org> --input selector.json

The body is a JSON selector, not query text. Compose it from the primer you just read, not from memory or from a grammar you recall from another session.

Name the org explicitly. Left off, -F orgName resolves from the selected stack or the default org, which is often an individual account with no entitlement; pulumi whoami -v lists every organization the login can reach. A denial here names its gate — the primer's "When it denies you" table says which are worth retrying and which to report to the user.

Step 3: apply the primer's completeness rules before answering

Every response carries fidelity signals — currently meta.resultMode, meta.visibility, and pageInfo.continuationToken; the primer names the authoritative set. Read the primer's rules for them and follow them; the remedies differ per signal and a stale paraphrase here would be worse than none.

What matters most: a completeness claim needs all of them clean. Impact analysis, "nothing depends on this", an exhaustive cleanup list, a total across groups — none of these survive a truncated result, a trimmed traversal, or an undrained page. When you can't get there, say what the answer does cover.

Scope of the graph

Resources, stacks, and the relationships between them, trimmed to the stacks and accounts the caller can see. The primer's "What it cannot answer yet" section is the live boundary — check it before concluding a question is unanswerable, and reach for a different API rather than approximating one of those gaps with a graph query.

One boundary worth knowing up front, because it decides which API to use: the graph returns a schema-declared subset of fields per node type, not full resource property bags. The primer lists which fields each node type can match on and which it can return; when the question needs the property values themselves, they come back from Resource Search.

Human-readable reference: Context API overview and query guide.

Files

use_cases.yaml

# Queries that should activate the pulumi-context-api skill
queries:
  # Blast radius / impact
  - "What breaks if I change the outputs of my networking stack?"
  - "What is the blast radius of deleting this security group?"
  - "Which resources depend on this RDS instance?"
  - "If I upgrade the AWS provider in this stack, what does it touch?"
  # Dependency / reference traversal
  - "What references this security group, including resources Pulumi doesn't manage?"
  - "Which stacks consume the outputs of our shared VPC stack?"
  - "Show me everything downstream of this S3 bucket across our organization"
  # Inventory by relationship
  - "Which provider versions are we running, and in which stacks?"
  - "What resources does this provider instance manage?"
  - "Query the infrastructure graph for all resources grouped by cloud account"
  # Orphans / absence
  - "Which resources in my org have nothing depending on them?"
  - "Find unreferenced resources in the production project"
  # Direct mentions
  - "Use the Pulumi Context API to map dependencies between our stacks"
  - "Run a graph query against our Pulumi organization"

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Node.js

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Pulumi
Publisher
Pulumi (Official)
Source
pulumi/agent-skills · pulumi/skills/pulumi-context-api · commit 82f222a
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Pulumi or Pulumi.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pulumi-context-api.zip