code-hidden-failures
БесплатноЗапускает вложенные скриптыНе проверенScan for hidden failures: swallowed errors (empty catch, || true, 2>/dev/null) and silent degradation (success on zero results). Use when failures vanish or…
от laurigates★ 61 звезда на GitHubОб этом скилле
Hidden-Failure Scanner
Detect code that fails without saying so. Two tracks:
| Track | Failure shape | Example |
|---|---|---|
| errors | Syntactic — an error signal is discarded | catch (e) {}, || true, 2>/dev/null, floating promise, _ = err |
| degradation | Logical — an operation "succeeds" with empty/useless output because a precondition was silently unmet | success toast on count === 0, if (!apiKey) return [], a 1-of-3 detector run with no indication |
Why one skill covers both tracks: references/history.md.
When to Use This Skill
| Use this skill when... | Use another skill instead when... |
|---|---|
| Scripts/CI report success but real work failed | /code:antipatterns — broad multi-category scan |
|| true, 2>/dev/null, empty catch {}, except: pass suspected (errors track) |
/code:review — prose code review |
| A feature reports success but produces nothing (degradation track) | /code:lint — a linter already flags the issue |
| Scans return 0 results / success banners on empty outcomes | /code:dead-code — you suspect code never runs |
| You need severity classification + a surfacing recommendation | — |
Context
- Scan path:
$ARGUMENTS(defaults to current directory) - Language signals: !
find . -maxdepth 2 \( -name '*.sh' -o -name '*.bash' -o -name '*.ts' -o -name '*.tsx' -o -name '*.js' -o -name '*.jsx' -o -name '*.py' -o -name '*.go' -o -name '*.rs' \) -type f -not -path './node_modules/*' -not -path './.git/*' - App-type signals (frontend): !
find . -maxdepth 2 \( -name 'index.html' -o -name 'vite.config.*' -o -name 'next.config.*' \) -type f - App-type signals (CLI): !
find . -maxdepth 2 \( -name 'bin' -type d -o -name 'Makefile' -o -name 'justfile' \) - App-type signals (service): !
find . -maxdepth 2 \( -name 'Dockerfile' -o -name '*.service' -o -name 'pyproject.toml' \) -type f - Config signals: !
find . -maxdepth 2 \( -name '.env*' -o -name 'config.*' -o -name 'settings.*' \) -type f - Workflows: !
find . -path '*/.github/workflows/*' -maxdepth 3 -name '*.yml' -type f
Parameters
Parse from $ARGUMENTS:
PATH: directory or file to scan (defaults to.)--track <errors|degradation|both>: which track to run (defaultboth)--lang <shell|js|py|go|rust|auto>: errors track — restrict to one language (defaultauto)--severity <low|med|high>: minimum severity to report (defaultmed)--emit-patch: errors track — emit a unified-diff patch on stdout (no in-place mutation; apply withgit apply)--fix: degradation track — apply recommended fixes in place (precondition checks, status indicators, distinguishing copy)
--emit-patch and --fix are mutually exclusive — the errors track reviews
its surfacing copy via a patch, the degradation track applies structural
fixes directly.
Execution
Run the selected track(s). Default both: run errors first, then degradation,
then a combined summary.
Track A — Error swallowing
Run when --track is errors or both.
Step A1: Detect languages and app context
From the command output in Context, determine which language matchers to run. For the app-context matrix (signals → surfacing channel), load REFERENCE-surfacing.md.
Step A2: Run the matchers
The AST-shaped swallowed-error patterns (js/ts, python, go, rust) live as an
ast-grep rule project in rules/ (one *.yml per pattern under
rules/lib/, each with a valid/invalid fixture in rules/tests/). Run the whole
catalog in one deterministic pass — do not re-type sg -p '…' per language:
ast-grep scan -c ${CLAUDE_SKILL_DIR}/rules/sgconfig.yml --json=compact <path>
Each finding carries ruleId, file, range (line/column), message, and the
matched text — the raw finding set for Steps A3–A6.
The shell / bash track stays grep-based — || true, 2>/dev/null in context,
and xtrace suppression are line-shaped, not AST-shaped:
bash ${CLAUDE_SKILL_DIR}/scripts/scan-shell.sh <path>
| Track | Tool | Reference (linked from rule files) |
|---|---|---|
| JS / TS, Python, Go, Rust | ast-grep scan -c rules/sgconfig.yml (one pass) |
REFERENCE-js.md, REFERENCE-python.md, REFERENCE-go.md, REFERENCE-rust.md |
| Shell / bash | scripts/scan-shell.sh (grep-based) |
REFERENCE-shell.md |
If ast-grep/sg is not installed, follow the per-pattern fallback in
references/no-ast-grep-fallback.md.
For every finding, capture: file:line, matched snippet, surrounding function
name if discoverable.
Step A3: Classify severity
For every raw finding, assign Low / Medium / High:
| Severity | Criteria | Examples | |------
Установить code-hidden-failures в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(bash *)Bash(ast-grep *)Bash(sg *)Bash(grep *)ReadGrepGlobEditWriteTodoWriteВложенные файлы
FAQ
Что делает скилл code-hidden-failures?
Scan for hidden failures: swallowed errors (empty catch, || true, 2>/dev/null) and silent degradation (success on zero results). Use when failures vanish or success masks empty output.
Как установить скилл code-hidden-failures?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл code-hidden-failures запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic