From hatch3r
Profiles application performance against budgets and optimizes hot paths. Use when investigating performance issues or auditing budgets.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hatch3r:hatch3r-perf-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Note:** Commands below use `npm` as an example. Substitute with your project's package manager (`yarn`, `pnpm`, `bun`) or build tool when your project uses a different package manager.
Note: Commands below use
npmas an example. Substitute with your project's package manager (yarn,pnpm,bun) or build tool when your project uses a different package manager.
Task Progress:
- [ ] Step 0: Detect ambiguity (P8 B1)
- [ ] Step 1: Read performance budgets from rules and specs
- [ ] Step 2: Profile — bundle size, runtime, memory
- [ ] Step 3: Identify violations — which budgets exceeded, which hot paths slow
- [ ] Step 4: Plan optimizations — code splitting, lazy loading, memoization, etc.
- [ ] Step 5: Implement optimizations with before/after measurements
- [ ] Step 6: Verify all budgets met, no regressions
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per agents/shared/user-question-protocol.md. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: target surface (frontend bundle vs backend cold start vs DB query), budget threshold values, profiling environment (local vs CI vs production), regression policy (revert vs ship-and-monitor), and whether optimization is allowed to introduce new deps.
Fan-out scales with task size; token cost never justifies serializing independent work (rules/hatch3r-fan-out-discipline.md P8 B2; agents/shared/efficiency-patterns.md). Emit sub_agents_spawned: { count, rationale } in your output.
Load the project's performance budgets from project rules and quality documentation:
Bundle size:
npm run build. Inspect output for gzipped sizes.vite-bundle-visualizer, rollup-plugin-visualizer, or webpack-bundle-analyzer (or build tool equivalent) to identify large chunks and dependencies.Runtime (frontend):
browser_profile_start/browser_profile_stop for CPU profiling with call stacks.Memory:
Backend/API:
Check monitoring for cold start and warm execution times.
Instrument key paths.
For external library docs and current best practices, follow the project's tooling hierarchy.
Common strategies:
Code splitting: Route-based or component-based. Lazy-load panels, modals, non-critical features.
Lazy loading: defineAsyncComponent, dynamic import() for heavy components.
Memoization: computed, memo for expensive derivations. Avoid unnecessary re-renders.
Reduce re-renders: v-show over v-if for frequently toggled. shallowRef where appropriate.
Bundle: Remove unused deps, replace heavy libs with lighter alternatives, tree-shake.
Images/assets: Optimize, lazy-load, use appropriate formats.
Database: Reduce reads (batch, cache, denormalize).
Cloud/API: Warm-up strategies, reduce cold starts.
Check project ADRs for constraints. Verify optimizations do not violate privacy/security invariants documented in the ADRs.
For external library docs and current best practices, follow the project's tooling hierarchy.
platform in .hatch3r/hatch.json for PR vs MR terminology).prefers-reduced-motion — do not add animations that ignore it.${HATCH3R:VERIFY_GATE_ALL}
npm run build
The gate line is resolved to the project's language-aware command set at sync time (fallback when detection is unknown: npm run lint && npm run typecheck && npm run test); the build line is illustrative — substitute the project's build command.
You MUST spawn these agents via the Task tool (subagent_type: "generalPurpose") at the appropriate points:
hatch3r-performance (CQ7) — MUST spawn to perform autonomous performance profiling and optimization (CWV, p95/p99, bundle-size, N+1, hot-path analysis). Provide the target areas, budget thresholds, and baseline measurements.hatch3r-performance-budgets — reference this rule for the project's defined performance budget thresholdshatch3r-performance-budgets rule as a baseline. Note in the report that custom budgets should be defined.performance.now() or console.time) for critical paths. Document the measurement method used.npx claudepluginhub hatch3r/hatch3r --plugin hatch3rGuides performance measurement and optimization workflows using Core Web Vitals targets. Use when profiling reveals bottlenecks or when load time budgets exist.
Guides performance profiling for web applications: Core Web Vitals, bundle analysis, runtime optimization, and common bottlenecks.
Validates web app performance metrics—page loads, bundle sizes, API responses—against budgets to detect regressions.