AIUSD Pro — AI-powered trading agent with built-in reasoning. Use when user wants to trade, check balances, or manage positions through natural language conv...
---
name: aiusd-pro
version: 1.0.1
description: "AIUSD Pro — AI-powered trading agent with built-in reasoning. Use when user wants to trade, check balances, or manage positions through natural language conversation."
license: MIT
compatibility: "Requires node >= 18"
metadata:
openclaw:
emoji: "🤖"
requires:
bins: ["node"]
---
# AIUSD Pro
Chat with AIUSD using natural language. This skill delegates to a backend
AI agent — you do NOT need to understand AIUSD internals or construct
specific commands.
## CLI entry point
All commands in this skill use `npx -y aiusd-pro` as the CLI prefix. This works without any global installation — npx resolves the package from npm automatically.
If `aiusd-pro` is already in PATH (via `npm install -g aiusd-pro`), you may use `aiusd-pro` directly instead.
## When to use
Use when the user wants anything related to AIUSD or trading
through natural conversation. Examples:
- "What are my balances?"
- "Buy 100 USDC worth of SOL"
- "Stake 500 AIUSD"
- "Long ETH 5x on HyperLiquid"
- "Show trending tokens"
## Authentication
If `npx -y aiusd-pro send` fails with auth error, run login:
1. `npx -y aiusd-pro login --browser` → prints JSON with `url` and `session_id`
2. Send the `url` to the user (NEVER fabricate it)
3. `npx -y aiusd-pro login --poll-session <session_id>` → waits for sign-in
## Usage
### Send a message (background mode)
Backend agent operations take 10-300 seconds (tool calls, reasoning, trading,
transaction confirmation). **Always use background mode** to avoid exec
timeout cutting off output:
```
bash background:true command:"npx -y aiusd-pro send 'user request here'"
```
Returns a `sessionId`. Then poll for completion and retrieve output:
```
process action:poll sessionId:<id>
process action:log sessionId:<id>
```
**Complete pattern:**
1. Start: `bash background:true command:"npx -y aiusd-pro send 'What are my balances?'"`
→ returns `sessionId: abc123`
2. Wait & poll: `process action:poll sessionId:abc123`
→ returns `running` or `exited`
3. Get output: `process action:log sessionId:abc123`
→ returns the agent's full response text
4. Relay output to user as-is
### Multi-turn conversation
Session context is maintained automatically across `send` calls.
The backend agent remembers all previous messages in the session.
**Confirmation flow example:**
1. `bash background:true command:"npx -y aiusd-pro send 'Buy 100 USDC worth of SOL'"`
2. Poll + log → agent responds: "Will buy ~0.65 SOL at $153. Confirm?"
3. Relay to user, user says "yes"
4. `bash background:true command:"npx -y aiusd-pro send 'yes'"`
5. Poll + log → agent responds: "Done. TX: abc123..."
6. Relay to user
**Follow-up questions work the same way** — just `send` the user's
response. The backend has full conversation history.
To start a fresh conversation:
```
bash command:"npx -y aiusd-pro session reset"
```
### Cancel
```
bash command:"npx -y aiusd-pro cancel"
```
### Session management
```
bash command:"npx -y aiusd-pro session new"
bash command:"npx -y aiusd-pro session list"
bash command:"npx -y aiusd-pro session reset"
```
## Rules
1. **Always use `background:true`** for `send` — agent responses take 10-300s.
2. Pass user intent as natural language — do NOT interpret or construct
specific trading commands.
3. Backend agent handles all domain knowledge, tool selection, and
multi-step reasoning.
4. Relay stdout to user as-is — already formatted for humans.
The output includes a browser link at the end (e.g. `https://aiusd.ai/chat/<session-id>`).
Always include this link when relaying the response — it lets browser-login users
continue the conversation in the web UI.
5. If response asks for confirmation or more info, relay to user,
then `send` their reply back (same session, same pattern).
6. Run commands sequentially — only one active `send` per session.
7. Short commands (`session reset`, `cancel`, `login`) can run foreground
(no `background:true` needed).
don't have the plugin yet? install it then click "run inline in claude" again.
by @clawhub
added explicit authentication flow with browser login polling, clarified background mode polling pattern with timeouts, documented decision branching for confirmations and errors, specified output formats and contracts, added edge cases for network timeouts and auth expiry, and structured procedure as numbered steps with clear input/output per each step.
---
name: aiusd-pro
version: 1.0.1
description: "AIUSD Pro , AI-powered trading agent with built-in reasoning. Use when user wants to trade, check balances, or manage positions through natural language conversation."
license: MIT
compatibility: "Requires node >= 18"
metadata:
openclaw:
emoji: "🤖"
requires:
bins: ["node"]
---
# AIUSD Pro
## intent
chat with aiusd through natural language to trade, check balances, manage positions, and execute multi-step operations. use this when a user wants anything related to aiusd or trading without needing to understand internal command syntax. the backend ai agent handles domain knowledge, tool selection, and multi-turn reasoning. you relay requests as natural language and retrieve responses from a long-running background process.
## inputs
- **user request**: natural language intent (e.g., "buy 100 usdc worth of sol", "what are my balances", "stake 500 aiusd")
- **aiusd-pro cli package**: installed via npx (no global install required) or `npm install -g aiusd-pro`
- **authentication**: aiusd session token from browser login or `login --browser` flow
- **network connectivity**: http/https access to aiusd backend (public api, no oauth required)
- **node runtime**: node >= 18 in PATH or available to npx
## procedure
### authentication flow
1. **check existing auth**: run `npx -y aiusd-pro send 'hello'` and observe response.
- output: agent responds with greeting or confirmation (auth valid)
- output: auth error (401/403, missing/expired token)
2. **if auth fails, initiate browser login**:
- run `npx -y aiusd-pro login --browser`
- output: json object with `url` (string) and `session_id` (string)
- relay the `url` to the user; never fabricate or modify it
- do NOT close the skill after this step
3. **poll for login completion**:
- run `npx -y aiusd-pro login --poll-session <session_id>` where `<session_id>` is from step 2
- output: `{"status": "pending"}` (user still signing in) or `{"status": "authenticated", "token": "..."}` (login complete)
- poll every 3-5 seconds for up to 5 minutes; abort if timeout
4. **verify auth**: run `npx -y aiusd-pro send 'hello'` again
- output: agent responds (auth now valid); proceed to main flow
### main conversation loop
5. **send user request in background mode** (all agent operations take 10-300 seconds):
- run: `bash background:true command:"npx -y aiusd-pro send '<user request here>'"`
- input: user request as natural language (do not parse or rewrite)
- output: stdout containing `sessionId: <id>` (alphanumeric string)
- store the `sessionId` for polling
6. **poll for completion** (check every 2-3 seconds):
- run: `process action:poll sessionId:<sessionId>`
- output: `{"status": "running"}` (agent still processing) or `{"status": "exited"}` (agent finished)
- repeat until status is `exited` or 5 minute timeout; abort if timeout
7. **retrieve final response**:
- run: `process action:log sessionId:<sessionId>`
- output: agent's full response text (formatted for human reading, includes browser link at end)
- relay output to user as-is, including the browser link (`https://aiusd.ai/chat/<session-id>`)
8. **if response is a confirmation prompt or clarification request**:
- relay the prompt to the user verbatim
- await user's reply (e.g., "yes", "no", "clarify X")
- goto step 5 with user's reply as the new request (same session, same `sessionId` context is maintained server-side)
- repeat steps 6-8 until agent response is final (no more prompts)
### session management
9. **start a fresh session** (if user requests or old session state is stale):
- run: `bash command:"npx -y aiusd-pro session reset"`
- output: `{"status": "reset"}`
10. **list or manage sessions** (debugging):
- run: `bash command:"npx -y aiusd-pro session list"`
- output: json array of session objects with ids and timestamps
11. **cancel an in-flight operation** (if user requests abort):
- run: `bash command:"npx -y aiusd-pro cancel"`
- output: `{"status": "cancelled"}`
## decision points
- **if `send` returns 401/403 auth error**: branch to authentication flow (steps 2-4). do not retry `send` until auth succeeds.
- **if poll returns `running` for > 5 minutes**: timeout. abort polling, inform user "agent is taking too long; try again later or cancel with `npx -y aiusd-pro cancel`".
- **if response contains a confirmation prompt (e.g., "confirm?", "approve?", "yes/no")**: do not execute or interpret the action. relay prompt to user, await their explicit response, then `send` that response back to the agent in a new `send` call.
- **if response is a final error from the agent** (e.g., "insufficient balance", "invalid symbol"): relay to user; do not retry. user must correct the request and you start a new `send`.
- **if user asks for a follow-up question or new request** (e.g., after a successful trade, asks "what's the price of btc now?"): send the new request via a new `send` call; server maintains session history automatically.
- **if user requests a fresh conversation**: run `session reset`, then proceed with a new `send`.
- **if network request times out** (unreachable host, dns failure): retry once after 5 seconds. if second attempt fails, inform user "network unreachable; check internet connection and try again".
## output contract
- **successful response**: agent's text output, one or more lines, formatted as prose or structured data (agent decides format). always includes a browser continuation link at the bottom in format `https://aiusd.ai/chat/<session-id>`.
- **confirmation prompt output**: agent's question (e.g., "will buy ~0.65 sol at $153. confirm?"). awaiting user input.
- **error output**: agent error message (e.g., "insufficient usdc balance") or system error (e.g., "network timeout", "auth failed").
- **session reset output**: json `{"status": "reset"}` or confirmation string.
- **poll output**: json `{"status": "running"}` or `{"status": "exited"}`.
- **auth output**: json `{"status": "authenticated", "token": "..."}` (on successful login) or `{"status": "pending"}` (login in progress).
all outputs are logged to process stdout and retrievable via `process action:log sessionId:<id>`.
## outcome signal
- user receives a natural language response from the ai agent that answers their request or asks for clarification
- if the request was a trade or position action, the response includes a transaction id or confirmation summary
- if the request was informational (balance, price, position), the response includes the requested data
- all responses include a clickable browser link (`https://aiusd.ai/chat/<session-id>`) that allows the user to continue the conversation in the web ui
- if a confirmation was needed, the agent prompts the user and waits; upon confirmation, a follow-up response confirms execution (e.g., "tx abc123 confirmed")
- auth failures or network errors produce explicit error text that instructs the user to re-authenticate or retry
---
credits: original skill author unknown; enriched per implexa quality standards with explicit decision logic, edge case handling, and complete auth flow documentation.