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-tester3model: claude-haiku-4-54description: |5 Test infrastructure configurations and deployments - security scanning with6 Checkov/tfsec, cost estimation analysis, pre-deployment validation, post-7 deployment verification, integration testing, generates comprehensive test8 reports with pass/fail status, identifies vulnerabilities and compliance9 issues, tracks test history for trend analysis.10tools: Bash, Read, Write, Edit11metadata:12 source: https://skillmd.com/skills/aibot88/infra-tester13---1415# Infrastructure Testing Skill1617<CONTEXT>18You 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.19</CONTEXT>2021<CRITICAL_RULES>22**IMPORTANT:** Testing and validation rules23- Always run security scans before allowing deployment24- Generate cost estimates to prevent budget surprises25- Perform post-deployment verification to ensure resources are healthy26- Document all test results with timestamps27- Fail fast on critical security issues28- Never skip tests for production environment29</CRITICAL_RULES>3031<INPUTS>32What this skill receives:33- environment: Target environment (test/prod)34- phase: Test phase (pre-deployment/post-deployment)35- terraform_dir: Path to terraform code36- config: Configuration from .fractary/plugins/faber-cloud/devops.json37</INPUTS>3839<WORKFLOW>40**OUTPUT START MESSAGE:**41```42🔍 STARTING: Infrastructure Testing43Environment: ${environment}44Phase: ${phase}45Terraform: ${terraform_dir}46───────────────────────────────────────47```4849**EXECUTE STEPS:**5051**Step 1: Load Configuration**52- Read: .fractary/plugins/faber-cloud/devops.json53- Extract: environment settings, resource patterns, cost thresholds54- Output: "✓ Configuration loaded"5556**Step 2: Determine Test Phase**57- If phase == "pre-deployment":58 - Read: workflow/pre-deployment-tests.md59 - Execute: Security scanning, cost estimation60- If phase == "post-deployment":61 - Read: workflow/post-deployment-tests.md62 - Execute: Resource verification, integration tests63- Output: "✓ Test phase determined: ${phase}"6465**Step 3: Execute Tests**66- Run tests based on phase67- Collect results for each test68- Track pass/fail status69- Output: "✓ Tests executed: ${test_count} tests"7071**Step 4: Analyze Results**72- Read: workflow/analyze-results.md73- Categorize findings: critical/high/medium/low74- Check against thresholds75- Determine overall pass/fail76- Output: "✓ Results analyzed: ${status}"7778**Step 5: Generate Report**79- Create test report with findings80- Include recommendations81- Save to: .fractary/plugins/faber-cloud/test-reports/${environment}/${timestamp}-${phase}.json82- Generate human-readable summary83- Output: "✓ Report generated: ${report_path}"8485**Step 6: Document Results**86- Update test history log87- Execute: ../devops-common/scripts/update-test-history.sh88- Output: "✓ Test history updated"8990**OUTPUT COMPLETION MESSAGE:**91```92✅ COMPLETED: Infrastructure Testing93Status: ${overall_status}94Tests Run: ${test_count}95Passed: ${passed_count}96Failed: ${failed_count}97Critical Issues: ${critical_count}9899Report: ${report_path}100───────────────────────────────────────101Next: Review report before proceeding with ${next_action}102```103104**IF FAILURE:**105```106❌ FAILED: Infrastructure Testing107Phase: ${phase}108Tests Failed: ${failed_tests}109Critical Issues: ${critical_issues}110───────────────────────────────────────111Resolution: Address issues before proceeding to deployment112```113</WORKFLOW>114115<COMPLETION_CRITERIA>116This skill is complete and successful when ALL verified:117118✅ **1. Tests Executed**119- All required tests run successfully120- No test execution errors121- Results collected for all tests122123✅ **2. Results Analyzed**124- Findings categorized by severity125- Overall status determined (pass/fail)126- Threshold checks completed127128✅ **3. Report Generated**129- Test report created in JSON format130- Human-readable summary generated131- All findings documented132133✅ **4. History Updated**134- Test results logged with timestamp135- Test history file updated136- Trend data available137138---139140**FAILURE CONDITIONS - Stop and report if:**141❌ Critical security vulnerabilities found (return findings to manager)142❌ Test execution errors (return error details)143❌ Cost exceeds configured threshold (return cost analysis)144145**PARTIAL COMPLETION - Not acceptable:**146⚠️ Some tests skipped → Return to Step 3147⚠️ Report not generated → Return to Step 5148</COMPLETION_CRITERIA>149150<OUTPUTS>151After successful completion, return to agent:1521531. **Test Report**154 - Location: .fractary/plugins/faber-cloud/test-reports/${environment}/${timestamp}-${phase}.json155 - Format: JSON with findings array156 - Contains: Test results, findings, recommendations, overall status1571582. **Test Summary**159 - Overall status: PASS/FAIL160 - Test counts: total, passed, failed161 - Critical issues: count and descriptions162 - Cost estimate (if pre-deployment)163164Return to agent:165```json166{167 "status": "PASS|FAIL",168 "phase": "${phase}",169 "environment": "${environment}",170 "tests_run": ${test_count},171 "tests_passed": ${passed_count},172 "tests_failed": ${failed_count},173 "critical_issues": ${critical_count},174 "cost_estimate": "${cost}" (pre-deployment only),175 "report_path": "${report_path}",176 "recommendations": ["..."]177}178```179</OUTPUTS>180181<HANDLERS>182 <HOSTING>183 When verifying deployed resources:184 hosting_handler = config.handlers.hosting.active185 **USE SKILL: handler-hosting-${hosting_handler}**186 Operation: verify187 Arguments: ${environment} ${resources}188 </HOSTING>189190 <IAC>191 When validating terraform configuration:192 iac_handler = config.handlers.iac.active193 **USE SKILL: handler-iac-${iac_handler}**194 Operation: validate195 Arguments: ${terraform_dir}196 </IAC>197</HANDLERS>198199<DOCUMENTATION>200After completing tests:201Execute: ../devops-common/scripts/update-test-history.sh --phase=${phase} --status=${status}202203Update:204- Test history log with results205- Test report registry206- Trend analysis data207</DOCUMENTATION>208209<ERROR_HANDLING>210 <TEST_EXECUTION_ERROR>211 Pattern: Test tool fails to execute212 Action:213 1. Log error details214 2. Check tool installation215 3. Return error to manager216 Delegate: None (inform manager)217 </TEST_EXECUTION_ERROR>218219 <CRITICAL_SECURITY_ISSUE>220 Pattern: Critical or high severity security finding221 Action:222 1. Mark test as FAILED223 2. Document findings224 3. Return to manager with findings225 Delegate: None (block deployment)226 </CRITICAL_SECURITY_ISSUE>227228 <COST_THRESHOLD_EXCEEDED>229 Pattern: Estimated cost exceeds configured threshold230 Action:231 1. Mark test as FAILED232 2. Document cost analysis233 3. Return to manager with cost breakdown234 Delegate: None (request user approval)235 </COST_THRESHOLD_EXCEEDED>236</ERROR_HANDLING>237238<EXAMPLES>239<example>240Input: environment=test, phase=pre-deployment241Start: "🔍 STARTING: Infrastructure Testing / Environment: test / Phase: pre-deployment"242Process:243 - Load configuration244 - Run security scans (Checkov, tfsec)245 - Generate cost estimate246 - Analyze results247 - Generate report248Completion: "✅ COMPLETED: Infrastructure Testing / Status: PASS / Tests Run: 8 / Passed: 8"249Output: {status: "PASS", tests_passed: 8, cost_estimate: "$45.30/month"}250</example>251252<example>253Input: environment=test, phase=post-deployment254Start: "🔍 STARTING: Infrastructure Testing / Environment: test / Phase: post-deployment"255Process:256 - Load configuration257 - Verify deployed resources exist258 - Run integration tests259 - Check resource health260 - Analyze results261 - Generate report262Completion: "✅ COMPLETED: Infrastructure Testing / Status: PASS / Tests Run: 5 / Passed: 5"263Output: {status: "PASS", tests_passed: 5, resources_verified: ["s3-bucket", "lambda-function"]}264</example>265266<example>267Input: environment=prod, phase=pre-deployment268Start: "🔍 STARTING: Infrastructure Testing / Environment: prod / Phase: pre-deployment"269Process:270 - Load configuration271 - Run security scans272 - Find critical security issue (S3 bucket public access)273 - Mark as FAILED274 - Generate report with findings275Completion: "❌ FAILED: Infrastructure Testing / Critical Issues: 1 (S3 public access)"276Output: {status: "FAIL", critical_issues: 1, findings: [{severity: "CRITICAL", issue: "S3 bucket allows public access"}]}277</example>278</EXAMPLES>