code-quality-plugin/skills/code-silent-degradation/SKILL.md
Detect silent degradation where ops succeed with zero results. Use when features report success but produce nothing, scans return 0 items, or UI shows success for empty outcomes.
npx skillsauth add laurigates/claude-plugins code-silent-degradationInstall 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.
Detect code patterns where operations complete "successfully" but produce empty or useless results because preconditions are silently unmet.
| Use this skill when... | Use /code:review instead when... |
|------------------------|-----------------------------------|
| A feature reports success but produces nothing | You need general code quality review |
| Scan/batch operations return 0 results silently | You want security or performance review |
| Users see green success banners for empty outcomes | You need SOLID principles assessment |
| Config-dependent features skip without warning | You want test coverage analysis |
| Multi-detector/multi-step operations silently skip steps | You need architecture review |
$ARGUMENTS (defaults to current directory if empty)find . -maxdepth 1 \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \) -type ffind . -maxdepth 1 \( -name ".env*" -o -name "config.*" -o -name "settings.*" \) -type fParse from $ARGUMENTS:
PATH: Directory or file to scan (defaults to .)--fix: Apply recommended fixes (add precondition checks, warning messages, status indicators)Execute this silent degradation scan:
Use Glob to find source files in the target path:
**/*.ts, **/*.tsx, **/*.js, **/*.jsx for TypeScript/JavaScript**/*.py for Python**/*.go for Go**/*.rs for RustExclude node_modules, dist, build, .git, vendor, __pycache__ directories.
Search each source file for these five pattern categories. Use Grep and Read to find matches.
Code that checks for a config value and silently returns empty results when absent.
Indicators:
if (!apiKey) or if not api_key: followed by return [] or return 0 or continueprocess.env.X or os.environ.get() or os.Getenv() used in conditions that gate result-producing logicExample of the problem:
// Silently returns nothing when Gemini isn't configured
if (!config.geminiApiKey) {
return { suggestions: [] }; // No warning, no status
}
Code that reports success regardless of whether meaningful work was performed.
Indicators:
count === 0Example of the problem:
// Green banner whether it found 50 items or 0
toast.success(`Scan completed. Created ${results.length} suggestions.`);
Operations composed of multiple detectors/processors/steps where individual steps are skipped without surfacing this to the caller.
Indicators:
try/catch blocks that swallow errors and continue iterationExample of the problem:
for (const detector of detectors) {
if (!detector.isAvailable()) {
skipped.push(detector.name); // Tracked but never shown
continue;
}
results.push(...detector.run());
}
// skipped list exists but UX ignores it
Functions that require preconditions (data present, services configured, dependencies available) but don't validate or communicate them upfront.
Indicators:
Example of the problem:
# Returns empty if no themes have embeddings - but doesn't check or warn
def find_similar_themes(threshold=0.85):
themes = db.query(Theme).filter(Theme.embedding.isnot(None)).all()
# If no embeddings exist, this silently returns []
pairs = [(a, b) for a, b in combinations(themes, 2)
if cosine_similarity(a.embedding, b.embedding) > threshold]
return pairs
Code that falls back to a degraded mode of operation (fewer features, reduced functionality) without any indication to the user that they're getting a partial experience.
Indicators:
Example of the problem:
// User has no idea they're getting a degraded scan
const detectors = [basicDetector];
if (geminiKey) detectors.push(aiDetector); // silently omitted
if (hasEmbeddings) detectors.push(simDetector); // silently omitted
return runDetectors(detectors); // runs 1 of 3 with no indication
For each finding, report:
| Field | Content |
|-------|---------|
| File | file:line reference |
| Pattern | Which of the 5 patterns it matches |
| Severity | high (success message on empty), medium (silent skip), low (missing validation) |
| What happens | Describe the silent failure from the user's perspective |
| Preconditions | List what must be true for the code to produce results |
| Fix | Specific code change to surface the degradation |
Severity guide:
Print a summary table:
Silent Degradation Scan: <path>
| Pattern | Findings | Severity |
|----------------------------|----------|----------|
| Silent config skip | N | medium |
| Success on zero results | N | high |
| Silent step skipping | N | high |
| Missing precondition check | N | low |
| Degraded mode hidden | N | medium |
Total: N findings across M files
If --fix is specified, apply these fixes for each finding:
After applying fixes, list all changes made with file:line references.
Before running multi-detector operations, check and display precondition status:
// Before
const results = await runScan();
toast.success(`Done. ${results.length} found.`);
// After
const status = checkPreconditions();
if (status.issues.length > 0) {
showPreconditionPanel(status); // "Gemini: not configured, Embeddings: 0 themes"
}
const results = await runScan();
toast.info(`Scan: ${results.active}/${results.total} detectors ran. ${results.length} found.`);
// Before
return { success: true, count: results.length };
// After
return {
success: true,
count: results.length,
skipped: skippedDetectors,
degraded: activeDetectors.length < totalDetectors,
missingPreconditions: missingPrereqs,
};
| Context | Command |
|---------|---------|
| Quick scan | /code:silent-degradation src/ |
| Scan and fix | /code:silent-degradation src/ --fix |
| Specific file | /code:silent-degradation src/features/scanner.ts |
/configure:sentry for error monitoring/configure:feature-flags for controlled rolloutstesting
Verify accumulated bug claims at upstream HEAD and dedup against trackers before filing issues. Use when filing upstream reports from backlogs, audit docs, or git-history findings.
documentation
Gate outward-bound text (upstream issues, docs, PR bodies) through isolated haiku fresh-reader critique before publishing. Use when an artifact must survive a reader with zero project context.
tools
Suggest improvements to SKILL.md content, descriptions, or tool config from eval results. Use when raising pass rates, fixing triggering, or iterating on a skill after evaluation.
tools
deadbranch CLI for stale-branch cleanup — dry-run preview, TUI or non-interactive delete, protects main/develop/WIP. Use when asked to clean up branches, prune branches, or remove stale branches.