castai-local-dev-loop
Set up a local Kubernetes development loop with CAST AI cost monitoring. Use when building cost-aware deployments, testing autoscaler policies, or iterating on Terraform CAST AI configurations locally. Trigger with phrases like "cast ai dev setup", "cast ai local testing", "develop with cast ai", "cast ai terraform dev".
Best use case
castai-local-dev-loop is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Set up a local Kubernetes development loop with CAST AI cost monitoring. Use when building cost-aware deployments, testing autoscaler policies, or iterating on Terraform CAST AI configurations locally. Trigger with phrases like "cast ai dev setup", "cast ai local testing", "develop with cast ai", "cast ai terraform dev".
Teams using castai-local-dev-loop should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/castai-local-dev-loop/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How castai-local-dev-loop Compares
| Feature / Agent | castai-local-dev-loop | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Set up a local Kubernetes development loop with CAST AI cost monitoring. Use when building cost-aware deployments, testing autoscaler policies, or iterating on Terraform CAST AI configurations locally. Trigger with phrases like "cast ai dev setup", "cast ai local testing", "develop with cast ai", "cast ai terraform dev".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
SKILL.md Source
# CAST AI Local Dev Loop
## Overview
Fast iteration workflow for CAST AI integrations: test autoscaler policies in a dev cluster, validate Terraform modules before applying to production, and use the CAST AI API to measure savings impact during development.
## Prerequisites
- Completed `castai-install-auth` setup
- A development Kubernetes cluster (kind, minikube, or cloud dev cluster)
- `kubectl`, `helm`, and optionally `terraform` installed
## Instructions
### Step 1: Project Structure
```
my-castai-infra/
├── terraform/
│ ├── environments/
│ │ ├── dev.tfvars
│ │ ├── staging.tfvars
│ │ └── prod.tfvars
│ ├── modules/
│ │ └── castai-cluster/
│ │ ├── main.tf
│ │ ├── variables.tf
│ │ └── outputs.tf
│ └── main.tf
├── policies/
│ ├── dev-policy.json
│ └── prod-policy.json
├── scripts/
│ ├── check-savings.sh
│ └── validate-policies.sh
├── .env.dev # Dev API key (git-ignored)
└── .env.example
```
### Step 2: Dev Cluster with Relaxed Policies
```bash
# Connect your dev cluster (read-only first)
helm upgrade --install castai-agent castai-helm/castai-agent \
-n castai-agent --create-namespace \
--set apiKey="${CASTAI_API_KEY_DEV}" \
--set provider="eks"
# Apply development-safe autoscaler policy
curl -X PUT -H "X-API-Key: ${CASTAI_API_KEY_DEV}" \
-H "Content-Type: application/json" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
-d '{
"enabled": true,
"unschedulablePods": { "enabled": true },
"nodeDownscaler": {
"enabled": true,
"emptyNodes": { "enabled": true, "delaySeconds": 300 }
},
"clusterLimits": {
"enabled": true,
"cpu": { "minCores": 2, "maxCores": 16 }
}
}'
```
### Step 3: Quick Savings Check Script
```bash
#!/bin/bash
# scripts/check-savings.sh
set -euo pipefail
API_KEY="${CASTAI_API_KEY_DEV}"
CLUSTER_ID="${CASTAI_CLUSTER_ID}"
echo "=== CAST AI Dev Cluster Savings ==="
curl -s -H "X-API-Key: ${API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CLUSTER_ID}/savings" \
| jq '{
monthlySavings: .monthlySavings,
percentage: .savingsPercentage,
spotNodes: [.nodes[] | select(.lifecycle == "spot")] | length,
totalNodes: [.nodes[]] | length
}'
```
### Step 4: Terraform Plan-Apply Loop
```bash
# Plan with dev variables
cd terraform/
terraform plan -var-file=environments/dev.tfvars -out=plan.tfplan
# Apply and check CAST AI result
terraform apply plan.tfplan
# Verify policies took effect
curl -s -H "X-API-Key: ${CASTAI_API_KEY_DEV}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
| jq .
```
### Step 5: Watch Node Changes in Real Time
```bash
# Terminal 1: Watch CAST AI node operations
watch -n 15 'curl -s -H "X-API-Key: ${CASTAI_API_KEY_DEV}" \
"https://api.cast.ai/v1/kubernetes/external-clusters/${CASTAI_CLUSTER_ID}/nodes" \
| jq "[.items[] | {name, instanceType, lifecycle, age: .createdAt}] | length"'
# Terminal 2: Watch kubectl node status
kubectl get nodes -w
```
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Dev cluster not found | Wrong cluster ID | List clusters with API first |
| Policy rejected | Invalid JSON | Validate with `jq . < policy.json` |
| Terraform drift | Manual console changes | Run `terraform refresh` |
| Agent offline after restart | Helm release stale | `helm upgrade --install` again |
## Resources
- [CAST AI Terraform Provider](https://registry.terraform.io/providers/castai/castai/latest/docs)
- [Autoscaler Policies](https://docs.cast.ai/docs/autoscaler-settings)
- [Node Configuration](https://docs.cast.ai/docs/node-configuration)
## Next Steps
See `castai-sdk-patterns` for reusable API wrapper patterns.Related Skills
workhuman-local-dev-loop
Workhuman local dev loop for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman local dev loop".
wispr-local-dev-loop
Wispr Flow local dev loop for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr local dev loop".
windsurf-local-dev-loop
Configure Windsurf local development workflow with Cascade, Previews, and terminal integration. Use when setting up a development environment, configuring Turbo mode, or establishing a fast iteration cycle with Windsurf AI. Trigger with phrases like "windsurf dev setup", "windsurf local development", "windsurf dev environment", "windsurf workflow", "develop with windsurf".
webflow-local-dev-loop
Configure a Webflow local development workflow with TypeScript, hot reload, mocked API tests, and webhook tunneling via ngrok. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with the Webflow Data API. Trigger with phrases like "webflow dev setup", "webflow local development", "webflow dev environment", "develop with webflow".
vercel-local-dev-loop
Configure Vercel local development with vercel dev, environment variables, and hot reload. Use when setting up a development environment, testing serverless functions locally, or establishing a fast iteration cycle with Vercel. Trigger with phrases like "vercel dev setup", "vercel local development", "vercel dev environment", "develop with vercel locally".
veeva-local-dev-loop
Veeva Vault local dev loop for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva local dev loop".
vastai-local-dev-loop
Configure Vast.ai local development with testing and fast iteration. Use when setting up a development environment, testing instance provisioning, or building a fast iteration cycle for GPU workloads. Trigger with phrases like "vastai dev setup", "vastai local development", "vastai dev environment", "develop with vastai".
twinmind-local-dev-loop
Set up local development workflow with TwinMind API integration. Use when building applications that integrate TwinMind transcription, testing API calls locally, or developing meeting automation tools. Trigger with phrases like "twinmind dev setup", "twinmind local development", "twinmind API testing", "build with twinmind".
together-local-dev-loop
Together AI local dev loop for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together local dev loop".
techsmith-local-dev-loop
TechSmith local dev loop for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith local dev loop".
supabase-local-dev-loop
Configure Supabase local development with the CLI, Docker, and migration workflow. Use when initializing a Supabase project locally, starting the local stack, writing migrations, seeding data, or iterating on schema changes. Trigger with phrases like "supabase local dev", "supabase start", "supabase init", "supabase db reset", "supabase local setup".
stackblitz-local-dev-loop
Configure local development for WebContainer applications with hot reload and testing. Use when building browser-based IDEs, testing WebContainer file operations, or setting up development workflows for WebContainer projects. Trigger: "stackblitz dev setup", "webcontainer local", "test webcontainers locally".