Audit Analyzer
Context
Automates detection and prioritization of audit-related issues across the workspace. Scans documentation and code for performance, accessibility, and monitoring signals; outputs actionable improvements and small, safe patches. Triggers on phrases like "Analyze audit errors" or "Audit analysis".
Instructions
- Discover audit signals across the workspace
- Scan for common audit signals: Lighthouse performance hints (LCP, FID, CLS), Lighthouse scores, caching headers, accessibility hints (aria-labels, alt text), error monitoring (Sentry, uptime), and common deployment concerns (CI/CD, rollback, smoke tests).
- Identify files and sections referencing these signals.
- Classify and prioritize improvements
- Group findings into categories: Performance, Accessibility, Monitoring/Errors, Build/Deployment.
- Score items by impact vs effort to get 80/20 high-leverage fixes.
- Propose concrete patches (small, safe changes)
- For each high-priority item, provide a minimal patch snippet and the target file path.
- Include a short rationale and a quick test step.
- Output format
- Return a compact plan with: Category, File, Patch Snippet, Why it helps, and Test steps.
- Apply or stage changes
- Suggest applying changes directly or creating a patch file for review.
- Do not push to remote; leave review to user.
- Optional: Create a new SKILL.md on success
- If user approves, codify this as a new skill under /workspace/skills/audit-analyzer/SKILL.md
Constraints
- Do not perform destructive operations without explicit user approval.
- Focus on small, incremental changes that are safe and testable.
- Do not modify tests unless explicitly requested.
- Output only actionable patches and plan summaries.
Examples
Example 1: Missing Sentry integration
- Category: Monitoring/Errors
- File: src/main.jsx
- Patch:
+import * as Sentry from '@sentry/react';
+Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 0.1 });
- Why it helps: enables error tracking and alerting; Test: ensure Sentry captures an error in a test route.
Example 2: Large hero image causing slow LCP
- Category: Performance
- File: src/components/Hero.jsx
- Patch:
+<img src={hero} alt="Hero" loading="lazy" />
- Why it helps: reduces LCP; Test: Lighthouse shows improved LCP after patch.
Example 3: Missing alt text hurting accessibility
- Category: Accessibility
- File: src/components/Image.jsx
- Patch:
+<img src={logo} alt="Company logo" />
- Why it helps: improves accessibility score; Test: axe or Lighthouse shows improved accessibility.
1---2name: audit-analyzer3description: Automates detection and prioritization of audit-related issues across the workspace. Scans for performance, accessibility, and monitoring signals. Use when analyzing audit errors or requesting actionable improvement patches.4---56# Audit Analyzer78## Context910Automates detection and prioritization of audit-related issues across the workspace. Scans documentation and code for performance, accessibility, and monitoring signals; outputs actionable improvements and small, safe patches. Triggers on phrases like "Analyze audit errors" or "Audit analysis".1112---1314## Instructions15161) Discover audit signals across the workspace17- Scan for common audit signals: Lighthouse performance hints (LCP, FID, CLS), Lighthouse scores, caching headers, accessibility hints (aria-labels, alt text), error monitoring (Sentry, uptime), and common deployment concerns (CI/CD, rollback, smoke tests).18- Identify files and sections referencing these signals.19202) Classify and prioritize improvements21- Group findings into categories: Performance, Accessibility, Monitoring/Errors, Build/Deployment.22- Score items by impact vs effort to get 80/20 high-leverage fixes.23243) Propose concrete patches (small, safe changes)25- For each high-priority item, provide a minimal patch snippet and the target file path.26- Include a short rationale and a quick test step.27284) Output format29- Return a compact plan with: Category, File, Patch Snippet, Why it helps, and Test steps.30315) Apply or stage changes32- Suggest applying changes directly or creating a patch file for review.33- Do not push to remote; leave review to user.34356) Optional: Create a new SKILL.md on success36- If user approves, codify this as a new skill under /workspace/skills/audit-analyzer/SKILL.md3738---3940## Constraints4142- Do not perform destructive operations without explicit user approval.43- Focus on small, incremental changes that are safe and testable.44- Do not modify tests unless explicitly requested.45- Output only actionable patches and plan summaries.4647---4849## Examples5051### Example 1: Missing Sentry integration52- Category: Monitoring/Errors53- File: src/main.jsx54- Patch:55```js56+import * as Sentry from '@sentry/react';57+Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 0.1 });58```59- Why it helps: enables error tracking and alerting; Test: ensure Sentry captures an error in a test route.6061### Example 2: Large hero image causing slow LCP62- Category: Performance63- File: src/components/Hero.jsx64- Patch:65```jsx66+<img src={hero} alt="Hero" loading="lazy" />67```68- Why it helps: reduces LCP; Test: Lighthouse shows improved LCP after patch.6970### Example 3: Missing alt text hurting accessibility71- Category: Accessibility72- File: src/components/Image.jsx73- Patch:74```jsx75+<img src={logo} alt="Company logo" />76```77- Why it helps: improves accessibility score; Test: axe or Lighthouse shows improved accessibility.