Detects anomalies in swing-scan and morning-brief workflows to prevent classifier drift.
Install
mkdir -p .claude/skills/bug-scan && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14322" && unzip -o skill.zip -d .claude/skills/bug-scan && rm skill.zipInstalls to .claude/skills/bug-scan
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Classifier-anomaly detector for the swing-scan, morning-brief, and external-scanner crons. Detects Pattern B shapes (absent-with-subs, silent, ghost), sub-signal weight drift, L3 calibration skew, and cross-TF classification contradictions. Audit 2026-06-23 #2.Key capabilities
- →Detect Pattern B shapes (absent-with-subs, silent, ghost)
- →Detect sub-signal weight drift
- →Detect L3 calibration skew
- →Detect cross-timeframe classification contradictions
- →Run offline against a pre-computed state file
- →Perform fresh scans on ad-hoc tickers
How it works
The skill acts as a classifier-anomaly detector, applying specific rules to L2/L3 analysis outputs or state files to identify patterns like weight drift, calibration skew, and cross-timeframe contradictions.
Inputs & outputs
When to use bug-scan
- →Detect classifier anomalies
- →Identify classification drift
- →Surface cross-timeframe conflicts
About this skill
bug-scan
Single source of truth for the classifier-anomaly rules the swing-scan workflow has been hunting since 2026-06-21. Designed for both automated-tick surfacing and LLM-agent surface so morning briefs and external scanners stop missing the same anomalies that swing-scan catches.
When to use
- After running
run-all-l2orrun-all-l3— pipe the envelope through--from-jsonto surface bugs the brief would otherwise miss. An L3-only envelope now also surfaces cross-TF direction conflicts (alongdominant idea on one TF vs ashorton another for the same strategy), not just the L2 healthy-vs-weakening contradictions — so a merged multi-timeframerun-all-l3envelope no longer reports zero findings. SetBUG_SCAN_FROM_JSON_DEBUG=1to print abug-scan from-json: l2_keys=<n>, l3_keys=<n>line to stderr before the scan runs, which makes future "empty findings" regressions surface immediately. - Offline (no network):
--from-statereads the existing swing-scan state tracker and translates its open_findings into the bug-scan envelope. - Standalone for a fresh scan on ad-hoc tickers (does the fetch + run + detect all in one call).
When NOT to use
- For full L2/L3 analysis — use
run-all-l2/run-all-l3directly. This skill is a detector on top of their output, not a replacement. - For live trade signals — bug-scan is purely diagnostic. Never pair its output with execution.
Detection rules
| Shape | Tag | Trigger | Severity |
|---|---|---|---|
pattern_b_1 (absent-with-subs) | [BUG] | l2_fired=False AND ≥2 sub-signals present AND wsum > 0.30 | medium / high (wsum ≥ 0.5) |
pattern_b_2 (silent) | [BUG] | pattern.present=True AND classification=None AND any sub-signal present | high |
pattern_b_3 (ghost) | [BUG] | pattern.present=False AND classification populated | high |
weight_drift | [DRIFT] | sub-signal weights sum outside 1.0 ± 0.05 | medium |
l3_calibration_skew | [INFO] | ≥6 ideas, zero with conviction ≥ 4 | low (regime signal) |
cross_tf_contradiction | [INFO] | same ticker + L2 skill, healthy vs weakening across TFs | medium |
cross_tf_direction_conflict | [INFO] | same ticker + L3 strategy, long dominant idea on one TF vs short on another (both ideas conviction ≥ 2) | medium |
The first three shapes are the recurring Pattern B family: classifier
anomaly + L1 absence + non-null classification (ghost-classifier
shape). Weight drift catches the market-exhaustion 0.900 regression.
The L3 and cross-TF checks detect calibration skew and inter-timeframe
contradictions.
Usage
# Fresh fetch — positional tickers, comma-separated interval/period
uv run skills/bug-scan/scripts/run.py HYPEUSD SOLUSD AEROUSD \
--interval=1h,4h --period=1mo,6mo --json
# Read the swing-scan state tracker (no network)
uv run skills/bug-scan/scripts/run.py --from-state --json
# Pipe a pre-fetched run-all-l2 envelope
uv run skills/bug-scan/scripts/run.py --from-json /path/to/l2_envelope.json --json
The --interval / --period flags accept comma-separated lists paired
1:1. A single --period value is reused for every interval.
Output schema
{
"ok": true,
"findings": [
{
"tag": "[BUG]",
"shape": "pattern_b_1",
"ticker": "HYPEUSD",
"tf": "1h",
"skill": "market-trend-quality",
"summary": "Pattern B Shape #1: 3 subs (w=0.60) but pattern absent",
"wsum": 0.60,
"present_sub_signals": ["ema_alignment", "pullback_depth", "volume_confirmation"],
"severity": "medium"
}
]
}
Findings are sorted high → medium → low severity for terminal output.
Use --json to get the full list unsorted.
State-resolved paths
--from-state(bare) reads from$XDG_DATA_HOME/market-skills/swing_scan_state.json. Pass--from-state=PATHto override. The env var must be set — the runner does not fall back to a host-specific default.- The fresh-fetch mode uses the same data provider stack as
run-all-l2/run-all-l3(Hyperliquid → CCXT → Kraken → YFinance).
Layer rules
- Sits between L2/L3 and the LLM narrative layer. Reads L2/L3 output, emits diagnostic findings. Does not gate trades.
- Detection rules use
analysis.contracts.l2_firedandl2_classification(the single source of truth for "did the L2 actually fire?") — never rawpattern.get("classification").
Output envelope (AXI)
--json output follows the canonical AXI envelope — {data, count, errors, help[]}. Pass --fields=<csv> to project or --full for the full payload. count is the item count (findings for bug-scan, ranked ideas for l3-conviction-scan, total journal entries for daily-trade-pick), help[] is contextual next-step command templates.
Home view (no-arg mode)
No-arg mode prints the home view from $XDG_DATA_HOME/market-skills/<skill>_last.json (last successful run). Errors are not cached.
When not to use it
- →For full L2/L3 analysis
- →For live trade signals
Prerequisites
Limitations
- →It is a detector, not a replacement for full L2/L3 analysis
- →Output is purely diagnostic and should not be used for execution
- →Requires specific input formats like L2/L3 envelopes or state files
How it compares
This skill provides a diagnostic layer on top of existing analysis tools, specifically identifying anomalies that might be missed by direct L2/L3 analysis, rather than performing the analysis itself.
Compared to similar skills
bug-scan side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| bug-scan (this skill) | 0 | 1mo | Review | Intermediate |
| langsmith-observability | 4 | 7mo | Review | Intermediate |
| optimizing-performance | 1 | 2mo | Review | Intermediate |
| fireflies-debug-bundle | 1 | 29d | Caution | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
langsmith-observability
davila7
LLM observability platform for tracing, evaluation, and monitoring. Use when debugging LLM applications, evaluating model outputs against datasets, monitoring production systems, or building systematic testing pipelines for AI applications.
optimizing-performance
CloudAI-X
Analyzes and optimizes application performance across frontend, backend, and database layers. Use when diagnosing slowness, improving load times, optimizing queries, reducing bundle size, or when asked about performance issues.
fireflies-debug-bundle
jeremylongshore
Collect Fireflies.ai debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Fireflies.ai problems. Trigger with phrases like "fireflies debug", "fireflies support bundle", "collect fireflies logs", "fireflies diagnostic".
sentry-debug-bundle
jeremylongshore
Execute collect debug information for Sentry support tickets. Use when preparing support requests, debugging complex issues, or gathering diagnostic information. Trigger with phrases like "sentry debug info", "sentry support ticket", "gather sentry diagnostics", "sentry debug bundle".
openrouter-debug-bundle
jeremylongshore
Execute set up comprehensive logging and debugging for OpenRouter. Use when investigating issues or monitoring requests. Trigger with phrases like 'openrouter debug', 'openrouter logging', 'openrouter trace', 'monitor openrouter'.
python-observability
wshobson
Python observability patterns including structured logging, metrics, and distributed tracing. Use when adding logging, implementing metrics collection, setting up tracing, or debugging production systems.