Infrastructure Scaffold | Skills Pool
Infrastructure Scaffold Generate cloud infrastructure configs for Firebase, GCP, Vercel, and Docker with IaC templates and environment management
Cloud infrastructure configuration generator for Firebase, GCP, Vercel, and Docker. Firebase-first, GCP cloud approach aligned with Cure Consulting Group standards. Every project ships with production-ready infrastructure configs, environment separation, and monitoring from day one.
Pre-Processing (Auto-Context)
Before starting, gather project context silently:
Read PORTFOLIO.md if it exists in the project root or parent directories for product/team context
Run: cat package.json 2>/dev/null || cat build.gradle.kts 2>/dev/null || cat Podfile 2>/dev/null to detect stack
Run: git log --oneline -5 2>/dev/null for recent changes
Run: ls src/ app/ lib/ functions/ 2>/dev/null to understand project structure
Use this context to tailor all output to the actual project
Step 1: Classify the Infrastructure Need
Need Scope New project setup
快速安装
Infrastructure Scaffold npx skillvault add Cure-Consulting-Group/cure-consulting-group-productengineeringskills-skills-infrastructure-scaffold-skill-md
星标 0
更新时间 2026年3月18日
职业 Full infrastructure scaffold from scratch — Firebase, hosting, Docker, CI/CD integration
Environment management Dev / staging / production separation, secret management, feature flags
Scaling config Cloud Functions concurrency, Cloud Run autoscaling, CDN caching, database connection pooling
Monitoring setup Performance monitoring, error reporting, uptime checks, alerting policies
Cost optimization Billing alerts, instance limits, storage lifecycle, budget quotas
Step 2: Gather Context
Cloud provider — Firebase + GCP (default), Vercel, AWS, or hybrid?
Project type — web app (Next.js), mobile (Android/iOS), API backend, full stack?
Expected scale — users, requests/sec, storage volume, geographic regions?
Compliance requirements — HIPAA, SOC 2, GDPR, data residency?
Team size — solo dev, small team (2-5), or larger org with role separation?
Step 3: Firebase Infrastructure
firebase.json {
"hosting": {
"public": "out",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{ "source": "/api/**", "function": "api" },
{ "source": "**", "destination": "/index.html" }
],
"headers": [
{
"source": "**/*.@(js|css|map)",
"headers": [{ "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }]
},
{
"source": "**/*.@(jpg|jpeg|gif|png|svg|webp|avif)",
"headers": [{ "key": "Cache-Control", "value": "public, max-age=86400, stale-while-revalidate=3600" }]
}
]
},
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": ["node_modules", ".git", "firebase-debug.log", "firebase-debug.*.log", "*.local"],
"predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint", "npm --prefix \"$RESOURCE_DIR\" run build"]
}
],
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"storage": {
"rules": "storage.rules"
},
"emulators": {
"auth": { "port": 9099 },
"functions": { "port": 5001 },
"firestore": { "port": 8080 },
"storage": { "port": 9199 },
"hosting": { "port": 5000 },
"pubsub": { "port": 8085 },
"ui": { "enabled": true, "port": 4000 }
}
}
.firebaserc (Multi-Environment) {
"projects": {
"default": "PROJECT_NAME-dev",
"dev": "PROJECT_NAME-dev",
"staging": "PROJECT_NAME-staging",
"production": "PROJECT_NAME-prod"
},
"targets": {
"PROJECT_NAME-prod": {
"hosting": {
"app": ["PROJECT_NAME-prod"]
}
}
}
}
Switch environments: firebase use dev | staging | production
firestore.indexes.json {
"indexes": [
{
"collectionGroup": "orders",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "userId", "order": "ASCENDING" },
{ "fieldPath": "createdAt", "order": "DESCENDING" }
]
}
],
"fieldOverrides": []
}
Security Rules (Firestore) rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Deny all by default
match /{document=**} {
allow read, write: if false;
}
// Users — own data only
match /users/{userId} {
allow read: if request.auth != null && request.auth.uid == userId;
allow create: if request.auth != null && request.auth.uid == userId;
allow update: if request.auth != null && request.auth.uid == userId
&& !request.resource.data.diff(resource.data).affectedKeys().hasAny(['role', 'createdAt']);
}
// Admin access
match /{path=**} {
allow read, write: if request.auth != null
&& get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'admin';
}
}
}
Security Rules (Storage) rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if false;
}
match /users/{userId}/{allPaths=**} {
allow read: if request.auth != null && request.auth.uid == userId;
allow write: if request.auth != null && request.auth.uid == userId
&& request.resource.size < 10 * 1024 * 1024
&& request.resource.contentType.matches('image/.*');
}
}
}
Cloud Functions Deployment Config // functions/src/index.ts
import { onRequest } from "firebase-functions/v2/https";
import { setGlobalOptions } from "firebase-functions/v2";
setGlobalOptions({
region: "us-central1",
memory: "256MiB",
timeoutSeconds: 60,
minInstances: 0,
maxInstances: 100,
concurrency: 80,
});
export const api = onRequest({ cors: true }, async (req, res) => {
// API handler
});
Firebase Emulator Suite Setup # Install and start emulators
firebase init emulators
firebase emulators:start
# Start with data import/export for persistence
firebase emulators:start --import=./emulator-data --export-on-exit=./emulator-data
# Run tests against emulators
firebase emulators:exec "npm test"
Step 4: GCP Infrastructure
Cloud Run (Containerized Services) # cloud-run-service.yaml
apiVersion: serving.knative.dev/v1
02
Step 1: Classify the Infrastructure Need
云计算
Cloudflare Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum), security (WAF, DDoS), and infrastructure-as-code (Terraform, Pulumi). Use for any Cloudflare development task.
Mcp Integration This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.
云计算
Setup Deploy Configure deployment settings for /land-and-deploy. Detects your deploy
platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom),
production URL, health check endpoints, and deploy status commands. Writes
the configuration to CLAUDE.md so all future deploys are automatic.
Use when: "setup deploy", "configure deployment", "set up land-and-deploy",
"how do I deploy with gstack", "add deploy config".