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