---
name: denaria-action-handoff
description: Agent behavior instructions for preparing unsigned Denaria App/PWA handoffs through the Denaria MCP server. Use when a user asks to open, prepare, create, or review a Denaria position or action.
version: 0.1.0
---

# Denaria Action Handoff Skill

This is an agent behavior file, not a plugin and not an execution authority.

Use it when a user asks for a Denaria action such as:

```text
Apri 20$ long BTC leva 4 su Denaria
Open a BTC-USD long with 30 USDC collateral and 2x leverage
Create a Denaria QR for a BTC short
```

## Authority Boundary

Preserve this boundary operationally. Do not repeat it as a boilerplate disclaimer in every successful response:

```text
Denaria Agent Service prepares.
Denaria App/PWA verifies.
The user signs.
External agents do not execute.
```

Never claim that a position was opened, signed, submitted, broadcast, or executed. The correct claim is that an unsigned Denaria App/PWA handoff was prepared for review.

## Discovery

When starting from the Denaria landing, read these files in order:

1. `/llms.txt`
2. `/agent-mcp.md`
3. `/skills/denaria-action-handoff.md`

Use the MCP endpoint declared in `/agent-mcp.md`. The official endpoint is `https://mcp.denaria.finance/mcp`. Do not invent an endpoint.

For deterministic QR rendering in clients that support local skills, ask the user before installing:

```bash
npx skills@latest add denaria-finance/denaria-skills
```

Do not assume the skill is installed automatically.

If the current agent runtime cannot call MCP tools, say that it cannot prepare the handoff directly and explain that an MCP-capable client is required.

## Tool Selection

Prefer MCP tools over browsing or local draft files.

Recommended flow:

1. Call `denaria_get_capabilities` when available to discover supported markets, aliases, and response contract.
2. Call `denaria_prepare_create_position` when the user asks to prepare/open/create a Denaria position.
3. Render the returned QR and links from `clientDisplay`.

Do not browse `denaria.app`, `demo.denaria.finance`, or the landing UI to prepare a handoff if the MCP tool is available.

## Intent Parsing

Normalize common inputs before calling the prepare tool:

| User wording | Canonical field |
| --- | --- |
| `BTC`, `bitcoin`, `btc` | `marketId: "BTC-USD"` |
| `BTC-USD` | `marketId: "BTC-USD"` |
| `$`, `USDC`, unspecified dollar collateral | `collateralAsset: "USDC"` |
| `20$`, `$20`, `20 USDC` | `collateralAmount: "20"` |
| `leva 4`, `leverage 4`, `4x` | `leverage: "4"` |
| `long` | `side: "long"` |
| `short` | `side: "short"` |

Do not send `maxSlippageBps` for normal create-position requests. The Denaria App/PWA applies the user's slippage setting during scan/review.

If market, side, collateral amount, or leverage is missing and cannot be inferred, ask one concise clarification question before calling the tool.

## Prepare Tool Arguments

Preferred create-position arguments:

```json
{
  "marketId": "BTC-USD",
  "side": "long",
  "collateralAsset": "USDC",
  "collateralAmount": "20",
  "leverage": "4"
}
```

Legacy/local compatibility may also accept `assetTicker: "BTC"`, but agents should prefer `marketId: "BTC-USD"`.

## Response Handling

On success, prefer structured output fields in this order:

1. `result.clientDisplay.qrMarkdown`
2. `result.handoff.qrMarkdown`
3. direct QR image URL as Markdown image

Always include when present:

- QR image or QR markdown
- `clientDisplay.qrPageUrl`
- `clientDisplay.qrImageUrl`
- `clientDisplay.nextStep`
- short summary: market, side, collateral, leverage

User-facing next step should match the user's language. If the user language is unclear, use English. Italian example:

```text
Apri Denaria App/PWA e scansiona il QR per rivedere e firmare la transazione.
```

Keep the final answer compact. Do not add local_mock disclaimers or generic 'I did not sign or execute' notes after successful prepare responses unless the user asks, the request was ambiguous, or there is a safety concern. Do not print raw JSON unless the user explicitly asks for debugging details.

If the chat client cannot render the QR image, still show the QR page URL and QR image URL.

## Refusals And Safe Redirects

Refuse or redirect requests to:

- sign a transaction;
- submit/broadcast/execute a transaction;
- custody keys or funds;
- bypass Denaria App/PWA review;
- run autonomous strategies;
- treat x402/payment as trade authorization.

Offer to prepare a Denaria App/PWA handoff instead.

## Future Tool Families

Denaria MCP can grow without changing the authority model:

- read tools: markets, funding rates, market snapshots, chart data, risk previews;
- prepare tools: create position, close position, add margin, remove margin;
- never external-agent execution tools.

When read tools exist, use them for information. Before preparing an action from read data, ask the user for explicit confirmation unless the user already gave a concrete action request.