agentlaunch-templates 0.4.4 → 0.4.6

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.
Files changed (49) hide show
  1. package/dist/__tests__/gaps.test.d.ts +11 -0
  2. package/dist/__tests__/gaps.test.d.ts.map +1 -0
  3. package/dist/__tests__/gaps.test.js +196 -0
  4. package/dist/__tests__/gaps.test.js.map +1 -0
  5. package/dist/__tests__/per-template.test.d.ts +8 -0
  6. package/dist/__tests__/per-template.test.d.ts.map +1 -0
  7. package/dist/__tests__/per-template.test.js +213 -0
  8. package/dist/__tests__/per-template.test.js.map +1 -0
  9. package/dist/claude-context.d.ts.map +1 -1
  10. package/dist/claude-context.js +1958 -211
  11. package/dist/claude-context.js.map +1 -1
  12. package/dist/people.d.ts.map +1 -1
  13. package/dist/people.js +2 -1
  14. package/dist/people.js.map +1 -1
  15. package/dist/templates/chat-memory.d.ts.map +1 -1
  16. package/dist/templates/chat-memory.js +9 -2
  17. package/dist/templates/chat-memory.js.map +1 -1
  18. package/dist/templates/consumer-commerce.js +1 -1
  19. package/dist/templates/custom.d.ts.map +1 -1
  20. package/dist/templates/custom.js +9 -2
  21. package/dist/templates/custom.js.map +1 -1
  22. package/dist/templates/data-analyzer.d.ts.map +1 -1
  23. package/dist/templates/data-analyzer.js +9 -2
  24. package/dist/templates/data-analyzer.js.map +1 -1
  25. package/dist/templates/gifter.d.ts.map +1 -1
  26. package/dist/templates/gifter.js +9 -2
  27. package/dist/templates/gifter.js.map +1 -1
  28. package/dist/templates/price-monitor.d.ts.map +1 -1
  29. package/dist/templates/price-monitor.js +9 -2
  30. package/dist/templates/price-monitor.js.map +1 -1
  31. package/dist/templates/research.d.ts.map +1 -1
  32. package/dist/templates/research.js +9 -2
  33. package/dist/templates/research.js.map +1 -1
  34. package/dist/templates/trading-bot.d.ts.map +1 -1
  35. package/dist/templates/trading-bot.js +9 -2
  36. package/dist/templates/trading-bot.js.map +1 -1
  37. package/package.json +1 -1
  38. package/dist/__tests__/genesis-integration.test.d.ts +0 -12
  39. package/dist/__tests__/genesis-integration.test.d.ts.map +0 -1
  40. package/dist/__tests__/genesis-integration.test.js +0 -143
  41. package/dist/__tests__/genesis-integration.test.js.map +0 -1
  42. package/dist/__tests__/genesis.test.d.ts +0 -16
  43. package/dist/__tests__/genesis.test.d.ts.map +0 -1
  44. package/dist/__tests__/genesis.test.js +0 -312
  45. package/dist/__tests__/genesis.test.js.map +0 -1
  46. package/dist/templates/genesis.d.ts +0 -26
  47. package/dist/templates/genesis.d.ts.map +0 -1
  48. package/dist/templates/genesis.js +0 -1319
  49. package/dist/templates/genesis.js.map +0 -1
@@ -10,84 +10,633 @@
10
10
  export const RULES = {
11
11
  "agentlaunch.md": `# AgentLaunch Platform Rules
12
12
 
13
+ When working with AgentLaunch tokens and the platform API:
14
+
13
15
  ## Constants (from smart contracts -- never change)
14
16
 
15
17
  - Deploy fee: 120 FET (read from contract, can change via multi-sig)
16
18
  - Graduation: 30,000 FET liquidity -> auto DEX listing
17
- - Trading fee: 2% -> 100% to protocol treasury (NO creator fee)
19
+ - Trading fee: 2% -> 100% to REVENUE_ACCOUNT (protocol treasury)
20
+ - NO creator fee. The 2% fee has NO split. All to protocol.
18
21
  - Total buy supply: 800,000,000 tokens per token
22
+ - Buy price difference: 1000 (10x)
19
23
  - Default chain: BSC (testnet=97, mainnet=56)
20
24
 
21
25
  ## API Authentication
22
26
 
23
27
  - Use \`X-API-Key\` header with Agentverse API key
24
28
  - Key is read from \`.env\` AGENTVERSE_API_KEY
29
+ - No wallet signatures needed for API calls
30
+ - Redis caches validation for 5 minutes
25
31
 
26
32
  ## API Base URLs
27
33
 
28
- - Production: \`https://agent-launch.ai/api\`
29
- - Frontend: \`https://agent-launch.ai\`
34
+ - Production (default): \`https://agent-launch.ai/api\`
35
+ - Dev: \`https://launchpad-backend-dev-1056182620041.us-central1.run.app\`
36
+ - Set \`AGENT_LAUNCH_ENV=dev\` to use dev URLs
37
+ - Direct override: set \`AGENT_LAUNCH_API_URL\`
38
+
39
+ ## Wallet & Key Management
40
+
41
+ - Agents have auto-provisioned Fetch.ai wallets (\`fetch1...\`) via \`agent.wallet\`
42
+ - For BSC/EVM operations, agents store private keys via Agentverse Secrets API
43
+ - Handoff links are used for irreversible actions (token deployment, 120 FET)
44
+ - Autonomous trading uses agent-held keys for routine operations
45
+ - Deploy link: \`https://agent-launch.ai/deploy/{tokenId}\`
46
+ - Trade link: \`https://agent-launch.ai/trade/{tokenAddress}?action=buy&amount=100\`
47
+
48
+ ### Wallet Access (Runtime-Verified)
30
49
 
31
- ## Key Endpoints
50
+ - \`ctx.wallet\` **DOES NOT EXIST** — never use it
51
+ - \`agent.wallet\` **EXISTS** — \`cosmpy.aerial.wallet.LocalWallet\`
52
+ - \`ctx.ledger\` **EXISTS** — \`cosmpy.aerial.client.LedgerClient\`
53
+ - Balance query: \`ctx.ledger.query_bank_balance(str(agent.wallet.address()), "atestfet")\`
54
+
55
+ ## Key Endpoints (VERIFIED - always use these exact paths)
32
56
 
33
57
  \`\`\`
34
- POST /agents/tokenize Create token -> handoff link
35
- GET /tokens List tokens
36
- GET /tokens/address/{address} Token details by address
37
- GET /tokens/id/{id} Token details by ID
38
- GET /tokens/calculate-buy Preview buy
39
- GET /tokens/calculate-sell Preview sell
40
- GET /agents/my-agents List your agents
41
- GET /agents/token/{address}/holders Token holder list
42
- POST /agents/auth Exchange API key for JWT
43
- GET /comments/{address} Get comments
44
- POST /comments/{address} Post comment
45
- GET /platform/stats Platform statistics
58
+ GET /tokens List tokens
59
+ GET /tokens/address/{address} Token details by address
60
+ GET /tokens/id/{id} Token details by ID
61
+ GET /tokens/calculate-buy Preview buy
62
+ GET /tokens/calculate-sell Preview sell
63
+
64
+ POST /agents/tokenize Create token -> handoff link
65
+ GET /agents/my-agents List your agents
66
+ GET /agents/token/{address}/holders Token holder list
67
+ POST /agents/auth Exchange API key for JWT
68
+
69
+ GET /comments/{address} Get comments
70
+ POST /comments/{address} Post comment
71
+
72
+ GET /platform/stats Platform stats
46
73
  \`\`\`
47
74
 
48
- ## Handoff Protocol
75
+ ## Common Path Mistakes (NEVER use these)
49
76
 
50
- Token deployment requires a human signature:
51
- 1. Agent calls API to create token record
52
- 2. API returns handoff link
53
- 3. Agent shares link with human
54
- 4. Human signs transaction
77
+ | WRONG | CORRECT |
78
+ |-------|---------|
79
+ | \`POST /tokenize\` | \`POST /agents/tokenize\` |
80
+ | \`GET /token/{address}\` | \`GET /tokens/address/{address}\` |
81
+ | \`GET /token/{address}/holders\` | \`GET /agents/token/{address}/holders\` |
82
+ | \`GET /my-agents\` | \`GET /agents/my-agents\` |
83
+ | \`POST /auth\` | \`POST /agents/auth\` |
55
84
 
56
- Once deployed, agents CAN trade autonomously via HoldingsManager + BSC_PRIVATE_KEY.
57
- `,
85
+ ## Fee Rule (Enforced)
86
+
87
+ The 2% trading fee goes 100% to REVENUE_ACCOUNT (protocol treasury).
88
+ There is NO creator fee split. Never write "1% creator", "split evenly",
89
+ "creator earnings from fees", or any CREATOR_FEE constant.
90
+ This applies to ALL files: code, docs, comments, marketing copy.
91
+
92
+ ## Token Lifecycle
93
+
94
+ 1. Agent calls POST /agents/tokenize with agentAddress, name, symbol, description, chainId
95
+ 2. API returns token record with handoff link
96
+ 3. Human visits link, connects wallet, signs transaction (pays 120 FET)
97
+ 4. Token deploys on-chain with bonding curve
98
+ 5. At 30,000 FET liquidity, auto-lists on DEX (Uniswap/PancakeSwap)`,
58
99
  "agentverse.md": `# Agentverse Deployment Rules
59
100
 
60
- ## API: https://agentverse.ai/v1
61
- ## Auth: Authorization: Bearer <AGENTVERSE_API_KEY>
101
+ When deploying agents to Agentverse:
102
+
103
+ ## API Base URL
104
+
105
+ \`\`\`
106
+ https://agentverse.ai/v1
107
+ \`\`\`
108
+
109
+ ## Auth Header
110
+
111
+ \`\`\`
112
+ Authorization: Bearer <AGENTVERSE_API_KEY>
113
+ \`\`\`
114
+
115
+ Note: Capital "Bearer", followed by space, then the raw API key.
62
116
 
63
117
  ## CRITICAL: Code Upload Format
64
118
 
65
119
  The code field MUST be double-encoded JSON:
120
+
66
121
  \`\`\`python
67
122
  code_array = [{"language": "python", "name": "agent.py", "value": source_code}]
68
123
  payload = {"code": json.dumps(code_array)}
69
124
  \`\`\`
70
125
 
126
+ Sending the raw array (not json.dumps'd) causes: "Invalid code format"
127
+
71
128
  ## Agent Code Requirements
72
129
 
73
- - Use \`Agent()\` with zero params
74
- - Use Chat Protocol v0.3.0
75
- - Must have \`ChatAcknowledgement\` handler
130
+ - Use \`Agent()\` with zero params (Agentverse provides config)
131
+ - Use Chat Protocol v0.3.0 from \`uagents_core.contrib.protocols.chat\`
132
+ - Must have \`@chat_proto.on_message(ChatAcknowledgement)\` handler
76
133
  - Use \`ctx.logger\`, never \`print()\`
77
- - Use \`datetime.now()\` not \`utcnow()\`
78
- - Include \`publish_manifest=True\`
134
+ - Use \`datetime.now()\` not \`datetime.utcnow()\` (deprecated)
135
+ - End sessions with \`EndSessionContent\`
136
+ - Include \`publish_manifest=True\` in \`agent.include()\`
79
137
 
80
138
  ## Deployment Flow
81
139
 
82
- 1. POST /v1/hosting/agents -> creates agent
83
- 2. PUT /v1/hosting/agents/{addr}/code -> upload
84
- 3. POST /v1/hosting/secrets -> set secrets
85
- 4. POST /v1/hosting/agents/{addr}/start -> start
86
- 5. Poll until compiled (15-60s)
87
- `,
140
+ 1. \`POST /v1/hosting/agents\` -- creates agent, returns address
141
+ 2. \`PUT /v1/hosting/agents/{addr}/code\` -- upload (double-encoded!)
142
+ 3. \`POST /v1/hosting/secrets\` -- set AGENTVERSE_API_KEY etc.
143
+ 4. \`POST /v1/hosting/agents/{addr}/start\` -- start agent
144
+ 5. \`GET /v1/hosting/agents/{addr}\` -- poll until compiled=true (15-60s)
145
+ 6. \`GET /v1/hosting/agents/{addr}/logs\` -- verify running
146
+
147
+ ## Common Errors
148
+
149
+ - "Invalid code format" -- code field not json.dumps'd
150
+ - Agent stuck in "compiling" -- wait longer, check logs for syntax errors
151
+ - 401 Unauthorized -- bad API key or missing "bearer" prefix
152
+ - Agent listing response is \`{ items: [...] }\` not \`{ agents: [...] }\`
153
+
154
+ ## Available Packages on Agentverse
155
+
156
+ - \`uagents\`, \`uagents_core\`
157
+ - \`requests\`, \`openai\`
158
+ - Python standard library
159
+
160
+ ## Secrets
161
+
162
+ Set secrets via POST /v1/hosting/secrets:
163
+ \`\`\`json
164
+ {
165
+ "address": "agent1q...",
166
+ "name": "AGENTVERSE_API_KEY",
167
+ "secret": "av-xxx"
168
+ }
169
+ \`\`\`
170
+
171
+ List secrets: GET /v1/hosting/secrets?address=agent1q...`,
172
+ "api-design.md": `---
173
+ paths:
174
+ - "packages/sdk/src/**/*.ts"
175
+ - "packages/cli/src/**/*.ts"
176
+ - "packages/mcp/src/**/*.ts"
177
+ ---
178
+
179
+ # API Design Rules
180
+
181
+ ## Endpoints
182
+ - GET /api/{resource} - List
183
+ - POST /api/{resource} - Create
184
+ - GET /api/{resource}/:id - Read
185
+ - PUT /api/{resource}/:id - Update
186
+ - DELETE /api/{resource}/:id - Delete
187
+
188
+ ## Response Format
189
+ {
190
+ "success": boolean,
191
+ "data": object | array,
192
+ "error": null | { "code": string, "message": string }
193
+ }
194
+
195
+ ## Status Codes
196
+ - 200: Success
197
+ - 201: Created
198
+ - 400: Bad Request (validation)
199
+ - 401: Unauthorized
200
+ - 403: Forbidden
201
+ - 404: Not Found
202
+ - 500: Server Error
203
+
204
+ ## Pagination
205
+ - Query: ?page=1&limit=20
206
+ - Response meta: { page, limit, total, totalPages }`,
207
+ "api-paths.md": `# API Paths Reference (VERIFIED)
208
+
209
+ These paths have been tested against the live API and are the ONLY correct paths.
210
+ When writing code, tests, or documentation, ALWAYS use these exact paths.
211
+
212
+ ## Base URL
213
+
214
+ \`\`\`
215
+ https://agent-launch.ai/api
216
+ \`\`\`
217
+
218
+ ## Verified Endpoints
219
+
220
+ ### Tokens
221
+
222
+ | Method | Path | Description |
223
+ |--------|------|-------------|
224
+ | \`GET\` | \`/tokens\` | List all tokens |
225
+ | \`GET\` | \`/tokens/address/{address}\` | Get token by contract address |
226
+ | \`GET\` | \`/tokens/id/{id}\` | Get token by numeric ID |
227
+ | \`GET\` | \`/tokens/calculate-buy\` | Simulate buy (params: address, fetAmount) |
228
+ | \`GET\` | \`/tokens/calculate-sell\` | Simulate sell (params: address, tokenAmount) |
229
+
230
+ ### Agents
231
+
232
+ | Method | Path | Description |
233
+ |--------|------|-------------|
234
+ | \`POST\` | \`/agents/tokenize\` | Create token for an agent |
235
+ | \`GET\` | \`/agents/my-agents\` | List caller's Agentverse agents |
236
+ | \`GET\` | \`/agents/token/{address}/holders\` | Get token holder list |
237
+ | \`POST\` | \`/agents/auth\` | Exchange API key for JWT |
238
+
239
+ ### Comments
240
+
241
+ | Method | Path | Description |
242
+ |--------|------|-------------|
243
+ | \`GET\` | \`/comments/{address}\` | Get comments for a token |
244
+ | \`POST\` | \`/comments/{address}\` | Post a comment |
245
+
246
+ ### Platform
247
+
248
+ | Method | Path | Description |
249
+ |--------|------|-------------|
250
+ | \`GET\` | \`/platform/stats\` | Platform-wide statistics |
251
+
252
+ ## WRONG vs CORRECT Paths
253
+
254
+ These mistakes are common. NEVER use the wrong paths:
255
+
256
+ | WRONG (will 404) | CORRECT |
257
+ |------------------|---------|
258
+ | \`POST /tokenize\` | \`POST /agents/tokenize\` |
259
+ | \`GET /token/{address}\` | \`GET /tokens/address/{address}\` |
260
+ | \`GET /tokens/{address}\` | \`GET /tokens/address/{address}\` |
261
+ | \`GET /tokens/{id}\` | \`GET /tokens/id/{id}\` |
262
+ | \`GET /token/{address}/holders\` | \`GET /agents/token/{address}/holders\` |
263
+ | \`GET /my-agents\` | \`GET /agents/my-agents\` |
264
+ | \`POST /auth\` | \`POST /agents/auth\` |
265
+ | \`GET /stats\` | \`GET /platform/stats\` |
266
+
267
+ ## SDK Function to Path Mapping
268
+
269
+ | SDK Function | Correct Path |
270
+ |--------------|--------------|
271
+ | \`listTokens()\` | \`GET /tokens\` |
272
+ | \`getToken(address)\` | \`GET /tokens/address/{address}\` |
273
+ | \`tokenize(params)\` | \`POST /agents/tokenize\` |
274
+ | \`calculateBuy(address, amount)\` | \`GET /tokens/calculate-buy\` |
275
+ | \`calculateSell(address, amount)\` | \`GET /tokens/calculate-sell\` |
276
+ | \`getTokenHolders(address)\` | \`GET /agents/token/{address}/holders\` |
277
+ | \`getComments(address)\` | \`GET /comments/{address}\` |
278
+ | \`postComment(params)\` | \`POST /comments/{address}\` |
279
+ | \`authenticate(key)\` | \`POST /agents/auth\` |
280
+ | \`getMyAgents()\` | \`GET /agents/my-agents\` |
281
+ | \`getPlatformStats()\` | \`GET /platform/stats\` |
282
+
283
+ ## Enforcement
284
+
285
+ When reviewing or writing code that makes API calls:
286
+ 1. Check that the path matches this reference
287
+ 2. If you see an old/wrong path, fix it immediately
288
+ 3. Reference \`docs/paths.md\` for full documentation with examples`,
289
+ "consumer-payments.md": `# Consumer Payments Rules
290
+
291
+ ## Multi-Token Support
292
+
293
+ The toolkit supports FET and USDC on BSC (Testnet chain 97, Mainnet chain 56).
294
+
295
+ ### Known Token Addresses
296
+
297
+ | Token | Chain | Address |
298
+ |-------|-------|---------|
299
+ | FET | BSC Testnet (97) | \`0x304ddf3eE068c53514f782e2341B71A80c8aE3C7\` |
300
+ | FET | BSC Mainnet (56) | \`0xBd5df99ABe0E2b1e86BE5eC0039d1e24de28Fe87\` |
301
+ | USDC | BSC Testnet (97) | \`0x64544969ed7EBf5f083679233325356EbE738930\` |
302
+ | USDC | BSC Mainnet (56) | \`0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d\` |
303
+
304
+ ### Token Registry
305
+
306
+ Use \`getToken(symbol, chainId)\` to look up tokens. Never hardcode addresses.
307
+
308
+ \`\`\`typescript
309
+ import { getToken, KNOWN_TOKENS } from 'agentlaunch-sdk';
310
+ const fet = getToken('FET', 97); // PaymentToken object
311
+ const usdc = getToken('USDC', 97); // PaymentToken object
312
+ \`\`\`
313
+
314
+ ## Spending Delegation
315
+
316
+ Uses standard ERC-20 \`approve()\` / \`transferFrom()\` — no custom contracts.
317
+
318
+ ### Flow
319
+
320
+ 1. Agent generates delegation handoff link → sends to human
321
+ 2. Human opens link, connects wallet, signs \`approve()\` transaction
322
+ 3. Agent checks allowance on-chain with \`checkAllowance()\`
323
+ 4. Agent spends from delegation with \`spendFromDelegation()\` (calls \`transferFrom\`)
324
+
325
+ ### SDK Functions
326
+
327
+ \`\`\`typescript
328
+ import { checkAllowance, spendFromDelegation, createSpendingLimitHandoff } from 'agentlaunch-sdk';
329
+
330
+ // Generate link for human to approve
331
+ const link = createSpendingLimitHandoff({ tokenSymbol: 'FET', amount: '100' }, agentWallet);
332
+
333
+ // Check on-chain allowance
334
+ const limit = await checkAllowance(tokenAddress, ownerAddress, spenderAddress, 97);
335
+
336
+ // Spend from delegation
337
+ const result = await spendFromDelegation(tokenAddress, owner, recipient, '10');
338
+ \`\`\`
339
+
340
+ ## Invoices
341
+
342
+ Invoices are stored in Agentverse agent storage (consistent with existing revenue/pricing patterns).
343
+
344
+ ### Storage Keys
345
+
346
+ - \`invoice_{id}\` — Individual invoice JSON
347
+ - \`invoice_index\` — Array of invoice IDs
348
+
349
+ ### Invoice Lifecycle
350
+
351
+ \`pending\` → \`paid\` → (done)
352
+ \`pending\` → \`expired\`
353
+ \`paid\` → \`refunded\`
354
+ \`paid\` → \`disputed\`
355
+
356
+ ### SDK Functions
357
+
358
+ \`\`\`typescript
359
+ import { createInvoice, getInvoice, listInvoices, updateInvoiceStatus } from 'agentlaunch-sdk';
360
+
361
+ const inv = await createInvoice(agentAddress, { id, issuer, payer, service, amount });
362
+ const invoices = await listInvoices(agentAddress, 'pending');
363
+ await updateInvoiceStatus(agentAddress, invoiceId, 'paid', txHash);
364
+ \`\`\`
365
+
366
+ ## Fiat Onramp
367
+
368
+ Fiat is handoff-only — generate URLs to MoonPay/Transak, never process fiat directly.
369
+
370
+ ### Supported Providers
371
+
372
+ | Provider | Env Var | URL |
373
+ |----------|---------|-----|
374
+ | MoonPay | \`MOONPAY_API_KEY\` | \`https://buy.moonpay.com\` |
375
+ | Transak | \`TRANSAK_API_KEY\` | \`https://global.transak.com\` |
376
+
377
+ ### SDK Function
378
+
379
+ \`\`\`typescript
380
+ import { generateFiatOnrampLink } from 'agentlaunch-sdk';
381
+
382
+ const link = generateFiatOnrampLink({
383
+ fiatAmount: '50',
384
+ fiatCurrency: 'USD',
385
+ cryptoToken: 'FET',
386
+ walletAddress: '0x...',
387
+ provider: 'moonpay',
388
+ });
389
+ // Returns { provider, url }
390
+ \`\`\`
391
+
392
+ ## Consumer Commerce Template
393
+
394
+ The \`consumer-commerce\` template generates agents with:
395
+ - MultiTokenPricingTable — FET + USDC columns
396
+ - InvoiceManager — CRUD in ctx.storage
397
+ - FiatOnrampHelper — card purchase link generation
398
+ - DelegationChecker — verify allowance before auto-pay
399
+
400
+ ### Presets
401
+
402
+ | Preset | Symbol | Use Case |
403
+ |--------|--------|----------|
404
+ | \`payment-processor\` | $PAY | Multi-token payment routing |
405
+ | \`booking-agent\` | $BOOK | Service booking + payment |
406
+ | \`subscription-manager\` | $SUB | Recurring billing with delegation |
407
+ | \`escrow-service\` | $ESCR | Funds held until delivery confirmed |
408
+
409
+ ### Scaffold Command
410
+
411
+ \`\`\`bash
412
+ agentlaunch scaffold my-agent --type consumer-commerce
413
+ \`\`\`
414
+
415
+ ## MCP Tools
416
+
417
+ | Tool | Description |
418
+ |------|-------------|
419
+ | \`multi_token_payment\` | Send FET, USDC, or ERC-20 payment |
420
+ | \`check_spending_limit\` | Read ERC-20 allowance |
421
+ | \`create_delegation\` | Generate delegation handoff link |
422
+ | \`get_fiat_link\` | Generate MoonPay/Transak URL |
423
+ | \`create_invoice\` | Create payment invoice |
424
+ | \`list_invoices\` | List invoices by status |
425
+ | \`get_multi_token_balances\` | Query FET + USDC + BNB balances |
426
+
427
+ ## CLI Commands
428
+
429
+ \`\`\`bash
430
+ agentlaunch wallet balances # Multi-token balance display
431
+ agentlaunch wallet delegate FET 100 --spender 0x... # Generate delegation link
432
+ agentlaunch wallet allowance FET --owner 0x... --spender 0x... # Check limit
433
+ agentlaunch wallet send USDC 0x... 10 # Multi-token transfer
434
+ agentlaunch pay 0x... 10 --token USDC # Pay in any token
435
+ agentlaunch invoice create --agent agent1q... --payer 0x... --service api --amount 10
436
+ agentlaunch invoice list --agent agent1q... --status pending
437
+ \`\`\`
438
+
439
+ ## Backward Compatibility
440
+
441
+ - All new type fields are optional — existing FET-only agents are unchanged
442
+ - New fields on PricingEntry: \`altPrices?\`, \`acceptedTokens?\`
443
+ - New fields on AgentRevenue: \`revenueByToken?\`
444
+ - New fields on AgentCommerceStatus: \`usdcBalance?\`, \`tokenBalances?\`, \`activeInvoices?\`, \`delegations?\`
445
+ - Default token is always FET when not specified`,
446
+ "marketing-swarm.md": `# Marketing Team Swarm Rules
447
+
448
+ ## The 7 Roles
449
+
450
+ | Role | Token | Services | Price/call | Interval |
451
+ |------|-------|----------|-----------|----------|
452
+ | Writer | $WRITE | blog_post, tweet_thread, newsletter, ad_copy | 0.01 FET | on-demand |
453
+ | Social | $POST | post_tweet, schedule_thread, reply_mentions | 0.005 FET | 5 min |
454
+ | Community | $COMM | moderate, answer_faq, run_poll | 0.002 FET | 1 min |
455
+ | Analytics | $STATS | engagement_report, audience_insights, content_performance | 0.005 FET | 5 min |
456
+ | Outreach | $REACH | find_partners, draft_pitch, send_email | 0.01 FET | on-demand |
457
+ | Ads | $ADS | create_ad, ab_test, campaign_report | 0.01 FET | 5 min |
458
+ | Strategy | $PLAN | content_calendar, brand_audit, competitor_analysis, campaign_plan | 0.02 FET | on-demand |
459
+
460
+ ## Build Order
461
+
462
+ Writer -> Community -> Social -> Analytics -> Outreach -> Ads -> Strategy
463
+
464
+ Writer first (everyone needs content), Community second (standalone engagement).
465
+
466
+ ## Starter Configurations
467
+
468
+ - **Content only**: Writer (1 agent)
469
+ - **Social presence**: Writer + Social (2 agents)
470
+ - **Community**: Writer + Community + Social (3 agents)
471
+ - **Analytics stack**: Writer + Social + Analytics (3 agents)
472
+ - **Full team**: All 7
473
+
474
+ ## Customizing SwarmBusiness
475
+
476
+ The swarm-starter template marks the business logic section:
477
+ \`\`\`python
478
+ # === YOUR SWARM LOGIC ===
479
+ \`\`\`
480
+
481
+ This is where you add:
482
+ - Custom message handlers for your services
483
+ - Interval tasks for background work
484
+ - Integration with external APIs
485
+ - Agent-to-agent communication logic
486
+
487
+ ## Adding New Roles
488
+
489
+ 1. Define the role's services and pricing
490
+ 2. Create a preset in \`packages/templates/src/presets.ts\`
491
+ 3. Generate from swarm-starter template with role variables
492
+ 4. Deploy and wire into the swarm
493
+
494
+ ## Cross-Holdings
495
+
496
+ Agents can buy each other's tokens:
497
+ - Strategy buys Writer tokens (values its content)
498
+ - Writer buys Analytics tokens (values its performance data)
499
+ - Creates economic alignment between agents
500
+
501
+ ## Token Lifecycle
502
+
503
+ 1. Deploy agent on Agentverse
504
+ 2. Tokenize on AgentLaunch (120 FET deploy fee)
505
+ 3. Bonding curve active (2% fee to protocol treasury, NO creator fee)
506
+ 4. At 30,000 FET -> auto DEX listing (graduation)`,
507
+ "payment-protocol.md": `# Payment Protocol Rules
508
+
509
+ > **Status:** Payment protocol import verified available on Agentverse (2026-03-04).
510
+
511
+ ## Official Imports (uagents_core)
512
+
513
+ \`\`\`python
514
+ from uagents_core.contrib.protocols.payment import (
515
+ RequestPayment,
516
+ CommitPayment,
517
+ CompletePayment,
518
+ RejectPayment,
519
+ CancelPayment,
520
+ Funds,
521
+ payment_protocol_spec,
522
+ )
523
+ \`\`\`
524
+
525
+ ## Protocol Creation
526
+
527
+ \`\`\`python
528
+ from uagents import Protocol
529
+
530
+ # Seller side (agents that charge for services):
531
+ payment_proto = Protocol(spec=payment_protocol_spec, role="seller")
532
+
533
+ # Buyer side (agents that pay for services):
534
+ payment_proto = Protocol(spec=payment_protocol_spec, role="buyer")
535
+ \`\`\`
536
+
537
+ **Note:** The payment protocol has defined roles. You MUST specify \`role="seller"\` or \`role="buyer"\` when creating the protocol. \`agent.create_protocol()\` does NOT exist on Agentverse. Always use \`Protocol(spec=..., role=...)\`.
538
+
539
+ ## Payment Flow
540
+
541
+ \`\`\`
542
+ Buyer Seller
543
+ | |
544
+ | ChatMessage (service req) |
545
+ |----------------------------->|
546
+ | |
547
+ | RequestPayment |
548
+ |<-----------------------------|
549
+ | |
550
+ | CommitPayment (tx_hash) |
551
+ |----------------------------->|
552
+ | |
553
+ | [verifies on-chain] |
554
+ | |
555
+ | CompletePayment (result) |
556
+ |<-----------------------------|
557
+ \`\`\`
558
+
559
+ ## Denomination
560
+
561
+ | Network | Denom | Rate |
562
+ |---------|-------|------|
563
+ | Testnet | atestfet | 1 FET = 10^18 atestfet |
564
+ | Mainnet | afet | 1 FET = 10^18 afet |
565
+
566
+ Common amounts:
567
+ - 0.001 FET = 1,000,000,000,000,000 atestfet
568
+ - 0.01 FET = 10,000,000,000,000,000 atestfet
569
+ - 1 FET = 1,000,000,000,000,000,000 atestfet
570
+
571
+ ## Error Handling
572
+
573
+ - Always handle \`RejectPayment\` -- buyer may decline
574
+ - Always handle \`CancelPayment\` -- timeout or cancellation
575
+ - Verify tx_hash on-chain before delivering service
576
+ - Store transaction log in \`ctx.storage\`
577
+
578
+ ## Swarm-Starter Template Commerce Layers
579
+
580
+ The swarm-starter template includes these commerce classes inline:
581
+ - \`PaymentService\`: Seller-side payment handling
582
+ - \`PricingTable\`: Per-service pricing from ctx.storage
583
+ - \`TierManager\`: Token-gated access (free/premium)
584
+ - \`WalletManager\`: Balance queries, fund alerts
585
+ - \`RevenueTracker\`: Income/expense logging
586
+ - \`SelfAwareMixin\`: Token price/holder awareness
587
+ - \`HoldingsManager\`: Direct on-chain token operations`,
588
+ "security-checklist.md": `---
589
+ paths:
590
+ - "packages/**/*.ts"
591
+ ---
592
+
593
+ # Security Checklist
594
+
595
+ ## Backend
596
+ - Input validation on all endpoints
597
+ - JWT expiration configured
598
+ - Secrets in .env only
599
+ - CORS restricted
600
+ - Error messages don't leak internals
601
+
602
+ ## Frontend
603
+ - No secrets in client code
604
+ - Sanitize user input
605
+ - Validate wallet addresses
606
+
607
+ ## Smart Contracts
608
+ - Reentrancy guard on state changes
609
+ - Access control validated
610
+ - Events for all state changes
611
+ - No hardcoded addresses (use constructor)
612
+
613
+ ## General
614
+ - npm audit regularly
615
+ - No private keys in code
616
+ - .env in .gitignore`,
617
+ "testing.md": `---
618
+ paths:
619
+ - "packages/**/*.spec.ts"
620
+ - "packages/**/*.test.ts"
621
+ ---
622
+
623
+ # Testing Rules
624
+
625
+ ## SDK / CLI / MCP (Jest)
626
+ - Co-located: *.spec.ts or *.test.ts
627
+ - Mock with jest.mock()
628
+ - beforeEach/afterEach for setup/cleanup
629
+
630
+ ## Integration Tests
631
+ - Test SDK against mock API server
632
+ - Test CLI commands with mocked HTTP
633
+ - Test MCP tools with mock context`,
88
634
  "uagent-patterns.md": `# uAgent Code Patterns
89
635
 
90
- > For new agents, run: \`npx agentlaunch myagent\` (uses chat-memory template by default)
636
+ When writing Agentverse agent code:
637
+
638
+ > **For new agents, use the swarm-starter template:** \`agentlaunch scaffold myagent --type swarm-starter\`
639
+ > It includes the full commerce stack (payments, pricing, tiers, revenue tracking).
91
640
 
92
641
  ## Minimal Working Agent
93
642
 
@@ -99,7 +648,7 @@ from uagents_core.contrib.protocols.chat import (
99
648
  )
100
649
  from datetime import datetime
101
650
 
102
- agent = Agent()
651
+ agent = Agent() # Zero params on Agentverse
103
652
  chat_proto = Protocol(spec=chat_protocol_spec)
104
653
 
105
654
  @chat_proto.on_message(ChatMessage)
@@ -112,6 +661,7 @@ async def handle_message(ctx: Context, sender: str, msg: ChatMessage):
112
661
  msg_id=msg.msg_id,
113
662
  content=[TextContent(text=f"You said: {text}")]
114
663
  ))
664
+
115
665
  await ctx.send(sender, ChatMessage(
116
666
  timestamp=datetime.now(),
117
667
  msg_id=msg.msg_id,
@@ -120,7 +670,7 @@ async def handle_message(ctx: Context, sender: str, msg: ChatMessage):
120
670
 
121
671
  @chat_proto.on_message(ChatAcknowledgement)
122
672
  async def handle_ack(ctx: Context, sender: str, msg: ChatAcknowledgement):
123
- ctx.logger.info(f"Ack: {msg.acknowledged_msg_id}")
673
+ ctx.logger.info(f"Ack from {sender}: {msg.acknowledged_msg_id}")
124
674
 
125
675
  agent.include(chat_proto, publish_manifest=True)
126
676
 
@@ -128,35 +678,34 @@ if __name__ == "__main__":
128
678
  agent.run()
129
679
  \`\`\`
130
680
 
131
- ## Payment Protocol (Official)
681
+ ## Rules
132
682
 
133
- \`\`\`python
134
- from uagents_core.contrib.protocols.payment import (
135
- RequestPayment, CommitPayment, CompletePayment,
136
- RejectPayment, CancelPayment, Funds, payment_protocol_spec,
137
- )
683
+ - Always use \`Agent()\` with zero params on Agentverse
684
+ - Always include \`ChatAcknowledgement\` handler (required by protocol)
685
+ - Always end conversations with \`EndSessionContent\`
686
+ - Always use \`ctx.logger\` (never \`print\`)
687
+ - Always use \`datetime.now()\` (never \`utcnow\`, it is deprecated)
688
+ - Always include \`publish_manifest=True\` in \`agent.include()\`
689
+ - Use \`Protocol(spec=chat_protocol_spec)\` — \`agent.create_protocol()\` does NOT exist on Agentverse
138
690
 
139
- # Seller (service provider)
140
- seller_proto = Protocol(spec=payment_protocol_spec)
691
+ ## Required Imports
141
692
 
142
- # Buyer (service consumer)
143
- buyer_proto = Protocol(spec=payment_protocol_spec)
693
+ \`\`\`python
694
+ from uagents import Agent, Context, Protocol, Model
695
+ from uagents_core.contrib.protocols.chat import (
696
+ ChatAcknowledgement, ChatMessage, TextContent,
697
+ EndSessionContent, chat_protocol_spec
698
+ )
699
+ from datetime import datetime
144
700
  \`\`\`
145
701
 
146
- ## Commerce Layer (Swarm-Starter Template)
702
+ ---
147
703
 
148
- The swarm-starter template includes inline commerce classes:
149
- - PaymentService: Charge callers, pay other agents
150
- - PricingTable: Per-service pricing from ctx.storage
151
- - TierManager: Token-gated access (free/premium)
152
- - WalletManager: Balance queries, fund alerts
153
- - RevenueTracker: Income/expense logging
154
- - SelfAwareMixin: Token price/holder awareness
155
- - HoldingsManager: Buy/sell other agents' tokens
156
- `,
157
- "payment-protocol.md": `# Payment Protocol Rules
704
+ ## Payment Protocol (Official)
158
705
 
159
- ## Official Imports (uagents_core)
706
+ Use the official payment protocol from \`uagents_core\`. Do NOT create custom payment models.
707
+
708
+ ### Imports
160
709
 
161
710
  \`\`\`python
162
711
  from uagents_core.contrib.protocols.payment import (
@@ -170,226 +719,1424 @@ from uagents_core.contrib.protocols.payment import (
170
719
  )
171
720
  \`\`\`
172
721
 
173
- ## Role-Based Protocol Creation
722
+ ### Protocol Creation
174
723
 
175
724
  \`\`\`python
176
- # Seller (service provider)
177
- seller_proto = Protocol(spec=payment_protocol_spec)
725
+ from uagents import Protocol
178
726
 
179
- # Buyer (service consumer)
180
- buyer_proto = Protocol(spec=payment_protocol_spec)
181
- \`\`\`
727
+ # Seller side (agents that charge for services):
728
+ payment_proto = Protocol(spec=payment_protocol_spec, role="seller")
182
729
 
183
- ## Payment Flow
730
+ # Buyer side (agents that pay for services):
731
+ payment_proto = Protocol(spec=payment_protocol_spec, role="buyer")
732
+ \`\`\`
184
733
 
185
- Buyer sends ChatMessage -> Seller sends RequestPayment -> Buyer sends CommitPayment (tx_hash) -> Seller verifies on-chain -> Seller sends CompletePayment.
734
+ **Note:** The payment protocol has defined roles. You MUST specify \`role="seller"\` or \`role="buyer"\` when creating the protocol. \`agent.create_protocol()\` does NOT exist on Agentverse. Always use \`Protocol(spec=..., role=...)\`.
186
735
 
187
- ## Denomination
736
+ ### Payment Flow
188
737
 
189
- - Testnet: atestfet (1 FET = 10^18 atestfet)
190
- - Mainnet: afet (1 FET = 10^18 afet)
738
+ \`\`\`
739
+ Buyer Seller
740
+ | |
741
+ | ChatMessage (service req) |
742
+ |----------------------------->|
743
+ | |
744
+ | RequestPayment |
745
+ |<-----------------------------|
746
+ | |
747
+ | CommitPayment (tx_hash) |
748
+ |----------------------------->|
749
+ | |
750
+ | [verifies on-chain] |
751
+ | |
752
+ | CompletePayment (result) |
753
+ |<-----------------------------|
754
+ \`\`\`
191
755
 
192
- ## Error Handling
756
+ ### Error Handling
193
757
 
194
- - Always handle RejectPayment -- buyer may decline
195
- - Always handle CancelPayment -- timeout or cancellation
758
+ - Always handle \`RejectPayment\` -- buyer may decline
759
+ - Always handle \`CancelPayment\` -- timeout or cancellation
196
760
  - Verify tx_hash on-chain before delivering service
197
- - Store transaction log in ctx.storage
761
+ - Store transaction log in \`ctx.storage\`
198
762
 
199
- ## Swarm-Starter Template Commerce Layers
763
+ See \`.claude/rules/payment-protocol.md\` for the full reference.
200
764
 
201
- The swarm-starter template includes these commerce classes inline:
202
- - PaymentService, PricingTable, TierManager
203
- - WalletManager, RevenueTracker, SelfAwareMixin, HoldingsManager
204
- `,
205
- "marketing-swarm.md": `# Marketing Team Rules
765
+ ---
206
766
 
207
- ## The 7 Roles
767
+ ## Wallet & Ledger Operations (Runtime-Verified 2026-03-04)
208
768
 
209
- | Role | Token | Services | Price/call |
210
- |------|-------|----------|-----------|
211
- | Writer | $WRITE | blog_post, tweet_thread, newsletter, ad_copy | 0.01 FET |
212
- | Social | $POST | post_tweet, schedule_thread, reply_mentions | 0.005 FET |
213
- | Community | $COMM | moderate, answer_faq, run_poll | 0.002 FET |
214
- | Analytics | $STATS | engagement_report, audience_insights, content_performance | 0.005 FET |
215
- | Outreach | $REACH | find_partners, draft_pitch, send_email | 0.01 FET |
216
- | Ads | $ADS | create_ad, ab_test, campaign_report | 0.01 FET |
217
- | Strategy | $PLAN | content_calendar, brand_audit, competitor_analysis, campaign_plan | 0.02 FET |
769
+ Every agent on Agentverse has a wallet. Key facts:
218
770
 
219
- ## Build Order
771
+ - **\`ctx.ledger\` EXISTS** — type \`cosmpy.aerial.client.LedgerClient\` (verified on Agentverse)
772
+ - **\`ctx.wallet\` DOES NOT EXIST** — not on the Context object
773
+ - **\`agent.wallet\` EXISTS** — type \`cosmpy.aerial.wallet.LocalWallet\` (use this instead)
774
+ - **Balance queries WORK** — \`ctx.ledger.query_bank_balance()\` returns int
220
775
 
221
- Writer -> Community -> Social -> Analytics -> Outreach -> Ads -> Strategy
776
+ ### Complete \`ctx\` Attributes (verified)
222
777
 
223
- Writer first (everyone needs content), Community second (standalone engagement).
778
+ \`\`\`
779
+ address, agent, envelopes, get_message_protocol, identifier,
780
+ ledger, logger, outbound_messages, protocols, send,
781
+ send_and_receive, send_raw, send_wallet_message, session,
782
+ session_history, storage, wallet_messages
783
+ \`\`\`
224
784
 
225
- ## Starter Configurations
785
+ ### Check Balance
226
786
 
227
- - Content only: Writer (1 agent)
228
- - Social presence: Writer + Social (2 agents)
229
- - Community: Writer + Community + Social (3 agents)
230
- - Analytics stack: Writer + Social + Analytics (3 agents)
231
- - Full team: All 7
787
+ \`\`\`python
788
+ agent = Agent()
232
789
 
233
- ## Cross-Holdings
790
+ async def check_balance(ctx: Context) -> int:
791
+ """Get agent's FET balance in atestfet (1 FET = 10^18 atestfet)."""
792
+ # Use agent.wallet (NOT ctx.wallet — it doesn't exist)
793
+ balance = ctx.ledger.query_bank_balance(str(agent.wallet.address()), "atestfet")
794
+ return int(balance)
795
+ \`\`\`
234
796
 
235
- Agents buy each other's tokens for economic alignment.
236
- - Strategy buys Writer tokens (values its content)
237
- - Writer buys Analytics tokens (values its performance data)
797
+ ### Send FET to Another Agent
238
798
 
239
- ## Token Lifecycle
799
+ \`\`\`python
800
+ agent = Agent()
240
801
 
241
- 1. Deploy on Agentverse
242
- 2. Tokenize on AgentLaunch (120 FET deploy fee)
243
- 3. Bonding curve active (2% fee to protocol treasury, NO creator fee)
244
- 4. At 30,000 FET -> auto DEX listing (graduation)
245
- `,
246
- "api-design.md": `# API Design Rules
802
+ async def send_fet(ctx: Context, recipient: str, amount_afet: int, denom: str = "atestfet") -> str:
803
+ """Send FET on Fetch.ai native chain."""
804
+ tx = ctx.ledger.send_tokens(
805
+ recipient, amount_afet, denom, agent.wallet # agent.wallet, NOT ctx.wallet
806
+ ).wait_to_complete()
807
+ ctx.logger.info(f"Sent {amount_afet} {denom} to {recipient}: {tx.tx_hash}")
808
+ return tx.tx_hash
809
+ \`\`\`
810
+
811
+ ### Denomination
247
812
 
248
- ## Response Format
249
- \`\`\`json
250
- {
251
- "success": boolean,
252
- "data": object | array,
253
- "error": null | { "code": string, "message": string }
254
- }
255
813
  \`\`\`
814
+ TESTNET: "atestfet" (1 FET = 10^18 atestfet)
815
+ MAINNET: "afet" (1 FET = 10^18 afet)
256
816
 
257
- ## Status Codes
258
- - 200: Success
259
- - 201: Created
260
- - 400: Bad Request
261
- - 401: Unauthorized
262
- - 404: Not Found
263
- - 429: Rate Limited
264
- - 500: Server Error
265
- `,
266
- "security-checklist.md": `# Security Checklist
817
+ Example: 0.01 FET = 10_000_000_000_000_000 atestfet
818
+ \`\`\`
267
819
 
268
- ## Agent Code
269
- - Input validation on all messages
270
- - Rate limiting per user
271
- - Secrets in .env only
272
- - Never log sensitive data
273
- - Sanitize user input
820
+ ### Two Wallet Systems
274
821
 
275
- ## General
276
- - No private keys in code
277
- - .env in .gitignore
278
- - Use ctx.logger not print
279
- `,
280
- "testing.md": `# Testing Rules
822
+ Agents may need TWO wallets for full functionality:
823
+
824
+ | | Fetch.ai Native (Cosmos) | BSC (EVM) |
825
+ |---|---|---|
826
+ | **Address** | \`fetch1...\` (auto-provisioned) | \`0x...\` (key in Agentverse Secrets) |
827
+ | **Access** | \`agent.wallet\` + \`ctx.ledger\` | web3.py + \`ctx.get_secret("WALLET_KEY")\` |
828
+ | **Used for** | Agent-to-agent FET payments | Token trading, bonding curve, deploy fee |
829
+ | **Library** | cosmpy (built-in) | web3, eth_account |
830
+
831
+ ---
832
+
833
+ ## Commerce Layer (Swarm-Starter Template)
834
+
835
+ The swarm-starter template includes a complete commerce stack inline. These classes are
836
+ generated directly into the agent code -- no external imports needed.
837
+
838
+ | Class | Purpose |
839
+ |-------|---------|
840
+ | \`PaymentService\` | Charge callers, pay other agents, verify on-chain transactions |
841
+ | \`PricingTable\` | Per-service pricing stored in \`ctx.storage\` |
842
+ | \`TierManager\` | Token-gated access: free tier vs. premium (hold tokens to unlock) |
843
+ | \`WalletManager\` | Balance queries, low-fund alerts |
844
+ | \`RevenueTracker\` | Income/expense logging, GDP contribution |
845
+ | \`SelfAwareMixin\` | Read own token price, holder count, market cap |
846
+ | \`HoldingsManager\` | Buy/sell other agents' tokens for cross-holdings |
847
+
848
+ To use the commerce layer, scaffold with the swarm-starter template:
281
849
 
282
- ## Local Testing
283
850
  \`\`\`bash
284
- source .env && python agent.py
851
+ agentlaunch scaffold myagent --type swarm-starter
852
+ # Or with a preset:
853
+ agentlaunch scaffold oracle-agent --type swarm-starter --preset oracle
854
+ \`\`\`
855
+
856
+ See \`.claude/rules/marketing-swarm.md\` for the 7 preset roles and build order.
857
+
858
+ ---
859
+
860
+ ## Storage Patterns
861
+
862
+ Use \`ctx.storage\` for persistent data:
863
+
864
+ \`\`\`python
865
+ # Set value (strings only)
866
+ ctx.storage.set("my_key", "my_value")
867
+ ctx.storage.set("count", str(123))
868
+ ctx.storage.set("data", json.dumps({"foo": "bar"}))
869
+
870
+ # Get value
871
+ value = ctx.storage.get("my_key") # Returns str or None
872
+ count = int(ctx.storage.get("count") or 0)
873
+ data = json.loads(ctx.storage.get("data") or "{}")
874
+
875
+ # Check exists
876
+ if ctx.storage.get("initialized"):
877
+ pass
878
+ \`\`\`
879
+
880
+ ---
881
+
882
+ ## Interval Tasks
883
+
884
+ \`\`\`python
885
+ @agent.on_interval(period=300.0) # Every 5 minutes
886
+ async def periodic_task(ctx: Context):
887
+ ctx.logger.info("Running periodic task")
888
+ balance = await check_balance(ctx)
889
+ ctx.storage.set("last_balance", str(balance))
890
+ \`\`\`
891
+
892
+ ---
893
+
894
+ ## Agentverse Allowed Imports
895
+
896
+ These are available on Agentverse hosted agents:
897
+
898
+ \`\`\`
899
+ uagents, uagents_core # Agent framework
900
+ cosmpy # Ledger operations
901
+ pydantic # Data validation
902
+ requests, aiohttp # HTTP
903
+ web3, eth_account # EVM interaction
904
+ datetime, json, hashlib, uuid # Standard library
905
+ \`\`\`
906
+
907
+ ---
908
+
909
+ ## Common Gotchas
910
+
911
+ 1. **Double-encoded code upload** -- When uploading via API, code must be JSON stringified twice
912
+ 2. **ChatAcknowledgement required** -- Always handle it, even if empty
913
+ 3. **datetime.utcnow() deprecated** -- Use \`datetime.now()\`
914
+ 4. **Agent listing is \`items\`** -- Response is \`{ items: [...] }\` not \`{ agents: [...] }\`
915
+ 5. **Wait for compilation** -- 15-60s after start before agent responds
916
+ 6. **Balance in atestfet** -- 1 FET = 10^18 atestfet, always use int not float
917
+ 7. **Use official payment protocol** -- Import from \`uagents_core.contrib.protocols.payment\`, not custom models (verified available on Agentverse)
918
+ 8. **agent.create_protocol() does NOT exist** -- Use \`Protocol(spec=...)\` directly
919
+ 9. **ctx.wallet DOES NOT EXIST** -- Use \`agent.wallet\` (module-scope Agent object). Never write \`ctx.wallet\`
920
+ 10. **ctx.ledger EXISTS** -- It's a \`cosmpy.aerial.client.LedgerClient\`. No \`hasattr\` guard needed
921
+ 11. **Logs endpoint is /logs/latest** -- \`GET /v1/hosting/agents/{addr}/logs/latest\`, NOT \`/logs\``,
922
+ "workflow.md": `# Agent Lifecycle Workflow (MANDATORY)
923
+
924
+ **Every agent deployment MUST follow the full workflow from \`docs/workflow.md\`.**
925
+ Skipping phases degrades agent ranking, discoverability, and ASI:One routing.
926
+
927
+ ## The 8 Phases
928
+
929
+ \`\`\`
930
+ [1] Create -> [2] Deploy -> [3] Optimize -> [4] Tokenize
931
+ [5] Handoff -> [6] Discover -> [7] Trade -> [8] Grow
285
932
  \`\`\`
286
933
 
287
- ## Deploy Testing
934
+ ## Phase 3: Optimize (NEVER SKIP)
935
+
936
+ After deploying an agent, you MUST complete the Setup Checklist before moving on:
937
+
938
+ ### Required (API-settable)
939
+
940
+ 1. **README** -- Write a compelling README with:
941
+ - One-line value proposition
942
+ - Capabilities list with specific examples
943
+ - 2-3 example conversations
944
+ - Pricing table (if agent charges)
945
+ - Keywords for search
946
+ - Push via \`PUT /v1/hosting/agents/{addr}\` with \`{"readme": "..."}\`
947
+
948
+ 2. **Short Description** -- 1-2 sentence bio for directory listings
949
+ - Push via \`PUT /v1/hosting/agents/{addr}\` with \`{"short_description": "..."}\`
950
+
951
+ 3. **Avatar** (if available) -- Custom image for visual identity
952
+ - Push via \`PUT /v1/hosting/agents/{addr}\` with \`{"avatar_url": "..."}\`
953
+
954
+ ### Manual (inform user)
955
+
956
+ 4. **@Handle** -- Dashboard only, no API. Suggest 3-5 options.
957
+ 5. **3+ Interactions** -- Tell user to chat with agent or use Response QA Agent.
958
+ 6. **Domain Verification** -- Optional bonus, DNS TXT record.
959
+
960
+ ### API Call Pattern
961
+
288
962
  \`\`\`bash
289
- agentlaunch deploy
290
- agentlaunch status <address>
963
+ curl -s -X PUT "https://agentverse.ai/v1/hosting/agents/{addr}" \\
964
+ -H "Authorization: Bearer $AGENTVERSE_API_KEY" \\
965
+ -H "Content-Type: application/json" \\
966
+ -d '{
967
+ "readme": "# Agent Name\\n\\nDescription...",
968
+ "short_description": "One-line description of what this agent does."
969
+ }'
291
970
  \`\`\`
292
- `,
971
+
972
+ ## Enforcement
973
+
974
+ When deploying agents (via /deploy, /build-agent, /build-swarm, or manual API calls):
975
+
976
+ 1. After confirming agent is compiled and running
977
+ 2. IMMEDIATELY set README and short_description
978
+ 3. Suggest avatar, handle, and test interactions to user
979
+ 4. Log optimization status in output
980
+
981
+ For swarm deployments: optimize ALL agents in the swarm, not just one.
982
+
983
+ ## README Template for Marketing Team Agents
984
+
985
+ \`\`\`markdown
986
+ # {Agent Name} -- {Role Description}
987
+
988
+ {One-line value proposition}
989
+
990
+ ## Services
991
+
992
+ | Service | Price | Description |
993
+ |---------|-------|-------------|
994
+ | {service} | {price} FET | {what it does} |
995
+
996
+ ## Example Conversation
997
+
998
+ **User:** {example input}
999
+ **Agent:** {example output}
1000
+
1001
+ ## Commands
1002
+
1003
+ - \`help\` -- list all commands
1004
+ - \`{command}\` -- {description}
1005
+ - \`revenue\` -- view earnings
1006
+ - \`balance\` -- check wallet
1007
+
1008
+ ## Part of the AgentLaunch Marketing Team
1009
+
1010
+ This agent is part of a 7-agent swarm: Writer, Social, Community, Analytics, Outreach, Ads, Strategy.
1011
+
1012
+ Built with [AgentLaunch](https://agent-launch.ai)
1013
+ \`\`\``,
293
1014
  };
294
1015
  // ---------------------------------------------------------------------------
295
1016
  // Skills — Claude's slash commands
296
1017
  // ---------------------------------------------------------------------------
297
1018
  export const SKILLS = {
298
- "build-agent/SKILL.md": `# /build-agentFull Agent Lifecycle
1019
+ "alliance/SKILL.md": `# /allianceDeploy the ASI Alliance Agent Economy
1020
+
1021
+ > **Secret command for ASI Alliance members.**
1022
+ > Deploys 27 agents representing every team in the Fetch.ai + SingularityNET ecosystem.
1023
+
1024
+ ---
1025
+
1026
+ ## What This Does
1027
+
1028
+ Deploys the complete Agent Economy in the correct sequence:
1029
+
1030
+ \`\`\`
1031
+ Wave 1 (Sequential): CTO → CFO → COO → CEO → CRO (5 agents)
1032
+ Wave 2 (Parallel): GUIDE, RANK, COACH, CONC, BRAND, DEV, GRANT (7 agents)
1033
+ Wave 3 (Parallel): All 15 SingularityNET ecosystem agents (15 agents)
1034
+ \`\`\`
1035
+
1036
+ **Total:** 27 agents, 3,240 FET deploy cost
1037
+
1038
+ ---
1039
+
1040
+ ## Execution
1041
+
1042
+ When the user types \`/alliance\`, follow this flow:
1043
+
1044
+ ### Step 1: Confirm Identity
1045
+
1046
+ Ask: "This deploys the full ASI Alliance economy (27 agents, ~3,240 FET). Are you ready?"
1047
+
1048
+ If they confirm, proceed.
1049
+
1050
+ ### Step 2: Check Prerequisites
1051
+
1052
+ \`\`\`bash
1053
+ # Check wallet balance
1054
+ npx agentlaunch wallet balances
1055
+
1056
+ # Need: ≥3,500 FET (3,240 deploy + 270 seeding)
1057
+ \`\`\`
1058
+
1059
+ If insufficient funds, suggest:
1060
+ - Claim from @gift agent (200 TFET)
1061
+ - Or provide a funding link
1062
+
1063
+ ### Step 3: Deploy Wave 1 — C-Suite (Sequential)
1064
+
1065
+ Deploy in this exact order (dependencies matter):
1066
+
1067
+ \`\`\`bash
1068
+ # 1. CTO first — everyone pays for reasoning
1069
+ npx agentlaunch scaffold the-cto --type swarm-starter --preset cto
1070
+ npx agentlaunch deploy the-cto/
1071
+
1072
+ # 2. CFO — treasury monitoring
1073
+ npx agentlaunch scaffold the-cfo --type swarm-starter --preset cfo
1074
+ npx agentlaunch deploy the-cfo/
1075
+
1076
+ # 3. COO — operations
1077
+ npx agentlaunch scaffold the-coo --type swarm-starter --preset coo
1078
+ npx agentlaunch deploy the-coo/
1079
+
1080
+ # 4. CEO — routing (depends on CTO, CFO)
1081
+ npx agentlaunch scaffold the-ceo --type swarm-starter --preset ceo
1082
+ npx agentlaunch deploy the-ceo/
1083
+
1084
+ # 5. CRO — recruitment (depends on CTO)
1085
+ npx agentlaunch scaffold the-cro --type swarm-starter --preset cro
1086
+ npx agentlaunch deploy the-cro/
1087
+ \`\`\`
1088
+
1089
+ After each deploy:
1090
+ - Set README + short_description (Phase 3 Optimize)
1091
+ - Record agent address
1092
+ - Confirm running before next
1093
+
1094
+ ### Step 4: Deploy Wave 2 — Fetch Internal (Parallel)
1095
+
1096
+ Deploy all 7 in parallel:
1097
+
1098
+ | Agent | Preset | Description |
1099
+ |-------|--------|-------------|
1100
+ | The Tour Guide | \`guide\` | Ecosystem onboarding |
1101
+ | The SEO Manager | \`rank\` | Agent discoverability |
1102
+ | The Business Coach | \`coach\` | Startup guidance |
1103
+ | The Concierge | \`conc\` | Consumer experience |
1104
+ | The Brand Manager | \`brand\` | Brand partnerships |
1105
+ | The Dev Advocate | \`dev\` | Developer support |
1106
+ | The Grants Officer | \`grant\` | Funding guidance |
1107
+
1108
+ ### Step 5: Deploy Wave 3 — SingularityNET (Parallel)
1109
+
1110
+ Deploy all 15:
1111
+
1112
+ | Agent | Token | Organisation |
1113
+ |-------|-------|--------------|
1114
+ | The Marketplace Manager | $MKTPL | SingularityNET |
1115
+ | The IT Manager | $INFRA | CUDOS |
1116
+ | The Facilities Manager | $EDGE | NuNet |
1117
+ | The Finance Controller | $FLOW | HyperCycle |
1118
+ | The Health Coach | $LIFE | Rejuve.AI |
1119
+ | The Lab Manager | $LAB | Rejuve Biotech |
1120
+ | The Editor | $ED | Mindplex |
1121
+ | The Fund Manager | $FUND | SingularityDAO |
1122
+ | The Yield Farmer | $YIELD | Singularity Finance |
1123
+ | The Treasury Manager | $STABLE | Cogito Protocol |
1124
+ | The EA | $EA | Twin Protocol |
1125
+ | The A&R Manager | $AR | Jam Galaxy |
1126
+ | The Strategy Director | $STRAT | TrueAGI |
1127
+ | The Research Scientist | $PHD | Zarqa / OpenCog |
1128
+ | The Talent Agent | $TALENT | Yaya Labs |
1129
+
1130
+ ### Step 6: Seed Cross-Holdings
1131
+
1132
+ After all agents deployed:
1133
+
1134
+ \`\`\`bash
1135
+ # CEO buys infrastructure tokens
1136
+ npx agentlaunch buy $CTO_TOKEN --amount 5
1137
+ npx agentlaunch buy $CFO_TOKEN --amount 5
1138
+ npx agentlaunch buy $GUIDE_TOKEN --amount 2
1139
+
1140
+ # COO buys monitoring dependencies
1141
+ npx agentlaunch buy $CEO_TOKEN --amount 3
1142
+ npx agentlaunch buy $CTO_TOKEN --amount 3
1143
+
1144
+ # Coalition cross-holdings...
1145
+ \`\`\`
1146
+
1147
+ ### Step 7: Verify & Report
1148
+
1149
+ \`\`\`bash
1150
+ npx agentlaunch status --swarm
1151
+ \`\`\`
1152
+
1153
+ Show summary:
1154
+ \`\`\`
1155
+ ╭────────────────────────────────────────────────────────────────╮
1156
+ │ ASI ALLIANCE ECONOMY DEPLOYED │
1157
+ ├────────────────────────────────────────────────────────────────┤
1158
+ │ Agents: 27 running │
1159
+ │ Tokens: 27 on bonding curves │
1160
+ │ GDP: Tracking... │
1161
+ │ Deploy: 3,240 FET │
1162
+ │ │
1163
+ │ C-Suite: CEO, CTO, CFO, COO, CRO │
1164
+ │ Fetch: GUIDE, RANK, COACH, CONC, BRAND, DEV, GRANT │
1165
+ │ SNET: MKTPL, INFRA, EDGE, FLOW, LIFE, LAB, ED, │
1166
+ │ FUND, YIELD, STABLE, EA, AR, STRAT, PHD, │
1167
+ │ TALENT │
1168
+ │ │
1169
+ │ Next: CRO will scout for more agents to recruit │
1170
+ ╰────────────────────────────────────────────────────────────────╯
1171
+ \`\`\`
1172
+
1173
+ ---
1174
+
1175
+ ## Named After Real People
1176
+
1177
+ These agents are named after real ASI Alliance leadership:
1178
+
1179
+ | Agent | Named After | Organisation |
1180
+ |-------|-------------|--------------|
1181
+ | The CEO ($CEO) | Humayun Sheikh | Fetch.ai / ASI Alliance |
1182
+ | The CTO ($CTO) | Thomas Hain | Fetch.ai (Co-Founder) |
1183
+ | The CRO ($CRO) | Sana Wajid | Fetch.ai Innovation Lab |
1184
+ | The Tour Guide ($GUIDE) | Maria Minaricova | Fetch.ai BD |
1185
+ | The Marketplace Manager ($MKTPL) | Ben Goertzel | SingularityNET |
1186
+ | The IT Manager ($INFRA) | Matt Hawkins | CUDOS |
1187
+
1188
+ ---
1189
+
1190
+ ## Related Docs
1191
+
1192
+ - [people.md](docs/people.md) — Full team roster + agent mapping
1193
+ - [the-agent-economy.md](docs/the-agent-economy.md) — Complete vision document
1194
+ - [agent-coordination.md](docs/agent-coordination.md) — Pitch deck version
1195
+
1196
+ ---
1197
+
1198
+ ## Output Style
1199
+
1200
+ Be elegant and helpful:
1201
+ - Show progress clearly
1202
+ - Celebrate each wave completion
1203
+ - Explain what each agent does as it deploys
1204
+ - End with clear next steps
1205
+
1206
+ **This is the flagship deployment. Make it feel special.**`,
1207
+ "build-agent/SKILL.md": `# /build-agent -- Full Agent Lifecycle
299
1208
 
300
1209
  Build, deploy, and tokenize an agent in one guided flow.
301
1210
 
302
1211
  ## Steps
303
1212
 
304
- 1. Ask user what agent they want (name, description, functionality)
305
- 2. Generate agent.py code based on description
306
- 3. Show code, let user request changes
307
- 4. Deploy: \`agentlaunch deploy\`
308
- 5. Tokenize: \`agentlaunch tokenize --agent <address> --name "Name" --symbol SYM\`
309
- 6. Return handoff link for human to sign
1213
+ 1. **Gather requirements**: Ask the user what kind of agent they want to build.
1214
+ Get the agent name, ticker symbol, and description.
310
1215
 
311
- ## Platform Fees
312
- - Deploy: 120 FET (paid by human signer)
313
- - Trading: 2% to protocol treasury
314
- `,
315
- "build-swarm/SKILL.md": `# /build-swarm Deploy Agent Swarm
1216
+ 2. **Choose a template**: Based on the description, pick one of:
1217
+ custom, price-monitor, trading-bot, data-analyzer, research, gifter.
1218
+ Confirm the choice with the user.
1219
+
1220
+ 3. **Scaffold the agent code**: Use the \`scaffold_agent\` MCP tool (or the
1221
+ templates package directly) to generate agent code from the template.
1222
+ Customize the generated code based on user requirements.
1223
+
1224
+ 4. **Review with user**: Show the generated code. Let them request changes.
1225
+
1226
+ 5. **Deploy to Agentverse**:
1227
+ - Use the \`deploy_to_agentverse\` MCP tool
1228
+ - Or manually: create agent, upload code (double-encoded JSON), set secrets, start
1229
+ - Poll until compiled (60s timeout)
1230
+ - Check logs for errors
1231
+
1232
+ 6. **Optimize** (MANDATORY -- Phase 3 of \`docs/workflow.md\`):
1233
+ - Write a compelling README with: value proposition, services, example conversations, pricing
1234
+ - Write a short_description (1-2 sentences for directory listing)
1235
+ - Push via \`PUT /v1/hosting/agents/{addr}\` with \`{"readme": "...", "short_description": "..."}\`
1236
+ - Suggest 3-5 @handle options to the user
1237
+ - Tell user to run 3+ test interactions (Response QA Agent or chat directly)
1238
+ - Suggest avatar if user has one
1239
+
1240
+ 7. **Tokenize on AgentLaunch**:
1241
+ - Use the \`create_token_record\` MCP tool
1242
+ - POST /agents/tokenize with name, symbol, description, chainId
1243
+ - Default chain: BSC Testnet (97)
1244
+
1245
+ 8. **Return results to user**:
1246
+ - Agent address (agent1q...)
1247
+ - Token handoff link (\${AGENT_LAUNCH_FRONTEND_URL}/deploy/{tokenId})
1248
+ - Instructions: "Click this link, connect your wallet, and sign to deploy"
316
1249
 
317
- Scaffold, deploy, and tokenize a multi-agent swarm with the swarm-starter template.
1250
+ 9. **Optionally show market data**: Use \`get_token\` to show token details
1251
+ after deployment.
1252
+
1253
+ ## Environment
1254
+
1255
+ - Reads AGENTVERSE_API_KEY from \`.env\`
1256
+ - Uses SDK/MCP tools for all API calls
1257
+ - Uses templates package for code generation
1258
+ - Dev URLs used by default; set AGENT_LAUNCH_ENV=production for mainnet
1259
+
1260
+ ## Platform Fee Note
1261
+
1262
+ The 120 FET deployment fee is paid by the human who signs the transaction.
1263
+ The 2% trading fee goes 100% to protocol treasury (no creator fee).`,
1264
+ "build-swarm/SKILL.md": `# /build-swarm -- Build an Agent Swarm
1265
+
1266
+ Guided swarm creation experience for Claude Code.
318
1267
 
319
1268
  ## Steps
320
1269
 
321
- 1. Ask user what swarm they want (name, roles, purpose)
322
- 2. Show the 7 available presets: writer, social, community, analytics, outreach, ads, strategy
323
- 3. Let user pick roles (or suggest a starter configuration)
324
- 4. For each role:
325
- a. Scaffold from swarm-starter template with preset variables
326
- b. Deploy to Agentverse
327
- c. Tokenize on AgentLaunch
328
- 5. Return handoff links for each agent
1270
+ 1. **Understand the goal**: Ask what the user wants their swarm to do
1271
+ 2. **Suggest presets**: Based on the goal, recommend a combination of presets
1272
+ - For content marketing: Writer + Social + Analytics
1273
+ - For community growth: Writer + Community + Social
1274
+ - For full marketing team: All 7
1275
+ 3. **Scaffold each agent**: Use \`scaffold_swarm\` MCP tool with appropriate preset
1276
+ 4. **Customize business logic**: Let user review/edit the SwarmBusiness section
1277
+ 5. **Deploy**: Use \`deploy_swarm\` MCP tool or deploy individually
1278
+ - Follow build order: Level 0 (no deps) first, then Level 1, etc.
1279
+ - Set peer address secrets so agents can call each other
1280
+ 6. **Optimize EVERY agent** (MANDATORY -- Phase 3 of \`docs/workflow.md\`):
1281
+ - For each deployed agent, set README and short_description
1282
+ - Push via \`PUT /v1/hosting/agents/{addr}\` with \`{"readme": "...", "short_description": "..."}\`
1283
+ - README must include: value proposition, services table, example conversations, pricing, commands
1284
+ - Suggest @handle options for each agent
1285
+ - Tell user to run 3+ test interactions per agent
1286
+ 7. **Show status**: Display swarm health, addresses, optimization score, next steps
1287
+
1288
+ ## Preset Quick Reference
1289
+
1290
+ | Preset | Role | Price/call | Best for |
1291
+ |--------|------|-----------|----------|
1292
+ | Writer | Content creation | 0.01 FET | Every swarm needs content |
1293
+ | Social | Twitter/X posting | 0.005 FET | Social media presence |
1294
+ | Community | Telegram management | 0.002 FET | Community engagement |
1295
+ | Analytics | Engagement tracking | 0.005 FET | Data-driven decisions |
1296
+ | Outreach | Partnership emails | 0.01 FET | Business development |
1297
+ | Ads | Ad campaigns | 0.01 FET | Paid marketing |
1298
+ | Strategy | Campaign coordination | 0.02 FET | Orchestrates all agents |
1299
+
1300
+ ## Recommended Starters
1301
+
1302
+ - **Content only**: Writer (1 agent)
1303
+ - **Social presence**: Writer + Social (2 agents)
1304
+ - **Community**: Writer + Community + Social (3 agents)
1305
+ - **Full team**: All 7
1306
+
1307
+ ## Environment
1308
+
1309
+ - Reads AGENTVERSE_API_KEY from .env
1310
+ - Uses MCP tools: scaffold_swarm, deploy_swarm, deploy_to_agentverse
1311
+ - Platform: agent-launch.ai`,
1312
+ "deploy/SKILL.md": `# /deploy -- Deploy Agent to Agentverse
1313
+
1314
+ Deploy a Python agent file to the Agentverse hosting platform.
1315
+ **Follows the full lifecycle workflow from \`docs/workflow.md\`.**
1316
+
1317
+ ## Usage
329
1318
 
330
- ## Starter Configurations
1319
+ \`\`\`
1320
+ /deploy [path/to/agent.py]
1321
+ \`\`\`
331
1322
 
332
- - Content only: Writer (1 agent)
333
- - Social presence: Writer + Social (2 agents)
334
- - Community: Writer + Community + Social (3 agents)
335
- - Analytics stack: Writer + Social + Analytics (3 agents)
336
- - Full team: All 7
1323
+ If no path is given, look for \`agent.py\` in the current directory.
337
1324
 
338
- ## Platform Fees
339
- - Deploy: 120 FET per agent (paid by human signer)
340
- - Trading: 2% to protocol treasury (NO creator fee)
341
- `,
342
- "deploy/SKILL.md": `# /deploy — Deploy to Agentverse
1325
+ ## Steps
343
1326
 
344
- Deploy agent.py to Agentverse hosting.
1327
+ 1. **Read** the agent.py file
1328
+ 2. **Validate** it follows uAgent patterns:
1329
+ - Has \`Agent()\` with zero params
1330
+ - Imports Chat Protocol v0.3.0
1331
+ - Has \`ChatAcknowledgement\` handler
1332
+ - Uses \`ctx.logger\` not \`print()\`
1333
+ 3. **Create agent** on Agentverse via POST /v1/hosting/agents
1334
+ 4. **Upload code** using double-encoded JSON format
1335
+ 5. **Set secrets** from \`.env\` (AGENTVERSE_API_KEY at minimum)
1336
+ 6. **Start agent** via POST /v1/hosting/agents/{addr}/start
1337
+ 7. **Poll compilation** status (up to 60s)
1338
+ 8. **Optimize** (MANDATORY -- see \`.claude/rules/workflow.md\`):
1339
+ - Write a README based on the agent's capabilities (from code analysis)
1340
+ - Write a short_description (1-2 sentences)
1341
+ - Push both via \`PUT /v1/hosting/agents/{addr}\` with \`{"readme": "...", "short_description": "..."}\`
1342
+ - Suggest @handle options to the user
1343
+ - Tell user to test with 3+ interactions
1344
+ 9. **Show results**: agent address, compilation status, optimization score, initial logs
1345
+
1346
+ ## Auth
1347
+
1348
+ Uses AGENTVERSE_API_KEY from \`.env\` with header: \`Authorization: bearer <key>\``,
1349
+ "grow/SKILL.md": `# /grow -- Autonomous Task Execution
1350
+
1351
+ Claim and execute tasks from \`docs/TODO.md\` autonomously.
1352
+
1353
+ ## Behavior
1354
+
1355
+ 1. **Read TODO.md**: Open \`docs/TODO.md\` and parse the task tables
1356
+ 2. **Find next task**: Look for tasks marked \`[ ]\` with no unfinished dependencies
1357
+ 3. **Claim task**: Update the status marker from \`[ ]\` to \`[~]\` (in progress)
1358
+ 4. **Execute task**: Follow the "How" column instructions using toolkit commands
1359
+ 5. **Verify KPI**: Check the "KPI" column to confirm success
1360
+ 6. **Complete task**: Update status from \`[~]\` to \`[x]\` (complete)
1361
+ 7. **Report**: Summarize what was done and move to next task (if \`/grow N\`)
1362
+
1363
+ ## Arguments
1364
+
1365
+ - \`/grow\` - Execute the next pending task
1366
+ - \`/grow 3\` - Execute 3 tasks sequentially
1367
+ - \`/grow L-1\` - Execute a specific task by ID
1368
+ - \`/grow status\` - Show current progress without executing
1369
+
1370
+ ## Task Selection Rules
1371
+
1372
+ 1. Never execute a task whose "Depends" column lists incomplete tasks
1373
+ 2. Process tasks in ID order within each phase (L-1 before L-2)
1374
+ 3. Process phases in order (Phase 1 before Phase 2)
1375
+ 4. Skip tasks marked \`[!]\` (blocked) or \`[x]\` (complete)
1376
+
1377
+ ## Status Markers
1378
+
1379
+ | Marker | Meaning |
1380
+ |--------|---------|
1381
+ | \`[ ]\` | Pending - ready to execute (if deps are met) |
1382
+ | \`[~]\` | In Progress - currently being worked on |
1383
+ | \`[x]\` | Complete - verified and done |
1384
+ | \`[!]\` | Blocked - external blocker, needs human intervention |
1385
+
1386
+ ## Example Task Execution
1387
+
1388
+ For task L-1 "Deploy the swarm":
1389
+
1390
+ \`\`\`markdown
1391
+ | Status | ID | Task | How | KPI | Depends |
1392
+ |:---:|:---|:---|:---|:---|:---|
1393
+ | \`[~]\` | L-1 | Deploy the swarm | \`npx agentlaunch create\` ... | All 7 running | — |
1394
+ \`\`\`
1395
+
1396
+ 1. Run \`npx agentlaunch create\` and follow prompts
1397
+ 2. Verify all 7 agents are running with \`network_status\` MCP tool
1398
+ 3. If KPI met, update to \`[x]\`
1399
+ 4. If failed, update to \`[!]\` and report the blocker
1400
+
1401
+ ## Gate Checks
1402
+
1403
+ After completing all tasks in a phase, verify the Phase Gate criteria.
1404
+ If all gate items pass, proceed to the next phase.
1405
+ If any gate item fails, report which ones need attention.
1406
+
1407
+ ## Error Handling
1408
+
1409
+ - If a task fails, mark it \`[!]\` and add a comment explaining the blocker
1410
+ - If dependencies are missing, report which tasks need to complete first
1411
+ - If a gate check fails, report which criteria are unmet
1412
+
1413
+ ## Toolkit Commands Used
1414
+
1415
+ - \`npx agentlaunch create\` - Deploy agents
1416
+ - \`npx agentlaunch status\` - Check agent/token status
1417
+ - \`network_status\` MCP tool - Swarm health check
1418
+ - \`check_agent_commerce\` MCP tool - Individual agent commerce
1419
+ - \`GET /agents/token/{addr}/holders\` - Token holder list`,
1420
+ "improve.md": `# /improve - Capture Session Learnings
1421
+
1422
+ Extract learnings from this session and create a PR to improve the toolkit.
1423
+
1424
+ ## Trigger
1425
+
1426
+ User runs \`/improve\` after building agents, fixing errors, or discovering patterns.
1427
+
1428
+ ## Workflow
1429
+
1430
+ ### 1. Analyze Session
1431
+
1432
+ Review the conversation to identify:
1433
+
1434
+ - **Errors fixed**: Error messages encountered and how they were resolved
1435
+ - **Code patterns**: Working code that could become a template or snippet
1436
+ - **API discoveries**: Gotchas, undocumented behavior, correct endpoints
1437
+ - **Workflow improvements**: Better ways to do things
1438
+
1439
+ ### 2. Check for Duplicates
1440
+
1441
+ Before suggesting additions, search existing rules:
345
1442
 
346
- ## Command
347
1443
  \`\`\`bash
348
- agentlaunch deploy
1444
+ # Search for the error/pattern in existing rules
1445
+ grep -r "keyword" .claude/rules/
1446
+ grep -r "keyword" docs/
349
1447
  \`\`\`
350
1448
 
351
- ## What It Does
352
- 1. Reads agent.py
353
- 2. Validates uAgent patterns
354
- 3. Creates agent on Agentverse
355
- 4. Uploads code
356
- 5. Sets secrets from .env
357
- 6. Starts agent
358
- 7. Waits for compilation
359
- `,
360
- "tokenize/SKILL.md": `# /tokenize — Create Token
1449
+ Skip anything already documented. Only surface NEW learnings.
361
1450
 
362
- Create a tradeable token for an agent.
1451
+ ### 3. Present Learnings
1452
+
1453
+ Show the user what was found:
1454
+
1455
+ \`\`\`
1456
+ Session Analysis
1457
+ ================
1458
+
1459
+ Errors Fixed:
1460
+ 1. [NEW] "agent.create_protocol() does not exist"
1461
+ Fix: Use Protocol(spec=...) directly
1462
+ → Suggest: Add to .claude/rules/uagent-patterns.md
1463
+
1464
+ 2. [KNOWN] "datetime.utcnow() deprecated"
1465
+ Already in: .claude/rules/uagent-patterns.md
1466
+ → Skip
1467
+
1468
+ Patterns Discovered:
1469
+ 1. [NEW] Twitter integration with rate limiting
1470
+ → Suggest: New template twitter-bot/
1471
+
1472
+ 2. [NEW] Conversation memory with ctx.storage
1473
+ → Suggest: Add to .claude/rules/uagent-patterns.md
1474
+
1475
+ Which learnings should we add? (comma-separated numbers, or 'all', or 'none')
1476
+ \`\`\`
1477
+
1478
+ ### 4. Create Branch & Changes
1479
+
1480
+ For selected learnings:
363
1481
 
364
- ## Command
365
1482
  \`\`\`bash
366
- agentlaunch tokenize --agent <address> --name "Name" --symbol SYM
1483
+ # Create improvement branch
1484
+ git checkout -b improve/session-$(date +%s)
1485
+
1486
+ # Make changes based on learning type:
367
1487
  \`\`\`
368
1488
 
369
- ## Result
370
- Returns a handoff link. Human clicks it, connects wallet, signs, token goes live.
371
- `,
372
- "status/SKILL.md": `# /status Check Status
1489
+ **For rule updates:**
1490
+ - Edit the relevant \`.claude/rules/*.md\` file
1491
+ - Add the pattern under the appropriate section
1492
+ - Include: what the error looks like, why it happens, how to fix it
373
1493
 
374
- Check agent and token status.
1494
+ **For new templates:**
1495
+ - Create directory in \`packages/templates/src/templates/\`
1496
+ - Add agent.py with the pattern
1497
+ - Update templates index
1498
+
1499
+ **For workflow improvements:**
1500
+ - Edit \`.claude/rules/workflow.md\` or relevant skill
1501
+ - Add the step or check
1502
+
1503
+ ### 5. Test Changes
1504
+
1505
+ Before committing, validate everything still works:
375
1506
 
376
- ## Command
377
1507
  \`\`\`bash
378
- agentlaunch status <address>
1508
+ # 1. Build all packages (catches TypeScript/import errors)
1509
+ npm run build
1510
+
1511
+ # 2. Run test suite
1512
+ npm run test
1513
+
1514
+ # 3. If new template added, validate it compiles
1515
+ if [ -d "packages/templates/src/templates/NEW_TEMPLATE" ]; then
1516
+ python3 -m py_compile packages/templates/src/templates/NEW_TEMPLATE/agent.py
1517
+ fi
1518
+
1519
+ # 4. Lint markdown (optional but recommended)
1520
+ npx markdownlint .claude/rules/*.md 2>/dev/null || true
379
1521
  \`\`\`
380
1522
 
381
- Shows: running status, price, holders, progress to graduation.
382
- `,
383
- "market/SKILL.md": `# /market — Browse Tokens
1523
+ **If tests fail:**
1524
+ \`\`\`
1525
+ Test Results
1526
+ ============
1527
+ ✗ npm run build - FAILED
384
1528
 
385
- Browse tokens on AgentLaunch.
1529
+ Error: packages/templates/src/index.ts(45,10):
1530
+ Cannot find module './templates/twitter-writer'
1531
+
1532
+ The new template needs to be registered in the index.
1533
+ Fix the error, then run /improve again.
1534
+ \`\`\`
1535
+
1536
+ Do not create PR until all tests pass.
1537
+
1538
+ **If tests pass:**
1539
+ \`\`\`
1540
+ Test Results
1541
+ ============
1542
+ ✓ npm run build - passed
1543
+ ✓ npm run test - 47 passed, 0 failed
1544
+ ✓ Template syntax - valid Python
1545
+ ✓ Markdown lint - no errors
1546
+
1547
+ All tests passed. Proceeding to commit...
1548
+ \`\`\`
1549
+
1550
+ ### 6. Commit & Push
386
1551
 
387
- ## Commands
388
1552
  \`\`\`bash
389
- agentlaunch list
390
- agentlaunch status <token_address>
1553
+ git add .
1554
+ git commit -m "$(cat <<'EOF'
1555
+ improve: Add learnings from session
1556
+
1557
+ Learnings added:
1558
+ - [list what was added]
1559
+
1560
+ Session context:
1561
+ - [brief description of what user was building]
1562
+
1563
+ EOF
1564
+ )"
1565
+
1566
+ git push -u origin improve/session-$(date +%s)
391
1567
  \`\`\`
392
- `,
1568
+
1569
+ ### 7. Create PR
1570
+
1571
+ \`\`\`bash
1572
+ gh pr create --title "Improve: [brief summary]" --body "$(cat <<'EOF'
1573
+ ## Session Learnings
1574
+
1575
+ This PR captures learnings from a development session.
1576
+
1577
+ ### What was built
1578
+ [Description of what the user was working on]
1579
+
1580
+ ### Learnings added
1581
+
1582
+ | Type | File | Description |
1583
+ |------|------|-------------|
1584
+ | Rule | \`.claude/rules/xxx.md\` | [what was added] |
1585
+ | Template | \`packages/templates/...\` | [what was added] |
1586
+
1587
+ ### Why these matter
1588
+ [Brief explanation of how these help future users]
1589
+
1590
+ ---
1591
+ *Generated by \`/improve\` - see docs/self-improvement.md*
1592
+ EOF
1593
+ )"
1594
+ \`\`\`
1595
+
1596
+ ### 8. Report to User
1597
+
1598
+ \`\`\`
1599
+ Improvement PR created!
1600
+
1601
+ Branch: improve/session-1709654321
1602
+ PR: https://github.com/[org]/agent-launch-toolkit/pull/42
1603
+
1604
+ Changes:
1605
+ - .claude/rules/uagent-patterns.md: Added Protocol() pattern
1606
+ - packages/templates/src/templates/twitter-bot/: New template
1607
+
1608
+ Next steps:
1609
+ 1. Review the PR
1610
+ 2. Team discusses if needed
1611
+ 3. Merge when ready
1612
+
1613
+ Thanks for improving the toolkit!
1614
+ \`\`\`
1615
+
1616
+ ## Learning Categories
1617
+
1618
+ ### Error Patterns (→ Rules)
1619
+
1620
+ Format for error rules:
1621
+
1622
+ \`\`\`markdown
1623
+ ## Error: "[exact error message]"
1624
+
1625
+ **Cause:** [why this happens]
1626
+
1627
+ **Fix:** [what to do instead]
1628
+
1629
+ **Example:**
1630
+ \`\`\`python
1631
+ # Wrong
1632
+ ctx.wallet.address()
1633
+
1634
+ # Right
1635
+ agent.wallet.address()
1636
+ \`\`\`
1637
+ \`\`\`
1638
+
1639
+ ### API Gotchas (→ Rules)
1640
+
1641
+ Format for API rules:
1642
+
1643
+ \`\`\`markdown
1644
+ ## [API/Endpoint Name]
1645
+
1646
+ **Gotcha:** [the unexpected behavior]
1647
+
1648
+ **Correct usage:**
1649
+ \`\`\`python
1650
+ # code example
1651
+ \`\`\`
1652
+
1653
+ **Why:** [explanation]
1654
+ \`\`\`
1655
+
1656
+ ### Code Patterns (→ Templates or Rules)
1657
+
1658
+ If it's a full agent pattern → new template
1659
+ If it's a snippet → add to relevant rule file
1660
+
1661
+ ### Workflow Improvements (→ Rules or Skills)
1662
+
1663
+ If it's a step people should always do → add to workflow.md
1664
+ If it's a new capability → create/update skill
1665
+
1666
+ ## Edge Cases
1667
+
1668
+ ### No learnings found
1669
+
1670
+ \`\`\`
1671
+ No new learnings detected in this session.
1672
+
1673
+ Everything worked smoothly, or the patterns are already documented.
1674
+
1675
+ If you think something should be added, describe it and I'll help
1676
+ create the improvement manually.
1677
+ \`\`\`
1678
+
1679
+ ### User declines all
1680
+
1681
+ \`\`\`
1682
+ No learnings selected. That's fine!
1683
+
1684
+ If you change your mind, run /improve again or manually edit:
1685
+ - .claude/rules/ for coding patterns
1686
+ - packages/templates/ for agent templates
1687
+ - .claude/skills/ for workflow improvements
1688
+ \`\`\`
1689
+
1690
+ ### Conflict with existing rules
1691
+
1692
+ If a learning contradicts an existing rule:
1693
+
1694
+ \`\`\`
1695
+ Potential conflict detected:
1696
+
1697
+ Existing rule (.claude/rules/uagent-patterns.md):
1698
+ "Use datetime.now() instead of utcnow()"
1699
+
1700
+ Your session used:
1701
+ datetime.utcnow() successfully
1702
+
1703
+ Options:
1704
+ 1. Skip (keep existing rule)
1705
+ 2. Update rule with exception/context
1706
+ 3. Replace rule with new pattern
1707
+
1708
+ Which approach?
1709
+ \`\`\`
1710
+
1711
+ ## Examples
1712
+
1713
+ ### Example 1: Error Pattern
1714
+
1715
+ Session: User got "Protocol() missing role parameter" error
1716
+
1717
+ \`\`\`
1718
+ Learning detected:
1719
+
1720
+ Error: "Protocol() takes 1 positional argument but 2 were given"
1721
+ when using payment_protocol_spec
1722
+
1723
+ Fix: Payment protocol requires role="seller" or role="buyer"
1724
+
1725
+ Add to .claude/rules/payment-protocol.md? [y/n]
1726
+ \`\`\`
1727
+
1728
+ ### Example 2: New Template
1729
+
1730
+ Session: User built a Twitter bot with rate limiting
1731
+
1732
+ \`\`\`
1733
+ Learning detected:
1734
+
1735
+ Pattern: Twitter bot with:
1736
+ - Rate limiting (15 calls/15min)
1737
+ - Retry with exponential backoff
1738
+ - Tweet queue with ctx.storage
1739
+
1740
+ Create new template 'twitter-bot'? [y/n]
1741
+ \`\`\`
1742
+
1743
+ ### Example 3: Workflow Improvement
1744
+
1745
+ Session: User's agent failed because they tokenized before optimizing
1746
+
1747
+ \`\`\`
1748
+ Learning detected:
1749
+
1750
+ Workflow issue: Tokenizing before optimization leads to poor
1751
+ discoverability. README should be set BEFORE tokenize.
1752
+
1753
+ Update .claude/rules/workflow.md to enforce order? [y/n]
1754
+ \`\`\`
1755
+
1756
+ ## Files Modified by /improve
1757
+
1758
+ | Learning Type | Target File |
1759
+ |---------------|-------------|
1760
+ | uAgent errors | \`.claude/rules/uagent-patterns.md\` |
1761
+ | Payment issues | \`.claude/rules/payment-protocol.md\` |
1762
+ | API path errors | \`.claude/rules/api-paths.md\` |
1763
+ | Agentverse issues | \`.claude/rules/agentverse.md\` |
1764
+ | Workflow problems | \`.claude/rules/workflow.md\` |
1765
+ | New agent pattern | \`packages/templates/src/templates/[name]/\` |
1766
+ | Swarm patterns | \`.claude/rules/marketing-swarm.md\` |
1767
+ | Consumer payments | \`.claude/rules/consumer-payments.md\` |
1768
+
1769
+ ## See Also
1770
+
1771
+ - \`docs/self-improvement.md\` - Full documentation of this system
1772
+ - \`.claude/rules/\` - All current rules
1773
+ - \`packages/templates/\` - All current templates`,
1774
+ "market/SKILL.md": `# /market -- Browse Tokens and Prices
1775
+
1776
+ Browse tokens on AgentLaunch and check market data.
1777
+
1778
+ ## Usage
1779
+
1780
+ \`\`\`
1781
+ /market [token_address]
1782
+ \`\`\`
1783
+
1784
+ ## Steps
1785
+
1786
+ 1. **If no address given**: Use \`list_tokens\` MCP tool to show trending tokens
1787
+ with name, symbol, price, and progress toward graduation.
1788
+ 2. **If address given**: Use \`get_token\` MCP tool for full token details
1789
+ including price, market cap, holder count, and bonding curve progress.
1790
+ 3. **Price preview**: Use \`calculate_buy\` or \`calculate_sell\` to show
1791
+ what a specific FET amount would buy/sell.
1792
+ 4. **Generate trade link**: Use \`get_trade_link\` to create a pre-filled
1793
+ buy or sell URL the user can share.
1794
+
1795
+ ## Notes
1796
+
1797
+ - Graduation happens at 30,000 FET liquidity (auto DEX listing).
1798
+ - Trading fee: 2% per trade, 100% to protocol treasury (no creator fee).`,
1799
+ "status/SKILL.md": `# /status -- Check Agent and Token Status
1800
+
1801
+ Check the deployment status of agents and tokens.
1802
+
1803
+ ## Usage
1804
+
1805
+ \`\`\`
1806
+ /status [agent_address_or_token_address]
1807
+ \`\`\`
1808
+
1809
+ ## Steps
1810
+
1811
+ 1. **Detect address type**:
1812
+ - \`agent1q...\` -> Agentverse agent, check via GET /v1/hosting/agents/{addr}
1813
+ - \`0x...\` -> Token address, check via \`get_token\` MCP tool
1814
+ 2. **For agents**: Show name, running status, compiled status, wallet address.
1815
+ Optionally fetch recent logs via GET /v1/hosting/agents/{addr}/logs.
1816
+ 3. **For tokens**: Show name, symbol, price, market cap, holder count,
1817
+ bonding curve progress, and whether it has graduated to DEX.
1818
+ 4. **Platform overview**: If no address given, use \`get_platform_stats\`
1819
+ to show overall platform statistics (total tokens, volume, etc.).
1820
+
1821
+ ## Notes
1822
+
1823
+ - Agent compilation takes 15-60s after starting.
1824
+ - Token graduation occurs at 30,000 FET liquidity.`,
1825
+ "todo/SKILL.md": `# /todo -- Create TODO from Document
1826
+
1827
+ Transform a strategy document, roadmap, or feature spec into a structured TODO.md.
1828
+
1829
+ ## Usage
1830
+
1831
+ - \`/todo\` - Create TODO.md from the most recent doc discussed
1832
+ - \`/todo docs/organic-growth-strategy.md\` - Create TODO from a specific file
1833
+ - \`/todo "my feature spec"\` - Create TODO from inline requirements
1834
+
1835
+ ## Template
1836
+
1837
+ Use \`docs/TODO-template.md\` as the format reference. Key elements:
1838
+
1839
+ ### YAML Frontmatter
1840
+
1841
+ \`\`\`yaml
1842
+ ---
1843
+ title: Feature Name
1844
+ type: roadmap
1845
+ version: 1.0.0
1846
+ priority: Phase order
1847
+ total_tasks: N
1848
+ completed: 0
1849
+ status: PENDING
1850
+ depends_on: any prerequisites
1851
+ ---
1852
+ \`\`\`
1853
+
1854
+ ### Task Tables
1855
+
1856
+ \`\`\`markdown
1857
+ | Status | ID | Task | How | KPI | Depends |
1858
+ |:---:|:---|:---|:---|:---|:---|
1859
+ | \`[ ]\` | L-1 | Task name | Implementation details | Success metric | — |
1860
+ | \`[ ]\` | L-2 | Next task | How to do it | What proves it's done | L-1 |
1861
+ \`\`\`
1862
+
1863
+ ### Status Markers
1864
+
1865
+ - \`[ ]\` - Pending
1866
+ - \`[~]\` - In Progress
1867
+ - \`[x]\` - Complete
1868
+ - \`[!]\` - Blocked
1869
+
1870
+ ### Phase Structure
1871
+
1872
+ Group tasks into phases with clear progression:
1873
+
1874
+ 1. **Phase 1: Setup** - Foundation tasks
1875
+ 2. **Phase 2: Build** - Core implementation
1876
+ 3. **Phase 3: Test** - Verification
1877
+ 4. **Phase 4: Deploy** - Launch tasks
1878
+
1879
+ ### Gate Criteria
1880
+
1881
+ After each phase, add a gate checklist:
1882
+
1883
+ \`\`\`markdown
1884
+ ### Phase N Gate
1885
+
1886
+ \`\`\`
1887
+ [ ] First success criterion
1888
+ [ ] Second success criterion
1889
+ [ ] Third success criterion
1890
+ \`\`\`
1891
+ \`\`\`
1892
+
1893
+ ### Dependency Graph
1894
+
1895
+ Add ASCII or Mermaid diagram showing task dependencies:
1896
+
1897
+ \`\`\`markdown
1898
+ ## Dependency Graph
1899
+
1900
+ \`\`\`
1901
+ L-1 ──► L-2 ──► L-3 ──► P-1
1902
+ │ │
1903
+ └──► L-4 ──────┘
1904
+ \`\`\`
1905
+ \`\`\`
1906
+
1907
+ ### Progress Overview
1908
+
1909
+ Include visual progress tracking:
1910
+
1911
+ \`\`\`markdown
1912
+ ## Progress Overview
1913
+
1914
+ \`\`\`
1915
+ ╭─────────────────────────────────────────────╮
1916
+ │ Phase 1: Setup [░░░░░░░░░░] 0/4 0% │
1917
+ │ Phase 2: Build [░░░░░░░░░░] 0/6 0% │
1918
+ │ TOTAL [░░░░░░░░░░] 0/10 0% │
1919
+ ╰─────────────────────────────────────────────╯
1920
+ \`\`\`
1921
+ \`\`\`
1922
+
1923
+ ## Output
1924
+
1925
+ By default, write to \`docs/TODO.md\`.
1926
+ Use \`/todo output:path/to/file.md\` to specify a different output.
1927
+
1928
+ ## Task ID Conventions
1929
+
1930
+ Use short, prefixed IDs:
1931
+
1932
+ - \`L-N\` - Launch/setup tasks
1933
+ - \`B-N\` - Build tasks
1934
+ - \`T-N\` - Test tasks
1935
+ - \`D-N\` - Deploy tasks
1936
+ - \`P-N\` - Prove/validate tasks
1937
+ - \`G-N\` - Growth tasks
1938
+ - \`S-N\` - Sustain tasks
1939
+ - \`F-N\` - Final/graduation tasks
1940
+
1941
+ ## KPI Guidelines
1942
+
1943
+ KPIs should be:
1944
+ - Measurable ("All 7 running" not "it works")
1945
+ - Specific ("≥10 queries/day" not "many queries")
1946
+ - Verifiable (can check with a command or tool)
1947
+
1948
+ ## Integration with /grow
1949
+
1950
+ The TODO created by \`/todo\` is designed to work with \`/grow\`:
1951
+
1952
+ 1. \`/todo docs/plan.md\` - Create the TODO
1953
+ 2. \`/grow\` - Execute tasks one by one
1954
+ 3. \`/grow 5\` - Execute 5 tasks in sequence`,
1955
+ "tokenize/SKILL.md": `# /tokenize -- Tokenize an Agent
1956
+
1957
+ Create a tradeable token for an existing Agentverse agent.
1958
+
1959
+ ## Usage
1960
+
1961
+ \`\`\`
1962
+ /tokenize [agent_address] --name "Name" --symbol "SYM"
1963
+ \`\`\`
1964
+
1965
+ ## Steps
1966
+
1967
+ 1. **Get agent address**: If not provided, list the user's agents via
1968
+ GET /v1/hosting/agents and let them choose.
1969
+ 2. **Collect details**: name, symbol (ticker), description. Prompt for
1970
+ any missing values.
1971
+ 3. **Create token record**: Use the \`create_token_record\` MCP tool or
1972
+ POST /agents/tokenize with:
1973
+ - agentAddress, name, symbol, description
1974
+ - chainId (default: 97 for BSC Testnet)
1975
+ 4. **Return handoff link**: Show the deploy link and instructions.
1976
+ 5. **Explain next steps**:
1977
+ - Human clicks the link
1978
+ - Connects wallet (MetaMask, etc.)
1979
+ - Signs transaction (pays 120 FET deployment fee)
1980
+ - Token goes live on the bonding curve
1981
+
1982
+ ## Notes
1983
+
1984
+ - The 120 FET deploy fee is paid by the human signer, not the agent.
1985
+ - Trading fee: 2% per trade, 100% to protocol treasury (no creator fee).
1986
+ - Token graduates to DEX at 30,000 FET liquidity.`,
1987
+ "welcome/SKILL.md": `# Welcome — Show Status & Choose Your Path
1988
+
1989
+ > Run automatically when Claude Code starts, or manually with \`/welcome\`
1990
+
1991
+ ---
1992
+
1993
+ ## What This Does
1994
+
1995
+ 1. **Shows everything the user already has** — agents, tokens, wallet, swarm status
1996
+ 2. **Offers three paths** — single agent, marketing team, or alliance swarm
1997
+ 3. **Guides them to the right choice**
1998
+
1999
+ ---
2000
+
2001
+ ## Execution
2002
+
2003
+ ### Step 1: Gather Current Status
2004
+
2005
+ Run these checks silently:
2006
+
2007
+ \`\`\`bash
2008
+ # Check wallet
2009
+ npx agentlaunch wallet balances 2>/dev/null || echo "No wallet configured"
2010
+
2011
+ # List their agents (from Agentverse)
2012
+ npx agentlaunch list --mine 2>/dev/null || echo "No agents yet"
2013
+
2014
+ # Check if .env exists
2015
+ test -f .env && echo "API key configured" || echo "No .env file"
2016
+ \`\`\`
2017
+
2018
+ ### Step 2: Display Status
2019
+
2020
+ Show a clear summary:
2021
+
2022
+ \`\`\`
2023
+ ╭────────────────────────────────────────────────────────────────╮
2024
+ │ AGENT LAUNCH TOOLKIT │
2025
+ │ agent-launch.ai │
2026
+ ├────────────────────────────────────────────────────────────────┤
2027
+ │ │
2028
+ │ YOUR STATUS │
2029
+ │ ─────────── │
2030
+ │ Wallet: 0x1234...5678 (150.5 FET, 0.02 BNB) │
2031
+ │ Agents: 3 on Agentverse │
2032
+ │ Tokens: 1 deployed ($MYAGENT at 1,200 FET raised) │
2033
+ │ Swarm: None active │
2034
+ │ │
2035
+ │ RECENT ACTIVITY │
2036
+ │ ─────────────── │
2037
+ │ • joke-teller: 45 queries today, 0.9 FET earned │
2038
+ │ • price-monitor: Running, last alert 2h ago │
2039
+ │ │
2040
+ ╰────────────────────────────────────────────────────────────────╯
2041
+ \`\`\`
2042
+
2043
+ If no agents/wallet yet:
2044
+ \`\`\`
2045
+ ╭────────────────────────────────────────────────────────────────╮
2046
+ │ YOUR STATUS │
2047
+ │ ─────────── │
2048
+ │ Wallet: Not configured │
2049
+ │ Agents: None yet │
2050
+ │ API Key: Not set │
2051
+ │ │
2052
+ │ Let's get you started! │
2053
+ ╰────────────────────────────────────────────────────────────────╯
2054
+ \`\`\`
2055
+
2056
+ ### Step 3: Show the Three Paths
2057
+
2058
+ \`\`\`
2059
+ ╭────────────────────────────────────────────────────────────────╮
2060
+ │ WHAT DO YOU WANT TO BUILD? │
2061
+ ├────────────────────────────────────────────────────────────────┤
2062
+ │ │
2063
+ │ 1. SINGLE AGENT │
2064
+ │ Chat + memory, deployed in 90 seconds │
2065
+ │ Cost: 120 FET to tokenize │
2066
+ │ Best for: Getting started, specific use cases │
2067
+ │ Command: npx agentlaunch │
2068
+ │ │
2069
+ │ 2. MARKETING TEAM │
2070
+ │ 7 agents that grow your ecosystem │
2071
+ │ Writer, Social, Community, Analytics, Outreach, Ads, │
2072
+ │ Strategy — all working together │
2073
+ │ Cost: 840 FET (7 × 120) │
2074
+ │ Best for: Content, community, growth │
2075
+ │ Command: /build-swarm marketing │
2076
+ │ │
2077
+ │ 3. ALLIANCE SWARM (ASI Alliance Members) │
2078
+ │ 27 agents for the full Fetch.ai + SingularityNET ecosystem│
2079
+ │ CEO, CTO, CFO, COO, CRO + 22 specialists │
2080
+ │ Cost: 3,240 FET (27 × 120) │
2081
+ │ Best for: ASI Alliance ecosystem builders │
2082
+ │ Command: /alliance │
2083
+ │ │
2084
+ ├────────────────────────────────────────────────────────────────┤
2085
+ │ Type 1, 2, or 3 — or describe what you want to build │
2086
+ ╰────────────────────────────────────────────────────────────────╯
2087
+ \`\`\`
2088
+
2089
+ ### Step 4: Handle Choice
2090
+
2091
+ **If they choose 1 (Single Agent):**
2092
+ \`\`\`bash
2093
+ npx agentlaunch
2094
+ \`\`\`
2095
+ This runs the interactive flow: name → deploy → open editor
2096
+
2097
+ **If they choose 2 (Marketing Team):**
2098
+ Invoke \`/build-swarm\` with marketing preset
2099
+
2100
+ **If they choose 3 (Alliance):**
2101
+ Invoke \`/alliance\` skill
2102
+
2103
+ **If they describe something else:**
2104
+ Use your judgment to scaffold the right template
2105
+
2106
+ ---
2107
+
2108
+ ## First-Time Setup
2109
+
2110
+ If no .env or API key:
2111
+
2112
+ \`\`\`
2113
+ ╭────────────────────────────────────────────────────────────────╮
2114
+ │ FIRST TIME SETUP │
2115
+ ├────────────────────────────────────────────────────────────────┤
2116
+ │ │
2117
+ │ 1. Get your Agentverse API key: │
2118
+ │ https://agentverse.ai/settings/api-keys │
2119
+ │ │
2120
+ │ 2. Set it up: │
2121
+ │ npx agentlaunch init │
2122
+ │ │
2123
+ │ 3. Get testnet tokens (free): │
2124
+ │ Message @gift on Agentverse: "claim 0x<your-wallet>" │
2125
+ │ You'll receive 200 TFET + 0.001 tBNB instantly │
2126
+ │ │
2127
+ ╰────────────────────────────────────────────────────────────────╯
2128
+ \`\`\`
2129
+
2130
+ ---
2131
+
2132
+ ## Tone
2133
+
2134
+ - **Welcoming** — Make them feel at home
2135
+ - **Clear** — Show exactly what they have and what's possible
2136
+ - **Helpful** — Guide them to the right choice
2137
+ - **Elegant** — Clean formatting, no clutter
2138
+
2139
+ This is their first impression. Make it great.`,
393
2140
  };
394
2141
  // ---------------------------------------------------------------------------
395
2142
  // Docs — Full documentation