pulumi — Claude Code skill: Pulumi rules for your agent
A skill that hands your agent 46 Pulumi rules covering state, resource graph, components and secrets. Useful when you write infrastructure alongside a model.
npx skills add pproenca/dot-skills --skill pulumi -a claude-codeWhat pulumi does
The rules sit in 8 categories ranked by impact. State management and backend come first, then resource graph optimization, component design, secrets and configuration. Stack organization, resource lifecycle options, testing and CI/CD automation follow. Each rule carries a prefix like pstate- or graph-, so the agent can point at a specific one.
Inside you get a quick reference to every rule plus separate files with explanations and code examples. The full guide is compiled into AGENTS.md, category structure lives in references/_sections.md, and a template for new rules sits in assets/templates/_template.md. The agent reads this while you write new Pulumi code, refactor existing code, or wire up a pipeline.
Some rules give hard numbers: keep a stack under 500 resources, enable checkpoint skipping for large stacks. Worth checking your own stacks if they have been growing for a while. The skill runs on Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode — install drops SKILL.md into the skills directory of the platform you pick.
What it helps with
- structure resources so a Pulumi deploy runs in parallel
- extract repeated infrastructure into a ComponentResource
- stop secrets from leaking into state
- split stacks by deployment lifecycle
- run preview in pull request checks
Example prompts for the agent
- Refactor this Pulumi stack using the pulumi skill rules, start with state management
- Review my Pulumi code for resource graph and lifecycle violations
- Help me move these resources into a ComponentResource with a parent option
How to install pulumi
1Skills CLI (Vercel)
npx skills add pproenca/dot-skills --skill pulumi -a claude-code2Manually: put the files in place
~/.claude/skills/pulumi/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pulumi/
1Skills CLI (Vercel)
npx skills add pproenca/dot-skills --skill pulumi -a codex2Manually: put the files in place
.agents/skills/pulumi/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add pproenca/dot-skills --skill pulumi -a cursor2Manually: put the files in place
.cursor/skills/pulumi/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install pproenca/dot-skills pulumi2Manually: put the files in place
.github/skills/pulumi/SKILL.md1Skills CLI (Vercel)
npx skills add pproenca/dot-skills --skill pulumi -a gemini-cli2Platform CLI
gemini skills install https://github.com/pproenca/dot-skills --path skills/.experimental/pulumiManually: put the files in place
.devin/skills/pulumi/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add pproenca/dot-skills --skill pulumi -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about pulumi
How do I install pulumi in Claude?
Run npx skills add pproenca/dot-skills --skill pulumi -a claude-code. The skill lands in ~/.claude/skills/pulumi/SKILL.md.
What does the pulumi skill do?
It gives the agent a set of Pulumi rules: state management, resource graph optimization, components, secrets, stacks, lifecycle, testing and CI/CD. The agent follows them when generating or reviewing code.
Which platforms does the skill support?
Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. Each platform has its own install command and SKILL.md path.
Source text
SKILL.md · MIT
--- name: pulumi description: Pulumi infrastructure as code performance and reliability guidelines. This skill should be used when writing, reviewing, or refactoring Pulumi code to ensure optimal deployment performance and infrastructure reliability. Triggers on tasks involving Pulumi stacks, components, state management, secrets configuration, resource lifecycle options, or CI/CD automation. --- # Pulumi Best Practices Comprehensive performance and reliability guide for Pulumi infrastructure as code, designed for AI agents and LLMs. Contains 46 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation. ## When to Apply Reference these guidelines when: - Writing new Pulumi infrastructure code - Designing component abstractions for reuse - Configuring secrets and sensitive values - Organizing stacks and cross-stack references - Setting up CI/CD pipelines for infrastructure ## Rule Categories by Priority | Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | State Management and Backend | CRITICAL | `pstate-` | | 2 | Resource Graph Optimization | CRITICAL | `graph-` | | 3 | Component Design | HIGH | `pcomp-` | | 4 | Secrets and Configuration | HIGH | `secrets-` | | 5 | Stack Organization | MEDIUM-HIGH | `stack-` | | 6 | Resource Options and Lifecycle | MEDIUM | `lifecycle-` | | 7 | Testing and Validation | MEDIUM | `test-` | | 8 | Automation and CI/CD | LOW-MEDIUM | `auto-` | ## Quick Reference ### 1. State Management and Backend (CRITICAL) - `pstate-backend-selection` - Use managed backend for production stacks - `pstate-checkpoint-skipping` - Enable checkpoint skipping for large stacks - `pstate-stack-size` - Keep stacks under 500 resources - `pstate-refresh-targeting` - Use targeted refresh instead of full stack - `pstate-export-import` - Use state export/import for migrations - `pstate-import-existing` - Import existing resources before managing ### 2. Resource Graph Optimization (CRITICAL) - `graph-parallel-resources` - Structure resources for maximum parallelism - `graph-output-dependencies` - Use outputs to express true dependencies - `graph-explicit-depends` - Use dependsOn only for external dependencies - `graph-avoid-apply-side-effects` - Avoid side effects in apply functions - `graph-conditional-resources` - Use conditional logic at resource level - `graph-stack-references-minimal` - Minimize stack reference depth ### 3. Component Design (HIGH) - `pcomp-component-resources` - Use ComponentResource for reusable abstractions - `pcomp-parent-child` - Pass parent option to child resources - `pcomp-unique-naming` - Use name prefix pattern for unique resource names - `pcomp-register-outputs` - Register component outputs explicitly - `pcomp-multi-language` - Design components for multi-language consumption - `pcomp-transformations` - Use transformations for cross-cutting concerns ### 4. Secrets and Configuration (HIGH) - `secrets-use-secret-config` - Use secret config for sensitive values - `secrets-avoid-state-exposure` - Prevent secret leakage in state - `secrets-external-providers` - Use external secret managers for production - `secrets-generate-random` - Generate secrets with random provider - `secrets-provider-rotation` - Rotate secrets provider when team members leave - `secrets-environment-isolation` - Isolate secrets by environment ### 5. Stack Organization (MEDIUM-HIGH) - `stack-separation-by-lifecycle` - Separate stacks by deployment lifecycle - `stack-references-parameterized` - Parameterize stack references - `stack-output-minimal` - Export only required outputs - `stack-naming-conventions` - Use consistent stack naming convention ### 6. Resource Options and Lifecycle (MEDIUM) - `lifecycle-protect-stateful` - Protect stateful resources - `lifecycle-delete-before-replace` - Use deleteBeforeReplace for unique constraints - `lifecycle-retain-on-delete` - Use retainOnDelete for shared resources - `lifecycle-ignore-changes` - Use ignoreChanges for externally managed properties - `lifecycle-replace-on-changes` - Use replaceOnChanges for immutable dependencies - `lifecycle-aliases` - Use aliases for safe resource renaming - `lifecycle-custom-timeouts` - Set custom timeouts for long-running resources ### 7. Testing and Validation (MEDIUM) - `test-unit-mocking` - Use mocks for fast unit tests - `test-property-policies` - Use policy as code for property testing - `test-integration-ephemeral` - Use ephemeral stacks for integration tests - `test-preview-assertions` - Assert on preview results before deployment - `test-stack-reference-mocking` - Mock stack references in unit tests ### 8. Automation and CI/CD (LOW-MEDIUM) - `auto-automation-api-workflows` - Use Automation API for complex workflows - `auto-inline-programs` - Use inline programs for dynamic infrastructure - `auto-ci-cd-preview` - Run preview in PR checks - `auto-deployments-api` - Use Pulumi Deployments for GitOps - `auto-review-stacks` - Use review stacks for PR environments - `auto-drift-detection` - Enable drift detection for production ## How to Use Read individual reference files for detailed explanations and code examples: - [Section definitions](references/_sections.md) - Category structure and impact levels - [Rule template](assets/templates/_template.md) - Template for adding new rules ## Full Compiled Document For the complete guide with all rules expanded: `AGENTS.md`
© pproenca · MIT · pproenca/dot-skills