pulumi-best-practices

Detect Pulumi best-practice violations and recommend fixes for programs.

19|3|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/dirien/yet-another-agent-harness --skill pulumi-best-practices-dirien
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pulumi-best-practices
Source: https://github.com/dirien/yet-another-agent-harness/tree/main/.claude/skills/pulumi-best-practices
Command: npx skills add https://github.com/dirien/yet-another-agent-harness --skill pulumi-best-practices-dirien

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides concise, actionable best practices and detection signals to prevent unpredictable Pulumi deployments, accidental resource replacement during refactors, and the accidental exposure of secrets.

Core Features & Use Cases

  • Detection & Remediation Guidance: Points out resource creation inside apply callbacks, improper Output unwrapping, missing parent relationships, and absent aliases, with clear fixes.
  • Component and Refactor Patterns: Explains how to author ComponentResource classes, set parent: this, use aliases for safe renames/moves, and register outputs for reuse.
  • Secrets and Deployment Workflow: Recommends encrypting config from day one, using ESC for centralized secrets, and running pulumi preview in CI/CD; ideal for code reviews, refactors, and deployment checks.

Quick Start

Use pulumi-best-practices to scan the Pulumi codebase at ./infra and produce a checklist of violations with recommended fixes.

Frequently Asked Questions about pulumi-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does pulumi preview show unpredictable results when refactoring infrastructure as code?

Unpredictable pulumi preview results often stem from creating resources inside apply callbacks or improper Output unwrapping. Enforce best-practice patterns for Pulumi programs by moving resource creation outside apply callbacks and handling Outputs correctly to ensure reliable previews.

How do I prevent accidental resource replacement during Pulumi refactors?

Prevent accidental resource replacement during Pulumi refactors by using aliases for safe renames and moves. Defining aliases maintains resource identity across structural changes, avoiding destructive deletes and replacements while keeping infrastructure-as-code state intact.

What is the best way to author Pulumi ComponentResources for reuse?

Author Pulumi ComponentResources by setting parent: this to establish missing component parent relationships and registering outputs for reuse. Following these component patterns ensures proper resource hierarchy and reliable infrastructure-as-code management.

How should I configure Pulumi secrets across stacks and CI/CD workflows?

Configure Pulumi secrets across stacks and CI/CD workflows by encrypting configuration from day one and using ESC for centralized secrets management. This prevents accidental exposure and secures infrastructure-as-code deployments during CI/CD preview checks.

Can I scan my Pulumi codebase for missing parent relationships and absent aliases?

Yes, you can scan your Pulumi codebase to detect missing parent relationships, absent aliases, and resource creation inside apply callbacks. This produces a checklist of violations with recommended fixes to make Pulumi programs refactor-safe.