/htmx-php-builder:new-appfrom htmx-php-builder
Scaffolds a new HTMX + PHP + Bootstrap 5.3 application with a fixed build order: database/memory design, then auth/app shell, then vertical feature slices. Invoke via /new-app or phrases like 'new app'.
Ships in htmx-php-builder. 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.
Read when SKILL.md points to them.
Build every application in the same fixed order. Do not skip phases, reorder them, or start writing feature screens before Phase 2 is approved by the user. Each phase ends with a user checkpoint.
Before starting, load context from the sibling skills in this plugin:
config/.env, /srv/apps/<key>, the kernel's sign-on instead of a login form, roles as a set, the kernel's action-manifest shape and JSON-mode handlers, the MCP servers' kernel contract, the command bar through the kernel's chat endpoint, maludb-os.json. Consult in Phase 0 (decide OS application or standalone), and it changes Phases 1, 2 and 4 as its table says. The contract itself is the maludb-os-integration plugin.| Layer | Choice |
|---|---|
| OS | Ubuntu 24.04 |
| System of record | PostgreSQL 17 |
| Activity memory | MaluDB (PostgreSQL extensions), fed by application logs |
| Memory interface | Two client-facing read MCP servers per app (Python + FastMCP), per the mcp-servers skill |
| Action interface | One localhost-only actions MCP server per app (navigation + app actions), per the chat-actions skill |
| Assistant | OS application: the kernel runs the application's expert (the command bar posts to the kernel's chat endpoint; no model key in the app). Standalone: one unified Claude Agent SDK service (Python) — AMA answers, chat actions, navigation |
| Web server | Apache (also reverse-proxies the MCP servers and, standalone, the AMA service); an OS application lives at /srv/apps/<key> behind deploy/ templates the kernel's installer renders |
| Application | PHP (vanilla, per php-patterns skill) |
| UI | Bootstrap 5.3 per the design-system skill |
| Interactivity | HTMX partial updates |
Node.js is the documented alternative for the MCP/agent layers; default to Python, one runtime per project.
Plan the application with the user using the memory-first-planning skill: decide what the application remembers before what it does. Deliverables:
Checkpoint: user approves the memory model and feature order.
Design the complete database up front — every table for every planned feature, not just the first slice.
Survey the estate before designing a table (OS application; maludb-os-integration's shared-schema.md). The
applications of the Business OS share one data model across their separate databases. List every table the sibling
applications already have (/srv/apps/*/db/*.sql on the build server, or the maludb-os-<key> repositories) and
decide each planned table against them: read — another application owns the data (HR's employment, the
ledger's parties, Help Desk's tickets …), so hold at most its id and reach it through the kernel's K7 read, never a
copy; reuse — the same concept and your own rows (attachments, notes, notifications, sequences, billing
documents …), so copy the canonical definition verbatim into your own db/ file and extend only by appending;
new — nothing is close, and yours becomes the canonical table. The definition always lives in this application's
own migrations: installations differ in which applications they hold, and the installer creates every table from
this repository alone.
db/ (e.g. db/001_auth.sql, db/002_core.sql, …) targeting PostgreSQL 17. The auth schema always includes the Google-identity and TOTP-2FA structures from the php-session-auth skill's references (auth_identities, nullable password_hash, totp_* columns, recovery codes) — they ship in every app even if a project enables the features later.bigint generated always as identity primary keys unless the user specifies otherwise. Every table in the design document carries its provenance — read: <app>.<tool>, reuse: <app>/db/NNN_x.sql (+ appended columns) or new (why nothing fit) — and a reused table keeps the canonical name, columns and types exactly.Action · File · Params · Undo · Confirm · Agent approval · Log · Who), a path parameter is written by its entity's name (/vessels/{vessel}/status), and bin/build_action_registry.php produces mcp/action_registry.json.maludb-os.json (OS application): catalog key, vhost label, database roles, env keys, services, endpoints, the roles catalogue in the schema (app_rights, app_roles, app_role_rights), the expert's job description and tool grants. The kernel's installer will install from it; writing it now keeps the design honest.Checkpoint: user approves the full schema (every table's provenance stated: read, reuse or new), the MCP tool surface, and the action manifest before any PHP is written.
Goal: at the end of this phase the application looks and feels exactly like the finished product, with working login, even though it has no features yet.
/sso and /sso/logout from php-sign-on-kit.md, the directory mirror and its one-minute sync, the per-request guard, /api/v1/health, and deploy/ templates; prove it with bin/dev_handoff.php (os-application). Standalone product only: build session auth (register, login, logout, reset) in vanilla PHP following the php-session-auth skill — all of its non-negotiables apply. The login page offers email/password and "Sign in with Google" (server-side OIDC per references/google-signin.md); authenticator-app 2FA (per references/totp-2fa.md) ships with its enrollment settings page and login challenge page. CSRF is wired for HTMX from the first shell render (meta tag + htmx:configRequest listener). Reset and verification emails go through the malumail-send skill's malumail_send() helper. Auth pages use the design-system minimal auth layout; login/logout/2FA are full page navigations, never swaps.#assistant-bar, per chat-actions, with Send shown only while the bar is in use) wired to a stub handler so the surface exists from the first screen. Ship the shell's form guard script and the shared page-header partial that marks form headers page-header-form (design-system) now, so every slice's forms get the pinned Save and the unsaved-changes prompt for free. Ship the application switcher now (design-system components.md "Header: the application switcher": app/switcher.php, shared/app-switcher.php in header-right — the Helpdesk button and the dropdown of the person's applications from the kernel's feed; nothing standalone). Ship the record picker now too (design-system references/record-picker.md: the #record-picker modal in the layout, record-picker.js, app/picker.php, an empty app/pickers.php, html/pick/index.php, shared/picker-rows.php) — every slice's forms choose records through it.Checkpoint: user reviews the running shell (desktop and mobile) and confirms the look and feel before Phase 3.
Build one feature at a time, end-to-end, in the order fixed in Phase 0. Each slice includes:
Checkpoint per slice: demo the feature, then move to the next.
navigate + per-action tools calling the app's own endpoints with signed action tokens, undo support.app_roles) and agents' run tokens (os-application). Standalone product: build the unified assistant — one Claude Agent SDK service (Python) with all three MCP servers, per references/ama-implementation.md and chat-actions: the AMA page for full conversations, the command bar on every screen for voice actions and navigation. The agent reads memories and performs actions only through MCP.The workflow spends judgment once, up front, on the most capable model available, and hands the repetitive majority to cheaper worker models building against specs. Tier by class (specific models change; the classes don't):
| Work | Model class | Current defaults |
|---|---|---|
| Phases 0–1: planning, schema, MCP tool surface, action manifest, slice build specs | Planning-class (most capable available) | Fable / Opus |
| Phase 2: auth + shell | Planning-class — security judgment and one-time wiring | Opus |
| Phase 3, first slice (the exemplar) | Planning-class | Opus |
| Phase 3, remaining slices | Worker-class | Sonnet by default; Haiku for strictly templated slices |
| Phase 4: MCP servers + unified assistant | Planning-class | Opus |
| Per-slice conformance review | Planning-class at low effort — reviewing a diff costs far less than generating it | Opus/Sonnet |
Four rules make worker-built slices safe:
{entity} slice exactly like the {exemplar} slice, per its build spec." Small models replicate patterns far more reliably than they apply pattern documentation.hx-push-url="true" — every hx-push-url value is an explicit canonical URL.modal usage in the slice (the shell's #record-picker is the one modal); hx-confirm appears only on destructive controls<select> whose options are a table with a list screen: those fields are record pickers under the field's old name and id, each with a source in app/pickers.php over the feature's find_*() query (design-system record-picker.md)stretch / stretch-full classes on cards{entity}-list-*, {entity}-form-field-*, {entity}-row-{id}-*); no duplicates in any composed DOMrequire_post() + verify_csrf() + authorization check + log_activity()e(); prepared statements for values; allowlists for SQL identifiersPDO as first parameter and never touch request/responsepage-header-form with data-form = its form id (via the shared page-header partial); no Save button outside the page header.modal for anything that shows or collects data. Create/edit/detail are dedicated full pages loaded via HTMX; quick edits may expand inline; offcanvas drawers only for filters/quick views and full-width on mobile. Confirmations are exempt: hx-confirm guards destructive actions.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub maludb/maludb-os-htmx-php-guidelines --plugin htmx-php-builder10 skills in this plugin
/chat-actionsThe voice-first chat command bar that ships on every screen of every application — natural language in (typically dictated via a tool like Wispr Flow), application actions and navigation out, powered by an LLM router activating MCP tools. Use when building or extending the assistant command bar, the actions MCP server, the action manifest, chat-driven navigation, or voice-to-data capture./design-systemThe mandatory UI design system for applications built with this plugin — Bootstrap 5.3 admin template (nxl theme) with fixed layout, component patterns, and mobile-first rules. Use before generating or editing ANY page, screen, partial, or HTML in an application built with this plugin, and when the user mentions look and feel, styling, layout, or UI consistency./Other plugins' skills for the same job