Help us improve
Share bugs, ideas, or general feedback.
From followrabbit
Perform a FollowRabbit cost review on the current repository. Use when the user wants to understand the cost impact of Terraform or SQL infrastructure, asks about cloud costs, or is working with *.tf or *.sql files.
npx claudepluginhub followrabbit-ai/awesome-rabbit --plugin followrabbitHow this skill is triggered — by the user, by Claude, or both
Slash command
/followrabbit:cost-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill guides you through performing a cost review using the `followrabbit` CLI. The CLI scans local Terraform and SQL files, sends the infrastructure context to the FollowRabbit API, and returns AI-powered cost optimization instructions.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.
Share bugs, ideas, or general feedback.
This skill guides you through performing a cost review using the followrabbit CLI. The CLI scans local Terraform and SQL files, sends the infrastructure context to the FollowRabbit API, and returns AI-powered cost optimization instructions.
.tf) or SQL files and mentions cost, pricing, or optimizationThis skill invokes the local followrabbit CLI. The costreview command sends the following to https://api.agentic.followrabbit.ai (default; overridable with --api-url) over HTTPS:
*.tf, *.tfvars, and *.tfvars.json file under the working directory, up to a combined 512 KiB budget (over-budget files are listed by path only).*.sql file under the working directory, with each file capped at 100 KiB (truncation marker appended when capped)..tfvars environment files extracted from the same files (alongside, not instead of, the raw content).cost-impact,partition-check,best-practices) and, optionally, a model override.The costreview command does not send:
*.tf, *.tfvars, *.tfvars.json, and *.sql..git/ history, branch state, or any VCS metadata.. (e.g. .git, .terraform) or inside node_modules — these are skipped during the scan.Note: the CLI does not read or honor .gitignore. Any non-hidden directory listed in .gitignore will still be scanned.
Other commands and what they send:
followrabbit context — local only, does not call the API.followrabbit status — sends only your API key (no body, no context).followrabbit recos list — sends your git origin remote URL (auto-detected via git remote get-url origin) as a ?repo= query parameter, plus optional type and status filters.Every request also includes a User-Agent: followrabbit-cli/<version> header. No telemetry, analytics, error-reporting, or update-check traffic is generated by the CLI; only the three endpoints above (/cli/engine, /cli/recos, /cli/status) are contacted, all on the configured API base URL.
API keys are stored locally under ~/.config/followrabbit/credentials.json (file mode 0600, directory mode 0700). They are sent only in the X-Rabbit-Api-Key request header and never appear in request bodies or URLs.
Full policy: https://followrabbit.ai/privacy
Check whether the followrabbit binary is on PATH:
which followrabbit
Continue to Step 2.
Stop the skill here. Do not attempt to install software. Show the user this message and exit:
The
followrabbitCLI is required for this skill but is not installed on this machine. Please install it manually before re-running this skill.
- Installation instructions and pricing: https://subscriptions.agentic.followrabbit.ai
- Privacy policy: https://followrabbit.ai/privacy
- Terms of service: https://followrabbit.ai/terms
Once the CLI is installed and authenticated, re-run this skill.
Do not run any package-manager or download command on the user's behalf. Do not provide install command examples in your response. Direct the user to the links above and stop.
Check if the CLI is authenticated:
followrabbit auth status --json
If the output shows "authenticated": false or the command fails with exit code 2, use the AskUserQuestion tool to ask:
The CLI is not authenticated. You need a FollowRabbit API key — get one at subscriptions.agentic.followrabbit.ai. How would you like to authenticate?
Options:
followrabbit auth login --key <KEY>If the user chooses to paste the key, run:
followrabbit auth login --key <KEY_PROVIDED_BY_USER>
Verify authentication succeeded:
followrabbit auth status --json
| Command | Purpose |
|---|---|
followrabbit auth status --json | Check if CLI is authenticated |
followrabbit auth login --key <KEY> | Store an API key |
followrabbit auth logout | Remove stored credentials |
followrabbit auth token | Print the current API key to stdout (useful for scripts) |
Then check quota:
followrabbit status --json
If the quota usage shows no remaining budget, inform the user their quota is exhausted and when it resets.
Run the costreview command from the repository root (or the directory containing infrastructure files):
followrabbit costreview --json
| Flag | Default | Description |
|---|---|---|
--dir <path> | Current working directory | Directory to scan |
--types <list> | tf | Comma-separated scan types: tf, sql |
--skills <list> | cost-impact,partition-check,best-practices | Comma-separated skill IDs to request |
--model <name> | API default | LLM model override (e.g., gemini-2.5-pro) |
--json | Auto-enabled when piped | Output as JSON |
Scan only Terraform files (default):
followrabbit costreview --json
Scan both Terraform and SQL files:
followrabbit costreview --types tf,sql --json
Scan a specific directory:
followrabbit costreview --dir ./infrastructure --json
The JSON output uses this envelope structure:
{
"version": "1",
"command": "costreview",
"status": "success",
"data": {
"request_id": "eng_...",
"mode": "context",
"cost_usd": 0.01,
"skills": [
{
"id": "cost-impact",
"name": "Cost Impact Analysis",
"instructions": "<markdown instructions>"
},
{
"id": "partition-check",
"name": "Partition Check",
"instructions": "<markdown instructions>"
},
{
"id": "best-practices",
"name": "Best Practices",
"instructions": "<markdown instructions>"
}
]
}
}
The data.skills array contains up to three skill areas:
| Skill ID | What it covers |
|---|---|
cost-impact | Compute sizing, storage costs, database costs, networking costs |
partition-check | BigQuery partitioning, clustering, and partition expiration |
best-practices | Missing labels, lifecycle rules, autoscaling, HA over-provisioning, network tier, committed use discounts |
Each entry has an id, name, and instructions field. The instructions value is a markdown string with specific, actionable optimization instructions tailored to the scanned infrastructure.
If the API's primary engine is unavailable, the response will have "mode": "fallback" and "cost_usd": 0.0 — the instructions are still valid (loaded from static skill files) but not personalized to the specific context.
Present the instructions to the user — show the optimization recommendations from each skill area that returned content.
Offer to apply the suggestions — ask the user if they'd like you to help implement any of the recommendations by editing the Terraform or SQL files directly.
If the user agrees, read the relevant infrastructure files and apply the suggested changes (e.g., adding labels, lifecycle rules, adjusting machine types, adding partitioning).
| Exit Code | Meaning | What to Tell the User |
|---|---|---|
| 0 | Success | Show the instructions |
| 2 | Auth error | "Run followrabbit auth login --key <KEY> to authenticate. Get your key at subscriptions.agentic.followrabbit.ai" |
| 3 | Rate limit / quota exceeded | "API quota exhausted. Check followrabbit status for reset date" |
| 4 | Input error | "Invalid flags or arguments. Check the command syntax" |
| 5 | Processing error | "Failed to process the scan. Check that the directory contains valid .tf or .sql files" |
| 6 | Network error | "Cannot reach the FollowRabbit API. Check your internet connection" |
These flags work with any followrabbit command:
| Flag | Description |
|---|---|
--json | Output as JSON (auto-enabled when stdout is piped) |
--api-key <key> | Override the stored API key for this invocation |
--api-url <url> | Override the API base URL (default: https://api.agentic.followrabbit.ai) |
--quiet | Suppress non-essential output |
| Variable | Description |
|---|---|
FOLLOWRABBIT_API_KEY | API key override (used instead of stored credentials) |
RABBIT_CONFIG_DIR | Override the default config directory (~/.config/followrabbit/) |
These commands are available for further investigation:
| Command | Purpose |
|---|---|
followrabbit context --json | Local-only scan — outputs structured TF/SQL context without calling the API |
followrabbit recos list --json | List cost optimization recommendations for the current repo |
followrabbit status --json | Check API key usage, quota, and recent activity |
followrabbit completion <shell> | Generate shell completions (bash, zsh, fish, powershell) |
context FlagsThe context command supports the same scan flags as costreview:
| Flag | Default | Description |
|---|---|---|
--dir <path> | Current working directory | Directory to scan |
--types <list> | tf | Comma-separated scan types: tf, sql |
Example — scan a subdirectory for both Terraform and SQL files (local only, no API call):
followrabbit context --dir ./infrastructure --types tf,sql --json
recos list Flags| Flag | Description |
|---|---|
--repo <url> | Repository URL (auto-detected from git remote if omitted) |
--type <filter> | Filter by type: rightsizing, idle_resource, commitment |
--status <filter> | Filter by status: open, applied, dismissed |
User: "Can you check if there are any cost optimization opportunities in this Terraform code?"
Agent:
which followrabbit — foundfollowrabbit auth status --json — authenticatedfollowrabbit costreview --jsonHere are the findings from the FollowRabbit cost review:
Cost Impact:
- Your
google_compute_instance.web_serverusesn2-standard-8— consider right-sizing ton2-standard-4if CPU utilization is lowgoogle_storage_bucket.logsuses Standard storage class — consider Nearline or Coldline for infrequently accessed dataBest Practices:
- 3 resources are missing
cost_centerandenvironmentlabelsgoogle_storage_bucket.backupshas versioning enabled but no lifecycle rule to expire old versionsPartitioning:
google_bigquery_table.eventsis missing time partitioning — this causes full table scans on every queryWould you like me to apply any of these suggestions to your code?
User: "Yes, add the missing labels and the lifecycle rule"
Agent:
5. Reads the relevant .tf files
6. Adds labels and lifecycle rules
7. Shows the diff to the user