Skip to main content

Connect Your Skills to Moxie

Now that you've developed your Skills, it's time to inject dynamic user data from the states and connect your Skills to Moxie and register them to the Skills Marketplace.

This guide will walk you through each step to integrate Moxie user data into your Skills and get your Skills successfully listed.

Step 1: Inject Moxie User Data From State

First, open the balanceProvider.ts file in the src/providers directory again and replace the placeholder address with the agent wallet address instance from the state state.agentWallet as shown below:

packages/plugin-first-skill/src/providers/balanceProvider.ts
import {
type Provider,
type IAgentRuntime,
type Memory,
type State,
elizaLogger,
} from "@moxie-protocol/core";
import { formatEther, http, createPublicClient } from "viem";
import { base } from "viem/chains";

const balanceProvider: Provider = {
get: async (runtime: IAgentRuntime, message: Memory, state: State) => {
const publicClient = createPublicClient({
chain: base,
transport: http(),
});
// Get the agent wallet address from the state
const { address } = state.agentWallet as MoxieWalletClient;
const balance = await publicClient.getBalance({
// Use the agent wallet address from the state
address: address as `0x${string}`,
});
const balanceAsEther = formatEther(balance);

return balanceAsEther;
},
};

export default balanceProvider;

Step 2: Add Your Skills to skills.json

First, open the skills.json file in the registry/src folder and add your Skills metadata.

During this step, you can rename your Skill, polish its description, or add a logo.

To replace the logo for your skill, you can simply replace the image under images/logo.png with your own image (400x400 px).

Once you’ve prepared all the metadata, follow the structure below:

interface Skills {
/**
* Any UUID, must be unique; you can generate one at https://www.uuidgenerator.net/
*/
pluginId: string;

/**
* Name of the Skills, matching package.json
*/
name: string;

/**
* Version of the Skills, matching package.json
*/
version: string;

/**
* Description of what the Skills can do
*/
description: string;

/**
* Author/creator of the Skills (optional)
*/
author?: string | null;

/**
* GitHub URL to your Skills folder under `/packages`
*/
githubUrl: string;

/**
* URL to the logo.png file (400x400 px) in your Skills folder (optional)
*/
imageUrl?: string | null;
}

A valid skills.json entry will look like this:

[
{
"pluginId": "b5622f90-987e-51d1-bea9-5b1471bb9379",
"name": "@moxie-protocol/plugin-moxie-balance",
"version": "0.1.8+build.1",
"author": null,
"description": "A Skills for AI Agents that enables portfolio balance checking for Moxie users' connected wallets.",
"githubUrl": "https://github.com/moxie-protocol/moxie-agent-plugin/tree/main/packages/plugin-moxie-balance",
"imageUrl": "https://github.com/moxie-protocol/moxie-agent-plugin/tree/main/packages/plugin-moxie-balance/images/logo.png"
}
]

Step 2: Submit Request to Add Environment Variables (Optional)

If your Skills do not require any environment variables, you can skip this step.

If your Skills need environment variables for production, fill out this form to request them from the Moxie team. The team will reach out via Email ([email protected]) or Farcaster (group chat).

Step 3: Create a PR to main Branch

Lastly, create a new PR targeting the main branch. The Moxie team will review your submission and approve it if it meets the guidelines below:

  1. You have tested the Skills locally with the agent and confirmed everything works.
  2. Your Skills include a well-written README describing all actions, providers, evaluators, services, and clients.
  3. You have added the new Skills metadata to registry/src/skill.json.
  4. You have not made changes to any other parts of the repository beyond the new Skills folder.
  5. (Optional) You have requested environment variables via this form, if needed.
  6. Your code does not transfer Moxie user's holdings to a fixed address.
  7. Your code does not extract Moxie user's private information (e.g., wallet addresses, private keys).
  8. Your code does not interact with unverified or unpublished smart contracts.
  9. Any smart contracts your Skills interact with that also have liqudity or daily volume more than 100k USD must be audited.

Once your PR is approved and merged, congratulation! 🥳🎉 You've successfully added your Skills to the Skills Marketplace where it's accessible for Moxie users to use.

Developer Support

If you have any questions or need help with other use cases, feel free to join the Moxie Telegram Developers Channel and ask your questions there.

Our team is always ready to help you with any questions you may have.