# WeChat AI Direction

Primary **capability expansion** for Lampo: align MoonBit Skyline apps with
WeChat Mini Program **AI development mode (beta)** so business logic can be
exposed as agent-callable skills — without changing the product slogan
**MoonBit for WeChat MiniApp Skyline**.

This document is direction and mapping only. SKILL / `agent` / `mcp.json`
codegen is **not implemented** in the current `0.1.0` snapshot.

## Official landscape (sources)

| Topic                      | What WeChat documents                                                                                                                                      | Source                                                                                                                                                  |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AI development mode (beta) | Package MiniApp business as **atomic APIs / atomic components** inside a **`SKILL`**, invoked by Mini Program AI via a MiniApp-oriented MCP-style protocol | [Guide](https://developers.weixin.qq.com/miniprogram/dev/ai/guide), [Integration](https://developers.weixin.qq.com/miniprogram/dev/ai/integration.html) |
| SKILL package              | `SKILL.md` (flow) + `mcp.json` (JSON Schema) + API/component implementations; often in a subpackage; declared under `app.json` → `agent.skills`            | Integration doc                                                                                                                                         |
| Ecosystem access modes     | **Auto mode** (authorize source read at review; platform interprets pages) and **Developer mode** (custom skills; evaluation/review). Modes can coexist    | WeChat open-platform AI access guidance; last reviewed for this snapshot on 2026-07-10                                                                  |
| Tooling examples           | Nightly DevTools “Mini Program AI compile”; CloudBase **mp-skills** helpers                                                                                | [mp-skills](https://docs.cloudbase.net/mp-skill/)                                                                                                       |
| Status                     | Capability is still **beta / limited review**; do not claim full consumer rollout                                                                          | Official beta notices on the AI guide                                                                                                                   |

Industry narratives (“dialog is fulfillment”, AI as a super entry) explain _why_
skills matter. Lampo documents only what can be grounded in authoring and
generation — not unverified traffic claims.

## Why Lampo fits

Lampo already centers **testable business state machines** and **auditable host
command boundaries**. WeChat AI developer mode needs **model-selectable atomic
capabilities and schemas**. The expansion is to _expose_ that boundary to AI,
not to rebuild a UI framework.

| WeChat AI surface                       | Lampo strength today                                                                                                                  |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| Intent → selectable capability          | Elm `Model` / `Msg` / `update` / typed commands                                                                                       |
| `mcp.json` input/output schemas         | Typed capability facade, phases, diagnostics culture (`docs/miniapp_capability_adapter_spec.md`, `docs/miniapp_host_capabilities.md`) |
| Failure / refusal as structured facts   | Capability pending/success/failure/unavailable phases; reviewable command batches                                                     |
| Atomic UI cards / handoff back to pages | Generated Skyline pages + JS bridge (`setData`, lifecycle, events)                                                                    |
| Auto mode (parse pages)                 | Stable, reviewable generated WXML/JSON/bridge shapes                                                                                  |
| Payment / session / secrets             | Documented backend-required boundaries — more important when an agent may order                                                       |

## What Lampo will pursue next (not in this snapshot)

1. Skill contract draft aligned with the capability adapter acceptance path
2. Generate `mcp.json` / `SKILL.md` drafts from MoonBit capability metadata
3. Optional `app.json` `agent.skills` + subpackage layout in generators
4. Probe `handoff` / `wx.onAgentHandoff` against the existing page bridge
5. Read-only query skill fake-host tests before any payment fulfillment skill

## Non-goals for this direction doc

- No claim that auto mode “zero code” is Lampo’s primary value
- No frontend ownership of session exchange or payment signing
- No obligatory CloudBase-only stack; mp-skills is one ecosystem path
- No implication that SKILL codegen already ships in `0.1.0`

## Related

- Final positioning: `docs/positioning.md`
- Capability facade: `docs/miniapp_host_capabilities.md`
- Adapter promotion: `docs/miniapp_capability_adapter_spec.md`
