/prometheus-skills-mini:convert-htmx-reactfrom prometheus-skills-mini
Convert an HTMX + Alpine.js HTML artifact into a React TSX component ready for the scaffold-react-vite pipeline. Mechanical transforms run via a Node script; HTMX/Alpine constructs requiring judgment are surfaced as a sidecar markdown for review.
Ships in prometheus-skills-mini. 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.
Convert an HTMX + Alpine.js HTML artifact into a React TSX component.
artifact_type: html (input) → react (output)content_type: direct:reactreferences/domain/ui.mdThe user will provide: $ARGUMENTS
Parse the arguments for:
--source <path-to-html> (required)--feature-name <kebab-name> (required) — used to name the component (PascalCase) and the hook--output <path-to-tsx> (required)--ambiguous-sidecar <path> (optional; default <output>.ambiguous.md)--manifest <path-to-od-prototype.json> (optional) — a KnowDesign prototype manifest (htmx-alpine-prototype template). With it, routes become typed TanStack Query hooks and matching hx-* calls name the hook to use (see below).Dispatch to the orchestration script:
node scripts/convert-htmx-react.mjs \
--source "${SOURCE}" \
--feature-name "${FEATURE}" \
--output "${OUTPUT}"
The script:
parse5 (spec-conformant HTML5 parsing).class → className, for → htmlForstyle="a: b" → style={{ a: "b" }}data-*, aria-*, role, id, src, href, etc. pass through unchangedx-data="{ count: 0 }" into a named hook use<Feature>State exporting useState declarations.@click="count++" → onClick={() => setCount((v) => v + 1)}@click="x = expr" → onClick={() => setX(expr)}x-text="count" → {count} JSX childhx-* behaviors (hx-get, hx-post, hx-target, hx-swap)x-show, x-model, x-if (non-trivial Alpine constructs)Prototypes from KnowDesign's htmx-alpine-prototype template ship od-prototype.json beside the page (routes, components, Alpine state, entities, token roles). Pass it with --manifest:
<output>.api.ts: one <Entity>Item interface per entity, plus one hook per route. GET routes become useQuery (use<Entity>List, use<Entity>Detail(id)); writes become useMutation with cache invalidation (use<Entity>Create, Update, Delete, Toggle). form routes are UI-only and get no hook.hx-get/hx-post/hx-put/hx-patch/hx-delete whose method and path match a manifest route is reported as htmx-manifest in the sidecar, naming the exact hook. Unmatched hx-* calls keep the generic recommendation.Accept: application/json) under VITE_API_BASE. KnowDesign's od-axum-export server answers them with fragments today; a JSON variant is the next step.<template data-od-route> are not walked (parse5 keeps template content separate). Their actions are covered by the generated hooks, not by per-element sidecar entries.The sidecar <output>.ambiguous.md lists each region the script couldn't auto-convert with confidence. For each region:
Review each region, accept the recommendation or propose an alternative, and apply the change manually before feeding the TSX into the scaffolder. The script's job is to do 90% mechanical work and document the remaining 10% clearly — not to guess.
When the source HTMX contains Alpine x-data="{ ... }", the converter lifts
the state to React. The threshold determines the shape of the React state:
| Alpine x-data shape | React shape |
|---|---|
Single boolean field ({ open: false }, { active: true }) | Local useState hook |
Multi-field ({ count: 0, label: "idle" }) | zustand+immer store + hook adapter |
Single non-boolean field ({ count: 0 }) | zustand+immer store + hook adapter |
Rationale: per references/scaffolds/state-architecture.md, ephemeral
single-component state (e.g., dropdown open/closed) belongs in local useState;
anything that might be shared, persisted, or grow beyond a toggle belongs in
a store. The threshold catches counts, labels, and arrays at conversion time so
the scaffolder's useXxxStore routing picks them up correctly.
.html fragment or document..tsx file with a default-exported component named <PascalFeature> and (if Alpine state was present) a named hook use<PascalFeature>State.artifact_type: react
content_type: direct:react
outputs:
- path: <output>.tsx
description: Scaffolder-ready TSX with default component + optional named hook
- path: <output>.ambiguous.md
description: (only when ambiguous regions found) review-required transforms
constraints_satisfied:
- mechanical_transforms_complete
- alpine_state_lifted_to_useState
- htmx_behaviors_documented_for_review
- scaffolder_input_shape_matched
Typical flow:
HTMX artifact → convert-htmx-react → TSX → scaffold-react-vite → built Vite project
↓
(optionally) → rebrand-artifact for brand swap
scripts/convert-htmx-react.mjs — the orchestration scriptopenspec/changes/phase-3-conversion-layer/ — design rationaleWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub prometheus-ags/prometheus-skills-mini --plugin prometheus-skills-mini106 skills in this plugin
/adversarial-reviewIsolated, cross-model adversarial review of KBD artifacts and change diffs. Dispatches a fresh-context LLM judge over an OpenAI-compatible REST gateway (openai-proxy or `liter-llm api`) with an explicit mandate to find problems — the model that produced an artifact or change is never the model that reviews it. Runs as a pipeline stage inside kbd-assess/analyze/plan (artifact mode) and kbd-execute's per-change QA gate (diff mode). Findings are severity-bucketed (CRITICAL/WARNING/SUGGESTION) and the judge's own report is screened by sycophancy-correction before it is surfaced.
/agent-team-creatorCreate, revise, package, and deploy agent-team definitions with staged questions and native exports for UAR, Codex, Claude Code, Copilot, Kimi Code, MiniMax CLI, OpenCode and DeepSeek. Use for team definition and catalog lifecycle; use agent-team-manage for active runtime task state./agent-team-handoffPrepare and accept a durable handoff between agent roles or coding harnesses using task context, Git identity, evidence and memory references. Use when work must continue in another harness or agent; use agent-team-manage for ordinary same-owner task updates. Do not use for ordinary same-owner task updates (see agent-team-manage)./agent-team-manageManage an existing agent team's active task state: assign dependencies and owners, track evidence, cancel or reassign work, and reconcile KBD-linked completion. Use agent-team-creator for definition creation, versioned maintenance, native export, and UAR catalog deployment./agent-team-modelsDiscover configured models and choose explicit capability, strength and cost policies at team, role, skill and task levels. Use when selecting models or controlling an agent team budget; use agent-team-creator for role discovery. Unknown prices and capabilities remain unknown. Do not use for role selection (see agent-team-creator)./android-compose-adaptiveInstructions to make or update an app's UI so that it adapts to different Android devices including phones, tablets, foldables, laptops, desktop, TV, Auto and XR. It includes how to handle different window sizes, pointing devices (such as mouse) and text entry devices (such as keyboard) using the Compose MediaQuery API. It also covers multi-pane layouts using Navigation3 Scenes, adaptive UI components (such as buttons) with varying target sizes, and adaptive layouts (including navigation areas - nav rails and nav bars) using the Compose Grid and FlexBox APIs.