debug — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited debug (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Debug a web/web-app issue by instrumenting code with structured logging via window.__debug_logs. This skill does NOT use console.log — all debug data is collected in a single global array for clean export and analysis.
window.__debug_logs collects structured log entrieswindow.__debug_logs to a JSON fileAnalyze $ARGUMENTS and the relevant code to understand:
Use AskUserQuestion if the bug description is unclear or if you need to narrow down the scope.
Explore the codebase and identify every critical point in the code path where data changes or decisions are made. Typical points include:
Map out these points before writing any code.
Add this initialization at the app entry point or at the top of the root component/page being debugged (whichever is more appropriate):
// --- DEBUG START ---
if (typeof window !== 'undefined') {
window.__debug_logs = []
}
// --- DEBUG END ---If there are many log points, add a small helper near the initialization:
// --- DEBUG START ---
function __debugLog(key: string, data: Record<string, unknown>) {
if (typeof window !== 'undefined' && window.__debug_logs) {
window.__debug_logs.push({
timestamp: Date.now(),
key,
...data,
})
}
}
// --- DEBUG END ---At each instrumentation point, push a structured entry:
// --- DEBUG START ---
__debugLog('initial_data', {
data: { id: product.id, status: product.status, price: product.price },
})
// --- DEBUG END ---Every entry MUST have these fields:
| Field | Type | Description |
|---|---|---|
timestamp | number | Date.now() — milliseconds since epoch |
key | string | Descriptive snake_case ID for this point (see naming conventions below) |
Additional fields are added as needed per log point (e.g., data, props, state, error, response).
Use descriptive, snake_case keys that tell a story when read in sequence:
first_load
initial_props
fetch_start
fetch_response
state_after_fetch
on_filter_change
filtered_results
on_item_click
selected_item_data
on_submit
submit_response
error_caughtCRITICAL: Only log what's relevant to the bug. For each log point:
Example — instead of logging an entire product list:
// ❌ Bad: logs everything
__debugLog('products_loaded', { data: products })
// ✅ Good: logs what matters
__debugLog('products_loaded', {
data: {
count: products.length,
firstId: products[0]?.id,
lastId: products[products.length - 1]?.id,
statuses: [...new Set(products.map(p => p.status))],
},
})ALL debug code MUST be wrapped in clearly marked comments for easy removal:
// --- DEBUG START ---
__debugLog('some_key', { data: relevantData })
// --- DEBUG END ---This makes cleanup trivial — search for DEBUG START and remove all blocks.
Check if there is a spec folder for the feature being debugged:
.specs/).debug/ subfolder inside it.debug/ in the project rootDetermine the next available index:
.debug/logs-1.json
.debug/logs-2.json
.debug/logs-3.json
...Create the file with a placeholder:
[]After instrumenting, output clear instructions:
Debug instrumentation is ready.
To capture logs:
1. Reproduce the bug in your browser
2. Open DevTools console and run: copy(JSON.stringify(window.__debug_logs, null, 2))
3. Paste into: <path-to-debug-file>
4. Then ask me to analyze the logs and fix the bug
To clean up after debugging:
- Search for "DEBUG START" and remove all blocks between DEBUG START/END markersIf the user provides a populated debug JSON file or asks to analyze:
timestamp and key fieldswindow.__debug_logs only// --- DEBUG START --- and // --- DEBUG END --- // --- DEBUG START ---
declare global {
interface Window {
__debug_logs: Array<Record<string, unknown>>
}
}
// --- DEBUG END ---useEffect for React, onMounted for Vue, etc.)~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.