jpskill.com
🛠️ 開発・MCP コミュニティ

new-agent-creation

Provides step-by-step templates and guidance for creating new AI agents in Unite-Hub with proper registration, testing, and governance

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o new-agent-creation.zip https://jpskill.com/download/17909.zip && unzip -o new-agent-creation.zip && rm new-agent-creation.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17909.zip -OutFile "$d\new-agent-creation.zip"; Expand-Archive "$d\new-agent-creation.zip" -DestinationPath $d -Force; ri "$d\new-agent-creation.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して new-agent-creation.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → new-agent-creation フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

新しい Agent の作成スキル

ステップバイステップの Agent 実装

使用場面: Unite-Hub 用の新しい AI エージェントを作成する場合


クイックスタートテンプレート

1. Agent ファイルの作成

場所: src/lib/agents/my-new-agent.ts

import { BaseAgent, AgentTask, AgentConfig } from './base-agent';
import { getAnthropicClient } from '@/lib/anthropic/lazy-client';

export class MyNewAgent extends BaseAgent {
  constructor() {
    super({
      name: 'MyNewAgent',
      queueName: 'my-new-agent-queue',
      concurrency: 1,
      retryDelay: 5000
    });
  }

  protected async processTask(task: AgentTask): Promise<any> {
    // ここにエージェントのロジックを記述します
    const client = getAnthropicClient();

    const response = await client.messages.create({
      model: 'claude-sonnet-4-5-20250929',
      max_tokens: 4096,
      messages: [{
        role: 'user',
        content: `Task: ${task.task_type}\nPayload: ${JSON.stringify(task.payload)}`
      }]
    });

    return {
      result: response.content[0].text,
      workspace_id: task.workspace_id,
      model_used: 'claude-sonnet-4-5-20250929',
      input_tokens: response.usage.input_tokens,
      output_tokens: response.usage.output_tokens
    };
  }
}

2. オーケストレーターへの登録

ファイル: src/lib/agents/orchestrator-router.ts

// AgentIntent enum に追加
export type AgentIntent =
  | 'my_new_agent'  // ← これを追加
  | 'email' | 'content' | ...;

// classifyIntent 関数に追加
if (objective.includes('my task keyword')) {
  return 'my_new_agent';
}

3. レジストリへの追加

ファイル: .claude/agents/registry.json

{
  "id": "my-new-agent",
  "name": "My New Agent",
  "version": "1.0.0",
  "file": "src/lib/agents/my-new-agent.ts",
  "capabilities": ["capability_1", "capability_2"],
  "queueName": "my-new-agent-queue",
  "models": ["claude-sonnet-4-5-20250929"],
  "governance": "HUMAN_GOVERNED",
  "verification_required": true,
  "budget_daily_usd": 10.00,
  "category": "marketing"
}

4. テストの作成

ファイル: tests/agents/my-new-agent.test.ts

import { describe, it, expect, vi } from 'vitest';
import { MyNewAgent } from '@/lib/agents/my-new-agent';

describe('MyNewAgent', () => {
  it('processes task successfully', async () => {
    const agent = new MyNewAgent();
    const task = {
      id: 'test-1',
      workspace_id: 'ws-123',
      task_type: 'my_task',
      payload: { data: 'test' },
      priority: 5,
      retry_count: 0,
      max_retries: 3
    };

    const result = await agent.processTask(task);

    expect(result).toBeDefined();
    expect(result.workspace_id).toBe('ws-123');
  });
});

5. CLI ランナーの作成 (オプション)

ファイル: scripts/run-my-agent.mjs

import { MyNewAgent } from '../src/lib/agents/my-new-agent.js';

const agent = new MyNewAgent();
await agent.start();
console.log('MyNewAgent running...');

チェックリスト

  • [ ] BaseAgent を拡張する agent ファイルを作成
  • [ ] processTask() メソッドを実装
  • [ ] orchestrator-router.ts の intent enum に追加
  • [ ] オーケストレーターのルーティングロジックに追加
  • [ ] .claude/agents/registry.json に登録
  • [ ] テストを作成 (100% 合格が必須)
  • [ ] CLI ランナースクリプトを追加 (オプション)
  • [ ] .claude/agent.md にドキュメント化
  • [ ] 適切な予算制限を設定
  • [ ] ガバナンスモードを選択 (HUMAN_GOVERNED vs AUTONOMOUS)

標準: すべての agent は workspace_id でフィルタリングし、予算を尊重し、検証に合格する必要があります。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

New Agent Creation Skill

Step-by-Step Agent Implementation

When to Use: Creating new AI agents for Unite-Hub


Quick Start Template

1. Create Agent File

Location: src/lib/agents/my-new-agent.ts

import { BaseAgent, AgentTask, AgentConfig } from './base-agent';
import { getAnthropicClient } from '@/lib/anthropic/lazy-client';

export class MyNewAgent extends BaseAgent {
  constructor() {
    super({
      name: 'MyNewAgent',
      queueName: 'my-new-agent-queue',
      concurrency: 1,
      retryDelay: 5000
    });
  }

  protected async processTask(task: AgentTask): Promise<any> {
    // Your agent logic here
    const client = getAnthropicClient();

    const response = await client.messages.create({
      model: 'claude-sonnet-4-5-20250929',
      max_tokens: 4096,
      messages: [{
        role: 'user',
        content: `Task: ${task.task_type}\nPayload: ${JSON.stringify(task.payload)}`
      }]
    });

    return {
      result: response.content[0].text,
      workspace_id: task.workspace_id,
      model_used: 'claude-sonnet-4-5-20250929',
      input_tokens: response.usage.input_tokens,
      output_tokens: response.usage.output_tokens
    };
  }
}

2. Register in Orchestrator

File: src/lib/agents/orchestrator-router.ts

// Add to AgentIntent enum
export type AgentIntent =
  | 'my_new_agent'  // ← Add this
  | 'email' | 'content' | ...;

// Add to classifyIntent function
if (objective.includes('my task keyword')) {
  return 'my_new_agent';
}

3. Add to Registry

File: .claude/agents/registry.json

{
  "id": "my-new-agent",
  "name": "My New Agent",
  "version": "1.0.0",
  "file": "src/lib/agents/my-new-agent.ts",
  "capabilities": ["capability_1", "capability_2"],
  "queueName": "my-new-agent-queue",
  "models": ["claude-sonnet-4-5-20250929"],
  "governance": "HUMAN_GOVERNED",
  "verification_required": true,
  "budget_daily_usd": 10.00,
  "category": "marketing"
}

4. Create Tests

File: tests/agents/my-new-agent.test.ts

import { describe, it, expect, vi } from 'vitest';
import { MyNewAgent } from '@/lib/agents/my-new-agent';

describe('MyNewAgent', () => {
  it('processes task successfully', async () => {
    const agent = new MyNewAgent();
    const task = {
      id: 'test-1',
      workspace_id: 'ws-123',
      task_type: 'my_task',
      payload: { data: 'test' },
      priority: 5,
      retry_count: 0,
      max_retries: 3
    };

    const result = await agent.processTask(task);

    expect(result).toBeDefined();
    expect(result.workspace_id).toBe('ws-123');
  });
});

5. Create CLI Runner (Optional)

File: scripts/run-my-agent.mjs

import { MyNewAgent } from '../src/lib/agents/my-new-agent.js';

const agent = new MyNewAgent();
await agent.start();
console.log('MyNewAgent running...');

Checklist

  • [ ] Create agent file extending BaseAgent
  • [ ] Implement processTask() method
  • [ ] Add to orchestrator-router.ts intent enum
  • [ ] Add to orchestrator routing logic
  • [ ] Register in .claude/agents/registry.json
  • [ ] Create tests (100% pass required)
  • [ ] Add CLI runner script (optional)
  • [ ] Document in .claude/agent.md
  • [ ] Set appropriate budget limits
  • [ ] Choose governance mode (HUMAN_GOVERNED vs AUTONOMOUS)

Standard: All agents must filter by workspace_id, respect budgets, pass verification