moon-iq-skills 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/mooniq-auth/SKILL.md +19 -0
- package/mooniq-buy-crypto/SKILL.md +48 -0
- package/mooniq-check-wallet/SKILL.md +33 -0
- package/mooniq-discover-tokens/SKILL.md +72 -0
- package/mooniq-lending/SKILL.md +54 -0
- package/mooniq-limit-orders/SKILL.md +72 -0
- package/mooniq-onramp-offramp/SKILL.md +72 -0
- package/mooniq-recurring-orders/SKILL.md +81 -0
- package/mooniq-sell-crypto/SKILL.md +55 -0
- package/mooniq-swap-tokens/SKILL.md +53 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# moon-iq-skills
|
|
2
|
+
|
|
3
|
+
A small skills pack for Moon IQ / MoonIQ CLI workflows.
|
|
4
|
+
|
|
5
|
+
This package ships a set of Anthropic-style skill folders (each containing a `SKILL.md`) prefixed with `mooniq-`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i -g moon-iq-skills
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## List skills
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
moon-iq-skills list
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Install skills into a project
|
|
20
|
+
|
|
21
|
+
Copy bundled skills into your repo/workspace `./skills` directory:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
moon-iq-skills install --to ./skills
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Overwrite existing:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
moon-iq-skills install --to ./skills --force
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Notes
|
|
34
|
+
- The skills are intended to be discovered by agents that scan a `skills/` directory.
|
|
35
|
+
- The primary MoonIQ CLI package is published separately (install via `npm i -g moon-iq`).
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import fs from "fs/promises";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
async function pathExists(p) {
|
|
9
|
+
try {
|
|
10
|
+
await fs.access(p);
|
|
11
|
+
return true;
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function listSkillDirs(rootDir) {
|
|
17
|
+
const entries = await fs.readdir(rootDir, { withFileTypes: true });
|
|
18
|
+
return entries.filter((e) => e.isDirectory() && e.name.startsWith("mooniq-")).map((e) => e.name).sort();
|
|
19
|
+
}
|
|
20
|
+
async function copyDir(src, dest) {
|
|
21
|
+
await fs.mkdir(dest, { recursive: true });
|
|
22
|
+
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
23
|
+
for (const e of entries) {
|
|
24
|
+
const s = path.join(src, e.name);
|
|
25
|
+
const d = path.join(dest, e.name);
|
|
26
|
+
if (e.isDirectory()) {
|
|
27
|
+
await copyDir(s, d);
|
|
28
|
+
} else if (e.isFile()) {
|
|
29
|
+
await fs.copyFile(s, d);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
var program = new Command();
|
|
34
|
+
program.name("moon-iq-skills").description(
|
|
35
|
+
"Moon IQ skills pack (Anthropic-style SKILL.md folders) for Clawdbot/Cursor-style agents."
|
|
36
|
+
).version("0.1.0");
|
|
37
|
+
function getPackageRoot() {
|
|
38
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
39
|
+
const __dirname = path.dirname(__filename);
|
|
40
|
+
return path.resolve(__dirname, "..");
|
|
41
|
+
}
|
|
42
|
+
program.command("list").description("List bundled skill directories").action(async () => {
|
|
43
|
+
const rootDir = getPackageRoot();
|
|
44
|
+
const dirs = await listSkillDirs(rootDir);
|
|
45
|
+
for (const d of dirs) console.log(d);
|
|
46
|
+
});
|
|
47
|
+
program.command("install").description(
|
|
48
|
+
"Copy bundled skills into a target skills directory (e.g. ./skills)."
|
|
49
|
+
).requiredOption(
|
|
50
|
+
"--to <dir>",
|
|
51
|
+
"Destination directory (will create). Example: --to ./skills"
|
|
52
|
+
).option("--force", "Overwrite existing skill directories", false).action(async (opts) => {
|
|
53
|
+
const rootDir = getPackageRoot();
|
|
54
|
+
const dirs = await listSkillDirs(rootDir);
|
|
55
|
+
const destRoot = path.resolve(process.cwd(), opts.to);
|
|
56
|
+
await fs.mkdir(destRoot, { recursive: true });
|
|
57
|
+
for (const dir of dirs) {
|
|
58
|
+
const srcDir = path.join(rootDir, dir);
|
|
59
|
+
const destDir = path.join(destRoot, dir);
|
|
60
|
+
if (await pathExists(destDir) && !opts.force) {
|
|
61
|
+
console.error(
|
|
62
|
+
`Skip ${dir}: already exists at ${destDir} (use --force to overwrite)`
|
|
63
|
+
);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (opts.force && await pathExists(destDir)) {
|
|
67
|
+
await fs.rm(destDir, { recursive: true, force: true });
|
|
68
|
+
}
|
|
69
|
+
await copyDir(srcDir, destDir);
|
|
70
|
+
console.log(`Installed ${dir} -> ${destDir}`);
|
|
71
|
+
}
|
|
72
|
+
console.log(`
|
|
73
|
+
Done. Installed ${dirs.length} skills into: ${destRoot}`);
|
|
74
|
+
});
|
|
75
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
76
|
+
console.error(err);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport path from \"node:path\";\nimport fs from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\n\nasync function pathExists(p: string) {\n try {\n await fs.access(p);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function listSkillDirs(rootDir: string) {\n const entries = await fs.readdir(rootDir, { withFileTypes: true });\n return entries\n .filter((e) => e.isDirectory() && e.name.startsWith(\"mooniq-\"))\n .map((e) => e.name)\n .sort();\n}\n\nasync function copyDir(src: string, dest: string) {\n await fs.mkdir(dest, { recursive: true });\n const entries = await fs.readdir(src, { withFileTypes: true });\n for (const e of entries) {\n const s = path.join(src, e.name);\n const d = path.join(dest, e.name);\n if (e.isDirectory()) {\n await copyDir(s, d);\n } else if (e.isFile()) {\n await fs.copyFile(s, d);\n }\n }\n}\n\nconst program = new Command();\n\nprogram\n .name(\"moon-iq-skills\")\n .description(\n \"Moon IQ skills pack (Anthropic-style SKILL.md folders) for Clawdbot/Cursor-style agents.\"\n )\n .version(\"0.1.0\");\n\nfunction getPackageRoot() {\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = path.dirname(__filename);\n // dist/index.js -> package root\n return path.resolve(__dirname, \"..\");\n}\n\nprogram\n .command(\"list\")\n .description(\"List bundled skill directories\")\n .action(async () => {\n const rootDir = getPackageRoot();\n const dirs = await listSkillDirs(rootDir);\n for (const d of dirs) console.log(d);\n });\n\nprogram\n .command(\"install\")\n .description(\n \"Copy bundled skills into a target skills directory (e.g. ./skills).\"\n )\n .requiredOption(\n \"--to <dir>\",\n \"Destination directory (will create). Example: --to ./skills\"\n )\n .option(\"--force\", \"Overwrite existing skill directories\", false)\n .action(async (opts: { to: string; force: boolean }) => {\n const rootDir = getPackageRoot();\n const dirs = await listSkillDirs(rootDir);\n const destRoot = path.resolve(process.cwd(), opts.to);\n\n await fs.mkdir(destRoot, { recursive: true });\n\n for (const dir of dirs) {\n const srcDir = path.join(rootDir, dir);\n const destDir = path.join(destRoot, dir);\n\n if ((await pathExists(destDir)) && !opts.force) {\n console.error(\n `Skip ${dir}: already exists at ${destDir} (use --force to overwrite)`\n );\n continue;\n }\n\n if (opts.force && (await pathExists(destDir))) {\n await fs.rm(destDir, { recursive: true, force: true });\n }\n\n await copyDir(srcDir, destDir);\n console.log(`Installed ${dir} -> ${destDir}`);\n }\n\n console.log(`\\nDone. Installed ${dirs.length} skills into: ${destRoot}`);\n });\n\nprogram.parseAsync(process.argv).catch((err) => {\n console.error(err);\n process.exit(1);\n});\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,SAAS,qBAAqB;AAE9B,eAAe,WAAW,GAAW;AACnC,MAAI;AACF,UAAM,GAAG,OAAO,CAAC;AACjB,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,cAAc,SAAiB;AAC5C,QAAM,UAAU,MAAM,GAAG,QAAQ,SAAS,EAAE,eAAe,KAAK,CAAC;AACjE,SAAO,QACJ,OAAO,CAAC,MAAM,EAAE,YAAY,KAAK,EAAE,KAAK,WAAW,SAAS,CAAC,EAC7D,IAAI,CAAC,MAAM,EAAE,IAAI,EACjB,KAAK;AACV;AAEA,eAAe,QAAQ,KAAa,MAAc;AAChD,QAAM,GAAG,MAAM,MAAM,EAAE,WAAW,KAAK,CAAC;AACxC,QAAM,UAAU,MAAM,GAAG,QAAQ,KAAK,EAAE,eAAe,KAAK,CAAC;AAC7D,aAAW,KAAK,SAAS;AACvB,UAAM,IAAI,KAAK,KAAK,KAAK,EAAE,IAAI;AAC/B,UAAM,IAAI,KAAK,KAAK,MAAM,EAAE,IAAI;AAChC,QAAI,EAAE,YAAY,GAAG;AACnB,YAAM,QAAQ,GAAG,CAAC;AAAA,IACpB,WAAW,EAAE,OAAO,GAAG;AACrB,YAAM,GAAG,SAAS,GAAG,CAAC;AAAA,IACxB;AAAA,EACF;AACF;AAEA,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,gBAAgB,EACrB;AAAA,EACC;AACF,EACC,QAAQ,OAAO;AAElB,SAAS,iBAAiB;AACxB,QAAM,aAAa,cAAc,YAAY,GAAG;AAChD,QAAM,YAAY,KAAK,QAAQ,UAAU;AAEzC,SAAO,KAAK,QAAQ,WAAW,IAAI;AACrC;AAEA,QACG,QAAQ,MAAM,EACd,YAAY,gCAAgC,EAC5C,OAAO,YAAY;AAClB,QAAM,UAAU,eAAe;AAC/B,QAAM,OAAO,MAAM,cAAc,OAAO;AACxC,aAAW,KAAK,KAAM,SAAQ,IAAI,CAAC;AACrC,CAAC;AAEH,QACG,QAAQ,SAAS,EACjB;AAAA,EACC;AACF,EACC;AAAA,EACC;AAAA,EACA;AACF,EACC,OAAO,WAAW,wCAAwC,KAAK,EAC/D,OAAO,OAAO,SAAyC;AACtD,QAAM,UAAU,eAAe;AAC/B,QAAM,OAAO,MAAM,cAAc,OAAO;AACxC,QAAM,WAAW,KAAK,QAAQ,QAAQ,IAAI,GAAG,KAAK,EAAE;AAEpD,QAAM,GAAG,MAAM,UAAU,EAAE,WAAW,KAAK,CAAC;AAE5C,aAAW,OAAO,MAAM;AACtB,UAAM,SAAS,KAAK,KAAK,SAAS,GAAG;AACrC,UAAM,UAAU,KAAK,KAAK,UAAU,GAAG;AAEvC,QAAK,MAAM,WAAW,OAAO,KAAM,CAAC,KAAK,OAAO;AAC9C,cAAQ;AAAA,QACN,QAAQ,GAAG,uBAAuB,OAAO;AAAA,MAC3C;AACA;AAAA,IACF;AAEA,QAAI,KAAK,SAAU,MAAM,WAAW,OAAO,GAAI;AAC7C,YAAM,GAAG,GAAG,SAAS,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,IACvD;AAEA,UAAM,QAAQ,QAAQ,OAAO;AAC7B,YAAQ,IAAI,aAAa,GAAG,OAAO,OAAO,EAAE;AAAA,EAC9C;AAEA,UAAQ,IAAI;AAAA,kBAAqB,KAAK,MAAM,iBAAiB,QAAQ,EAAE;AACzE,CAAC;AAEH,QAAQ,WAAW,QAAQ,IAAI,EAAE,MAAM,CAAC,QAAQ;AAC9C,UAAQ,MAAM,GAAG;AACjB,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-auth
|
|
3
|
+
description: Authenticate and troubleshoot Moon IQ CLI (mooniq). Use when you need to log in, check auth state, fix 401s, or switch accounts before running Moon IQ tools.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MoonIQ auth (CLI)
|
|
7
|
+
|
|
8
|
+
## Commands
|
|
9
|
+
- Login: `mooniq login`
|
|
10
|
+
- Who am I: `mooniq whoami`
|
|
11
|
+
- Logout: `mooniq logout`
|
|
12
|
+
|
|
13
|
+
## Workflow (recommended)
|
|
14
|
+
1) Run `mooniq whoami`.
|
|
15
|
+
2) If it fails with 401 or no session, run `mooniq login` (opens browser).
|
|
16
|
+
3) Re-run `mooniq whoami`.
|
|
17
|
+
|
|
18
|
+
## Notes
|
|
19
|
+
- Prefer running `mooniq run <tool> --input '<json>'` only after `whoami` succeeds.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-buy-crypto
|
|
3
|
+
description: Buy crypto using Moon IQ CLI (typically USDC -> token) via token_buy. Use when the user wants to buy a token, get a quote, then execute.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Buy crypto (MoonIQ CLI)
|
|
7
|
+
|
|
8
|
+
## Tool schema (source of truth)
|
|
9
|
+
- `src/tools/token/buy/schema.ts`
|
|
10
|
+
- Tool: `token_buy`
|
|
11
|
+
- Required input fields:
|
|
12
|
+
- `simulation` (boolean)
|
|
13
|
+
- `token` (string; token mint/address)
|
|
14
|
+
- `amount` (number; USDC amount; coerced)
|
|
15
|
+
|
|
16
|
+
## Safety workflow (default)
|
|
17
|
+
1) Run a **simulation** first and show the quote.
|
|
18
|
+
2) Ask for explicit confirmation.
|
|
19
|
+
3) Execute with `simulation:false`.
|
|
20
|
+
|
|
21
|
+
## CLI commands
|
|
22
|
+
- Preferred (scriptable + full params):
|
|
23
|
+
- `mooniq run token_buy --input '<json>'`
|
|
24
|
+
|
|
25
|
+
- Convenience command (currently limited):
|
|
26
|
+
- `mooniq token buy`
|
|
27
|
+
- Per `mooniq token buy --help`, it only supports `--base-url` (no `--token/--amount/--simulation`).
|
|
28
|
+
- Use `mooniq run` for real buys.
|
|
29
|
+
|
|
30
|
+
## Command templates (recommended: mooniq run)
|
|
31
|
+
```bash
|
|
32
|
+
# Quote
|
|
33
|
+
mooniq run token_buy --input '{
|
|
34
|
+
"simulation": true,
|
|
35
|
+
"token": "<mint-or-address>",
|
|
36
|
+
"amount": 100
|
|
37
|
+
}'
|
|
38
|
+
|
|
39
|
+
# Execute (only after CONFIRM)
|
|
40
|
+
mooniq run token_buy --input '{
|
|
41
|
+
"simulation": false,
|
|
42
|
+
"token": "<mint-or-address>",
|
|
43
|
+
"amount": 100
|
|
44
|
+
}'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Notes
|
|
48
|
+
- If the user only provides a symbol/name, call `token_search` first to find the correct address.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-check-wallet
|
|
3
|
+
description: Check wallet balances and holdings using Moon IQ CLI. Use for questions like "what's in my wallet", portfolio breakdown, token balances, and USD value on Solana/EVM.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Check wallet (MoonIQ CLI)
|
|
7
|
+
|
|
8
|
+
## Primary tools
|
|
9
|
+
- `token_balance_list` — list token balances + USD value
|
|
10
|
+
- `token_balance_retrieve` — (if needed) drill into a specific token balance
|
|
11
|
+
|
|
12
|
+
## CLI commands
|
|
13
|
+
- Preferred:
|
|
14
|
+
- `mooniq run token_balance_list --input '<json>'`
|
|
15
|
+
|
|
16
|
+
- Convenience grouping:
|
|
17
|
+
- There is a `mooniq token balance` command group, but availability/flags may vary.
|
|
18
|
+
- If it doesn’t accept the needed args, use `mooniq run token_balance_list`.
|
|
19
|
+
|
|
20
|
+
## Common commands (recommended: mooniq run)
|
|
21
|
+
List holdings:
|
|
22
|
+
```bash
|
|
23
|
+
mooniq run token_balance_list --input '{"wallet":"<address>","chain":"solana"}'
|
|
24
|
+
mooniq run token_balance_list --input '{"wallet":"0x...","chain":"ethereum"}'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Output handling
|
|
28
|
+
- Summarize top holdings by USD value.
|
|
29
|
+
- Call out small dust balances separately.
|
|
30
|
+
- If user asks for totals, sum `balance.value` across items.
|
|
31
|
+
|
|
32
|
+
## If auth fails
|
|
33
|
+
Use the `mooniq-auth` skill and run `mooniq login`.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-discover-tokens
|
|
3
|
+
description: Discover and research tokens using Moon IQ CLI. Use to search by name/symbol/address, view trending tokens, and retrieve token metadata/market data before trading.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Discover tokens (MoonIQ CLI)
|
|
7
|
+
|
|
8
|
+
## Tool schemas (source of truth)
|
|
9
|
+
- `src/tools/token/search/schema.ts` (`token_search`)
|
|
10
|
+
- `src/tools/token/trending/list/schema.ts` (`token_trending_list`)
|
|
11
|
+
- `src/tools/token/retrieve/schema.ts` (`token_retrieve`)
|
|
12
|
+
|
|
13
|
+
## CLI commands
|
|
14
|
+
- Preferred:
|
|
15
|
+
- `mooniq run token_search|token_trending_list|token_retrieve --input '<json>'`
|
|
16
|
+
- Convenience grouping:
|
|
17
|
+
- `mooniq token search --query "SOL" --chain solana [--limit 5]` (usable)
|
|
18
|
+
- `mooniq token swap recommend --query "swap 100 USDC for SOL"` (useful helper)
|
|
19
|
+
- `mooniq token trending list` (currently limited; per `--help` it only supports `--base-url`)
|
|
20
|
+
- `mooniq token retrieve` (not currently exposed with flags; prefer `mooniq run token_retrieve`)
|
|
21
|
+
|
|
22
|
+
## token_search
|
|
23
|
+
Required input fields:
|
|
24
|
+
- `query` (string)
|
|
25
|
+
- `chain` (string enum; e.g. solana/ethereum/base)
|
|
26
|
+
- `limit` (number | null) — required; use `null` to default to 5
|
|
27
|
+
|
|
28
|
+
Command template:
|
|
29
|
+
```bash
|
|
30
|
+
mooniq run token_search --input '{
|
|
31
|
+
"query": "SOL",
|
|
32
|
+
"chain": "solana",
|
|
33
|
+
"limit": null
|
|
34
|
+
}'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## token_trending_list
|
|
38
|
+
Required input fields:
|
|
39
|
+
- `chain` (string enum)
|
|
40
|
+
- `sort` ("rank" | "volume" | "liquidity")
|
|
41
|
+
- `order` ("asc" | "desc")
|
|
42
|
+
- `limit` (number)
|
|
43
|
+
- `page` (number)
|
|
44
|
+
|
|
45
|
+
Command template:
|
|
46
|
+
```bash
|
|
47
|
+
mooniq run token_trending_list --input '{
|
|
48
|
+
"chain": "solana",
|
|
49
|
+
"sort": "rank",
|
|
50
|
+
"order": "asc",
|
|
51
|
+
"limit": 5,
|
|
52
|
+
"page": 1
|
|
53
|
+
}'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## token_retrieve
|
|
57
|
+
Required input fields:
|
|
58
|
+
- `token` (string; mint/address)
|
|
59
|
+
- `chain` (string enum)
|
|
60
|
+
|
|
61
|
+
Command template:
|
|
62
|
+
```bash
|
|
63
|
+
mooniq run token_retrieve --input '{
|
|
64
|
+
"token": "<mint-or-address>",
|
|
65
|
+
"chain": "solana"
|
|
66
|
+
}'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Workflow
|
|
70
|
+
1) Resolve addresses with `token_search`.
|
|
71
|
+
2) Use `token_retrieve` for detailed market data.
|
|
72
|
+
3) Only then proceed to buy/sell/swap skills.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-lending
|
|
3
|
+
description: Use Moon IQ CLI lending tools (lending_*). Use when depositing/withdrawing, retrieving lending account status, rates, or getting lending recommendations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Lending (MoonIQ CLI)
|
|
7
|
+
|
|
8
|
+
## Tool schemas (source of truth)
|
|
9
|
+
- `src/tools/lending/deposit/schema.ts` (`lending_deposit`)
|
|
10
|
+
- `src/tools/lending/withdraw/schema.ts` (`lending_withdraw`)
|
|
11
|
+
- `src/tools/lending/account/retrieve/schema.ts` (`lending_account_retrieve`)
|
|
12
|
+
- `src/tools/lending/rate/retrieve/schema.ts` (`lending_rate_retrieve`)
|
|
13
|
+
|
|
14
|
+
## CLI commands
|
|
15
|
+
- Preferred:
|
|
16
|
+
- `mooniq run lending_* --input '<json>'`
|
|
17
|
+
- Convenience grouping:
|
|
18
|
+
- `mooniq lending ...`
|
|
19
|
+
|
|
20
|
+
## Read-only calls
|
|
21
|
+
```bash
|
|
22
|
+
mooniq run lending_account_retrieve --input '{"userId":"<user_id>"}'
|
|
23
|
+
mooniq run lending_rate_retrieve --input '{"chain":"solana"}'
|
|
24
|
+
```
|
|
25
|
+
(If validation errors occur, inspect the schema files above for required fields.)
|
|
26
|
+
|
|
27
|
+
## lending_deposit
|
|
28
|
+
Required input fields:
|
|
29
|
+
- `simulation` (boolean)
|
|
30
|
+
- `amount` (number; USDC)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Quote
|
|
34
|
+
mooniq run lending_deposit --input '{"simulation": true, "amount": 100}'
|
|
35
|
+
|
|
36
|
+
# Execute (only after CONFIRM)
|
|
37
|
+
mooniq run lending_deposit --input '{"simulation": false, "amount": 100}'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## lending_withdraw
|
|
41
|
+
Required input fields:
|
|
42
|
+
- `simulation` (boolean)
|
|
43
|
+
- `amount` (number; USDC)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Quote
|
|
47
|
+
mooniq run lending_withdraw --input '{"simulation": true, "amount": 100}'
|
|
48
|
+
|
|
49
|
+
# Execute (only after CONFIRM)
|
|
50
|
+
mooniq run lending_withdraw --input '{"simulation": false, "amount": 100}'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Notes
|
|
54
|
+
- Treat deposits/withdrawals as sensitive; confirm amount before `simulation:false`.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-limit-orders
|
|
3
|
+
description: Create, list, and manage limit orders using Moon IQ CLI (token_limit_* tools). Use when the user wants conditional buys/sells at a target price.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Limit orders (MoonIQ CLI)
|
|
7
|
+
|
|
8
|
+
## Tool schemas (source of truth)
|
|
9
|
+
- `src/tools/token/limit/buy/schema.ts` (`token_limit_buy`)
|
|
10
|
+
- `src/tools/token/limit/sell/schema.ts` (`token_limit_sell`)
|
|
11
|
+
- `src/tools/token/limit/order/list/schema.ts` (`token_limit_order_list`)
|
|
12
|
+
|
|
13
|
+
## CLI commands
|
|
14
|
+
- Preferred (scriptable + full params):
|
|
15
|
+
- `mooniq run token_limit_buy|token_limit_sell|token_limit_order_list --input '<json>'`
|
|
16
|
+
|
|
17
|
+
- Convenience grouping:
|
|
18
|
+
- `mooniq token limit ...`
|
|
19
|
+
- If the convenience commands don’t expose required flags, fall back to `mooniq run`.
|
|
20
|
+
|
|
21
|
+
## token_limit_buy
|
|
22
|
+
Required input fields:
|
|
23
|
+
- `simulation` (boolean)
|
|
24
|
+
- `token` (string)
|
|
25
|
+
- `amount` (number; USDC)
|
|
26
|
+
- `price` (number; USD/USDC)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Quote
|
|
30
|
+
mooniq run token_limit_buy --input '{
|
|
31
|
+
"simulation": true,
|
|
32
|
+
"token": "<mint-or-address>",
|
|
33
|
+
"amount": 100,
|
|
34
|
+
"price": 0.25
|
|
35
|
+
}'
|
|
36
|
+
|
|
37
|
+
# Execute (only after CONFIRM)
|
|
38
|
+
mooniq run token_limit_buy --input '{
|
|
39
|
+
"simulation": false,
|
|
40
|
+
"token": "<mint-or-address>",
|
|
41
|
+
"amount": 100,
|
|
42
|
+
"price": 0.25
|
|
43
|
+
}'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## token_limit_sell
|
|
47
|
+
Required input fields:
|
|
48
|
+
- `simulation` (boolean)
|
|
49
|
+
- `token` (string)
|
|
50
|
+
- `amount` (number; token units)
|
|
51
|
+
- `price` (number; USD/USDC)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Quote
|
|
55
|
+
mooniq run token_limit_sell --input '{
|
|
56
|
+
"simulation": true,
|
|
57
|
+
"token": "<mint-or-address>",
|
|
58
|
+
"amount": 123.45,
|
|
59
|
+
"price": 0.25
|
|
60
|
+
}'
|
|
61
|
+
|
|
62
|
+
# Execute (only after CONFIRM)
|
|
63
|
+
mooniq run token_limit_sell --input '{
|
|
64
|
+
"simulation": false,
|
|
65
|
+
"token": "<mint-or-address>",
|
|
66
|
+
"amount": 123.45,
|
|
67
|
+
"price": 0.25
|
|
68
|
+
}'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Notes
|
|
72
|
+
- Use `token_search` to resolve the correct token address.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-onramp-offramp
|
|
3
|
+
description: Use Moon IQ CLI Iron onramp/offramp tools (iron_*). Use when creating/listing/retrieving onramps or offramps and initiating an offramp.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Onramp / Offramp (MoonIQ CLI)
|
|
7
|
+
|
|
8
|
+
## Tool schemas (source of truth)
|
|
9
|
+
- `src/tools/iron/onramp/create/schema.ts` (`iron_onramp_create`)
|
|
10
|
+
- `src/tools/iron/offramp/create/schema.ts` (`iron_offramp_create`)
|
|
11
|
+
- `src/tools/iron/offramp/initiate/schema.ts` (`iron_offramp_initiate`)
|
|
12
|
+
|
|
13
|
+
## CLI commands
|
|
14
|
+
- Preferred:
|
|
15
|
+
- `mooniq run iron_* --input '<json>'`
|
|
16
|
+
- Convenience grouping:
|
|
17
|
+
- `mooniq iron ...`
|
|
18
|
+
|
|
19
|
+
## Create onramp
|
|
20
|
+
Required input fields:
|
|
21
|
+
- `name` (string)
|
|
22
|
+
- `fiat` (object; see `src/tools/iron/models.ts`)
|
|
23
|
+
- `stablecoin` (object; see `src/tools/iron/models.ts`)
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
mooniq run iron_onramp_create --input '{
|
|
27
|
+
"name": "<friendly name>",
|
|
28
|
+
"fiat": {"currency":"USD"},
|
|
29
|
+
"stablecoin": {"chain":"solana","symbol":"USDC"}
|
|
30
|
+
}'
|
|
31
|
+
```
|
|
32
|
+
(If validation errors occur, inspect the schema files above; these nested shapes are strict.)
|
|
33
|
+
|
|
34
|
+
## Create offramp
|
|
35
|
+
Required input fields:
|
|
36
|
+
- `name` (string)
|
|
37
|
+
- `fiat` (object)
|
|
38
|
+
- `stablecoin` (object)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
mooniq run iron_offramp_create --input '{
|
|
42
|
+
"name": "<friendly name>",
|
|
43
|
+
"fiat": {"currency":"USD"},
|
|
44
|
+
"stablecoin": {"chain":"solana","symbol":"USDC"}
|
|
45
|
+
}'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Initiate offramp (money movement)
|
|
49
|
+
Required input fields:
|
|
50
|
+
- `simulation` (boolean)
|
|
51
|
+
- `offrampId` (string)
|
|
52
|
+
- `amount` (number)
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Quote
|
|
56
|
+
mooniq run iron_offramp_initiate --input '{
|
|
57
|
+
"simulation": true,
|
|
58
|
+
"offrampId": "<offramp_id>",
|
|
59
|
+
"amount": 100
|
|
60
|
+
}'
|
|
61
|
+
|
|
62
|
+
# Execute (only after CONFIRM)
|
|
63
|
+
mooniq run iron_offramp_initiate --input '{
|
|
64
|
+
"simulation": false,
|
|
65
|
+
"offrampId": "<offramp_id>",
|
|
66
|
+
"amount": 100
|
|
67
|
+
}'
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Notes
|
|
71
|
+
- For onramp/offramp create inputs (`fiat`/`stablecoin`), use the exact schemas in `src/tools/iron/models.ts` / `src/tools/iron/*/models.ts`.
|
|
72
|
+
- Treat initiate as sensitive; require explicit confirmation.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-recurring-orders
|
|
3
|
+
description: Create and manage recurring (DCA) orders using Moon IQ CLI (token_recurring_* tools). Use for scheduling periodic buys/sells.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Recurring orders (MoonIQ CLI)
|
|
7
|
+
|
|
8
|
+
## Tool schemas (source of truth)
|
|
9
|
+
- `src/tools/token/recurring/buy/schema.ts` (`token_recurring_buy`)
|
|
10
|
+
- `src/tools/token/recurring/sell/schema.ts` (`token_recurring_sell`)
|
|
11
|
+
- `src/tools/token/recurring/models.ts` (`interval` enum)
|
|
12
|
+
|
|
13
|
+
## CLI commands
|
|
14
|
+
- Preferred (scriptable + full params):
|
|
15
|
+
- `mooniq run token_recurring_buy|token_recurring_sell|token_recurring_order_list --input '<json>'`
|
|
16
|
+
|
|
17
|
+
- Convenience grouping:
|
|
18
|
+
- `mooniq token recurring ...`
|
|
19
|
+
- If the convenience commands don’t expose required flags, fall back to `mooniq run`.
|
|
20
|
+
|
|
21
|
+
Interval values:
|
|
22
|
+
- `hour` | `day` | `week` | `month`
|
|
23
|
+
|
|
24
|
+
## token_recurring_buy
|
|
25
|
+
Required input fields:
|
|
26
|
+
- `simulation` (boolean)
|
|
27
|
+
- `token` (string)
|
|
28
|
+
- `amount` (number; USDC per order; min 50)
|
|
29
|
+
- `interval` (string enum)
|
|
30
|
+
- `numberOfOrders` (number; min 2)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Quote
|
|
34
|
+
mooniq run token_recurring_buy --input '{
|
|
35
|
+
"simulation": true,
|
|
36
|
+
"token": "<mint-or-address>",
|
|
37
|
+
"amount": 50,
|
|
38
|
+
"interval": "week",
|
|
39
|
+
"numberOfOrders": 4
|
|
40
|
+
}'
|
|
41
|
+
|
|
42
|
+
# Execute (only after CONFIRM)
|
|
43
|
+
mooniq run token_recurring_buy --input '{
|
|
44
|
+
"simulation": false,
|
|
45
|
+
"token": "<mint-or-address>",
|
|
46
|
+
"amount": 50,
|
|
47
|
+
"interval": "week",
|
|
48
|
+
"numberOfOrders": 4
|
|
49
|
+
}'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## token_recurring_sell
|
|
53
|
+
Required input fields:
|
|
54
|
+
- `simulation` (boolean)
|
|
55
|
+
- `token` (string)
|
|
56
|
+
- `amount` (number; token units)
|
|
57
|
+
- `interval` (string enum)
|
|
58
|
+
- `numberOfOrders` (number)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Quote
|
|
62
|
+
mooniq run token_recurring_sell --input '{
|
|
63
|
+
"simulation": true,
|
|
64
|
+
"token": "<mint-or-address>",
|
|
65
|
+
"amount": 10,
|
|
66
|
+
"interval": "week",
|
|
67
|
+
"numberOfOrders": 4
|
|
68
|
+
}'
|
|
69
|
+
|
|
70
|
+
# Execute (only after CONFIRM)
|
|
71
|
+
mooniq run token_recurring_sell --input '{
|
|
72
|
+
"simulation": false,
|
|
73
|
+
"token": "<mint-or-address>",
|
|
74
|
+
"amount": 10,
|
|
75
|
+
"interval": "week",
|
|
76
|
+
"numberOfOrders": 4
|
|
77
|
+
}'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Notes
|
|
81
|
+
- Use `token_search` to resolve token addresses.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-sell-crypto
|
|
3
|
+
description: Sell crypto using Moon IQ CLI (token -> USDC) via token_sell. Use when the user wants to sell a token balance (partial or all), quote first, then execute.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sell crypto (MoonIQ CLI)
|
|
7
|
+
|
|
8
|
+
## Tool schema (source of truth)
|
|
9
|
+
- `src/tools/token/sell/schema.ts`
|
|
10
|
+
- Tool: `token_sell`
|
|
11
|
+
- Required input fields:
|
|
12
|
+
- `simulation` (boolean)
|
|
13
|
+
- `token` (string; token mint/address)
|
|
14
|
+
- `amount` (number; token amount; coerced)
|
|
15
|
+
|
|
16
|
+
## Safety workflow (default)
|
|
17
|
+
1) Run a **simulation** first and show the quote.
|
|
18
|
+
2) Ask for explicit confirmation (token + amount).
|
|
19
|
+
3) Execute with `simulation:false`.
|
|
20
|
+
|
|
21
|
+
## CLI commands
|
|
22
|
+
- Preferred (scriptable + full params):
|
|
23
|
+
- `mooniq run token_sell --input '<json>'`
|
|
24
|
+
|
|
25
|
+
- Convenience command (currently limited):
|
|
26
|
+
- `mooniq token sell`
|
|
27
|
+
- Per `mooniq token sell --help`, it only supports `--base-url` (no `--token/--amount/--simulation`).
|
|
28
|
+
- Use `mooniq run` for real sells.
|
|
29
|
+
|
|
30
|
+
## Command templates (recommended: mooniq run)
|
|
31
|
+
```bash
|
|
32
|
+
# Quote
|
|
33
|
+
mooniq run token_sell --input '{
|
|
34
|
+
"simulation": true,
|
|
35
|
+
"token": "<mint-or-address>",
|
|
36
|
+
"amount": 123.45
|
|
37
|
+
}'
|
|
38
|
+
|
|
39
|
+
# Execute (only after CONFIRM)
|
|
40
|
+
mooniq run token_sell --input '{
|
|
41
|
+
"simulation": false,
|
|
42
|
+
"token": "<mint-or-address>",
|
|
43
|
+
"amount": 123.45
|
|
44
|
+
}'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Selling “all”
|
|
48
|
+
1) Get current balance:
|
|
49
|
+
```bash
|
|
50
|
+
mooniq run token_balance_list --input '{"wallet":"<wallet>","chain":"solana"}'
|
|
51
|
+
```
|
|
52
|
+
2) Use the returned `balance.amount` as `amount` for `token_sell`.
|
|
53
|
+
|
|
54
|
+
## Notes
|
|
55
|
+
- If the user only provides a symbol/name, call `token_search` first to find the correct address.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mooniq-swap-tokens
|
|
3
|
+
description: Swap tokens using Moon IQ CLI via token_swap. Use when the user requests a token A -> token B swap (not just buy/sell vs USDC).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Swap tokens (MoonIQ CLI)
|
|
7
|
+
|
|
8
|
+
## Tool schema (source of truth)
|
|
9
|
+
- `src/tools/token/swap/schema.ts`
|
|
10
|
+
- Tool: `token_swap`
|
|
11
|
+
- Required input fields:
|
|
12
|
+
- `simulation` (boolean)
|
|
13
|
+
- `input` (string; input token mint/address)
|
|
14
|
+
- `output` (string; output token mint/address)
|
|
15
|
+
- `amount` (number; amount of input token)
|
|
16
|
+
|
|
17
|
+
## Safety workflow (default)
|
|
18
|
+
1) Run a **simulation** first and show the quote.
|
|
19
|
+
2) Ask for explicit confirmation.
|
|
20
|
+
3) Execute with `simulation:false`.
|
|
21
|
+
|
|
22
|
+
## CLI commands
|
|
23
|
+
- Preferred (scriptable + full params):
|
|
24
|
+
- `mooniq run token_swap --input '<json>'`
|
|
25
|
+
|
|
26
|
+
- Convenience commands:
|
|
27
|
+
- `mooniq token swap`
|
|
28
|
+
- Per `--help`, the top-level command mostly exposes `--base-url`.
|
|
29
|
+
- `mooniq token swap recommend --query "swap 100 USDC for SOL"`
|
|
30
|
+
- This one is useful: it parses natural language into structured swap params.
|
|
31
|
+
- After you get the params, execute via `mooniq run token_swap --input ...`.
|
|
32
|
+
|
|
33
|
+
## Command templates (recommended: mooniq run)
|
|
34
|
+
```bash
|
|
35
|
+
# Quote
|
|
36
|
+
mooniq run token_swap --input '{
|
|
37
|
+
"simulation": true,
|
|
38
|
+
"input": "<input-mint-or-address>",
|
|
39
|
+
"output": "<output-mint-or-address>",
|
|
40
|
+
"amount": 1.23
|
|
41
|
+
}'
|
|
42
|
+
|
|
43
|
+
# Execute (only after CONFIRM)
|
|
44
|
+
mooniq run token_swap --input '{
|
|
45
|
+
"simulation": false,
|
|
46
|
+
"input": "<input-mint-or-address>",
|
|
47
|
+
"output": "<output-mint-or-address>",
|
|
48
|
+
"amount": 1.23
|
|
49
|
+
}'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
- If the user only provides names/symbols, call `token_search` to resolve addresses.
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "moon-iq-skills",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"moon-iq-skills": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/**",
|
|
11
|
+
"mooniq-*/SKILL.md",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsup",
|
|
16
|
+
"dev": "tsx src/index.ts"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"commander": "^12.1.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^20",
|
|
23
|
+
"tsup": "^8.3.5",
|
|
24
|
+
"tsx": "^4.19.2",
|
|
25
|
+
"typescript": "^5"
|
|
26
|
+
}
|
|
27
|
+
}
|