install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/pulumi" ~/.claude/skills/comeonoliver-skillshub-pulumi && rm -rf "$T"
manifest:
skills/pproenca/dot-skills/pulumi/SKILL.mdsource content
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 | |
| 2 | Resource Graph Optimization | CRITICAL | |
| 3 | Component Design | HIGH | |
| 4 | Secrets and Configuration | HIGH | |
| 5 | Stack Organization | MEDIUM-HIGH | |
| 6 | Resource Options and Lifecycle | MEDIUM | |
| 7 | Testing and Validation | MEDIUM | |
| 8 | Automation and CI/CD | LOW-MEDIUM | |
Quick Reference
1. State Management and Backend (CRITICAL)
- Use managed backend for production stackspstate-backend-selection
- Enable checkpoint skipping for large stackspstate-checkpoint-skipping
- Keep stacks under 500 resourcespstate-stack-size
- Use targeted refresh instead of full stackpstate-refresh-targeting
- Use state export/import for migrationspstate-export-import
- Import existing resources before managingpstate-import-existing
2. Resource Graph Optimization (CRITICAL)
- Structure resources for maximum parallelismgraph-parallel-resources
- Use outputs to express true dependenciesgraph-output-dependencies
- Use dependsOn only for external dependenciesgraph-explicit-depends
- Avoid side effects in apply functionsgraph-avoid-apply-side-effects
- Use conditional logic at resource levelgraph-conditional-resources
- Minimize stack reference depthgraph-stack-references-minimal
3. Component Design (HIGH)
- Use ComponentResource for reusable abstractionspcomp-component-resources
- Pass parent option to child resourcespcomp-parent-child
- Use name prefix pattern for unique resource namespcomp-unique-naming
- Register component outputs explicitlypcomp-register-outputs
- Design components for multi-language consumptionpcomp-multi-language
- Use transformations for cross-cutting concernspcomp-transformations
4. Secrets and Configuration (HIGH)
- Use secret config for sensitive valuessecrets-use-secret-config
- Prevent secret leakage in statesecrets-avoid-state-exposure
- Use external secret managers for productionsecrets-external-providers
- Generate secrets with random providersecrets-generate-random
- Rotate secrets provider when team members leavesecrets-provider-rotation
- Isolate secrets by environmentsecrets-environment-isolation
5. Stack Organization (MEDIUM-HIGH)
- Separate stacks by deployment lifecyclestack-separation-by-lifecycle
- Parameterize stack referencesstack-references-parameterized
- Export only required outputsstack-output-minimal
- Use consistent stack naming conventionstack-naming-conventions
6. Resource Options and Lifecycle (MEDIUM)
- Protect stateful resourceslifecycle-protect-stateful
- Use deleteBeforeReplace for unique constraintslifecycle-delete-before-replace
- Use retainOnDelete for shared resourceslifecycle-retain-on-delete
- Use ignoreChanges for externally managed propertieslifecycle-ignore-changes
- Use replaceOnChanges for immutable dependencieslifecycle-replace-on-changes
- Use aliases for safe resource renaminglifecycle-aliases
- Set custom timeouts for long-running resourceslifecycle-custom-timeouts
7. Testing and Validation (MEDIUM)
- Use mocks for fast unit teststest-unit-mocking
- Use policy as code for property testingtest-property-policies
- Use ephemeral stacks for integration teststest-integration-ephemeral
- Assert on preview results before deploymenttest-preview-assertions
- Mock stack references in unit teststest-stack-reference-mocking
8. Automation and CI/CD (LOW-MEDIUM)
- Use Automation API for complex workflowsauto-automation-api-workflows
- Use inline programs for dynamic infrastructureauto-inline-programs
- Run preview in PR checksauto-ci-cd-preview
- Use Pulumi Deployments for GitOpsauto-deployments-api
- Use review stacks for PR environmentsauto-review-stacks
- Enable drift detection for productionauto-drift-detection
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
Full Compiled Document
For the complete guide with all rules expanded:
AGENTS.md