/castai-pack:castai-ci-integrationfrom castai-pack
Integrates CAST AI cost validation into CI/CD pipelines: verify savings thresholds, validate Terraform plans, and gate deployments on cost thresholds.
Ships in castai-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Add CAST AI cost validation to CI/CD pipelines: verify savings thresholds, validate Terraform plans before apply, and gate deployments on autoscaler health.
# .github/workflows/castai-check.yml
name: CAST AI Cost Check
on:
pull_request:
paths: ["terraform/**", "k8s/**"]
schedule:
- cron: "0 8 * * 1" # Weekly Monday report
jobs:
cost-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check CAST AI Savings
env:
CASTAI_API_KEY: ${{ secrets.CASTAI_API_KEY }}
CASTAI_CLUSTER_ID: ${{ secrets.CASTAI_CLUSTER_ID }}
run: |
SAVINGS=$(curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/savings")
PERCENT=$(echo "$SAVINGS" | jq -r '.savingsPercentage')
MONTHLY=$(echo "$SAVINGS" | jq -r '.monthlySavings')
echo "### CAST AI Savings Report" >> $GITHUB_STEP_SUMMARY
echo "- Monthly savings: \$${MONTHLY}" >> $GITHUB_STEP_SUMMARY
echo "- Savings percentage: ${PERCENT}%" >> $GITHUB_STEP_SUMMARY
# Fail if savings drop below threshold
if (( $(echo "$PERCENT < 10" | bc -l) )); then
echo "WARNING: Savings below 10% threshold"
exit 1
fi
- name: Verify Agent Health
env:
CASTAI_API_KEY: ${{ secrets.CASTAI_API_KEY }}
CASTAI_CLUSTER_ID: ${{ secrets.CASTAI_CLUSTER_ID }}
run: |
STATUS=$(curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/external-clusters/${CASTAI_CLUSTER_ID}" \
| jq -r '.agentStatus')
if [ "$STATUS" != "online" ]; then
echo "CAST AI agent is ${STATUS}, expected online"
exit 1
fi
terraform-plan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- name: Terraform Init & Plan
working-directory: terraform/
env:
CASTAI_API_TOKEN: ${{ secrets.CASTAI_API_KEY }}
run: |
terraform init
terraform plan -var-file=environments/prod.tfvars \
-out=plan.tfplan -no-color | tee plan-output.txt
- name: Check for Destructive Changes
run: |
if grep -q "will be destroyed" terraform/plan-output.txt; then
echo "DESTRUCTIVE CHANGES DETECTED in CAST AI resources"
exit 1
fi
gh secret set CASTAI_API_KEY --body "your-api-key"
gh secret set CASTAI_CLUSTER_ID --body "your-cluster-id"
| Issue | Cause | Solution |
|---|---|---|
| Secret not found | Missing gh secret set | Add secrets to repo |
| Savings check fails | Cluster not onboarded | Verify cluster ID is correct |
| Terraform init fails | State backend misconfigured | Check backend config |
| Agent offline in CI | Key scope mismatch | Use production API key |
For deployment patterns, see castai-deploy-integration.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/castai-common-errorsDiagnose and fix CAST AI agent, API, and autoscaler errors.
Use when the CAST AI agent is offline, nodes are not scaling,
or API calls return errors.
Trigger with phrases like "cast ai error", "cast ai not working",
"cast ai agent offline", "cast ai debug", "fix cast ai".
/castai-core-workflow-aConfigure CAST AI autoscaler policies and node templates for cost optimization.
Use when enabling Phase 2 automation, setting spot instance policies,
or configuring node downscaler and evictor settings.
Trigger with phrases like "cast ai autoscaler", "cast ai policies",
"cast ai spot instances", "cast ai node optimization".
/castai-core-workflow-bConfigure CAST AI Workload Autoscaler for pod-level right-sizing and VPA.
Use when enabling workload autoscaling, configuring resource recommendations,
or tuning pod CPU and memory requests with CAST AI.
Trigger with phrases like "cast ai workload autoscaler", "cast ai pod sizing",
"cast ai resource recommendations", "cast ai VPA".
/castai-cost-tuningMaximize Kubernetes cost savings with CAST AI spot strategies and right-sizing.
Use when analyzing cloud spend, optimizing spot-to-on-demand ratios,
or configuring CAST AI for maximum savings.
Trigger with phrases like "cast ai cost", "cast ai savings",
"cast ai spot strategy", "reduce kubernetes cost", "cast ai budget".
/castai-debug-bundleCollect CAST AI diagnostic bundle for support tickets and troubleshooting.
Use when preparing a support case, collecting agent logs,
or building a diagnostic snapshot of cluster state.
Trigger with phrases like "cast ai debug", "cast ai support bundle",
"collect cast ai diagnostics", "cast ai logs".
/castai-deploy-integrationDeploy CAST AI across multi-cloud Kubernetes clusters with Terraform modules.
Use when onboarding EKS, GKE, or AKS clusters to CAST AI using
infrastructure-as-code patterns.
Trigger with phrases like "deploy cast ai", "cast ai eks",
"cast ai gke", "cast ai aks", "cast ai terraform module".
npx claudepluginhub flight505/skill-forge --plugin castai-packOther plugins' skills for the same job