一键导入
auto-documentation
Use when generating documentation for Terraform modules, infrastructure, or runbooks. Creates READMEs, operational guides, and architecture docs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when generating documentation for Terraform modules, infrastructure, or runbooks. Creates READMEs, operational guides, and architecture docs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when executing implementation plans with independent tasks in the current session
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Use before any Terraform or AWS operation to verify correct credentials and profile are active. Prevents cross-environment accidents.
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
Use when you have a written implementation plan to execute in a separate session with review checkpoints
基于 SOC 职业分类
| name | auto-documentation |
| description | Use when generating documentation for Terraform modules, infrastructure, or runbooks. Creates READMEs, operational guides, and architecture docs. |
Generate comprehensive documentation from infrastructure code. This skill creates READMEs, runbooks, and architecture documentation that stays in sync with actual code.
Announce at start: "I'm using the auto-documentation skill to generate documentation."
For Terraform modules, generate:
# Module: [module-name]
[Brief description of what this module provisions]
## Requirements
| Name | Version |
|------|---------|
| terraform | >= X.Y.Z |
| aws | >= X.Y.Z |
## Providers
| Name | Version |
|------|---------|
| aws | X.Y.Z |
## Resources
| Name | Type |
|------|------|
| aws_instance.this | resource |
| aws_security_group.this | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| name | Name prefix for resources | `string` | n/a | yes |
| vpc_id | VPC ID | `string` | n/a | yes |
## Outputs
| Name | Description |
|------|-------------|
| instance_id | ID of the created instance |
| public_ip | Public IP address |
## Usage
```hcl
module "example" {
source = "./modules/[module-name]"
name = "my-instance"
vpc_id = "vpc-12345"
}
[Optional: Mermaid diagram of resources]
[Any important considerations, limitations, or gotchas]
### 2. Environment Documentation
For environment directories:
```markdown
# Environment: [env-name]
## Overview
[Purpose and scope of this environment]
## Resource Inventory
| Category | Resource Type | Count | Key Resources |
|----------|--------------|-------|---------------|
| Compute | aws_instance | 5 | web-1, web-2, api-1 |
| Database | aws_rds_instance | 2 | primary, replica |
| Network | aws_vpc | 1 | main-vpc |
## Architecture Diagram
```mermaid
graph TB
subgraph VPC
subgraph Public
ALB[Load Balancer]
end
subgraph Private
WEB[Web Servers]
API[API Servers]
end
subgraph Data
RDS[(Database)]
end
end
ALB --> WEB
WEB --> API
API --> RDS
| Service | Port | Source | Purpose |
|---|---|---|---|
| ALB | 443 | 0.0.0.0/0 | Public HTTPS |
| Web | 8080 | ALB | Internal traffic |
[How to deploy changes to this environment]
### 3. Operational Runbook
For operations documentation:
```markdown
# Runbook: [service/component]
## Overview
[What this runbook covers]
## Common Operations
### Starting/Stopping
```bash
# Start the service
terraform apply -target=module.service
# Stop (with caution)
# See "Emergency Procedures" below
# Update instance count
terraform apply -var="instance_count=5"
# Check instance status
aws ec2 describe-instance-status --instance-ids i-xxx
# Check application health
curl https://service.example.com/health
Symptoms: CPU > 80% sustained
Investigation:
Resolution:
Symptoms: 504 errors at load balancer
Investigation:
Resolution:
# Identify previous state
git log --oneline terraform.tfstate
# Restore previous state (CAREFUL!)
# [State restoration steps]
| Role | Name | Contact |
|---|---|---|
| On-call | [Team] | [Contact] |
| Escalation | [Manager] | [Contact] |
## Process
### Step 1: Analyze Code
```bash
# Find all Terraform files
find . -name "*.tf" -type f
# Extract structure
grep -h "^variable\|^output\|^resource\|^module" *.tf
For each file, extract:
Based on directory type:
variables.tf + outputs.tf → Module READMEdev/, staging/, prod/ → Environment docsAlways present generated docs for review before writing.
Show:
Only after user approval:
Mark custom content to preserve during regeneration:
<!-- BEGIN CUSTOM -->
Your custom content here
<!-- END CUSTOM -->
Use Mermaid for architecture diagrams:
Store documentation patterns: