/grav-skills:grav-plugin-reviewfrom grav-skills
Reviews third-party Grav 2.0/Admin2 plugins for compatibility and security, covering API contracts, auth, injection, XSS, path traversal, and other vulnerability classes. Produces file:line-referenced handoffs.
Ships in grav-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this when vetting a third-party Grav 2.0 plugin for compatibility and security, typically a GPM [add-resource] submission on getgrav/grav. It encodes the review method, the verified Admin2/API contract to check against, and a findings taxonomy drawn from real reviews so you can be fast and concrete rather than generic.
The deliverable is usually a paste-ready, file:line-referenced handoff (for the maintainer or for another agent to action), not a vague prose summary. Be specific, tag severity, and credit correct practices so they don't get "fixed."
git clone --depth 1 <repo>). Note the actual default-branch version may be ahead of the version named in the issue; check blueprints.yaml version and the latest comments for hotfix releases.find . -type f -not -path './.git/*' | sort and wc -l the PHP/JS. Identify the entry plugin class, the classes/, the admin-next/ web components, public assets, and blueprints.yaml.user/accounts/*.yaml or config, file-upload handlers, and the client JS that renders untrusted data.user/plugins/ and live at ~/Projects/grav/grav-plugin-api, ~/Projects/grav/grav-plugin-admin2, ~/Projects/grav/grav-plugin-admin. Verify event names, controller signatures, and route mechanics there (see Contract below).Keep examples generic in any public-facing writeup (do not name the submitter). Internally, be blunt about severity.
These are confirmed against grav-plugin-api. Re-verify if the API plugin has moved on.
onApi* events that exist (fired by the api plugin): onApiRegisterRoutes, onApiCollectPublicRoutes, onApiSidebarItems, onApiPluginPageInfo, onApiAdminSettingsPanels, onApiFloatingWidgets, onApiMenubarItems, onApiContextPanels, onApiGenerateReports, onApiBlueprintResolved, onApiDashboardWidgets, plus the onApiBefore*/*ed lifecycle pairs. If a plugin subscribes to an onApi* name not in the api plugin, it silently never fires.AbstractApiController lives at Grav\Plugin\Api\Controllers\AbstractApiController. Constructor is (Grav $grav, Config $config) with promoted readonly props. The router instantiates handlers as new $controllerClass($this->container, $this->config), so $this->grav is the container and $this->grav['user'] is available. Route params arrive on the route_params request attribute (already rawurldecoded).requirePermission($request, 'api.access') checks api.access first, then the named permission. Custom permissions register via PermissionsRegisterEvent + a permissions.yaml (PermissionsReader::fromYaml).onApiCollectPublicRoutes exposes $event['prefixes'] (matched by str_starts_with) and $event['exact'] (exact match). Anything a plugin adds here is unauthenticated. Adding a whole prefix (e.g. /api/v1/<plugin>) makes every sub-route public. Auth-required routes simply must not appear here.RateLimitMiddleware after the auth bypass), but it limits request rate, not per-record growth or quota burn.onApiPluginPageInfo returns a definition with page_type: 'component'; admin2 loads admin-next/pages/{slug}.js, which must customElements.define('grav-{slug}--page', ...) and read window.__GRAV_PAGE_TAG. page_type: 'blueprint' renders a YAML form with data_endpoint/save_endpoint/actions.onApiAdminSettingsPanels panels usually set data_endpoint/save_endpoint to the generic /config/plugins/<slug>. That endpoint returns the raw plugin config to the browser (gated on api.config.read). So any secret stored in plugin config (API tokens, shared keys) is sent to the admin client unless the field is write-only and redacted server-side. A custom controller that masks the secret is bypassed if the panel points at the generic endpoint.X-API-Token (FPM/FastCGI strips Authorization on some hosts). window.__GRAV_API_TOKEN / __GRAV_API_SERVER_URL / __GRAV_API_PREFIX.window.__GRAV_DIALOGS.confirm(), never window.confirm/alert/prompt.Each item: what to look for, and the fix. Severity is a starting point, adjust to context.
compatibility.grav lies. A block of ['1.7','2.0'] while the code uses PHP 8 functions (str_contains, str_starts_with, str_ends_with, match, enums, readonly promoted props) cannot run on Grav 1.7 / PHP 7.x. Set compatibility.grav: ['2.0'].grav >=2.0.0 + admin2 + api but blueprints.yaml lists only grav >=1.7.0 (or omits admin2/api). GPM reads blueprints.yaml, so fix it there.blueprints.yaml (e.g. bugs:/docs: twice) silently take the last value. Dedupe.0.1.0-alpha) while blueprints.yaml is further along.text. API tokens / keys as type: text should be type: password, and must be redacted on every read path (see settings-panel vector above).class_exists-gated event subscription. getSubscribedEvents() that only subscribes to onApi* events when class_exists(ApiRouteCollector::class) is fragile: it depends on plugin load order at registration time. Prefer subscribing unconditionally and guarding inside handlers (the events only fire when the api plugin is present anyway).isAdmin()-gated subscription in onPluginsInitialized. A plugin that does if ($this->isAdmin()) { $this->enable(['onGetPageTemplates' => ...]) } (or onGetPageBlueprints) registers nothing under Admin2. The classic admin set $grav['admin'] early so isAdmin() was true at init; the api plugin's AdminProxy sets it only at route dispatch, after onPluginsInitialized has run, so the gated enable() never fires and the plugin's page template/blueprint is silently missing from the Add Page dropdown. Tell: the handler is a context-free $types->register(...). Fix: subscribe statically in getSubscribedEvents(); if a handler truly needs admin context, check isAdmin() inside the handler (dispatch time), not at subscription time. A theme that ships a same-named template file masks the bug, so don't rely on the dropdown looking right on one site.require_once everywhere works but is brittle; a proper autoload() returning a PSR-4 ClassLoader is the idiom (and fixes "Class not found" boot failures on case-sensitive Linux/cPanel).exit; in the page lifecycle. Frontend fallback handlers that exit bypass Grav's shutdown/caching. Acceptable for virtual routes by design, but note it, and watch for contradictions (a hard api dependency plus a "no api" fallback path that can never run).$this->grav['user'] but the bridge controller never passes the api-authenticated user through, authenticated actions may silently run as anonymous. Confirm the user is wired (some plugins use a setApiUser() pattern).grav-{slug}--page, file at admin-next/pages/{slug}.js, and page_type.api.access means any API-enabled user (not just admins) can reach PII reads and writes. Register a dedicated permission or require a higher scope for sensitive actions.=, +, -, @, tab, or CR, fed by public input, executes in Excel/Sheets when an admin opens it. Prefix risky cells with '.name placed into mail()'s subject after only trim(): an embedded CRLF injects headers. Strip line breaks. Also flag hardcoded From: on a foreign domain (fails SPF, looks like spam).esc() that omits " (or ') while values land in href="..."/src="..." attributes (attribute breakout); SVG uploads served same-origin (script-bearing); a markdown link builder that does not enforce an http(s) scheme (allows javascript:).readfile()s a path built from a user/admin-settable field (e.g. a free-text "cover path") with no realpath() confinement, and no extension allowlist, becomes an unauthenticated arbitrary-file read (account YAML, config secrets). Confine to the intended media dir, allowlist image extensions, store only the uploaded basename.finfo MIME, not just client extension; do not allow svg in an "image" upload (or serve with Content-Disposition: attachment); force the destination filename so a user can only overwrite their own asset.user/accounts/*.yaml could let a member set access.admin.super. The safe pattern whitelists fields and binds the edit to the session user (username == session). A grant routine whose switch only ever writes access.site.* cannot escalate, credit that.handle() that does set_time_limit(0) and a sleep() loop holds one PHP-FPM worker per connected client for the whole window; a few dozen tabs starve the pool and the whole site stalls. Often it is also dead in the supported config (the api bridge returns 501 and the client falls back to polling), making the "realtime SSE" claim false. Recommend owning the polling model, or offloading push to an external hub (Mercure, as grav-plugin-sync-mercure does). PHP must never hold a request open to stream.type: system/form lets guests forge official-looking notices; restrict privileged message types to mod/internal paths. Check for a reserved-name guard that stops guests impersonating members/mods, credit it when present.?modKey=..., GET) lands in access logs, history, and Referer. Move to a POST body or header. Credit hash_equals() for key comparison when present.plugins.login.redirect_after_login, messenger groups) on every request, affecting the whole site, is surprising. Scope it or respect existing config.priority 100000) interception of a public route means it can never be a real Grav page, and bypasses Grav caching/headers. By design for virtual routes, but note it.From:/footer/upsell URLs on the author's domains, demo data referencing the author's brand, theme/category names tied to the author, optional wire-ins to the author's other unlisted plugins. For a "general-purpose" listing, the generic version must be the default. Flag this separately as a decision for the maintainer.Produce a handoff the maintainer can read and another agent can action:
file:line reference and a concrete fix. Order security before manifest before quality.Scale effort to the ask: a quick "any red flags?" gets the top 3, a "thorough audit" gets the full taxonomy with the good-practices credits.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
9 skills in this plugin
/grav-2-migrationUse when migrating an existing Grav 1.7/1.8 site to Grav 2.0 by hand — the agent-driven equivalent of what the `migrate-grav` plugin's wizard does, for sites where core is swapped in place (git checkout, deploy pipeline, rsync) rather than staged in a subdirectory and promoted. Covers the whole sequence: preflight and a restore point, swapping core, bringing plugins/themes to their 2.0 releases and replacing classic `admin` with `admin2` + `api`, translating classic `admin.*` account and group permissions into the `api.*` set 2.0 actually enforces (including the `api.access` gate no 1.x permission corresponds to), reopening the `security.twig_content` gates and seeding `security.twig_sandbox` allowlists from the site's own content, `system.images.url_actions`, the GFM `tagfilter`, and verifying the result. Trigger when the user says "migrate this site to Grav 2", "upgrade my 1.7 site to 2.0", asks to do what migrate-grav does without running the plugin, or asks why Twig in content, image resizing, raw HTML, or a user's permissions broke after moving to Grav 2.0./grav-admin-ui-polishUse when reviewing, auditing or polishing the admin UI of a Grav 2.0 plugin that renders inside Admin Next (admin2) — a plugin page in component mode, an add-on section, a dashboard widget, a custom field, or a blueprint settings form. Covers the review method (walk both themes plus a tablet width via the same-origin iframe trick, read-only, demo rows injected client-side when the seed is empty, then one code-side consistency pass against the host's own tokens), the ten design rules that repeat across every view (status registry instead of raw enums, the zero-value rule, one primary per screen with destructive neutral at rest, one entry point per row with a ⋯ menu, collapsed creation forms, effective state instead of stored flags, one date and number format, counts for the whole result set, prose into `<details>`, every "see X" a link, every editor a route with a dirty guard, sub-nav groups, empty states with a CTA), host fit against Admin Next's `--background/--muted/--border/--input/--ring/--success/--warning/--destructive` custom properties and its badge/button/card/table/tabs/segmented/input conventions, the `--kc-*`-style token block and constructable-stylesheet pattern, the primitives a plugin admin needs (`status()`, `rowActions()`, `emptyState()`, `.table-scroll`, route + dirty-guard helpers, formatting helpers), the `ctx.ui` / `ctx.sheet` / `ctx.route` / `ctx.navigate` / `ctx.setTitle` contract an add-on section is handed, blueprint label and help-text rules, a twelve-item rendering-defect checklist, and the host/API limitations to plan around. Trigger when the user says "review the admin UI", "polish this plugin page", "make it feel native", "make it look premium", "bring it in line with KahunaCart", or mentions Admin Next, admin2, plugin page, kc-view, web component admin UI, blueprint labels/help, status pills, dark mode contrast, rendering defects, or a UI review of a Kahuna add-on (subscriptions, licenses, payment providers).npx claudepluginhub getgrav/grav-skills --plugin grav-skills