perf-audit
Skill6 starsChanged 28 days agoMITView on GitHub
Static analysis (N+1 patterns, missing cache identities, expensive plugins) with optional runtime inspection (indexer status, cache hit rates, slow queries, queue backlog). - Static-first. Default pass uses only the source tree — no runtime, no Magento CLI required. - Runtime is opt-in. Phase 3 runs only when the user passes --runtime. - Severity by impact at scale. A 50ms ViewModel call in a non-storefront context is Low; an N+1 query in checkout is High. - Concrete recommendation. Every finding includes…
We split this skill into the rules it gives an agent
6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Static-first: Default pass uses only the source tree — no runtime, no Magento CLI required.
- Distinctive: line 25
Concrete recommendation: Every finding includes the specific replacement pattern, not "improve performance."
- Distinctive: line 62
Only if user authorizes AND Magento CLI is present:
- Very specific: line 83
If BLACKFIRE_* env vars or ~/.blackfire.ini present:
- Very specific: line 182
Default: auto — agents when the plugin's context-budget hook reports this conversation above its threshold, inline otherwise.
- Very specific: line 192
Use the shared five-point scale (context/references/severity.md) with the performance-specific calibration anchors, the storefront-vs-admin …
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Magento 2 Performance Audit
Static analysis (N+1 patterns, missing cache identities, expensive plugins) with optional runtime inspection (indexer status, cache hit rates, slow queries, queue backlog).
Core Rules
- Static-first. Default pass uses only the source tree — no runtime, no Magento CLI required.
- Runtime is opt-in. Phase 3 runs only when the user passes
--runtime. - Severity by impact at scale. A 50ms ViewModel call in a non-storefront context is Low; an N+1 query in checkout is High.
- Concrete recommendation. Every finding includes the specific replacement pattern, not "improve performance."
- JSON + SARIF. Same shape as
review.
Workflow
Phase 0 — Context Resolution
Invoke context. Note presence of Magento CLI, Redis CLI, DB CLI, Blackfire.
Phase 1 — Scope
- Single module → static analysis only by default; runtime opt-in.
- Multiple modules → static analysis across all; runtime opt-in.
- Site-wide → static across all custom modules + runtime checks.
Phase 2 — Static Pass
Per references/perf-checklist.md:
| Check | Pattern |
| N+1 in foreach | Repository / Factory call inside loop body |
| Full-collection load | getCollection() without addFieldToFilter / setPageSize |
| Expensive constructor work | DB / HTTP / external call in __construct |
| Missing cache identity | Block subclass without getIdentities() |
| Missing cache lifetime | Block subclass without getCacheLifetime() |
around plugin on hot path | Catalog / Quote / Order method intercepted |
| Synchronous external HTTP in storefront | Curl / Client in Block, ViewModel, Resolver |
| Cron job without batch | foreach ($collection as $item) in cron with no setPageSize |
| Queue consumer without batch | Single-message processing pattern |
Plugin without sortOrder | Order-sensitive plugin chain |
Run via ${CLAUDE_SKILL_DIR}/scripts/static-perf.sh <module-path>.
Phase 3 — Runtime Pass (Opt-in)
Only if user authorizes AND Magento CLI is present:
| Check | Command |
| Indexer status | {magento_cli} indexer:status |
| Indexer mode | {magento_cli} indexer:show-mode |
| Pending cron | DB query on cron_schedule |
| Queue backlog | {magento_cli} queue:consumers:list + RabbitMQ stats |
| Cache type status | {magento_cli} cache:status |
| Slow queries | MySQL slow log — resolve the path via SHOW VARIABLES LIKE 'slow_query_log_file'; only when slow_query_log is ON |
| Redis hit rate | redis-cli INFO stats |
| Varnish status | Curl headers |
${CLAUDE_SKILL_DIR}/scripts/runtime-checks.sh automates the tool-based probes (indexer,
cache, queue, Redis) and emits them as findings. The DB (pending cron), slow-log, and
Varnish rows are run manually when their source is reachable — the script does not emit a
slow_query finding, so do not claim a slow-query result unless the slow log was actually
read.
Phase 4 — Optional: Blackfire / Tideways Integration
If BLACKFIRE_* env vars or ~/.blackfire.ini present:
- Prompt user to run a profiled URL.
- Parse Blackfire profile JSON.
- Surface top 10 hotspots with file:line references.
Phase 5 — Report
Two automation artifacts and one LLM deliverable:
- JSON + SARIF (automated).
${CLAUDE_SKILL_DIR}/scripts/build-findings.shaggregatesstatic-perf.sh(always) andruntime-checks.sh(whenINCLUDE_RUNTIME=1), invokes the shared emitter withOUTPUT_KIND=performance, and writes both.jsonand.sarif. Markdown summary (LLM deliverable, NOT automated). Written by the skill in the conversation, ranked by impact, with concrete recommendations. Sample:
### High — Catalog\Block\Category::getProducts() N+1 on store frontend Impact: Each category page render triggers 1+N queries (N = product count). Evidence: src/app/code/Acme/Catalog/Block/Category.php:47 Recommendation: Use addAttributeToSelect(['name','price']) before iteration; or use the CollectionProcessor pattern. Verification: Re-render the page with debug toolbar; query count should drop from 1+N to 1.
Builder invocation (for reference; callers normally just run the skill):
TARGET_MODULE=<Vendor_Module|site> TARGET_PATH=<path> SCOPE=module \
SCAN_ROOT={ctx.magento_root}/app/code INCLUDE_RUNTIME=0 \
DOCS_ROOT="${DOCS_ROOT_ARG:-.docs}" \
bash ${CLAUDE_SKILL_DIR}/scripts/build-findings.shwhere DOCS_ROOT_ARG is the resolved --docs-root value (empty ⇒ default .docs).
Inputs
/perf-audit [--runtime] [--scope=module|site] [--docs-root=<path>] [<Vendor>_<Module>...]Flags:
--runtime— opt in to runtime checks (Phase 3, 4)--scope=site— audit all custom modules + runtime--format=markdown|json|sarif— output format--docs-root=<path>— output-root override; see "Output Root" below
Outputs
Module scope (basename uses the underscore module name, e.g. Acme_OrderExport):
{output_root}/audits/{Vendor}_{Module}-perf-{date}.json # automation artifact (build-findings.sh)
{output_root}/audits/{Vendor}_{Module}-perf-{date}.sarif # automation artifact (build-findings.sh)
{output_root}/audits/{Vendor}_{Module}-perf-{date}.md # LLM deliverable, written in Phase 5Site scope:
{output_root}/audits/perf-{scope}-{date}.json
{output_root}/audits/perf-{scope}-{date}.sarif
{output_root}/audits/perf-{scope}-{date}.md{output_root} (.docs by default, {ctx.docs_root}) is anchored at the project root,
never under {ctx.magento_root}, app/code, or a module dir. See the Artifact location
rule in context/SKILL.md and the --docs-root/DOCS_ROOT recipe in
context/references/artifact-layout.md.
Output root (--docs-root)
This skill accepts --docs-root=<path> (see
context/references/artifact-layout.md). When set, run the emitter with
DOCS_ROOT=<path> so artifacts land under <path>/audits/; otherwise they default
to {ctx.docs_root}/audits/. Orchestrators such as feature
pass this to collect a run's artifacts under one folder.
Reference Files
references/perf-checklist.md— full static-check catalogue.references/n-plus-one-patterns.md— known N+1 patterns + remediation.references/caching-rules.md— identity, lifetime, tag rules.references/indexer-health.md— indexer mode interpretation.references/queue-health.md— backlog thresholds, dead-letter handling.references/blackfire-integration.md— Blackfire profile parsing.references/severity-perf.md— severity calibration anchored to shared scale.
Scripts
${CLAUDE_SKILL_DIR}/scripts/static-perf.sh— static pattern scan over module sources.${CLAUDE_SKILL_DIR}/scripts/runtime-checks.sh— bin/magento + redis-cli + mysql probes.${CLAUDE_SKILL_DIR}/scripts/build-findings.sh— aggregate scanner output; emit JSON + SARIF via the sharedcontext/scripts/emit-findings.shpipeline. Structurally identical tosecurity/scripts/build-findings.sh.context/references/findings-schema.md— JSON findings-document structure the emitted.jsonconforms to (outputKind=performance).
Execution Mode
Default: auto — agents when the plugin's context-budget hook reports this conversation
above its threshold, inline otherwise. In agents mode (--agents flag, or execution_mode in
.claude/m2.json surfaced as {ctx.execution_mode} — selection contract in
context/references/execution-modes.md) the judgement
passes of this skill are dispatched to the read-only reviewer agent with a performance/operations
dimension brief, and this skill owns synthesis. The scripted scanners
(scripts/build-findings.sh) are deterministic and run identically in both modes.
Severity
Use the shared five-point scale (context/references/severity.md) with the
performance-specific calibration anchors, the storefront-vs-admin bias, and the
profile-backed severity bands in references/severity-perf.md.
Acceptance Criteria
- Runs without Magento CLI; produces static report only.
- Runtime checks gracefully degrade when tools are missing.
- Top-10 findings are actionable with
file:line+ recommendation. - JSON output usable in CI for trend detection.
Related Skills
| Phase | Skill |
| 0 | context |
| (none for findings — output is the deliverable) |
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- eric-cielo/moflo★ 18same name
- helderberto/agent-skills★ 17same name
- rcelebrone/DotAgents★ 15same name
- gonimar/claude-web-studio★ 4same name
- kelgirechandrakant-cpu/vibe-coding-playbook★ 4same name
- CodeWithBehnam/cc-docs★ 2same name
- Asno-dev/apex★ 1same name
- cystema/skills★ 1same name
- PeterStanchev/ps-claude-skills★ 1same name
- SONGYEONGSIN/vibe-flow★ 1same name
4 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use security-audit and code-review.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CloudflareSkillsecurity-audit
Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.
Also in 4 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 4 projects that use this
In this repository35 other files it gives its agents.
- a11y-auditSkill
- admin-formSkill
- admin-listingSkill
- auditSkill
- breeze-adaptSkill
- breeze-compatSkill
- breeze-themeSkill
- cli-commandSkill
- contextSkill
- data-migrationSkill
- debugSkill
- deploySkill
- docsSkill
- eav-attributeSkill
- extension-pointSkill
- featureSkill
- fixSkill
- frontendSkill
- graphqlSkill
- i18nSkill
- indexerSkill
- lintSkill
- marketplaceSkill
- message-queueSkill
- module-createSkill
- releaseSkill
- remediateSkill
- reviewSkill
- securitySkill
- system-configSkill
- test-generateSkill
- triageSkill
- upgradeSkill
- webapiSkill
- widgetSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

