--- name: chaos-code-risk-scan description: >- Scan a source code repository for resilience risks that a Harness chaos experiment can prove (outbound calls without timeouts, retries without backoff, missing graceful shutdown, health checks that mask dependency state, unbounded queues and pools, local state), map each one to a generic SourceCode risk rule, and report them to Harness as a CodeRepository risk scan. Use when the user asks to scan a repo or service code for resilience or chaos risks, or wants code findings they can verify with chaos experiments. Do not use for manifest or pipeline risk scans (those run in Harness), to create or run chaos experiments (use chaos-experiment), or for security or code quality review. Trigger phrases: scan this repo for resilience risks, chaos code scan, find chaos-provable risks, code risk scan, resilience review of this service. metadata: author: Harness version: 1.0.1 mcp-server: harness-mcp-v2 module: CHAOS summary: Scan a code repository for chaos-provable resilience risks and report them as a risk scan license: Apache-2.0 compatibility: >- Requires Harness MCP v2 server (harness-mcp-v2) with chaos_risk_rule create/update and chaos_risk_scan submit_findings, Python 3.9 or later, and git --- # Chaos Code Risk Scan Find resilience risks in a repository that a chaos experiment can turn into a pass/fail result, and send them to Harness as a `CodeRepository` risk scan. Harness then scores them, adds them to the scan report and, for modules linked to a chaos service, recommends experiments. The work is split so evidence cannot be invented: scripts extract facts and verify snippets; you only map verified facts to rules and write the explanation; the server re-validates everything. One prompt runs the whole flow. Do not ask the user to choose an org, project, module, service, rule, or to approve a create or a submit. The only stops are a missing `origin` remote, or a tool error that a single retry does not clear. Report those at the end; do not pause the scan to ask how to proceed. Pass `confirm: true` on every `harness_create` and on the attach update below. If a write is blocked because no confirmation prompt could be shown, retry that same call once with `confirm: true`. Do not attach a runtime discovered service during the scan. After the summary, offer that attachment in one sentence and stop. Ask for the discovered service and probes only after the user asks to attach. MANDATORY — Tool Result Verification: - NEVER claim a tool call succeeded without an explicit success response from the tool. - NEVER fabricate, assume, or pre-empt tool results. If a call did not return a confirmed result, say so and retry. - NEVER submit a finding that `validate_evidence.py` dropped, and never edit a snippet to make it pass. - A confirmation card is not a reason to stop. Retry with `confirm: true`, then continue. ## Instructions `SKILL_DIR` below is the directory containing this file. Run scripts with `python3 "$SKILL_DIR/scripts/