agent-kit-plugin
БесплатноЗапускает вложенные скриптыНе проверенThis skill should be used when the user asks to "create a hedera plugin", "build a hedera agent kit plugin", "extend hedera agent kit", "create custom hedera…
от hedera-dev★ 37 звёзд на GitHubОб этом скилле
Creating Hedera Agent Kit Plugins
This skill provides guidance for creating custom plugins that extend the Hedera Agent Kit. Plugins allow adding new tools for Hedera network interactions—token operations, account management, consensus service, smart contracts, and custom integrations.
Quick Start
To create a Hedera plugin in 5 steps:
- Install dependencies: Set up a TypeScript project with
@hashgraph/hedera-agent-kitand@hiero-ledger/sdk - Create plugin structure: Create an
index.tswith the plugin definition and atools/directory - Define tools: Each tool is a class extending
BaseTool— this opts the tool into the hooks/policies lifecycle - Export properly: Export the plugin object and tool name constants
- Register with agent: Import and pass the plugin in the toolkit
configuration.pluginsarray
Plugin Interface
Every Hedera plugin implements this interface from @hashgraph/hedera-agent-kit:
import { Plugin } from '@hashgraph/hedera-agent-kit';
export interface Plugin {
name: string; // Unique kebab-case identifier
version?: string; // Semantic version (e.g., "1.0.0")
description?: string; // Brief explanation of plugin purpose
tools: (context: Context) => Tool[]; // Factory returning tools
}
The tools function receives a Context object containing network configuration and returns an array of Tool objects. BaseTool itself implements Tool, so a BaseTool subclass instance is a valid return value.
BaseTool
Tools are written as classes extending BaseTool, which implements Tool and runs a 7-stage lifecycle:
[1] preToolExecutionHook
[2] normalizeParams ← your logic
[3] postParamsNormalizationHook
[4] coreAction ← your logic
[5] postCoreActionHook
[6] secondaryAction ← your logic (skipped via shouldSecondaryAction for queries)
[7] postToolExecutionHook
Hooks and policies registered on the agent kit fire at stages 1, 3, 5, and 7 automatically — you never call them manually.
A subclass must provide:
| Member | Type | Notes |
|---|---|---|
method |
string |
Snake-case identifier with _tool suffix |
name |
string |
Human-readable display name |
description |
string |
LLM-facing description (typically built in the constructor from a prompt function) |
parameters |
z.ZodObject |
Zod schema for input validation |
normalizeParams(params, context, client) |
async | Stage 2 — resolve defaults, validate format |
coreAction(normalised, context, client) |
async | Stage 4 — build the transaction or perform the query |
secondaryAction(request, client, context) |
async | Stage 6 — sign/submit the transaction (no-op for queries) |
Optional overrides: outputParser, shouldSecondaryAction (return false for query-only tools), handleError, and the four hook methods.
Tool Types
Mutation tools — state-changing operations (token create/mint/transfer, account update, topic submit). coreAction builds the Transaction, secondaryAction calls handleTransaction(). Use transactionToolOutputParser.
Query tools — read-only operations (token info, balances, mirror-node fetches). coreAction returns the result directly. Override shouldSecondaryAction to return false. Use untypedQueryOutputParser.
File Structure Pattern
Follow this structure for all Hedera plugins:
my-hedera-plugin/
├── index.ts # Plugin definition and exports
└── tools/
└── category/ # Group related tools
├── create-something.ts
└── get-something.ts
Creating a Tool
Step 1: Define the Tool Constant
export const MY_TOOL_NAME = 'my_tool_name_tool';
Use UPPER_SNAKE_CASE with _TOOL suffix for the constant. The value should be lowercase snake_case.
Step 2: Create the Prompt Function
const myToolPrompt = (context: Context = {}) => {
return `This tool does X on Hedera.
Parameters:
- param1 (str, required): Description of param1
- param2 (int, optional): Description of param2, defaults to 0`;
};
Step 3: Define Parameters with Zod
import { z } from 'zod';
const myToolParameters = (_context: Context = {}) => {
return z.object({
param1: z.string().describe('Description of param1'),
param2: z.number().optional().describe('Description of param2'),
});
};
type MyToolParams = z.infer<ReturnType<typeof myToolParameters>>;
See references/zod-schema-patterns.md for common Hedera parameter patterns.
Step 4: Implement the BaseTool subclass (mutation example)
import { Client, Status } from '@hiero-ledger/sdk';
import {
BaseTool,
Context,
handleTransaction,
RawTransactionResponse,
transactionToolOutputParser,
} from '@hashgraph/hedera-agent-kit';
const postProcess = (response: RawTransactionResponse) =>
`Operation completed.
Transaction ID: ${response.transactionId}`;
Установить agent-kit-plugin в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл agent-kit-plugin?
This skill should be used when the user asks to "create a hedera plugin", "build a hedera agent kit plugin", "extend hedera agent kit", "create custom hedera tools", "add hedera functionality", "write a hedera tool", "implement hedera tool", or needs guidance on Hedera Agent Kit plugin architecture, tool definitions, mutation tools, query tools, or parameter schemas using Zod.
Как установить скилл agent-kit-plugin?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл agent-kit-plugin запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic