skills/harden/SKILL.md
Composable robustness — safeTask (error+deviation tracking), circuitBreaker (halt on failure rate), verificationGate (block downstream until verified)
npx skillsauth add Thomashighbaugh/opencode hardenInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Composable security and robustness hardening. Run @security-reviewer to audit the codebase, apply fixes for discovered vulnerabilities, then re-verify that all issues are resolved. Uses composable robustness patterns: safeTask for error tracking, circuitBreaker for failure rate control, verificationGate for downstream blocking.
Do not use when:
autopilot insteadplan-execute or tdd instead/project audit insteadDelegate to @security-reviewer to perform a comprehensive audit:
npm audit for Node.js projectspip audit or safety check for Pythoncargo audit for Rusttrivy or snyk if availableOutput: A SECURITY_AUDIT.md file in .opencode/state/orchestration/harden/ with categorized findings (Critical, High, Medium, Low).
For each finding, apply fixes in priority order (Critical → High → Medium → Low):
@executor with specific instructions.Fix patterns:
.gitignore, rotate if exposedAfter applying fixes:
Batch verification: If Phase 2 produced multiple independent fixes, batch them into a single re-verification pass. Collect all changed files and their corresponding finding IDs, then run one audit pass covering everything — not one audit per fix. This saves 1+ API call per batch.
Re-run the security audit on changed files (in batch if multiple fixes)
Verify each finding is resolved against the original SECURITY_AUDIT.md entries
Run the full test suite — fixes must not break existing functionality
Run build/typecheck
Apply composable robustness patterns to critical code paths:
safeTask — Wrap operations with error and deviation tracking:
// Pattern: track errors and unexpected behavior
function safeTask<T>(fn: () => T, context: string): T {
try {
const result = fn()
return result
} catch (error) {
console.error(`[safeTask] ${context}:`, error)
throw error
}
}
circuitBreaker — Halt operations when failure rate exceeds threshold:
// Pattern: track failure rate, open circuit when threshold exceeded
// Use for external API calls, database operations, file I/O
verificationGate — Block downstream operations until upstream is verified, with batch support:
// Pattern: require explicit verification before proceeding
// Use for deploy gates, data pipeline stages, payment processing
// Batch optimization: when multiple upstream stages complete simultaneously,
// verify them in a single gate pass rather than sequentially.
Generate a hardening report:
Wrap workflow with robustness composables.
tools
Create valid, type-safe TypeScript tools for OpenCode — generates correct boilerplate, typed interfaces, and handler stubs. Use when building new tools for global config or per-project .opencode/tools/.
testing
Explore multiple solution branches in parallel, evaluate each, and recommend the best path. Use when the user explicitly invokes /ideation tree-of-thoughts or asks for "tree of thought" / "branching exploration".
testing
Run multiple independent reasoning passes and find consensus. Use when the decision is critically important, the stakes are high, or the user explicitly requests "run it multiple times" / "check consistency" / "self-consistency".
testing
Optimization by PROmpting — generate candidate prompt variations, test each against a benchmark, and report the best performer. Use when the user invokes /ideation opro or asks for "prompt optimization" / "OPRO".