pw-admin-ui
Use when designing, structuring, or rendering HTML for ProcessWire Admin interfaces, custom Process modules, or Inputfields.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when designing, structuring, or rendering HTML for ProcessWire Admin interfaces, custom Process modules, or Inputfields.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | pw-admin-ui |
| description | Use when designing, structuring, or rendering HTML for ProcessWire Admin interfaces, custom Process modules, or Inputfields. |
| risk | safe |
| source | processwire-boost |
ProcessWire’s backend (AdminThemeUikit) uses native UIkit 3.x classes wrapped in customized CSS Custom Properties (--pw-*) that guarantee automatic Light/Dark mode adaptability and cross-module stylistic consistency.
Design system reference (source of truth): https://raw.githubusercontent.com/mxmsmnv/pw-design-system/refs/heads/main/Draft-AdminThemeUikit-DesignSystem-UIKit.html
Process module admin dashboards.Fieldtype or Inputfield modules inside the backend.These are common failure modes when an agent "tries to be helpful" without correctly following AdminThemeUikit conventions:
.pw-inputfield (collapsible settings widgets) and uk-card (dashboards) randomly, resulting in inconsistent admin UX.State payload does not belong to this component.$this->headline('') is not sufficient because AdminTheme falls back to page title.Use the rules below to prevent these.
If an agent attempts to build an admin UI without this skill, they typically rely on raw uk-card structures, hardcode standard hex colors (e.g. #ffffff or #eaeaea), or attempt to write custom media queries for dark mode. This causes severe theme breakage when the user toggles dark mode or changes the primary accent color.
ProcessWire implements color-scheme: light dark; natively via the light-dark() CSS function on the following variables. Never use explicit hex codes for backgrounds, borders, or standard text.
Use the following --pw-* variables in your CSS or style tags:
var(--pw-main-color): Primary accent color (e.g., brand red/blue).var(--pw-text-color): Neutral text (auto-adjusts light/dark).var(--pw-muted-color): Faded text or subtle borders.var(--pw-main-background): For the main page canvas.var(--pw-blocks-background): For card and form block backgrounds.var(--pw-inputs-background): For input fields and striping.var(--pw-border-color): All panel, input, and structural borders.Additional tokens that frequently matter in real UIs (from the reference):
--pw-button-background, --pw-button-color, --pw-button-hover-background, --pw-button-hover-color--pw-alert-primary, --pw-alert-warning, --pw-alert-success, --pw-alert-danger--pw-code-color, --pw-code-background--pw-button-radius, --pw-input-radiusuk-card vs .pw-inputfield (CRITICAL)Pick ONE primary container style per screen:
Use uk-card when:
Use .pw-inputfield when:
❌ Do not embed .pw-inputfield “widgets” inside cards unless you are intentionally mimicking a module config screen inside a card (rare).
.pw-inputfield)When building module config screens (not dashboards), use this exact HTML structure:
<div class="pw-inputfield">
<div class="pw-inputfield-header pw-bold">
Your Field Title <span uk-icon="icon:chevron-down;ratio:0.7" class="uk-float-right"></span>
</div>
<div class="pw-inputfield-content">
<p class="uk-text-small uk-text-muted">A description for the field goes here.</p>
<input class="uk-input" type="text" placeholder="Value...">
</div>
</div>
(Add .collapsed to the .pw-inputfield wrapper if it should be collapsed by default)
.pw-pagelist-actions)Link buttons shown near page titles or entities that behave like the ProcessWire PageTree action buttons:
<span class="pw-pagelist-actions">
<a href="#">Edit</a>
<a href="#">View</a>
</span>
When rendering the primary "Save" button for complex modules, utilize the split dropdown toggle ProcessWire provides:
<span class="pw-button-dropdown-wrap">
<button class="pw-head-button" type="submit" name="submit_save">Save</button>
<button class="pw-button-dropdown-toggle" type="button">▾</button>
</span>
Preferred (dashboards/tools): use UIkit alerts inside cards.
<div class="uk-alert uk-alert-warning" uk-alert>…</div><div class="uk-alert uk-alert-primary" uk-alert>…</div><div class="uk-alert uk-alert-success" uk-alert>…</div><div class="uk-alert uk-alert-danger" uk-alert>…</div>Preferred (config forms): pw-notes for short inline hints:
<div class="pw-notes"><strong>Note:</strong> …</div>
Ensure all standard markup uses native Uikit 3 classes:
uk-input, uk-select, uk-textarea, uk-checkbox, uk-radio<table class="uk-table uk-table-divider uk-table-small"><button class="uk-button uk-button-primary">, uk-button-secondary, uk-button-danger<span uk-icon="icon:home;ratio:1.2"></span> or <button class="uk-icon-button" uk-icon="icon:pencil"></button>AdminThemeUikit renders headline/breadcrumb from AdminThemeFramework::getHeadline() and will fallback to the page title.
✅ To hide both headline and breadcrumbs for a specific Process module, hook and replace:
<?php
declare(strict_types=1);
namespace ProcessWire;
class ProcessFoo extends Process {
public function init(): void {
parent::init();
$wire = $this->wire();
$isThis = fn() => $wire->process instanceof self;
$wire->addHookBefore('AdminThemeFramework::getHeadline', function($event) use ($isThis) {
if(!$isThis()) return;
$event->replace = true;
$event->return = '';
});
$wire->addHookBefore('AdminThemeUikit::renderBreadcrumbs', function($event) use ($isThis) {
if(!$isThis()) return;
$event->replace = true;
$event->return = '';
});
}
}
When building SPA-like Process modules:
✅ Rule 1: Navigation links should hx-get a partial endpoint and hx-push-url a friendly URL.
<a href="/admin/setup/console/?view=queue"
hx-get="/admin/setup/console/partial/?view=queue"
hx-target="#console-content"
hx-swap="innerHTML"
hx-push-url="/admin/setup/console/?view=queue">
Queue
</a>
✅ Rule 2: The partial endpoint must output RAW HTML (no admin chrome):
public function ___executePartial(): string {
/** @var Htmx $htmx */
$htmx = $this->wire()->modules->get('Htmx');
$html = $htmx->renderComponent(MyComponent::class, [...]);
header('Content-Type: text/html; charset=utf-8');
echo $html;
exit;
}
✅ Rule 3: Avoid HTMX component tampering: do not nest state-aware components inside another state-aware component during /hx/req swaps.
Instead, swap the outer shell, then hx-get the inner view content separately (or swap only inner content).
Use these as the “RED -> GREEN -> REFACTOR” checklist to verify this skill actually prevents failures.
RED (without skill): Agent mixes uk-card sections with .pw-inputfield widgets inside a dashboard page.
GREEN (with skill): Agent picks one primary container style per screen using the decision matrix.
uk-card sections..pw-inputfield sections..pw-inputfield blocks embedded in card dashboards.RED: Agent returns a string from ___executePartial() and the response contains admin masthead/breadcrumb/headline HTML.
GREEN: Partial endpoint outputs raw HTML only.
header('Content-Type: text/html; charset=utf-8'); echo $html; exit;/partial/ contains only component HTML, not full admin page markup.RED: Agent nests state-aware components inside another state-aware component and swaps outerHTML, producing:
HTMX Component Tampering Detected: State payload does not belong to this component.
GREEN: Agent avoids nesting/hydrating mismatched state payloads.
hx-get to /partial/ or only inner content is swapped.RED: Agent sets $this->headline('') but headline still renders due to AdminTheme fallback.
GREEN: Agent hooks AdminThemeFramework::getHeadline and AdminThemeUikit::renderBreadcrumbs with replace=true.
<h1 id='pw-content-title'> not present for the Process page.#fff, #333). Always use var(--pw-blocks-background), var(--pw-text-color), etc., otherwise Dark Mode breaks entirely.uk-grid, uk-flex-between, or uk-margin-top can achieve the result.@media (prefers-color-scheme: dark)). ProcessWire's built-in var(--pw-...) CSS variables handle this for you securely.uk-card layout with .pw-inputfield widget layout unless the screen is explicitly a “settings form”.pw-module-fieldtype-inputfieldpw-htmxUse when building, structuring, or refactoring native backend modules for ProcessWire using PHP 8.4 and strict typing.
Use when brainstorming or designing ProcessWire modules, templates, field schemas, or hooks to resolve ambiguity and validate architecture before implementation.
Use when creating, executing, or managing Pest tests within ProcessWire or ProcessWire modules, including Test-Driven Development (TDD) tasks.
Use when encountering any bug, test failure, blank screen of death, or unexpected behavior in ProcessWire before proposing fixes.
Use when creating or updating module documentation, package READMEs, architecture guides, or CLI command references for ProcessWire projects.
Use when creating implementation plans from approved specifications to ensure ProcessWire-native architecture, safe migration structures, and strict test-driven task execution.