Skill

cost-review

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.

From followrabbit
Install
1
Run in your terminal
$
npx claudepluginhub anthropics/claude-plugins-official --plugin followrabbit
Tool Access

This skill uses the workspace's default tool permissions.

Skill Content

FollowRabbit Cost Review Skill

Overview

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.

When to Use

  • User asks to review infrastructure for cost impact
  • User is working with Terraform (.tf) or SQL files and mentions cost, pricing, or optimization
  • User says things like "is this expensive?", "check costs", "optimize spending", "review pricing"
  • During a code review involving cloud infrastructure files

Step 1: Ensure CLI Is Installed and Up to Date

Check if the followrabbit binary is available:

which followrabbit

If not found — ask before installing

Use the AskUserQuestion tool to ask the user:

The followrabbit CLI is not installed. Would you like me to install it?

Options:

  • Yes, install it — detect the best available method and install
  • No, I'll install it myself — stop and let the user handle it

If the user agrees, detect the best available method:

  1. Check for Homebrew (preferred on macOS):
which brew

If available:

brew install followrabbit-ai/tap/followrabbit
  1. Check for npm (cross-platform fallback):
which npm

If available:

npm install -g @followrabbit/cli
  1. Fall back to the shell installer (works everywhere):
curl -fsSL https://followrabbit-ai.github.io/homebrew-tap/install.sh | sh

After install, verify:

followrabbit version --json

If already installed — check for updates

followrabbit version --json

The data object contains:

FieldExample
version"1.2.0"
commit"abc1234"
build_date"2026-03-01T12:00:00Z"
go_version"go1.23.0"
os"darwin"
arch"arm64"

Compare the data.version field against the latest release tag:

curl -fsSL "https://api.github.com/repos/followrabbit-ai/homebrew-tap/releases?per_page=1" | grep -m1 '"tag_name"'

If the installed version is behind, use the AskUserQuestion tool to ask:

A newer version of the followrabbit CLI is available (installed: X, latest: Y). Would you like me to upgrade it?

Options:

  • Yes, upgrade now — run the appropriate upgrade command
  • No, continue with current version — proceed without upgrading

If the user agrees to upgrade:

  • Homebrew: brew upgrade followrabbit-ai/tap/followrabbit
  • npm: npm update -g @followrabbit/cli
  • Otherwise: re-run curl -fsSL https://followrabbit-ai.github.io/homebrew-tap/install.sh | sh

After update, verify:

followrabbit version --json

Step 2: Ensure Authentication

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:

  • I'll paste the key — run the login for me — wait for the user to provide the key, then run followrabbit auth login --key <KEY>
  • I'll handle it myself — stop and wait for the user to authenticate on their own

If the user chooses to paste the key, run:

followrabbit auth login --key <KEY_PROVIDED_BY_USER>

Verify authentication succeeded:

followrabbit auth status --json

Other Auth Subcommands

CommandPurpose
followrabbit auth status --jsonCheck if CLI is authenticated
followrabbit auth login --key <KEY>Store an API key
followrabbit auth logoutRemove stored credentials
followrabbit auth tokenPrint 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.

Step 3: Run the Cost Review

Run the costreview command from the repository root (or the directory containing infrastructure files):

followrabbit costreview --json

Flags

FlagDefaultDescription
--dir <path>Current working directoryDirectory to scan
--types <list>tfComma-separated scan types: tf, sql
--skills <list>cost-impact,partition-check,best-practicesComma-separated skill IDs to request
--model <name>API defaultLLM model override (e.g., gemini-2.5-pro)
--jsonAuto-enabled when pipedOutput as JSON

Examples

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

Step 4: Parse the Response

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 IDWhat it covers
cost-impactCompute sizing, storage costs, database costs, networking costs
partition-checkBigQuery partitioning, clustering, and partition expiration
best-practicesMissing 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.

Step 5: Present Results and Offer to Help

  1. Present the instructions to the user — show the optimization recommendations from each skill area that returned content.

  2. 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.

  3. 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).

Error Handling

Exit CodeMeaningWhat to Tell the User
0SuccessShow the instructions
2Auth error"Run followrabbit auth login --key <KEY> to authenticate. Get your key at subscriptions.agentic.followrabbit.ai"
3Rate limit / quota exceeded"API quota exhausted. Check followrabbit status for reset date"
4Input error"Invalid flags or arguments. Check the command syntax"
5Processing error"Failed to process the scan. Check that the directory contains valid .tf or .sql files"
6Network error"Cannot reach the FollowRabbit API. Check your internet connection"

Global Flags

These flags work with any followrabbit command:

FlagDescription
--jsonOutput 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)
--quietSuppress non-essential output

Environment Variables

VariableDescription
FOLLOWRABBIT_API_KEYAPI key override (used instead of stored credentials)
RABBIT_CONFIG_DIROverride the default config directory (~/.config/followrabbit/)

Additional Commands

These commands are available for further investigation:

CommandPurpose
followrabbit context --jsonLocal-only scan — outputs structured TF/SQL context without calling the API
followrabbit recos list --jsonList cost optimization recommendations for the current repo
followrabbit status --jsonCheck API key usage, quota, and recent activity
followrabbit completion <shell>Generate shell completions (bash, zsh, fish, powershell)

context Flags

The context command supports the same scan flags as costreview:

FlagDefaultDescription
--dir <path>Current working directoryDirectory to scan
--types <list>tfComma-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

FlagDescription
--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

Example Interaction

User: "Can you check if there are any cost optimization opportunities in this Terraform code?"

Agent:

  1. Runs which followrabbit — not found
  2. Uses AskUserQuestion: "The followrabbit CLI is not installed. Would you like me to install it?"
  3. User selects "Yes, install it"
  4. Detects Homebrew, runs brew install followrabbit-ai/tap/followrabbit
  5. Runs followrabbit auth status --json — not authenticated
  6. Uses AskUserQuestion: "The CLI is not authenticated. You need a FollowRabbit API key — get one at subscriptions.agentic.followrabbit.ai. How would you like to authenticate?"
  7. User selects "I'll paste the key — run the login for me" and provides the key
  8. Runs followrabbit auth login --key <KEY> — success
  9. Runs followrabbit costreview --json
  10. Parses the response and presents:

Here are the findings from the FollowRabbit cost review:

Cost Impact:

  • Your google_compute_instance.web_server uses n2-standard-8 — consider right-sizing to n2-standard-4 if CPU utilization is low
  • google_storage_bucket.logs uses Standard storage class — consider Nearline or Coldline for infrequently accessed data

Best Practices:

  • 3 resources are missing cost_center and environment labels
  • google_storage_bucket.backups has versioning enabled but no lifecycle rule to expire old versions

Partitioning:

  • google_bigquery_table.events is missing time partitioning — this causes full table scans on every query

Would you like me to apply any of these suggestions to your code?

User: "Yes, add the missing labels and the lifecycle rule"

Agent: 11. Reads the relevant .tf files 12. Adds labels and lifecycle rules 13. Shows the diff to the user

Similar Skills
cache-components

Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.

138.5k
Stats
Stars1
Forks0
Last CommitMar 23, 2026