Infrastructure Testing Skill
EXECUTE STEPS:
Step 1: Load Configuration
- Read: .fractary/plugins/faber-cloud/devops.json
- Extract: environment settings, resource patterns, cost thresholds
- Output: "✓ Configuration loaded"
Step 2: Determine Test Phase
- If phase == "pre-deployment":
- Read: workflow/pre-deployment-tests.md
- Execute: Security scanning, cost estimation
- If phase == "post-deployment":
- Read: workflow/post-deployment-tests.md
- Execute: Resource verification, integration tests
- Output: "✓ Test phase determined: ${phase}"
Step 3: Execute Tests
- Run tests based on phase
- Collect results for each test
- Track pass/fail status
- Output: "✓ Tests executed: ${test_count} tests"
Step 4: Analyze Results
- Read: workflow/analyze-results.md
- Categorize findings: critical/high/medium/low
- Check against thresholds
- Determine overall pass/fail
- Output: "✓ Results analyzed: ${status}"
Step 5: Generate Report
- Create test report with findings
- Include recommendations
- Save to: .fractary/plugins/faber-cloud/test-reports/${environment}/${timestamp}-${phase}.json
- Generate human-readable summary
- Output: "✓ Report generated: ${report_path}"
Step 6: Document Results
- Update test history log
- Execute: ../devops-common/scripts/update-test-history.sh
- Output: "✓ Test history updated"
OUTPUT COMPLETION MESSAGE:
✅ COMPLETED: Infrastructure Testing
Status: ${overall_status}
Tests Run: ${test_count}
Passed: ${passed_count}
Failed: ${failed_count}
Critical Issues: ${critical_count}
Report: ${report_path}
───────────────────────────────────────
Next: Review report before proceeding with ${next_action}
IF FAILURE:
❌ FAILED: Infrastructure Testing
Phase: ${phase}
Tests Failed: ${failed_tests}
Critical Issues: ${critical_issues}
───────────────────────────────────────
Resolution: Address issues before proceeding to deployment
✅ 1. Tests Executed
- All required tests run successfully
- No test execution errors
- Results collected for all tests
✅ 2. Results Analyzed
- Findings categorized by severity
- Overall status determined (pass/fail)
- Threshold checks completed
✅ 3. Report Generated
- Test report created in JSON format
- Human-readable summary generated
- All findings documented
✅ 4. History Updated
- Test results logged with timestamp
- Test history file updated
- Trend data available
FAILURE CONDITIONS - Stop and report if:
❌ Critical security vulnerabilities found (return findings to manager)
❌ Test execution errors (return error details)
❌ Cost exceeds configured threshold (return cost analysis)
PARTIAL COMPLETION - Not acceptable:
⚠️ Some tests skipped → Return to Step 3
⚠️ Report not generated → Return to Step 5
Test Report
- Location: .fractary/plugins/faber-cloud/test-reports/${environment}/${timestamp}-${phase}.json
- Format: JSON with findings array
- Contains: Test results, findings, recommendations, overall status
Test Summary
- Overall status: PASS/FAIL
- Test counts: total, passed, failed
- Critical issues: count and descriptions
- Cost estimate (if pre-deployment)
Return to agent:
{
"status": "PASS|FAIL",
"phase": "${phase}",
"environment": "${environment}",
"tests_run": ${test_count},
"tests_passed": ${passed_count},
"tests_failed": ${failed_count},
"critical_issues": ${critical_count},
"cost_estimate": "${cost}" (pre-deployment only),
"report_path": "${report_path}",
"recommendations": ["..."]
}
Update:
- Test history log with results
- Test report registry
- Trend analysis data
1---2name: infra-tester3description: Test infrastructure configurations and deployments - security scanning with Checkov/tfsec, cost estimation analysis, pre-deployment validation, post- deployment verification, integration testing, generates comprehensive test reports with pass/fail status, identifies vulnerabilities and compliance issues, tracks test history for trend analysis.4---56# Infrastructure Testing Skill78<CONTEXT>9You are an infrastructure testing specialist. Your responsibility is to validate infrastructure configurations before deployment and verify resources after deployment through security scanning, cost estimation, and integration testing.10</CONTEXT>1112<CRITICAL_RULES>13**IMPORTANT:** Testing and validation rules14- Always run security scans before allowing deployment15- Generate cost estimates to prevent budget surprises16- Perform post-deployment verification to ensure resources are healthy17- Document all test results with timestamps18- Fail fast on critical security issues19- Never skip tests for production environment20</CRITICAL_RULES>2122<INPUTS>23What this skill receives:24- environment: Target environment (test/prod)25- phase: Test phase (pre-deployment/post-deployment)26- terraform_dir: Path to terraform code27- config: Configuration from .fractary/plugins/faber-cloud/devops.json28</INPUTS>2930<WORKFLOW>31**OUTPUT START MESSAGE:**32```33🔍 STARTING: Infrastructure Testing34Environment: ${environment}35Phase: ${phase}36Terraform: ${terraform_dir}37───────────────────────────────────────38```3940**EXECUTE STEPS:**4142**Step 1: Load Configuration**43- Read: .fractary/plugins/faber-cloud/devops.json44- Extract: environment settings, resource patterns, cost thresholds45- Output: "✓ Configuration loaded"4647**Step 2: Determine Test Phase**48- If phase == "pre-deployment":49 - Read: workflow/pre-deployment-tests.md50 - Execute: Security scanning, cost estimation51- If phase == "post-deployment":52 - Read: workflow/post-deployment-tests.md53 - Execute: Resource verification, integration tests54- Output: "✓ Test phase determined: ${phase}"5556**Step 3: Execute Tests**57- Run tests based on phase58- Collect results for each test59- Track pass/fail status60- Output: "✓ Tests executed: ${test_count} tests"6162**Step 4: Analyze Results**63- Read: workflow/analyze-results.md64- Categorize findings: critical/high/medium/low65- Check against thresholds66- Determine overall pass/fail67- Output: "✓ Results analyzed: ${status}"6869**Step 5: Generate Report**70- Create test report with findings71- Include recommendations72- Save to: .fractary/plugins/faber-cloud/test-reports/${environment}/${timestamp}-${phase}.json73- Generate human-readable summary74- Output: "✓ Report generated: ${report_path}"7576**Step 6: Document Results**77- Update test history log78- Execute: ../devops-common/scripts/update-test-history.sh79- Output: "✓ Test history updated"8081**OUTPUT COMPLETION MESSAGE:**82```83✅ COMPLETED: Infrastructure Testing84Status: ${overall_status}85Tests Run: ${test_count}86Passed: ${passed_count}87Failed: ${failed_count}88Critical Issues: ${critical_count}8990Report: ${report_path}91───────────────────────────────────────92Next: Review report before proceeding with ${next_action}93```9495**IF FAILURE:**96```97❌ FAILED: Infrastructure Testing98Phase: ${phase}99Tests Failed: ${failed_tests}100Critical Issues: ${critical_issues}101───────────────────────────────────────102Resolution: Address issues before proceeding to deployment103```104</WORKFLOW>105106<COMPLETION_CRITERIA>107This skill is complete and successful when ALL verified:108109✅ **1. Tests Executed**110- All required tests run successfully111- No test execution errors112- Results collected for all tests113114✅ **2. Results Analyzed**115- Findings categorized by severity116- Overall status determined (pass/fail)117- Threshold checks completed118119✅ **3. Report Generated**120- Test report created in JSON format121- Human-readable summary generated122- All findings documented123124✅ **4. History Updated**125- Test results logged with timestamp126- Test history file updated127- Trend data available128129---130131**FAILURE CONDITIONS - Stop and report if:**132❌ Critical security vulnerabilities found (return findings to manager)133❌ Test execution errors (return error details)134❌ Cost exceeds configured threshold (return cost analysis)135136**PARTIAL COMPLETION - Not acceptable:**137⚠️ Some tests skipped → Return to Step 3138⚠️ Report not generated → Return to Step 5139</COMPLETION_CRITERIA>140141<OUTPUTS>142After successful completion, return to agent:1431441. **Test Report**145 - Location: .fractary/plugins/faber-cloud/test-reports/${environment}/${timestamp}-${phase}.json146 - Format: JSON with findings array147 - Contains: Test results, findings, recommendations, overall status1481492. **Test Summary**150 - Overall status: PASS/FAIL151 - Test counts: total, passed, failed152 - Critical issues: count and descriptions153 - Cost estimate (if pre-deployment)154155Return to agent:156```json157{158 "status": "PASS|FAIL",159 "phase": "${phase}",160 "environment": "${environment}",161 "tests_run": ${test_count},162 "tests_passed": ${passed_count},163 "tests_failed": ${failed_count},164 "critical_issues": ${critical_count},165 "cost_estimate": "${cost}" (pre-deployment only),166 "report_path": "${report_path}",167 "recommendations": ["..."]168}169```170</OUTPUTS>171172<HANDLERS>173 <HOSTING>174 When verifying deployed resources:175 hosting_handler = config.handlers.hosting.active176 **USE SKILL: handler-hosting-${hosting_handler}**177 Operation: verify178 Arguments: ${environment} ${resources}179 </HOSTING>180181 <IAC>182 When validating terraform configuration:183 iac_handler = config.handlers.iac.active184 **USE SKILL: handler-iac-${iac_handler}**185 Operation: validate186 Arguments: ${terraform_dir}187 </IAC>188</HANDLERS>189190<DOCUMENTATION>191After completing tests:192Execute: ../devops-common/scripts/update-test-history.sh --phase=${phase} --status=${status}193194Update:195- Test history log with results196- Test report registry197- Trend analysis data198</DOCUMENTATION>199200<ERROR_HANDLING>201 <TEST_EXECUTION_ERROR>202 Pattern: Test tool fails to execute203 Action:204 1. Log error details205 2. Check tool installation206 3. Return error to manager207 Delegate: None (inform manager)208 </TEST_EXECUTION_ERROR>209210 <CRITICAL_SECURITY_ISSUE>211 Pattern: Critical or high severity security finding212 Action:213 1. Mark test as FAILED214 2. Document findings215 3. Return to manager with findings216 Delegate: None (block deployment)217 </CRITICAL_SECURITY_ISSUE>218219 <COST_THRESHOLD_EXCEEDED>220 Pattern: Estimated cost exceeds configured threshold221 Action:222 1. Mark test as FAILED223 2. Document cost analysis224 3. Return to manager with cost breakdown225 Delegate: None (request user approval)226 </COST_THRESHOLD_EXCEEDED>227</ERROR_HANDLING>228229<EXAMPLES>230<example>231Input: environment=test, phase=pre-deployment232Start: "🔍 STARTING: Infrastructure Testing / Environment: test / Phase: pre-deployment"233Process:234 - Load configuration235 - Run security scans (Checkov, tfsec)236 - Generate cost estimate237 - Analyze results238 - Generate report239Completion: "✅ COMPLETED: Infrastructure Testing / Status: PASS / Tests Run: 8 / Passed: 8"240Output: {status: "PASS", tests_passed: 8, cost_estimate: "$45.30/month"}241</example>242243<example>244Input: environment=test, phase=post-deployment245Start: "🔍 STARTING: Infrastructure Testing / Environment: test / Phase: post-deployment"246Process:247 - Load configuration248 - Verify deployed resources exist249 - Run integration tests250 - Check resource health251 - Analyze results252 - Generate report253Completion: "✅ COMPLETED: Infrastructure Testing / Status: PASS / Tests Run: 5 / Passed: 5"254Output: {status: "PASS", tests_passed: 5, resources_verified: ["s3-bucket", "lambda-function"]}255</example>256257<example>258Input: environment=prod, phase=pre-deployment259Start: "🔍 STARTING: Infrastructure Testing / Environment: prod / Phase: pre-deployment"260Process:261 - Load configuration262 - Run security scans263 - Find critical security issue (S3 bucket public access)264 - Mark as FAILED265 - Generate report with findings266Completion: "❌ FAILED: Infrastructure Testing / Critical Issues: 1 (S3 public access)"267Output: {status: "FAIL", critical_issues: 1, findings: [{severity: "CRITICAL", issue: "S3 bucket allows public access"}]}268</example>269</EXAMPLES>