- Home
- Skills
- Code Quality & Review
- Astro Code Doctor
Works with the AI Agents you already use
Astro Code Doctor
Audits Astro code for spec compliance and refactors oversized pages into typed, reusable components — three levels from quick spec fixes to full atomic-design restructuring, then verifies with a real build.
$9
Astro Code Doctor
Example session with this skill installed
Run astro-doctor on src/pages/ with medium level to clean up my index page and extract any repeated cards.
- Read your context and instructions
- Compiled the astro code doctor
I have analyzed the files in `src/pages/` using the medium optimization level. I identified several spec violations and opportunities for component extraction. ## Optimization Plan (level: medium) **Doc source:** AstroDocs MCP ### src/pages/index.astro - [fix] Remove `export default` (line 12) — not valid in .astro files - [extract] Hero section (lines 15–40) → new component: `src/components/HeroSection.astro` - [extract] FeatureCard repeated ×4 (lines 55–80) → `src/components/FeatureCard.astro` with `Props { title, description }` - [refactor] Replace `space-y-6` with `flex flex-col gap-6` (Tailwind v4) ### src/components/Header.astro - [fix] `<nav>` missing `ul > li` structure around navigation links - [refactor] Move repeated link classes to `*:` on parent `ul` ### src/content/blog/first-post.mdx - [fix] Frontmatter field `author_name` not defined in schema — should be `author` - [fix] `<InteractiveButton />` used without `client:visible` — currently static HTML **Next steps** 1. Confirm if you want to apply all changes or only the `[fix]` items. 2. I will create the new component files and update the imports. 3. I will run a build check to verify the refactor.
Connects securely to your tools. The creator never sees your data.
About this skill
Astro code generated quickly — by an AI agent or a human moving fast — tends to drift from spec over time and pile up as monolithic pages instead of reusable components. Catching this manually means re-reading every file against changing Astro conventions, which nobody has time to do consistently. ## What it does - Checks spec compliance: invalid export default in .astro files, missing client:* hydration directives, Tailwind v4 class naming (space-y-* to gap-*, flex-shrink/flex-grow to shrink/grow), img tags that should use the Image component, deprecated z imports in MDX/MD content collections, and basic accessibility structure (nav > ul > li, button text, input labels) - Extracts components at medium and deep levels: repeated inline HTML blocks, page-level monoliths with no component imports, and inconsistent granularity across files - Restructures with an atomic-design lens at the deep level: atoms, molecules, organisms, and proper slot composition, including the Header/Footer-belongs-in-Layout rule - Looks up current Astro documentation (via the Astro Docs MCP or Context7 when available) for the handful of things it is not fully certain about, rather than relying only on built-in knowledge - Optionally checks responsive images with --images: adds layout to Image components (full-width, constrained, or fixed) so the browser picks the right size from a srcset, adds priority to the first-view image, and proposes an explicit sizes when an image fills only part of the viewport. Off by default, independent of the three levels, and it never changes how the page looks - Always shows the full optimization plan before touching anything, and builds the project afterward to confirm nothing broke ## How it works - Collects every .astro, .tsx, .ts, .mdx, and .md file in the given scope - Analyzes each file across spec compliance, component granularity, and (deep only) architecture - Queries live Astro documentation for the most uncertain findings - Displays a structured, file-by-file plan with severity labels and asks how to proceed: apply everything, spec fixes only, file-by-file, or cancel - Applies the confirmed changes, then runs the project's build command and fixes any resulting errors before reporting ## What it is not This is a code reviewer and refactorer, not a linter you wire into CI — it runs interactively, shows its plan, and waits for confirmation before changing anything. It does not add new features or content; it restructures and corrects what is already there. ## Requirements Works on any Astro project. Uses the Astro Docs MCP or Context7 MCP for up-to-date documentation lookups when either is available in the agent — falls back to built-in Astro knowledge otherwise, so neither is required to run it. The optional responsive-image check needs Astro 5.10 or later; on older versions it is skipped and says so.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.
Requires an existing Astro project structure. Optimization depth is constrained by the level (light, medium, or deep) selected by the user.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 10 days ago
Permissions
File Scopes
This skill reads and writes files only within the Astro project scope you specify (Read Files, Write Files), and runs the project's own build command locally to verify changes (Terminal). It does not access the network directly — if the Astro Docs MCP or Context7 MCP is connected in your agent, this skill will use it for live documentation lookups, but works without either using built-in knowledge.