composable-mini-apps
它能做什么
这项技能指导在共享工作区中设计小型应用的方式,每个应用只有一个明确的职责。它说明何时某个应用应调用同级应用,何时应使用自身的操作。适合希望构建模块化工作区应用的构建者。
适用场景
- ✓当你在决定某项功能应该成为新的小型应用,还是现有应用的一部分的时候。
- ✓当某项任务可能需要工作区中另一个应用所拥有的数据或能力的时候。
- ✓当两个工作流共享一个辅助函数,你需要决定它放在哪里的时候。
技能链接
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/composable-mini-apps/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“发票提醒功能应该是我工作区中的一个独立小型应用,还是账单应用的一部分?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体让每个应用只承担一项职责,并拥有自己的操作名称和凭据。只有在用户请求,或任务需要另一个应用独有的功能时,它才会调用该应用。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Composable Mini-Apps
Rule
Prefer many one-job apps in a workspace over one oversized app. A headless app can own a provider, dataset, workflow, or specialist action surface without a full UI. This architecture does not make every task a cross-app task: use the current app's actions by default. Call a peer only when the user asks or the outcome requires data, credentials, or a capability only that peer can provide. A peer's availability or ability to enrich the result is not enough. The app that owns an artifact remains responsible for authoring and editing it.
Shape
- Give each mini-app one clear job, a concise
package.jsondescription, and action names that describe the job it owns. - Keep provider credentials and upstream API details in the app that owns that provider or workflow. When a task needs its peer-exclusive data, credentials, or capability, delegate that bounded work instead of copying integration code.
- Use a tiny status/config screen only when users need to inspect state. A pure headless app is fine when its job is invoked by agents, automations, or sibling apps.
- If two workflows only share a helper, put the helper in
packages/shared; keep the workflow actions in separate apps.
Discovery And Invocation
The main agent should discover available siblings before assuming capability:
- Runtime agents receive an
<available-apps>block built fromdiscoverAgents(). Workspace siblings are layered in bydiscoverWorkspaceAgents(). It carries one line per app — enough to know a sibling exists, not enough to know what it can do. - Use the built-in
describe-workspace-appstool for actual capability. It reads each peer's live/.well-known/agent-card.jsonand returns its purpose plus any optional stable machine contracts; passapp: "<id>"for one peer's full description. Use it only when the requested outcome depends on peer-exclusive data or capability and you cannot tell which peer owns it or whether a known peer can provide it, or when the user asks which app can do the job. - Never hand-maintain a markdown or code list of what each workspace app does.
A stale catalog is worse than none: it reads as authoritative while pointing
at capabilities that moved or vanished. An app's purpose belongs in its own
package.jsondescription(which flows into the workspace manifest and the<available-apps>block), and its capabilities belong in its exposed actions — both of whichdescribe-workspace-appsreads live. - UI shells, headless surfaces, and scripts can read the same registry through
GET /_agent-native/agents?selfAppId=<app-id>. - Code or CLI callers should use the first-class message-based A2A invocation
path (
invokeAgent()/agent-native invoke) when they need to ask an app by id, name, or URL. - In the agent loop, use
call-agentwith the sibling app id only when the requested outcome depends on peer-exclusive data or capability, or the user explicitly asks you to involve that app. A sibling's availability or ability to enrich the result is not enough. Never call the current app throughcall-agent; use local actions instead. - Send a natural-language objective by default so the sibling can apply its own
instructions, skills, schemas, data dictionary, credentials, and tools.
invokeAgentAction()orcall-agentwithaction+inputis only for an explicit stable semantic read contract whose complete input is already known. Never expose or call an implementation action as a workaround for slow or failed message delegation.
Send narrow prompts to siblings: name the exact question, relevant ids, date ranges, and expected output shape. Preserve returned ids and URLs verbatim.
Artifact Handoff
Mini-apps should hand off compact artifacts, not giant pasted transcripts or provider dumps. When a mini-app creates something another app may use, return or store an artifact with:
artifactType- what kind of output this is, such asdeal-set,call-evidence,brief,dashboard, orreport.artifactId- the stable app-owned id, file path, or resource id.createdAt- an ISO timestamp.source- provider/app/source ids used to create it.summary- a short human-readable explanation.itemsorrecords- the bounded structured data downstream apps need.links- fully qualified URLs for user-visible artifacts.
Downstream apps should receive artifact ids, URLs, and narrow foll
常见问题
每项任务都需要跨应用调用吗?
不需要。技能说明默认使用当前应用的操作。
共享的辅助函数应该放在哪里?
技能建议将被多个应用使用的辅助函数放在共享的 packages 文件夹中。
应用可以是无界面的吗?
可以。无界面应用可以为智能体或其他应用运行任务,而无需自己的界面。
详情
作者的原始描述
Build focused workspace apps and cross-app workflows, using A2A only when a task needs a peer-owned capability. Use when designing mini-app boundaries.
repo: BuilderIO/agent-native
热度
- GitHub 星标
- 7.6k
- 排名
- #13147
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …