$npx -y skills add terramate-io/agent-skills --skill terramate-best-practicesTerramate CLI, Cloud, and Catalyst best practices and usage guides. This skill should be used when working with Terramate stacks, orchestration, code generation, Cloud integration, or Catalyst components and bundles.
| 1 | # Terramate Best Practices |
| 2 | |
| 3 | Comprehensive guide for Terramate CLI, Cloud, and Catalyst, maintained by Terramate. Contains best practices and usage patterns for stack management, orchestration, code generation, Cloud integration, and Catalyst components/bundles. |
| 4 | |
| 5 | ## When to Apply |
| 6 | |
| 7 | Reference these guidelines when: |
| 8 | - Creating and organizing Terramate stacks |
| 9 | - Orchestrating commands across multiple stacks |
| 10 | - Using code generation to keep configurations DRY |
| 11 | - Integrating with Terramate Cloud for observability |
| 12 | - Creating Catalyst components and bundles |
| 13 | - Setting up CI/CD workflows with Terramate |
| 14 | - Managing stack dependencies and execution order |
| 15 | |
| 16 | ## Rule Categories by Priority |
| 17 | |
| 18 | | Priority | Category | Impact | Prefix | |
| 19 | |----------|----------|--------|--------| |
| 20 | | 1 | CLI Fundamentals | CRITICAL | `cli-` | |
| 21 | | 2 | CLI Orchestration | HIGH | `cli-orchestration-` | |
| 22 | | 3 | CLI Code Generation | HIGH | `cli-codegen-` | |
| 23 | | 4 | CLI Configuration | MEDIUM-HIGH | `cli-config-` | |
| 24 | | 5 | Terramate Cloud | MEDIUM-HIGH | `cloud-` | |
| 25 | | 6 | Terramate Catalyst | MEDIUM | `catalyst-` | |
| 26 | | 7 | CI/CD Integration | MEDIUM | `cicd-` | |
| 27 | | 8 | Advanced Patterns | LOW-MEDIUM | `advanced-` | |
| 28 | |
| 29 | ## Quick Reference |
| 30 | |
| 31 | ### 1. CLI Fundamentals (CRITICAL) |
| 32 | |
| 33 | - `cli-stack-structure` - Organize stacks with clear directory structure |
| 34 | - `cli-stack-config` - Configure stacks with proper stack blocks |
| 35 | - `cli-stack-metadata` - Use metadata for stack identification and filtering |
| 36 | |
| 37 | ### 2. CLI Orchestration (HIGH) |
| 38 | |
| 39 | - `cli-orchestration-run` - Run commands across stacks efficiently |
| 40 | - `cli-orchestration-change-detection` - Use change detection to limit execution scope |
| 41 | - `cli-orchestration-parallel` - Leverage parallel execution for independent stacks |
| 42 | - `cli-orchestration-dependencies` - Manage stack dependencies and execution order |
| 43 | |
| 44 | ### 3. CLI Code Generation (HIGH) |
| 45 | |
| 46 | - `cli-codegen-hcl` - Use generate_hcl for DRY Terraform code |
| 47 | - `cli-codegen-file` - Use generate_file for file generation patterns |
| 48 | - `cli-codegen-provider` - Generate provider configurations dynamically |
| 49 | |
| 50 | ### 4. CLI Configuration (MEDIUM-HIGH) |
| 51 | |
| 52 | - `cli-config-globals` - Use globals for shared configuration across stacks |
| 53 | - `cli-config-lets` - Use lets for stack-local computed values |
| 54 | - `cli-config-metadata` - Leverage metadata for stack information |
| 55 | |
| 56 | ### 5. Terramate Cloud (MEDIUM-HIGH) |
| 57 | |
| 58 | - `cloud-integration` - Set up Cloud connection and authentication |
| 59 | - `cloud-drift-management` - Configure drift detection and reconciliation |
| 60 | - `cloud-observability` - Use Cloud dashboard for stack visibility |
| 61 | |
| 62 | ### 6. Terramate Catalyst (MEDIUM) |
| 63 | |
| 64 | - `catalyst-components` - Create reusable component blueprints |
| 65 | - `catalyst-bundles` - Define bundles for component composition |
| 66 | - `catalyst-instantiation` - Instantiate bundles correctly |
| 67 | |
| 68 | ### 7. CI/CD Integration (MEDIUM) |
| 69 | |
| 70 | - `cicd-github-actions` - Set up GitHub Actions workflows |
| 71 | - `cicd-preview-workflows` - Create preview workflows for PRs |
| 72 | - `cicd-deployment-workflows` - Configure deployment automation |
| 73 | |
| 74 | ### 8. Advanced Patterns (LOW-MEDIUM) |
| 75 | |
| 76 | - `advanced-workflows` - Create complex multi-step workflows |
| 77 | - `advanced-codegen-patterns` - Advanced code generation techniques |
| 78 | |
| 79 | ## How to Use |
| 80 | |
| 81 | Read individual rule files for detailed explanations and code examples: |
| 82 | |
| 83 | ``` |
| 84 | rules/cli-stack-structure.md |
| 85 | rules/cli-orchestration-run.md |
| 86 | rules/cli-codegen-hcl.md |
| 87 | rules/cloud-integration.md |
| 88 | rules/catalyst-components.md |
| 89 | ``` |
| 90 | |
| 91 | Each rule file contains: |
| 92 | - Brief explanation of why it matters |
| 93 | - Incorrect/anti-pattern example with explanation |
| 94 | - Correct/best practice example with explanation |
| 95 | - Additional context and references |
| 96 | |
| 97 | ## Full Compiled Document |
| 98 | |
| 99 | For the complete guide with all rules expanded: `AGENTS.md` |