/astro-audit — Astro Migration & Best-Practice Audit
Version-neutral skill for all Astro projects. Automatically detects the installed version, compares with the latest available, and loads the matching checklist.
Complementary to /audit: This skill checks Astro-specific version and migration topics. The generic /audit checks code quality, performance, security, a11y, etc.
Modes
Detect the mode from user input:
- start -> Mode 1 (Scan project, load checklist)
- continue -> Mode 2 (Process next areas/fixes)
- status -> Mode 3 (Show progress)
- refresh -> Mode 4 (Check for new Astro releases)
- auto -> Mode 5 (Fully autonomous run)
Mode 1: /astro-audit start — Scan Project
Auto-Detection (in this order)
- package.json -> Astro version, adapter, integrations, all
@astrojs/* packages
- astro.config.mjs/ts -> experimental flags, config structure, output mode
- Node version ->
node --version (Astro 6 requires Node 22)
- Dockerfile -> Node version in base image, build commands
- src/content/config.ts -> Content Collections, loader type (Legacy vs Content Layer)
- tsconfig.json -> TypeScript configuration, strict mode
Version Logic
After detection:
- Read installed version from
package.json (e.g., 5.17.2, 6.0.0-beta.11)
- Check latest version:
npm view astro versions --json (show last 5)
- Select matching checklist:
| Installed |
Latest |
Checklist |
Scenario |
| 5.x |
5.x |
versions/v5-stable/ |
Up to date, check best practices |
| 5.x |
6.x-beta |
versions/v6-beta/ |
Migration to v6 Beta (only if user wants) |
| 5.x |
6.x (stable) |
versions/v6-stable/ |
Migration to v6 Stable |
| 6.x-beta |
6.x-beta |
versions/v6-beta/ |
Beta verification, check for newer betas |
| 6.x-beta |
6.x (stable) |
versions/v6-stable/ |
Upgrade Beta -> Stable |
| 6.x |
6.x |
versions/v6-stable/ |
Up to date, check best practices |
Astro 6 has been stable since March 10, 2026 (latest: 6.1.5). For migration 5->6 use the v6-beta/ checklist (74 checks, all breaking changes). For best practices on 6.x use the v6-stable/ checklist (31 checks).
- Ask user: "Check current version OR migrate to new version?"
- Load checklist and compare with project scan
- Document findings with
MIG-NN IDs + severity
Flow After Detection
- Display result table: Version, Node, Adapter, Collections, Flags
- Load matching checklist (max 2 areas per session)
- Check each checkpoint against the project
- Save findings to
.astro-audit-state.json
- Display summary + prioritized list
- Session end: "Start next session with
/astro-audit continue"
Mode 2: /astro-audit continue — Resume
- Read
.astro-audit-state.json
- Generate smart recommendation:
IF open CRITICAL findings > 0:
-> "Recommendation: Fix {N} CRITICAL findings first ({IDs})"
IF open HIGH findings > 3:
-> "Recommendation: Fix HIGH findings, then continue"
ELSE IF areas open:
-> "Recommendation: Next areas ({area names})"
ELSE:
-> "Recommendation: Fix remaining findings"
- If areas open -> process next 2 areas
- If all areas done -> next 5 findings by priority
- Load fix templates (from
fix-templates.md) where applicable
- Ask user: Follow recommendation? Choose different? Skip?
- Implement fixes -> verify -> update state
Mode 3: /astro-audit status — Progress
- Read
.astro-audit-state.json
- Display table: Done/Open/Total per area + severity
- Next recommended action
Mode 4: /astro-audit refresh — Check New Releases
npm view astro versions --json -> latest version
- If newer version than in state: context7 or WebSearch for release notes
- Show checklist delta:
Last checked: 6.0.0-beta.11
Current: 6.0.0-beta.15
New changes: 4 (2 Breaking, 2 Features)
-> Checklist update recommended
- Inform user + recommendation (update yes/no, breaking changes)
- Update
versions/*/changelog.md if needed (date stamp at end)
- When stable release detected -> automatically recommend
v6-stable/ checklist
Mode 5: /astro-audit auto — Autonomous Run
Fully autonomous Astro audit without prompts.
Flow
- Auto-detection as in
start
- All areas processed (no 2-area limitation)
- Document findings with fix templates from
fix-templates.md
- Context management: When context runs low:
- Write state immediately
- Create task in
.tasks.json with handoff note
- "New session with
/astro-audit continue"
- At end: Summary with prioritized fix list
Severity Order of Areas in Auto Mode
CRITICAL areas first:
ENV -> CFG -> CODE -> COLL -> ADPT -> VITE -> ZOD -> DCI -> MDLK -> IMG -> CSP -> TOOL -> FONT -> NEW
Check Priorities + Completeness Tracking
See _shared/audit-patterns.md (MUST/SHOULD/CAN markers, completeness counting, layer status standard).
Area with <100% MUST checks cannot be marked as done.
State File .astro-audit-state.json
Save in project root (gitignored).
{
"version": 2,
"created": "YYYY-MM-DD",
"lastUpdated": "YYYY-MM-DD",
"project": "Project Name",
"installedAstroVersion": "5.17.2",
"targetAstroVersion": "6.0.0-beta.11",
"checklist": "v6-beta",
"nodeVersion": "22.12.0",
"adapter": "@astrojs/node",
"output": "server",
"areas": {
"ENV": {
"status": "pending",
"session": null,
"findingsCount": 0,
"completeness": null,
"layers": { "source": "pending", "runtime": "pending" }
},
"CFG": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"CODE": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"COLL": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"ADPT": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"MDLK": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"IMG": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"TOOL": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"VITE": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"ZOD": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"NEW": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"CSP": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"FONT": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },
"DCI": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null }
},
"summary": {
"total": 0,
"critical": 0,
"high": 0,
"medium": 0,
"low": 0,
"fixed": 0,
"skipped": 0
},
"findings": [
{
"id": "MIG-01",
"area": "ENV",
"severity": "CRITICAL",
"title": "Short title",
"description": "What is the problem",
"location": "File or area",
"status": "open|fixed|skipped",
"fixedIn": "Session N | null",
"notes": ""
}
],
"history": [
{
"date": "YYYY-MM-DD",
"session": 1,
"areas": ["ENV", "CFG"],
"findingsAdded": 3,
"findingsFixed": 0
}
]
}
State Migration v1 -> v2
When a .astro-audit-state.json with "version": 1 is found:
- Migrate
areas from string enum to object:
"done" -> { "status": "done", "session": null, "findingsCount": 0, "completeness": null, "layers": null }
"in-progress" -> { "status": "in-progress", ... }
"pending" -> { "status": "pending", ... }
"skipped" -> { "status": "skipped", ... }
- Count
findingsCount from findings[] array (per area)
- Add
history: [] array
- Add
"notes": "" to each finding (if not present)
- Set
version to 2
- Inform user: "State migrated from v1 to v2 (completeness tracking, history, layer status)."
Rules
- Context protection: Max 2 areas OR 5 fixes per session. At limit: save state, recommend
/astro-audit continue.
- Write state immediately: Update
.astro-audit-state.json after every area and every fix.
- No auto-fix: Document findings, then ask user whether to fix.
- Read version files: Only read files from the relevant
versions/ directory. Don't load all.
- Severity rules:
- CRITICAL: Build breaks, runtime errors, security issues
- HIGH: Deprecation warning, functional limitation
- MEDIUM: Best practice deviation, performance
- LOW: Optional, nice-to-have, new features
- Finding prefix: Always
MIG-NN (Migration), not CODE/SEC like /audit.
- Fix templates: Load matching template from
fix-templates.md for findings.
- npm view: Run
npm view astro before any version statement. Never from memory.
- context7: Use for Astro documentation when available.
Session Strategy
| Session |
Content |
Context Protection |
| 1 |
start -> Detection + 2 areas (CRITICAL first) |
Max 2 areas |
| 2 |
continue -> next 2 areas |
Max 2 areas |
| 3+ |
continue -> Fixes (max 5/session) |
Fix -> Test -> Next |
Smart Next Steps
After completing the Astro audit, recommend relevant follow-up skills:
| Condition |
Recommendation |
Reason |
| No .audit-state.json present |
/audit start |
Check website quality (SEO, a11y, performance, privacy) |
| No .project-audit-state.json present |
/project-audit start |
Check code/CI/CD quality |
| Migration findings fixed |
/lighthouse-quick |
Verify performance after migration |
| UI/Design work needed |
/design-system |
Curated palettes, fonts, styles, UX rules (CSV databases) |
| Frontend polish desired |
/polish scan |
Rate 6 design dimensions, then improve |
| All areas done |
/lesson-learned session |
Extract learnings from migration |
Design Integration: When building or modifying UI components in Astro projects, always consult /design-system first. It provides industry-matched palettes, font pairings, UX rules, and wow effects from curated CSV databases. The design-system is stack-agnostic — it provides design decisions, Astro provides the code patterns.
Output after last area: "Next steps:" + 2-3 most relevant recommendations.
Version Directory Structure
Each directory under versions/ contains:
| File |
Content |
checklist.md |
Checkpoints with IDs, severity, description |
changelog.md |
Release notes (only for Beta/Major) |
reference-links.md |
Official docs links, PR links |
Currently available:
versions/v5-stable/ — Best practices for Astro 5.x
versions/v6-beta/ — Migration Astro 5->6 (74 checkpoints, definitive migration guide)
versions/v6-stable/ — Best practices for Astro 6.x Stable (28 checkpoints)
versions/v7/ — (still empty, for future use)
Additionally:
fix-templates.md — Quick-fix templates for common Astro findings
1---2name: astro-audit3description: Astro Migration & Best-Practice Audit with state persistence. Use when: "astro-audit", "astro upgrade", "astro migration", "astro check", "astro version".4---56<!-- AI-QUICK-REF7## /astro-audit — Quick Reference8- **Modes:** start | continue | status | refresh | auto9- **Auto-Detection:** package.json, astro.config, Node, Dockerfile, Content Collections10- **Version Logic:** Installed vs. Latest -> matching checklist (v5-stable, v6-beta, v6-stable)11- **State:** .astro-audit-state.json12- **Finding IDs:** MIG-01 (Migration), BP-01 (Best Practice)13- **Checkpoints:** [CHECKPOINT: decision] at version/checklist selection, [CHECKPOINT: verify] after each area14- **Complementary to /audit** — this skill only checks Astro-specific topics15-->1617# /astro-audit — Astro Migration & Best-Practice Audit1819Version-neutral skill for all Astro projects. Automatically detects the installed version, compares with the latest available, and loads the matching checklist.2021**Complementary to /audit:** This skill checks Astro-specific version and migration topics. The generic /audit checks code quality, performance, security, a11y, etc.2223## Modes2425Detect the mode from user input:2627- **start** -> Mode 1 (Scan project, load checklist)28- **continue** -> Mode 2 (Process next areas/fixes)29- **status** -> Mode 3 (Show progress)30- **refresh** -> Mode 4 (Check for new Astro releases)31- **auto** -> Mode 5 (Fully autonomous run)3233---3435## Mode 1: `/astro-audit start` — Scan Project3637### Auto-Detection (in this order)38391. **package.json** -> Astro version, adapter, integrations, all `@astrojs/*` packages402. **astro.config.mjs/ts** -> experimental flags, config structure, output mode413. **Node version** -> `node --version` (Astro 6 requires Node 22)424. **Dockerfile** -> Node version in base image, build commands435. **src/content/config.ts** -> Content Collections, loader type (Legacy vs Content Layer)446. **tsconfig.json** -> TypeScript configuration, strict mode4546### Version Logic4748After detection:49501. Read installed version from `package.json` (e.g., `5.17.2`, `6.0.0-beta.11`)512. Check latest version: `npm view astro versions --json` (show last 5)523. Select matching checklist:5354| Installed | Latest | Checklist | Scenario |55|-----------|--------|-----------|----------|56| 5.x | 5.x | `versions/v5-stable/` | Up to date, check best practices |57| 5.x | 6.x-beta | `versions/v6-beta/` | Migration to v6 Beta (only if user wants) |58| 5.x | 6.x (stable) | `versions/v6-stable/` | Migration to v6 Stable |59| 6.x-beta | 6.x-beta | `versions/v6-beta/` | Beta verification, check for newer betas |60| 6.x-beta | 6.x (stable) | `versions/v6-stable/` | Upgrade Beta -> Stable |61| 6.x | 6.x | `versions/v6-stable/` | Up to date, check best practices |6263**Astro 6 has been stable since March 10, 2026 (latest: 6.1.5).** For migration 5->6 use the `v6-beta/` checklist (74 checks, all breaking changes). For best practices on 6.x use the `v6-stable/` checklist (31 checks).64654. **Ask user:** "Check current version OR migrate to new version?"665. Load checklist and compare with project scan676. Document findings with `MIG-NN` IDs + severity6869### Flow After Detection70711. Display result table: Version, Node, Adapter, Collections, Flags722. Load matching checklist (max 2 areas per session)733. Check each checkpoint against the project744. Save findings to `.astro-audit-state.json`755. Display summary + prioritized list766. Session end: "Start next session with `/astro-audit continue`"7778---7980## Mode 2: `/astro-audit continue` — Resume81821. Read `.astro-audit-state.json`832. **Generate smart recommendation:**84 ```85 IF open CRITICAL findings > 0:86 -> "Recommendation: Fix {N} CRITICAL findings first ({IDs})"87 IF open HIGH findings > 3:88 -> "Recommendation: Fix HIGH findings, then continue"89 ELSE IF areas open:90 -> "Recommendation: Next areas ({area names})"91 ELSE:92 -> "Recommendation: Fix remaining findings"93 ```943. If areas open -> process next 2 areas954. If all areas done -> next 5 findings by priority965. **Load fix templates** (from `fix-templates.md`) where applicable976. Ask user: Follow recommendation? Choose different? Skip?987. Implement fixes -> verify -> update state99100---101102## Mode 3: `/astro-audit status` — Progress1031041. Read `.astro-audit-state.json`1052. Display table: Done/Open/Total per area + severity1063. Next recommended action107108---109110## Mode 4: `/astro-audit refresh` — Check New Releases1111121. `npm view astro versions --json` -> latest version1132. If newer version than in state: context7 or WebSearch for release notes1143. **Show checklist delta:**115 ```116 Last checked: 6.0.0-beta.11117 Current: 6.0.0-beta.15118 New changes: 4 (2 Breaking, 2 Features)119 -> Checklist update recommended120 ```1214. Inform user + recommendation (update yes/no, breaking changes)1225. Update `versions/*/changelog.md` if needed (date stamp at end)1236. When stable release detected -> automatically recommend `v6-stable/` checklist124125---126127## Mode 5: `/astro-audit auto` — Autonomous Run128129Fully autonomous Astro audit without prompts.130131### Flow1321331. Auto-detection as in `start`1342. **All areas** processed (no 2-area limitation)1353. Document findings with fix templates from `fix-templates.md`1364. **Context management:** When context runs low:137 - Write state immediately138 - Create task in `.tasks.json` with handoff note139 - "New session with `/astro-audit continue`"1405. At end: Summary with prioritized fix list141142### Severity Order of Areas in Auto Mode143144CRITICAL areas first:145`ENV -> CFG -> CODE -> COLL -> ADPT -> VITE -> ZOD -> DCI -> MDLK -> IMG -> CSP -> TOOL -> FONT -> NEW`146147---148149## Check Priorities + Completeness Tracking150151> See `_shared/audit-patterns.md` (MUST/SHOULD/CAN markers, completeness counting, layer status standard).152Area with <100% MUST checks cannot be marked as `done`.153154---155156## State File `.astro-audit-state.json`157158Save in project root (gitignored).159160```json161{162 "version": 2,163 "created": "YYYY-MM-DD",164 "lastUpdated": "YYYY-MM-DD",165 "project": "Project Name",166 "installedAstroVersion": "5.17.2",167 "targetAstroVersion": "6.0.0-beta.11",168 "checklist": "v6-beta",169 "nodeVersion": "22.12.0",170 "adapter": "@astrojs/node",171 "output": "server",172 "areas": {173 "ENV": {174 "status": "pending",175 "session": null,176 "findingsCount": 0,177 "completeness": null,178 "layers": { "source": "pending", "runtime": "pending" }179 },180 "CFG": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },181 "CODE": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },182 "COLL": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },183 "ADPT": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },184 "MDLK": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },185 "IMG": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },186 "TOOL": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },187 "VITE": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },188 "ZOD": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },189 "NEW": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },190 "CSP": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },191 "FONT": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null },192 "DCI": { "status": "pending", "session": null, "findingsCount": 0, "completeness": null, "layers": null }193 },194 "summary": {195 "total": 0,196 "critical": 0,197 "high": 0,198 "medium": 0,199 "low": 0,200 "fixed": 0,201 "skipped": 0202 },203 "findings": [204 {205 "id": "MIG-01",206 "area": "ENV",207 "severity": "CRITICAL",208 "title": "Short title",209 "description": "What is the problem",210 "location": "File or area",211 "status": "open|fixed|skipped",212 "fixedIn": "Session N | null",213 "notes": ""214 }215 ],216 "history": [217 {218 "date": "YYYY-MM-DD",219 "session": 1,220 "areas": ["ENV", "CFG"],221 "findingsAdded": 3,222 "findingsFixed": 0223 }224 ]225}226```227228### State Migration v1 -> v2229230When a `.astro-audit-state.json` with `"version": 1` is found:2312321. Migrate `areas` from string enum to object:233 - `"done"` -> `{ "status": "done", "session": null, "findingsCount": 0, "completeness": null, "layers": null }`234 - `"in-progress"` -> `{ "status": "in-progress", ... }`235 - `"pending"` -> `{ "status": "pending", ... }`236 - `"skipped"` -> `{ "status": "skipped", ... }`237 - Count `findingsCount` from `findings[]` array (per area)2382. Add `history: []` array2393. Add `"notes": ""` to each finding (if not present)2404. Set `version` to `2`2415. Inform user: "State migrated from v1 to v2 (completeness tracking, history, layer status)."242243---244245## Rules246247- **Context protection:** Max 2 areas OR 5 fixes per session. At limit: save state, recommend `/astro-audit continue`.248- **Write state immediately:** Update `.astro-audit-state.json` after every area and every fix.249- **No auto-fix:** Document findings, then ask user whether to fix.250- **Read version files:** Only read files from the relevant `versions/` directory. Don't load all.251- **Severity rules:**252 - CRITICAL: Build breaks, runtime errors, security issues253 - HIGH: Deprecation warning, functional limitation254 - MEDIUM: Best practice deviation, performance255 - LOW: Optional, nice-to-have, new features256- **Finding prefix:** Always `MIG-NN` (Migration), not CODE/SEC like /audit.257- **Fix templates:** Load matching template from `fix-templates.md` for findings.258- **npm view:** Run `npm view astro` before any version statement. Never from memory.259- **context7:** Use for Astro documentation when available.260261---262263## Session Strategy264265| Session | Content | Context Protection |266|---------|---------|-------------------|267| 1 | start -> Detection + 2 areas (CRITICAL first) | Max 2 areas |268| 2 | continue -> next 2 areas | Max 2 areas |269| 3+ | continue -> Fixes (max 5/session) | Fix -> Test -> Next |270271---272273## Smart Next Steps274275After completing the Astro audit, recommend relevant follow-up skills:276277| Condition | Recommendation | Reason |278|-----------|---------------|--------|279| No .audit-state.json present | `/audit start` | Check website quality (SEO, a11y, performance, privacy) |280| No .project-audit-state.json present | `/project-audit start` | Check code/CI/CD quality |281| Migration findings fixed | `/lighthouse-quick` | Verify performance after migration |282| UI/Design work needed | `/design-system` | Curated palettes, fonts, styles, UX rules (CSV databases) |283| Frontend polish desired | `/polish scan` | Rate 6 design dimensions, then improve |284| All areas done | `/lesson-learned session` | Extract learnings from migration |285286**Design Integration:** When building or modifying UI components in Astro projects, always consult `/design-system` first. It provides industry-matched palettes, font pairings, UX rules, and wow effects from curated CSV databases. The design-system is stack-agnostic — it provides design decisions, Astro provides the code patterns.287288**Output after last area:** "Next steps:" + 2-3 most relevant recommendations.289290---291292## Version Directory Structure293294Each directory under `versions/` contains:295296| File | Content |297|------|---------|298| `checklist.md` | Checkpoints with IDs, severity, description |299| `changelog.md` | Release notes (only for Beta/Major) |300| `reference-links.md` | Official docs links, PR links |301302Currently available:303- `versions/v5-stable/` — Best practices for Astro 5.x304- `versions/v6-beta/` — Migration Astro 5->6 (74 checkpoints, definitive migration guide)305- `versions/v6-stable/` — Best practices for Astro 6.x Stable (28 checkpoints)306- `versions/v7/` — (still empty, for future use)307308Additionally:309- `fix-templates.md` — Quick-fix templates for common Astro findings