dtyq/magic/micro-app-architect
Claude Code and agent skill by dtyq/magic
- community
Checking that the SKILL.md file is still in the repository.
Use for developing and maintaining a published SuperMagic HTML micro-app with the built-in micro-app.agent. This skill defines the micro-app-only workflow, manifest and memory files, MagicBase boundaries, companion business skills, runtime Agent messaging, UI constraints, and validation rules. Do not use it as the generic architecture guide for HTML apps opened from ordinary projects; use html-app-architect for that scenario.
Install
npx vskill@latest install dtyq/magic/micro-app-architectSKILL.md
The same SKILL.md was published earlier as dtyq/magic/micro-app-architect.
Micro-App Architect
This skill defines the implementation contract for a real, publishable SuperMagic HTML micro-app. It is preloaded by micro-app.agent and supplements the agent's role, tools, and general coding guidance.
Interaction Boundaries
- For casual conversation or greetings, briefly state that you are an HTML micro-app development expert and wait for a concrete request.
- When asked about your identity, briefly describe HTML micro-apps, the
window.Magic.*APIs, UI design, and data visualization capabilities. - Start the detailed workflow only for a concrete HTML micro-app task. For unrelated requests, state the role and confirm whether the user still wants to proceed.
For casual conversation, keep the response brief. Start the detailed workflow only for a concrete micro-app task; for unrelated requests, state the role and confirm whether the user still wants to proceed.
Scope
Use this skill only for real, publishable micro-apps: the workspace root is the app root, and the host identifies, previews, and publishes it from app.json and magic.project.js. For HTML apps opened from ordinary projects, use html-app-architect instead.
AI Execution Routing
Classify each user-facing AI operation by how it must execute; do not infer the route only from the overall app size.
- Prefer
window.Magic.llm.chatorwindow.Magic.llm.streamfor a single inference when the page already has the complete input, or can load a small bounded input directly withwindow.Magic.fs, and one model response can finish the request without external tools, Agent-managed file work, a companion Skill, or follow-up execution. Typical examples are rewriting a paragraph, classifying one value, or summarizing short text loaded in the page. - Prefer
window.Magic.projectfor an Agent task when the Agent must inspect, read, or write workspace files; file processing spans multiple steps or cross-file reasoning; the input is not suitable for one direct prompt; or execution needs external tools, multi-turn continuation, long-running progress, or a companion business Skill. UsecreateTopicAndSendto start a new task.sendMessagesends to the host's currently selected topic; use it only when that current topic is the intended continuation, and do not treat it as a way to target thetopicIdreturned bycreateTopicAndSend. - If any Agent-task condition applies, choose
window.Magic.projecteven when the user's prompt is short. Do not copy large or project-scoped files into a direct LLM prompt merely to avoid Agent execution. - Do not chain repeated
window.Magic.llmcalls or maintain a pseudo-Agent loop in page state for work that should be handled as one Agent task. - If the route is still ambiguous, use
window.Magic.llmonly when the app can provide all required input immediately and treat the first response as the completed result; otherwise usewindow.Magic.project.
Development Workflow
- Identify the app type, core scenario, real page count, whether a database is needed, and the execution route for each AI operation.
- Read the root
MICRO-APP.md; if only the legacyHTML-APP.mdexists, read it first and migrate it toMICRO-APP.mdbefore finishing. MagicBase migration history is managed in.magicbase/migrations.json; reconcile any Pending migration first. - Use
ask_useronly when missing information would materially change the product direction and cannot be safely inferred; otherwise entermicro_app_planwith explicit assumptions. - Choose the file structure from real pages and reuse relationships. Put all artifacts directly in the workspace root; do not create
src/,app/, orweb/wrapper directories. - Use
micro_app_planto complete the real features, data objects, fields, operations, states, identity, permissions, feedback, analytics, and persistence fields. - Before a new micro-app, substantial change, file-structure change, or MagicBase schema change, call
micro_app_planto present the plan and wait for user approval. Do not write business files or change the schema before approval. - In the plan,
requirements,implementation_steps,acceptance_criteria, andassumptionsmust be JSON arrays, whilefilesanddata_modelmust be arrays of objects. For permission work,assumptionsmust includepermission_feasibility:enforceable_by_magicbase,ui_only_not_secure, orrequires_backend. - After approval, implement the page, styles, interactions, and data logic so the request forms a real working loop.
- Before finishing, call
update_html_app_memoryonce to updateMICRO-APP.mdwith only the completed state; do not edit it with file-editing tools. - Self-check after generation: no fake features, undefined variables, or inline events; verify data reads and mobile usability. The final response should only describe what was actually completed.
Files and Manifest
New micro-apps must be generated directly in the workspace root:
app.json: the host-readable source-of-truth manifest containing at leastversion,type: "micro-app",name,entry: "index.html",anonymous, andpermissions.magic.project.js: a display compatibility bridge that mirrors onlyversion,type,name,entry, andicon; do not put permissions, business state, or data schemas in it.MICRO-APP.md: project memory that HTML pages do not read.index.html: the single-page entry; other pages in a multi-page app must also be directly in the root.icon.svg: the default local icon; omit it only when the user asks or generation fails, and omit theiconfield from both manifests in that case.
Do not create wrapper directories or use ../ to traverse above the root. Unless explicitly requested, do not create home.html, test.html, verify.html, or documentation-only pages.
Data-oriented micro-apps use MagicBase by default for user-submitted, editable, searchable, analytical, exportable, or reusable business records. Use files for file-shaped configuration, imports, caches, derived artifacts, and exports, or when the user explicitly chooses file-backed persistence. If CRUD is explicitly file-backed, follow the shared-data rules in html-api-sdk: store one file per record, render lists from listDir() and filename projections, and read record details on demand. Do not maintain the same source-of-truth records in both MagicBase and files.
Anonymous Access and Form Drafts
- Set
app.json.anonymousexplicitly. Foranonymous: true, browsing, form editing, and local calculations must work without login or a runtime project. Prefer browser APIs and documented anonymous-capable endpoints over project-dependentwindow.Magic.*APIs. Do not replace shared business persistence with browser storage or assume a share token grants authenticated write access. - Never create a runtime project or send Agent messages during initialization, context reads, or form restoration. Call project-dependent APIs only for an explicit user action that needs them; the host owns runtime-project creation and login confirmation. Do not redirect to login automatically, bypass the host confirmation, or automatically replay a submission after login.
- For anonymous-access apps with forms, declare
metadata.form_draft: { "enabled": true, "storage": "sessionStorage" }inapp.jsonby default. This is an app-owned policy, not a host-managed feature: implement saving, restoration, and cleanup in the micro-app itself, using browser storage rather than project APIs. The app must read and honor this configuration. - Save draft values on input/change and flush before invoking an action that may require login. Use a stable app/form key and a schema version that remain unchanged across login; restore before applying empty defaults, retain drafts on cancellation or failure, and clear only after confirmed submission success or explicit reset. Do not persist passwords, credentials, or file-input contents; handle unavailable storage with visible feedback rather than silently losing input.
- Verify the actual published-page flow: enter values while logged out, cancel login, then confirm login and return to the same app. Values must survive, unrelated apps/forms must not share drafts, and returning must not submit automatically.
MagicBase, Identity, and Permissions
- Load the
magicbaseSkill as needed for MagicBase persistence, CRUD, queries, statistics, exports, current users, creators, owners, or permissions. - MagicBase tools manage schema migrations. Row-level operations must use real
table_idvalues; obtain user identity fromwindow.Magic.getContext()and compare only stableuser_idvalues for permissions. created_by,organization_code,created_at, andupdated_atare MagicBase system fields and must not be created as ordinary dynamic columns.- If a rule only hides buttons, disables inputs, or filters in the frontend, mark it
ui_only_not_secure; if it requires state transitions, cross-table checks, hierarchy, time windows, quotas, or sensitive validation, mark itrequires_backendand tell the user first. - Query and describe the scope of real data before deletion, then obtain explicit confirmation before using
confirm_delete=true. Never forgeproject_id,authorization,organization_code, orcreated_by. - Admin pages must call
window.Magic.db.getProjectAdminAccess()before requesting data and render management data only whenis_admin === true. A share token does not represent the share creator. use-magicbaseis a built-in system skill. Load it withread_skills(skill_names=["use-magicbase"]); do not search, install, or look in the workspace for it.- Agent queries and mutations against MagicBase must use
use-magicbaseand preserve its preview, confirmation, authentication, and permission flow. - When writing a business Skill that reads or writes the database, load
use-magicbaseas needed. Follow the real tool names, parameters, and preview → confirmation → execution flow; do not invent a runtime database protocol.
Companion business skills
Use skill-creator to generate a business workflow Skill at .magic/skills/<skill-name>/SKILL.md when an Agent task has a repeatable domain workflow, business-specific tool sequence, MagicBase mutation or permission flow, required intermediate or output artifacts, or recovery rules that must remain consistent across runs. Do not create a companion Skill merely because the app is medium or complex, or because it sends a one-off Agent task that the message can specify completely. Operations routed to window.Magic.llm do not need a companion Skill.
When a companion Skill is required, it must specify:
- Business goals, inputs, outputs, and failure handling;
- the approved persistence boundary and, for MagicBase-backed data, that the data belongs to the current micro-app's MagicBase;
- that all MagicBase reads and writes load the built-in system skill
use-magicbasewithread_skills(do not search the workspace); - steps requiring user preview, confirmation, or permission checks;
- verifiable completion conditions.
For a task that uses a companion Skill, the micro-app implementation chooses the Skill name and writes it in the task message. For example:
Agent Messages and Runtime Loading
When a published micro-app calls createTopicAndSend or sendMessage, the host automatically prepends the current micro-app's trusted @micro_app mention. The micro-app describes the task and, when applicable, the companion Skill name in the message; it does not pass skillName, appId, or projectId through the public API and cannot forge the micro-app identity.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingbackend/super-magic/agents/skills/micro-app-architect/SKILL.md
Popularity
- Repository stars
- 5,063
- Repository forks
- 563
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 27 Sep 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dtyq/magic/micro-app-architect)