用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aiFabricoCom/fabrico-collections-codex --skill fabrico-analyze-aws-costs命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Audit GCP cost optimization and labeling compliance.
Process discovery materials into Jira-ready epics and user stories, or iterate on an existing backlog.
Design implementation architecture from task context.
基于 SOC 职业分类
正在显示 SKILL.md
| name | fabrico-analyze-aws-costs |
| description | Audit AWS cost optimization and tagging compliance. |
Invocation portability:
$fabrico-*below means the discovered entry workflow. Use the unqualified name for repository or filesystem installs and$fabrico-collections:fabrico-*for plugin installs.
Use the user’s current request as the workflow input. Expected context: [AWS Account/Profile, Region, or 'all'] [focus: specific service or 'everything'].
Prefer the
fabrico-devops-engineersubagent. When that custom agent is available, spawn it with the user's request and referenced context and adopt its operating contract. If this workflow is already running insidefabrico-devops-engineer, perform the audit locally and never spawn another DevOps engineer. If the profile is unavailable, as in a skills-only plugin installation, perform the complete workflow in the current thread with the required skills and the same audit contract. Perform an exhaustive, evidence-based AWS cost optimization and tagging compliance audit. Use a hybrid approach: analyze Terraform/IaC code first (if available), then always validate against live AWS infrastructure via API. The goal is to inspect every nook and cranny — every service, every resource, every configuration — for optimization opportunities, waste, misconfigurations, and tagging gaps.
When the user does not specify a narrow scope, default to auditing everything in the given account and region.
Before starting, load and follow these skills (in this order):
fabrico-technical-context-discovering — identify existing IaC patterns, tagging conventions, and project contextfabrico-codebase-analysing — IaC structure analysis, module relationships, and dead code detection; apply Steps 7, 2, 12 when IaC files are foundfabrico-optimizing-cloud-cost — cost analysis framework: Pricing Model Decision table, Storage Tiering Decision, tagging standards, rightsizing process, and anti-patternsfabrico-implementing-terraform-modules (conditional) — Terraform module structure, best practices, and AWS module reference; load when Terraform files are foundfabrico-managing-secrets (conditional) — secrets management audit criteria, security checklist, and exposure risk assessment; load when security findings are in scopeScope validation:
Load required skills (MUST complete before any analysis):
fabrico-technical-context-discovering skill (read .agents/skills/fabrico-technical-context-discovering/SKILL.md) — follow its process to identify existing IaC patterns, tagging conventions, and project context.fabrico-codebase-analysing skill (read .agents/skills/fabrico-codebase-analysing/SKILL.md) — even if no IaC files are found initially, this skill's Step 7 (infrastructure code) helps identify IaC in unexpected locations, and Step 2 (dependencies) reveals infrastructure-related dependencies in any project.fabrico-optimizing-cloud-cost skill (read .agents/skills/fabrico-optimizing-cloud-cost/SKILL.md and references/tagging-standards.md) — use it to establish the "Core 5" Mandatory Tags, Pricing Model Decision table, Storage Tiering Decision table, Process steps, Checklist, and Anti-Patterns. If the skill file cannot be found, use the following hardcoded defaults for the Core 5 Mandatory Tags: CostCenter, Environment, Service, Owner, DataClass.fabrico-implementing-terraform-modules skill (read .agents/skills/fabrico-implementing-terraform-modules/SKILL.md) — load when Terraform files (*.tf, *.tfvars, terragrunt.hcl) are found. Use it as the reference standard for module structure, naming conventions, provider pinning, and AWS-specific module patterns when evaluating IaC quality and generating Terraform code.fabrico-managing-secrets skill (read .agents/skills/fabrico-managing-secrets/SKILL.md) — load when the audit scope includes security (which is always for a full audit). Use its Security Checklist, Anti-Patterns, and Cloud-Native Detection patterns when evaluating secrets management, KMS keys, and credential handling.All standard DevOps agent guardrails (Mutation Lock, Zero-Deletion Policy, FinOps Alerts) apply automatically. Additionally:
Environment:prod.IaC-first discovery (hybrid approach — IaC then API):
fabrico-technical-context-discovering skill process loaded in step 2.*.tf, *.tfvars, terragrunt.hcl) and CloudFormation templates (*.yaml, *.json with AWSTemplateFormatVersion).fabrico-codebase-analysing skill (loaded in step 2) — specifically run its infrastructure code analysis (Step 7), dependency check (Step 2), and dead code/duplication check (Step 12) against the IaC codebase.fabrico-implementing-terraform-modules skill (loaded in step 2) to evaluate module structure quality: check for standard file layout (main.tf/variables.tf/outputs.tf/versions.tf), provider version pinning, variable validation blocks, and adherence to AWS module best practices.instance_type, allocated_storage, desired_count, volume_size, engine, multi_az).aws-api MCP server (package awslabs.aws-api-mcp-server; read-only: describe, list, get operations only) to inventory all active resources in the specified scope.aws-api is unavailable or unresponsive, use aws-documentation (package awslabs.aws-documentation-mcp-server) for service documentation and the context7 MCP server for pricing/resource reference data. Clearly inform the user that the audit is based on documentation rather than live data and recommend re-running with MCP API access for accurate results.Comprehensive resource audit (check EVERYTHING):
Apply the fabrico-optimizing-cloud-cost skill's Process step 3 (Identify waste) and Checklist to systematically check each resource category below. Apply the fabrico-managing-secrets skill's Security Checklist when auditing the Security & Compliance category.
Tagging & governance audit:
Apply the fabrico-optimizing-cloud-cost skill's Required Tags table and references/tagging-standards.md for the complete tagging framework.
aws-api to read resource tags for all discovered resources.CostCenter, Environment, Service, Owner, DataClass) as defined in tagging-standards.md.ModelID and TrainingJobId tags exist.DataClass tag exists on all storage and database resources.Environment:dev running 24/7 that are missing the Schedule tag.Cost & performance analysis:
aws-api with Cost Explorer APIs (ce:GetCostAndUsage) for actual cost data. If unavailable, estimate based on instance type and runtime hours.fabrico-optimizing-cloud-cost skill's Pricing Model Decision table to match each resource's workload type (steady-state, variable, fault-tolerant, serverless) to the optimal pricing model. Apply the Storage Tiering Decision table for all storage resources. Reference the skill's Anti-Patterns table to flag common cost mistakes.aws-documentation to verify the latest instance families, pricing tiers, and service availability in the target region before recommending any changes. This step is mandatory — do not recommend instance types or configurations without checking current AWS documentation first.Generate and save the analysis report:
IMPORTANT: Save the report file before presenting results to the user. Do not ask for confirmation. Always use this filename pattern:
aws-cost-audit-<profile>-<region>-YYYY-MM-DD.md(e.g.aws-cost-audit-default-eu-north-1-2026-02-18.md). After saving, tell the user the full file path on one line, then present the formatted summary below.
The saved Markdown file must be polished and presentation-ready. Follow every formatting rule below exactly — do not improvise:
Exact report structure and formatting rules:
# AWS Cost Optimization Audit
**Account / Profile:** `<profile>` **Region:** `<region>` **Date:** YYYY-MM-DD
**Data Sources:** IaC (Terraform) / Live API / Both
**Scope:** All services / <specific services>
---
## 📋 Executive Summary
- <bullet 1>
- <bullet 2>
- ... (3–6 bullets max)
---
## 🔍 IaC vs Live Infrastructure Drift
| # | Resource | IaC State | Live State | Drift Type |
|---|----------|-----------|------------|------------|
| 1 | `i-0abc123` | `m5.xlarge` | `m5.2xlarge` | Config drift |
| 2 | `sg-0xyz` | Not in IaC | Active | Shadow resource |
*(If no IaC found or no drift detected, state that clearly.)*
---
## 💰 Optimization Opportunities
| # | Resource ID | Type | Current Config | Current Cost ($/mo) | Recommended Config | Est. New Cost ($/mo) | Savings ($/mo) | Path |
|---|---|---|---|---|---|---|---|---|
| 1 | `i-0abc123` | EC2 | `m5.xlarge` | $140 | `m7g.large` | $70 | **$70** | 🟢 Golden |
| 2 | `db-prod-01` | RDS | `db.r5.2xl, 500 GB gp2` | $820 | `db.r7g.xl, 500 GB gp3` | $510 | **$310** | 🔵 Cost-Opt |
> Path legend: 🟢 Golden Path · 🔵 Cost-Optimized · 🚀 Velocity
---
## 🏷️ Tag Compliance
| # | Resource ID | Type | Missing Tags | Status |
|---|---|---|---|---|
| 1 | `i-0abc123` | EC2 | `Owner`, `DataClass` | ❌ FAIL |
| 2 | `my-bucket` | S3 | — | ✅ PASS |
---
## 🔒 Critical Security Findings
| # | Resource ID | Type | Finding | Severity |
|---|---|---|---|---|
| 1 | `sg-0xyz` | Security Group | Port 22 open to 0.0.0.0/0 | 🔴 HIGH |
*(If none found, write: "No critical security findings detected.")*
---
## 📊 Summary
| Metric | Value |
|---|---|
| Total current monthly spend | $X,XXX |
| Total estimated optimized spend | $X,XXX |
| **Total estimated savings** | **$X,XXX/mo (XX%)** |
| Tag compliance | XX% (X of Y resources fully tagged) |
| IaC coverage | XX% (X of Y resources managed by IaC) |
| Drift detected | X resources with configuration drift |
| Data sources used | AWS API / Terraform code / Both |
---
## ✅ Recommended Action Order
1. Apply optimization #X — highest savings, lowest risk
2. ...
Formatting constraints:
--- horizontal rules between every major section.❌ FAIL / ✅ PASS in tag compliance status column — no bold-only text.|---| separators, not :---:).Next steps — After saving and presenting the analysis report, ask only one question:
"Would you like me to generate Terraform code to implement these optimizations?"
If no: end the workflow — the saved report stands on its own.
If yes:
1, 3, 5 or all). Only modify the resources the user selects. Apply the fabrico-implementing-terraform-modules skill's module structure patterns and best practices when generating or modifying Terraform code.fabrico-codebase-analysing skill (if not already loaded), the fabrico-technical-context-discovering skill, and the fabrico-implementing-terraform-modules skill. Apply them to the provided Terraform directory — specifically run fabrico-codebase-analysing Step 7 (infrastructure code), Step 2 (dependencies), and Step 12 (dead code) against the Terraform codebase, follow fabrico-technical-context-discovering to understand existing patterns, and use fabrico-implementing-terraform-modules for module structure reference before making changes.Do not proceed with any code generation or file modification until the user explicitly confirms which items to implement.