Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Cursor rules for Hashgraph Online development with TypeScript, building AI agents on Hedera with RegistryBrokerClient.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 3% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 29% | 0% |
Cursor rules for Hashgraph Online development with TypeScript, building AI agents on Hedera with RegistryBrokerClient.
Synced from https://github.com/PatrickJS/awesome-cursorrules/tree/main/rules/hol-hedera-typescript-cursorrules-prompt-file.mdc.
You are an expert TypeScript developer building applications with Hashgraph Online (HOL) - the open-source SDK for AI agents and decentralized applications on Hedera.
Core:
HOL SDK:
Frontend (when applicable):
any - define proper interfacesas any casting - use type guardsregistry-client.ts, topic-manager.ts__tests__/registry-client.test.tsregistry-browser.tsxrenderContent()typescriptimport { RegistryBrokerClient } from '@hashgraphonline/standards-sdk'; const client = new RegistryBrokerClient({ baseUrl: 'https://api.hol.org', apiKey: process.env.HOL_API_KEY, });
typescriptimport { RegistryBrokerClient, SearchParams, Logger } from '@hashgraphonline/standards-sdk'; const logger = new Logger({ module: 'AgentSearch', level: 'info' }); const client = new RegistryBrokerClient(); const searchParams: SearchParams = { q: 'weather', registry: 'hcs-10', limit: 10, page: 1, }; const results = await client.search(searchParams); logger.info('Search completed', { total: results.total }); results.hits.forEach(agent => { logger.debug('Agent found', { name: agent.name, description: agent.description }); });
typescriptimport { RegistryBrokerClient, Logger } from '@hashgraphonline/standards-sdk'; const client = new RegistryBrokerClient(); const logger = new Logger({ module: 'AgentResolver', level: 'info' }); const agent = await client.resolveUaid('hcs10://0.0.123456/agent-name'); logger.info('Agent resolved', { name: agent.name, protocols: agent.protocols, capabilities: agent.capabilities });
typescriptimport { RegistryBrokerClient, AgentRegistrationRequest, Logger } from '@hashgraphonline/standards-sdk'; const client = new RegistryBrokerClient(); const logger = new Logger({ module: 'AgentRegistration', level: 'info' }); const registration: AgentRegistrationRequest = { name: 'My Agent', description: 'A helpful AI agent', protocols: ['hcs-10'], capabilities: ['chat', 'search'], endpoint: 'https://my-agent.example.com', }; const response = await client.registerAgent(registration, { autoTopUp: { accountId: process.env.HEDERA_OPERATOR_ID!, privateKey: process.env.HEDERA_OPERATOR_KEY!, }, }); if (response.success) { logger.info('Agent registered', { uaid: response.uaid }); }
typescriptimport { RegistryBrokerClient, StartChatOptions, Logger } from '@hashgraphonline/standards-sdk'; const client = new RegistryBrokerClient(); const logger = new Logger({ module: 'AgentChat', level: 'info' }); const options: StartChatOptions = { uaid: 'hcs10://0.0.123456/agent-name', auth: { accountId: process.env.HEDERA_OPERATOR_ID!, privateKey: process.env.HEDERA_OPERATOR_KEY!, }, }; const conversation = await client.chat.start(options); const response = await conversation.send({ plaintext: 'Hello, can you help me?', }); logger.info('Agent response received', { sessionId: conversation.sessionId });
typescriptimport { RegistryBrokerClient, Logger } from '@hashgraphonline/standards-sdk'; const client = new RegistryBrokerClient(); const logger = new Logger({ module: 'RegistryStats', level: 'info' }); const stats = await client.stats(); logger.info('Registry stats', { totalAgents: stats.totalAgents, protocols: stats.protocols }); const registries = await client.registries(); registries.forEach(r => logger.debug('Registry', { name: r.name }));
typescriptimport { RegistryBrokerClient, VectorSearchRequest, Logger } from '@hashgraphonline/standards-sdk'; const client = new RegistryBrokerClient(); const logger = new Logger({ module: 'VectorSearch', level: 'info' }); const request: VectorSearchRequest = { query: 'find me an agent that can help with weather forecasts', limit: 5, filter: { registry: 'hcs-10', protocols: ['a2a'], }, }; const results = await client.vectorSearch(request); results.hits.forEach(hit => { logger.info('Match found', { name: hit.agent.name, score: hit.score }); });
typescriptdescribe('RegistryBrokerClient', () => { let client: RegistryBrokerClient; beforeEach(() => { client = new RegistryBrokerClient(); }); describe('search', () => { it('should return agents matching query', async () => { const result = await client.search({ q: 'test' }); expect(result.hits).toBeDefined(); expect(Array.isArray(result.hits)).toBe(true); }); }); describe('resolveUaid', () => { it('should resolve valid UAID', async () => { const agent = await client.resolveUaid('hcs10://0.0.123456/test'); expect(agent.name).toBeDefined(); }); }); });
bashpnpm test # Run all tests pnpm test -- --watch # Watch mode pnpm test -- --coverage # Coverage report pnpm test -- -t "pattern" # Run specific tests
Before completing any task:
pnpm run lint - Zero violationspnpm run typecheck - Zero errors pnpm run build - Must compilepnpm test - All tests passtypescriptimport 'dotenv/config'; const config = { baseUrl: process.env.HOL_API_URL || 'https://api.hol.org', apiKey: process.env.HOL_API_KEY, network: process.env.HEDERA_NETWORK || 'testnet', operatorId: process.env.HEDERA_OPERATOR_ID, operatorKey: process.env.HEDERA_OPERATOR_KEY, };
Other measured skills in the registry, with their headline benchmark lift.