Spec-Driven Infrastructure as Code
Build production-ready infrastructure with systematic deployment automation using Terraform, Ansible, and ArgoCD.
SpecOps brings the Spec-Driven Development methodology to Infrastructure as Code. Instead of "vibe coding" your infrastructure, you:
- Define infrastructure requirements clearly
- Plan technical implementation systematically
- Execute with AI-assisted automation
- Deploy confidently with GitOps
SpecOps is inspired by GitHub's Spec Kit and adapted specifically for infrastructure engineering.
- Linux/macOS/Windows
- Python 3.11+
- uv package manager
- Git
- Infrastructure Tools:
- Terraform >= 1.6
- Ansible >= 2.15
- kubectl >= 1.28
- Helm (optional)
- ArgoCD CLI (optional)
# Install SpecOps CLI
uv tool install specops-cli --from git+https://github.com/dotlabshq/spec-ops.git
# Verify installation
specops check# Initialize new project
specops init my-infrastructure --ai claude
# Navigate to project
cd my-infrastructure
# Launch your AI agent (e.g., Claude Code)
claude
# Follow the workflow:
# 1. /specops.constitution - Establish principles
# 2. /specops.specify - Define infrastructure requirements
# 3. /specops.plan - Create technical implementation plan
# 4. /specops.tasks - Generate task breakdown
# 5. /specops.implement - Execute deploymentSpecOps is built around a proven infrastructure stack:
| Component | Tool | Purpose |
|---|---|---|
| VM Provisioning | Terraform | Infrastructure as Code for cloud resources |
| K8s Setup | Ansible | Configuration management and cluster installation |
| App Deployment | ArgoCD | GitOps continuous delivery |
| Network | Cilium | eBPF-based CNI with network policies |
| Multi-tenancy | Kubernetes | Namespace isolation with RBAC |
Traditional approach:
π Idea β π¨ Code β π Documentation (maybe)
SpecOps approach:
π Idea β π Specification β π Plan β β
Tasks β π Implementation
Establish your infrastructure principles and standards.
/specops.constitution Create principles for multi-tenant Kubernetes using Terraform,
Ansible, ArgoCD, and Cilium. Focus on security, scalability, and operational excellence.
Output: .specops/memory/constitution.md
Define what you want to build and why.
/specops.specify Deploy a single sign-on (SSO) solution for our organization.
Need to support multiple authentication providers and integrate with existing LDAP.
Must be isolated per organization using namespace boundaries.
Output: .specops/specs/001-sso-deployment/spec.md
Specify how to implement it technically.
/specops.plan Use Zitadel for SSO deployed via Helm. PostgreSQL backend in same namespace.
Configure Cilium network policies for isolation. Expose via ingress with TLS.
Output: .specops/specs/001-sso-deployment/plan.md
Generate actionable task breakdown.
/specops.tasks
Output: .specops/specs/001-sso-deployment/tasks.md
Execute the implementation with AI assistance.
/specops.implement
Result: Working infrastructure deployed and version controlled!
Deploy a shared Kubernetes cluster with:
- Namespace-based isolation per organization
- Cilium network policies for security
- Resource quotas and limits
- GitOps deployment with ArgoCD
Provision end-to-end:
- VMs/cloud resources (Terraform)
- Kubernetes cluster (Ansible)
- Applications (ArgoCD)
- Monitoring (Prometheus + Grafana)
- Logging (ELK/Loki)
Build infrastructure that meets:
- Security best practices
- Audit requirements
- Disaster recovery standards
- Documentation requirements
SpecOps works with popular AI coding assistants:
| Agent | Status | Notes |
|---|---|---|
| Claude Code | β Full Support | Recommended |
| GitHub Copilot | β Full Support | Via VS Code |
| Cursor | β Full Support | |
| Gemini CLI | β Full Support | |
| Windsurf | β Full Support |
my-infrastructure/
βββ terraform/ # Infrastructure provisioning
β βββ modules/ # Reusable Terraform modules
β βββ environments/ # Environment configs (dev, prod)
βββ ansible/ # Kubernetes cluster setup
β βββ roles/ # Ansible roles
β βββ playbooks/ # Playbooks for cluster management
β βββ inventory/ # Dynamic inventory
βββ kubernetes/ # Application deployments
β βββ argocd/ # ArgoCD setup and apps
β βββ apps/ # Application manifests
β βββ namespaces/ # Namespace definitions
β βββ network-policies/ # Cilium network policies
βββ .specops/ # SpecOps artifacts
βββ memory/
β βββ constitution.md
βββ specs/
β βββ 001-feature/
β βββ spec.md
β βββ plan.md
β βββ tasks.md
βββ templates/
# Initialize new project
specops init <project-name> [OPTIONS]
# Check installed tools
specops check
# Version information
specops --version--ai <agent> # AI agent: claude, copilot, cursor, gemini, windsurf
--script <type> # Script type: sh (bash) or ps (PowerShell)
--here # Initialize in current directory
--force # Force overwrite in non-empty directory
--no-git # Skip git initialization
--ignore-agent-tools # Skip AI agent checks
--debug # Enable debug output# Basic initialization
specops init my-infra --ai claude
# Initialize in current directory
specops init . --ai copilot
specops init --here --ai cursor
# Force overwrite
specops init . --force --ai claude
# Skip git initialization
specops init my-infra --ai gemini --no-git
# Debug mode
specops init my-infra --ai claude --debug# Clone repository
git clone https://github.com/dotlabshq/specops.git
cd specops
# Install dependencies
uv sync
# Install in editable mode
uv pip install -e .
# Run CLI
specops --help# Run all tests
pytest
# Run with coverage
pytest --cov=specops_cli
# Run specific test
pytest tests/test_cli.py# Format code
black src/
# Lint code
ruff check src/
# Type checking
mypy src/We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Additional AI agent integrations
- Cloud provider templates (AWS, Azure, GCP)
- Example infrastructure patterns
- Documentation improvements
- Bug fixes and testing
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by GitHub Spec Kit
- Built on top of industry-standard tools: Terraform, Ansible, Kubernetes, ArgoCD, Cilium
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
Built with β€οΈ for infrastructure engineers who believe in systematic, spec-driven automation.