/htmx-php-builder:os-applicationfrom htmx-php-builder
Builds a new application that integrates with the MaluDB Business OS kernel from the first commit, handling auth, configuration, deployment paths, and MCP integration.
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.
None: SKILL.md is the whole skill.
The MaluDB Business OS is a kernel: it manages the AI agents, the super-admins, the company's directory and
single sign-on, and runs no business application. Applications from us (HR, Projects, Help Desk, Cidery, …) are
separate Apache/PHP/HTMX applications built with THIS plugin, installed beside the kernel by its installer, signed in
by the kernel, and reached by its agents through MCP. The contract is the maludb-os-integration plugin
(github.com/maludb/maludb-os-integration: skills os-integration, os-adopt, os-install). This skill is the short
list of what to do differently while building so that nothing needs adopting afterwards. Where the two plugins
disagree, maludb-os-integration wins — it is the kernel's word.
OS_ENABLED (the os-adopt shape); an OS-only application has no login
at all.cidery): the DNS label <key>.<domain>, the install path /srv/apps/<key>, the database
<tenant>_<key>, the roles <key>_rw, <key>_records_ro, <key>_activity_ro.none (one business), location (per site), department./srv/apps/*/db/*.sql) before
the memory model is final; every table is read (another application's data, through the kernel), reuse (the
canonical definition verbatim) or new (maludb-os-integration, shared-schema.md).| Where | Standalone habit | OS application |
|---|---|---|
| Configuration | config/application.php + config/local.php; services.env for Python | config/.env read by PHP (env()) and Python alike — the kernel's installer writes it (DB_*, MCP_*_PORT, APP_INTERNAL_PORT, ACTION_TOKEN_KEY, ACTIONS_RELAY_KEY, OS_*, MALUDB_*). Keep application.php for defaults; map env keys onto it. |
| Root | /var/www, web root /var/www/html | /srv/apps/<key>, web root /srv/apps/<key>/html; every unit and vhost in deploy/ is a template with {{APP_DIR}}, {{APP_FQDN}}, {{APP_INTERNAL_PORT}}, {{MCP_RECORDS_PORT}}, {{MCP_ACTIVITY_PORT}} |
| Schema (Phase 1) | designed from the domain alone | designed against the estate: a table a sibling application already has is reused verbatim (same name, columns, types; extend by appending only); data another application owns is read through the kernel's K7, never copied; a new table is the last resort and becomes canonical. The definition still lives in THIS repository's db/*.sql — installations differ in which applications they hold, and the installer creates every table from here (shared-schema.md, with the catalogue of canonical tables) |
| Database | one database per client, an operator registry, provision-client.sh | one database per tenant (the installer creates it and the three roles, runs db/*.sql in order as postgres). If the schema needs more (files as the app role, an extension's memory schema, a seed row), ship an idempotent deploy/os-provision.sh and name it database.provision |
| Identity (Phase 2) | php-session-auth: password + TOTP + Google, invitations, reset, a users admin | No login form. /sso receives the kernel's hand-off (verify two signatures, TTL, audience, single-use nonce), mirrors the member (members, department_members with the kernel's ids — or, standalone-too, users.os_member_id), opens the app's own hardened session; /sso/logout ends the member's sessions; a directory sync every minute; people and roles are never created in the application. Copy the receivers from php-sign-on-kit.md. |
| Shell (Phase 2) | the theme's header | The application switcher in header-right before the dark-mode toggle: the Helpdesk button and the dropdown of every application the person may open, from the kernel's GET /api/v1/apps/mine.php (design-system components.md "Header: the application switcher"; app/switcher.php + shared/app-switcher.php from examples/php/app-switcher/). Standalone it renders nothing. |
| Roles | users.role, one value | the kernel grants a set: members.roles text[] (or users.os_roles); gates ask for a right (app_has_right('pay.write')), the catalogue lives in the database and is published by app_roles |
| Activity log | receipt_posted, sources screen/command_bar/ama/mcp/system, in-database memory | entity.verb (receipt.post), sources incl. agent, request_id honoured from X-Request-Id, agent_run_id; shipped to the tenant's one MaluDB through its API with "application": "<key>" first in the payload, checkpointed in activity_ingest_state |
| Action manifest (Phase 1) | 6 columns for the app's own actions server | the kernel's 8 columns (Action · File · Params · Undo · Confirm · Agent approval · Log · Who) and a bin/build_action_registry.php → mcp/action_registry.json; an endpoint with a path parameter is written /vessels/{vessel}/status (the kernel resolves and substitutes); deploy/kernel-registry-<key>.json names a find_<entity> resolver per entity |
| Handlers | HTMX only | HTMX and JSON mode: emit_action_status(true, ['id' => …, 'location' => "/x/$id"]) on success, emit_action_status(false, ['errors' => …]) on refusal; the tenant's X-Action-Token (+ X-Action-Relay for an agent) stands in for the session and CSRF; source = 'agent' under a run token. An existing HTMX-only application gets the shim instead (os-adopt, htmx-php-builder-profile.md) |
| MCP servers (Phase 4) | two read servers with named bearer tokens | the same two, plus: the kernel's token (kernel.…) admitted to app_roles alone; an agent's run token admitted to exactly the tools the kernel's run-facts call names for this endpoint (fail closed when the kernel is unreachable); a person's action token; find_<entity> resolvers answering {"rows": [...]}. Copy db.py + server_common.py from the kernel when on mcp 1.x; the 2.x adapter is Cidery's services/common/os_kernel.py |
| The assistant (Phase 4) | one Agent SDK service holding ANTHROPIC_API_KEY; a localhost actions server | none of it beside the kernel. The command bar posts the utterance to the kernel's chat endpoint as the acting person; the kernel runs the application's expert with the application's tools; the kernel's actions server executes the registry. A standalone-too product keeps its own service for OS_ENABLED=0 only. The application never holds a model key. |
| Registration | — | maludb-os.json at the root from Phase 1 (schema maludb-os.application/1): catalog_key, vhost, database, env, services, endpoints, actions, skills, sso, directory, assistant, agents[] (the expert first, with its tool grants and skills), approvals[]; os/expert.md; skills/<name>/SKILL.md (a runbook says kind: runbook); /api/v1/health |
| Install | README steps by hand | `sudo php /var/www/bin/app_install.php plan |
A development ACTION_TOKEN_KEY, bin/dev_handoff.php (a hand-off signed the kernel's way) and bin/dev_directory.json
(claims and a feed in the kernel's schema; directory_sync.php --from-file) prove sign-on, replay refusal, the audience
check, roles, sign-out and revocation on any server (testing-without-a-kernel.md). The installer replaces the key at
install.
OS_ENABLED is on in a standalone-too product.\i of its files, no reference into its database, no look at its install path).config/.env; nothing that differs per tenant is a constant in code or in deploy/.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
os-integration, maludb, business-os, application-scaffolding
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./malumail-sendSend transactional email through the MaluMail API (api.malumail.com) and integrate MaluMail sending into an application. Use when an app needs to send email programmatically — welcome/verification/receipt/notification/password-reset messages, alerts, or any outbound mail — through MaluMail; when wiring up MaluMail sending; when managing a MaluMail suppression list; or when debugging MaluMail send failures (401/403/429/502, verified sending domains, API keys, Bearer auth). Triggers on "send email via MaluMail", "MaluMail API", "api.malumail.com", "transactional email", "suppression list"./mcp-serversDesign and build the two MCP servers every application ships — the record-memory server over PostgreSQL 17 and the activity-memory server over MaluDB — in Python with FastMCP, exposed to the app's AMA agent and to clients' own AI tools. Use during Phase 1 (tool-surface design) and when implementing, deploying, or extending an application's MCP servers./memory-first-planningBackground context for planning or brainstorming a new application or SaaS product — memory-first design, the ask-me-anything view of applications, SaaS Plus+ data sovereignty, and the default technical stack (PostgreSQL 17 + MaluDB, Apache/PHP/Bootstrap 5.3/HTMX). Provides answers and direction, not a workflow to run./new-appStart building a new HTMX + PHP + Bootstrap 5.3 application. Use when the user says "new app", "start a new application", "build an app", "begin the project", or invokes /new-app. Enforces the fixed build order — full database + memory design first, then authentication + app shell, then vertical feature slices — on the standard stack (Ubuntu 24.04, PostgreSQL 17 + MaluDB, Apache, PHP, HTMX).Other plugins' skills for the same job