Skip to content

Commit baf09a5

Browse files
committed
feat: Add critical instructions for parsing Lighthouse audit reports to efficiently extract failing elements.
1 parent ca7be31 commit baf09a5

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

skills/a11y-debugging/SKILL.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ description: Uses Chrome DevTools MCP for accessibility (a11y) debugging and aud
1616
Start by running a Lighthouse accessibility audit to get a comprehensive baseline. This tool provides a high-level score and lists specific failing elements with remediation advice.
1717

1818
1. Run the audit:
19-
1. Run the audit:
20-
Call the `lighthouse_audit` tool. It checks "accessibility", "seo", and "best-practices" by default.
2119
- Set `mode` to `"navigation"` to refresh the page and capture load issues.
22-
- Optionally set `outputDirPath` to save full HTML/JSON reports.
20+
- Set `outputDirPath` (e.g., `/tmp/lh-report`) to save the full JSON report.
2321
2. **Analyze the Summary**:
2422
- Check `scores` (0-1 scale). A score < 1 indicates violations.
2523
- Review `audits.failed` count.
26-
3. **Review the Report**:
27-
- If you saved the report, open the JSON file to see detailed findings and exact element selectors.
28-
- If you only have the summary, proceed to specific checks below for the failing categories.
24+
3. **Review the Report (CRITICAL)**:
25+
- **Parsing**: Do not read the entire file line-by-line. Use a CLI tool like `jq` or a Node.js one-liner to filter for failures:
26+
```bash
27+
# Extract failing audits with their details
28+
node -e "const r=require('./report.json'); Object.values(r.audits).filter(a=>a.score!==null && a.score<1).forEach(a=>console.log(JSON.stringify({id:a.id, title:a.title, items:a.details?.items})))"
29+
```
30+
- This efficiently extracts the `selector` and `snippet` of failing elements without loading the full report into context.
2931

3032
### 2. Browser Issues & Audits
3133

0 commit comments

Comments
 (0)