Py’otrMuhammad Toheed Sahar

site-doctor: Website Audit and Auto-Fix Skill for Claude Code

I packaged a repeatable website audit as a Claude Code skill: a Playwright harness collects hard evidence, then the model fixes what it finds on a separate branch.

Client
Own project
Year
2026
Type
Developer tools

The problem

Checking a site properly means seeing it as several different visitors, on several devices, across UX, accessibility, speed, SEO and security, and then actually fixing what you find. Done ad hoc, audits miss things, and fixes land on the main branch with no proof they worked.

How I built it

The skill splits the work in two. A Python Playwright script of about 500 lines collects objective signals across desktop, mobile and tablet viewports: console errors, failed or slow requests, broken images and links, axe-core accessibility violations, Core Web Vitals, SEO metadata, security headers, insecure cookies, secrets shipped in the client bundle, and full-page screenshots. The model then reviews the screenshots as seven personas (real user, new user, power user, developer, accessibility user, mobile user, search crawler), ranks findings from P0 to P3 and fixes them one at a time on its own site-doctor/auto-fixes branch, ending with a written report.

What got hard

  1. Automated fixes can quietly break working behaviour.

    A written protocol: one finding per commit, each verified by re-running the check that found it, nothing touching login, payments or data, and anything that cannot be verified goes to a 'Needs human decision' list. Leaked secrets are flagged for rotation and never assumed safe.

  2. Security checks pointed at the wrong target would be an attack.

    The skill confirms ownership first and keeps the security checks defensive: headers, cookies, leaked keys and exposed source maps on properties the user owns.

  3. One failing check must not kill a long audit run.

    Every check is wrapped so a failure degrades gracefully and is recorded as skipped in the findings file, which keeps the report honest about what was not covered.

The result

Eight files: the skill definition, a 494-line audit harness and five reference guides (personas, review guide, security surface, agent flows, auto-fix protocol). The report format has Fixed and Needs-human-decision tables with before and after metrics.