DevOps Templates
Pre-built workflow templates for code review, incident analysis, deployment validation, and infrastructure auditing.
code-review-v1
AI Code Review -- Analyzes code changes for security vulnerabilities, performance issues, and best practice violations.
| Property | Value |
|---|---|
| Steps | 3 (parse-diff, analyze-issues, review-report) |
| Models | Sonnet (all steps) |
| HITL | None (automated review) |
| Est. Cost | $0.025 per execution |
| Est. Duration | 15-30 seconds |
Input Schema
{
diff: string; // Required: git diff output
language?: string; // Auto-detected if not specified
framework?: string; // e.g., 'express', 'react', 'django'
focusAreas?: ('security' | 'performance' | 'style' | 'testing' | 'all')[];
severity?: 'strict' | 'moderate' | 'lenient'; // Default: 'moderate'
}Usage
# Pipe git diff directly
git diff origin/main...HEAD | devteam templates deploy code-review-v1 \
--input diff=@- \
--input language="typescript" \
--input framework="express" \
--input 'focusAreas=["security","performance"]' \
--waitOutput Format
## Code Review Summary
**Files Changed:** 5
**Issues Found:** 3 (1 high, 1 medium, 1 low)
### HIGH: SQL Injection in user-service.ts:42
```typescript
// Current (vulnerable)
const query = `SELECT * FROM users WHERE id = ${req.params.id}`;
// Recommended (parameterized)
const query = 'SELECT * FROM users WHERE id = $1';
const result = await db.query(query, [req.params.id]);MEDIUM: Missing error boundary in Dashboard.tsx:15
...
---
## incident-analysis-v1
**Incident Post-Mortem Analysis** -- Analyzes incident data, identifies root cause, and generates a post-mortem report.
| Property | Value |
|----------|-------|
| Steps | 4 (parse-timeline, root-cause-analysis, impact-assessment, postmortem-report) |
| Models | Sonnet (parse, impact), Opus (root-cause, report) |
| HITL | Enabled on `root-cause-analysis` (threshold: 0.80) |
| Est. Cost | $0.032 per execution |
| Est. Duration | 25-50 seconds |
### Input Schema
```typescript
{
incidentDescription: string; // Required: what happened
timeline?: string; // Chronological event log
logs?: string; // Relevant application/system logs
metrics?: string; // Performance metrics during incident
affectedServices?: string[]; // List of impacted services
severity: 'SEV1' | 'SEV2' | 'SEV3' | 'SEV4';
duration?: string; // e.g., "45 minutes"
}Usage
const result = await client.deployTemplate('incident-analysis-v1', {
input: {
incidentDescription: 'API latency spike to 30s, 50% of requests timing out',
timeline: `
14:00 - Deployment of v2.4.1 started
14:05 - Deployment complete
14:12 - Latency alerts triggered (p99 > 5s)
14:15 - 50% error rate detected
14:20 - Rollback initiated
14:25 - Service recovered
`,
logs: logFileContent,
affectedServices: ['api-gateway', 'user-service', 'payment-service'],
severity: 'SEV1',
duration: '25 minutes',
},
wait: true,
});infra-audit-v1
Infrastructure Audit -- Reviews infrastructure configuration for security, cost optimization, and reliability.
| Property | Value |
|---|---|
| Steps | 5 (collect-config, security-review, cost-analysis, reliability-check, audit-report) |
| Models | Sonnet (all analysis steps), Opus (audit-report) |
| HITL | Enabled on audit-report (threshold: 0.85) |
| Est. Cost | $0.048 per execution |
| Est. Duration | 40-80 seconds |
Input Schema
{
infrastructure: string; // Required: description or config export
provider: 'aws' | 'gcp' | 'azure' | 'multi-cloud';
configFiles?: string[]; // Terraform, CloudFormation, Kubernetes YAML
monthlySpend?: string; // Current monthly cloud spend
complianceRequirements?: string[]; // e.g., ['SOC2', 'HIPAA', 'PCI-DSS']
auditScope?: ('security' | 'cost' | 'reliability' | 'performance' | 'all')[];
}Usage
devteam templates deploy infra-audit-v1 \
--input infrastructure=@./terraform-state.json \
--input provider="aws" \
--input monthlySpend="\$12,000" \
--input 'complianceRequirements=["SOC2"]' \
--input 'auditScope=["security","cost"]' \
--waitOutput Includes
- Security findings ranked by severity (CRITICAL, HIGH, MEDIUM, LOW)
- Cost optimization opportunities with estimated savings
- Reliability gaps and single points of failure
- Compliance mapping against specified standards
- Prioritized remediation roadmap
For infrastructure audits, provide as much configuration detail as possible. Terraform state files, Kubernetes manifests, and cloud provider exports yield the most accurate results.
Next Steps
- Creating Templates -- Build custom DevOps templates
- CLI Examples -- CI/CD integration patterns