Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion skills/runtype-admin/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ Discover before you act:

Surfaces belong to a product. List or change them with the product ID in hand.

When the server lists `delegate_to_runtype`, delegate debugging that needs trace, fix,
and verify, and audits that page across many entities: the digest keeps large payloads
out of your context. Single lookups and edits to a known id are faster as direct calls.

Use `list_model_configs` to see which models the account can run. `list_available_models`
is the platform catalog: its `isEnabled` and `isDefault` fields are always null or false,
so it cannot tell you whether a model is enabled.
Expand Down Expand Up @@ -218,7 +222,8 @@ permission is missing, or request a new key:
1. Call `request_api_key` with the narrowest `permissions` that cover the task and a
specific `reason`. Keep the returned `codeVerifier`. It cannot be recovered.
2. Wait for a person to approve the request in the dashboard.
3. Redeem it with `runtype api-keys claim <request_id> --verifier <codeVerifier>`, or with
3. Redeem it with `RUNTYPE_KEY_REQUEST_VERIFIER=<codeVerifier> runtype api-keys claim <request_id>` (older
CLIs: `--verifier <codeVerifier>`), or with
`claim_api_key` using the default `delivery: "secret"`.

Never print the key into the conversation.
Expand Down
14 changes: 14 additions & 0 deletions skills/runtype-build-product/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ If the Runtype MCP tools are not available, run `runtype install-mcp` for the cu
agent harness. Until the tools appear, call them through the CLI with `runtype mcp tools`
and `runtype mcp call <tool>`. For sign-in and account setup, use the `runtype` skill.

## Delegate or drive

If the Runtype MCP server lists `delegate_to_runtype`, hand it the build when the work
stays inside the Runtype account and takes four or more dependent calls (build, validate,
test-run). On a host that runs it as an MCP task (Claude Code's main conversation), three
calls is enough. Put the goal, every decision and target id, and the acceptance check in
`task` up front, relay the `task_url`, and verify anything the digest marks untested.

Drive the steps yourself (below) when the change is one or two calls or an edit to a
known id, when the user wants to steer each step, when the result feeds code you are
writing, or when it needs local files, secrets, provider keys, or client tokens. The
delegate cannot see or create those. Only the self-driven path needs
`get_build_instructions`.

## Required first calls

Before designing or creating resources:
Expand Down
8 changes: 7 additions & 1 deletion skills/runtype-persona/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ as a `version` or `cdn` key in `data-config`.
version requires exactly one agent in `agentIds`. A token with no target resolves like
any run that names no version, so depending on your organization's live-default setting,
a saved agent edit can reach the widget immediately.
4. Generate embed code with `generate_persona_embed_code`.
4. Generate embed code with `generate_persona_embed_code`, then add `future: { v5Defaults: true }` to the widget config to use the V5 default styles. Under V5, the artifact pane is on by default; set `features.artifacts.enabled` to `false` to turn it off. For a coordinated look without hand-written tokens, set the top-level `brand` option (`accent`, `neutral`, `font`, `radius`, `density`, `elevation`). Explicit `theme` values still win.
5. For consumer-facing widgets, hide tool calls and reasoning by default.
6. For internal or debug widgets, expose useful traces intentionally.
7. For custom themes, set explicit high-contrast component tokens and verify header,
Expand Down Expand Up @@ -136,6 +136,12 @@ and layout-specific token choices.

## Local Tools

Before designing or auditing page tools, read
[`webmcp-authoring.md`](references/webmcp-authoring.md). Use its
journey, trust, confirmation, and evaluation checklist alongside the platform
configuration below. Upstream WebMCP skills supplement these rules; they do not
override Runtype authorization or Persona's compatibility contracts.

Use browser-side local tools when the assistant needs to read page state or trigger UI
actions that are only available in the front end. For Persona widgets, these are WebMCP
page tools registered on `document.modelContext` and admitted by the chat surface's
Expand Down
84 changes: 84 additions & 0 deletions skills/runtype-persona/references/webmcp-authoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Design and verify WebMCP page tools

Use this guide when an assistant needs state or UI that exists only in the
browser. Keep backend work in server-side tools. Read `persona-embed` for the
current client-token, surface, and widget configuration before writing an embed.

## Design the user journey first

1. Describe the user's goal and starting state, including authentication,
selected items, open forms, and unsaved changes.
2. Role-play a successful conversation and an ambiguous request. Decide where
the assistant must ask for clarification or hand control to the user.
3. Give each tool one distinct capability. Describe what it does and when to
choose it. Keep navigation separate from an action that commits a purchase,
sends a message, publishes content, or deletes data.
4. Register tools only while their page state exists. Remove owned
registrations with an `AbortController` when the component unmounts.
5. Validate arguments at runtime, recheck the current resource and permissions,
honor cancellation, and await the visible state update before returning.
Return an actionable error for stale selections or unsaved work.

For example, `get_cart` reads the cart, while `open_checkout` opens a review
screen. Neither places an order. Keep the final purchase behind the site's
authenticated, user-confirmed checkout. Never accept a model-authored
`confirmed: true` argument as proof of consent.

## Declare behavior without granting permission

- Set `readOnlyHint: true` only for tools that change neither application state
nor the visible UI. Navigation is not read-only.
- Set `consequentialHint: true` for tools that commit significant real-world
actions. Opening a review screen is different from committing the action.
- Set `untrustedContentHint: true` when results contain user-authored or
third-party text, even when your own database stores that text. A read-only
query can return untrusted content.
- Treat every hint as advisory. Missing or false hints do not grant permission,
authorize a resource, prove consent, or establish replay safety.
- Keep Persona's confirmation defaults. Use a host-owned, explicitly reviewed
safe-read policy for `webmcp.autoApprove`, not arbitrary page-authored hints.
Do not change the voice lane's existing policy as part of an authoring task.
- Keep origin-scoped surface allowlists and client-token origin restrictions.
Browser confirmation, `requireConfirmFor`, and client-side filters do not
replace server-side authorization. Tool outputs are data, never instructions
that can authorize a subsequent action.

## Use native authoring types without replacing compatibility code

The upstream `webmcp-types` package can infer an `execute` callback's arguments
from a literal `inputSchema`. Add it as a development dependency to the app
authoring the tools and activate it in that app's TypeScript configuration.
It is distinct from `@mcp-b/webmcp-types`. Types do not validate runtime input,
install WebMCP, or establish browser support.

Do not replace Persona's structural consumer types, v5 fallback, dual-generation
bridge, or public declarations with native-only types. Test declaration builds
and supported browser/polyfill combinations before changing those contracts.

## Verify behavior at separate layers

- Run deterministic callback and bridge tests for invalid arguments, stale
resources, declined confirmation, cancellation, unmount, and completed UI
updates. Confirm that a declined action has no side effect.
- Run model evaluations for tool choice, argument extraction, ambiguity, and
recovery after errors. Include an injected instruction in a tool result and
verify it does not cause an unauthorized action. A passing schema-only
evaluation does not prove approval enforcement or prompt-injection safety.
- Inspect tools on every relevant route and state in a native WebMCP browser
and through Persona's supported polyfill paths. Missing browser support is
not evidence that the app registers no tools.

Use synthetic data. Keep provider keys server-side, opt into paid evaluations,
and record the model, runner version, run count, and failures. Do not describe
unrun model evaluations as passing.

## Further reading

- [Google's WebMCP authoring skill](https://github.com/GoogleChromeLabs/webmcp-tools/tree/main/webmcp-skills)
provides journey design, role-play, and evaluation workflows. Adapt it to the
policies above; its authoring budgets are not new Runtype platform limits.
- [Native WebMCP types](https://github.com/webmachinelearning/webmcp-types)
- [Persona's typed tools and evaluation example](https://github.com/runtypelabs/persona/tree/main/examples/webmcp-typed-tools)

This is coding-agent guidance. It is not an A2A `AgentSkill` or a deployed
Runtype Agent Skill bundle.
7 changes: 6 additions & 1 deletion skills/runtype/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ your session. A written configuration does not prove that the connection is acti
CLI writes the key to a local key file. From MCP, call `request_api_key`, keep the
`codeVerifier` it returns, and redeem the approved request with `claim_api_key`. Its
default delivery stores the key as a Runtype secret and returns only a `{{secret:KEY}}`
reference, so the key is never shown in the conversation.
reference, so the key is never shown in the conversation. When the key must be collected
on a machine with no Runtype login (a fresh sandbox, for example), file the request with
`--allow-unauthenticated-claim` (MCP `allow_unauthenticated_claim: true`) and redeem it
there with `RUNTYPE_KEY_REQUEST_VERIFIER=<codeVerifier> runtype api-keys claim <id>`.
The key is limited to scopes you already hold and lasts at most 7 days. Treat the
verifier like the key itself.
- **MCP.** Run `runtype install-mcp` for the current coding assistant, follow the action
or restart it reports, then confirm the account with `runtype auth whoami --no-tty`.

Expand Down
2 changes: 1 addition & 1 deletion skills/runtype/references/mcp-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ Bring-your-own provider credentials: `list_provider_keys`, `create_provider_key`
| `check_delegation` | Long-poll a running delegation for events since `after` |
| `cancel_delegation` | Stop a running delegation; completed changes stay |

When the account has the flag, the server instructions recommend delegating multi-step work (build or change a flow, agent, product, surface or tool; debug a run; load records; run evals). Pass `wait_seconds: 240` on Claude Code; keep it under 60 on clients with a 60-second tool timeout. A result with `status: input_required` carries a `question`; answer it with `delegate_to_runtype { task_id, task: <answer> }`.
When the account has the flag, the server instructions recommend delegating work that stays inside the account and takes four or more dependent calls, would need `get_build_instructions`, or reads many entities to produce a small answer. Call tools directly for single reads, known-id edits, output that feeds your code, `submit_batch` and `run_simulation`, and anything that needs local files, secrets, keys, or client tokens. On a host that runs the call as an MCP task (Claude Code 2.1.304+, main conversation), the bar drops to three calls, the call returns at once, and the host delivers the digest; `wait_seconds` is ignored there. Elsewhere, leave `wait_seconds` unset unless you know your tool-call timeout: the server defaults to 240 on Claude Code and 45 elsewhere. Then follow the result's `next_step`. A result with `status: input_required` carries a `question`; answer it with `delegate_to_runtype { task_id, task: <answer> }`.

Start with the `index` topic (task-to-topic map). Useful documentation topics include `platform-catalog`, `surface-types`, `flow-step-types`, `models`, `product-schema`, `types-fpo`, `types-flow-steps`, `types-entities`, `types-surface-configs`, `orthogonal-tools`, `builtin-tools`, `agent-skills`, `external-tools`, `external-agents`, `evals`, `limits`, `validation-errors`, `setup-readiness`, `dashboard-links`, `mock-ecommerce`, `persona-embed`, `persona-fullscreen-assistant`, and `sdk-reference`.

Expand Down
Loading
Loading