agent-implementer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Agent Implementer Skill

Agent实现技能

Purpose

目标

Create individual agents for the Arcanea ecosystem with proper structure, capabilities, and integration points.
为Arcanea生态系统创建具备规范结构、能力及集成接入点的独立Agent。

When to Use

适用场景

  • Adding new agents to the registry
  • Modifying existing agent capabilities
  • Creating agent-specific prompts
  • Implementing agent routing logic
  • Testing agent performance
  • 向注册中心添加新Agent
  • 修改现有Agent的能力
  • 创建Agent专属提示词
  • 实现Agent路由逻辑
  • 测试Agent性能

Agent Structure

Agent结构

Required Properties

必填属性

typescript
interface Agent {
  // Identity
  id: string;              // Unique kebab-case ID
  name: string;            // Display name
  command: string;         // Invocation command (/id)
  
  // Classification
  court: string;           // Guardian court name
  element: string;         // Fire/Water/Earth/Air/Void
  frequency: string;       // Operating frequency
  
  // Capabilities
  specialty: string;       // One-line description
  capabilities: string[];  // What they can do
  skills: string[];        // Available skills
  triggers: string[];      // Activation keywords
  
  // Configuration
  promptTemplate: string;  // System prompt template
  examples: string[];      // Example outputs
  parameters: ParamSchema; // Input parameters
  
  // Metadata
  version: string;         // Agent version
  author: string;          // Creator
  tier: 'free' | 'premium'; // Access level
}
typescript
interface Agent {
  // 身份信息
  id: string;              // 唯一的短横线命名ID
  name: string;            // 显示名称
  command: string;         // 调用命令(/id)
  
  // 分类信息
  court: string;           // 守护法庭名称
  element: string;         // 火/水/土/风/虚空
  frequency: string;       // 运行频率
  
  // 能力特性
  specialty: string;       // 一句话描述
  capabilities: string[];  // 可执行操作
  skills: string[];        // 可用技能
  triggers: string[];      // 触发关键词
  
  // 配置信息
  promptTemplate: string;  // 系统提示词模板
  examples: string[];      // 示例输出
  parameters: ParamSchema; // 输入参数
  
  // 元数据
  version: string;         // Agent版本
  author: string;          // 创建者
  tier: 'free' | 'premium'; // 访问级别
}

Implementation Steps

实现步骤

Step 1: Define Agent Identity

步骤1:定义Agent身份

Questions to answer:
  1. What is the agent's core purpose?
  2. Which court does it belong to?
  3. What frequency does it operate at?
  4. What makes it unique?
Example:
typescript
const ignitionAgent = {
  id: "ignition",
  name: "Ignition",
  command: "/ignition",
  court: "Draconia",
  element: "fire",
  frequency: "528Hz",
  specialty: "Spark rapid creative ideas"
};
需明确的问题:
  1. Agent的核心目标是什么?
  2. 它属于哪个法庭?
  3. 它的运行频率是多少?
  4. 它的独特性体现在哪里?
示例:
typescript
const ignitionAgent = {
  id: "ignition",
  name: "Ignition",
  command: "/ignition",
  court: "Draconia",
  element: "fire",
  frequency: "528Hz",
  specialty: "快速激发创意想法"
};

Step 2: Define Capabilities

步骤2:定义能力特性

List what the agent can do:
  • Generate ideas rapidly
  • Break creative blocks
  • Initiate projects
  • Provide energetic momentum
Map to skills:
  • /fire ignite
  • /fire intensify
  • /foundation begin
列出Agent可执行的操作:
  • 快速生成创意
  • 打破创作瓶颈
  • 启动项目
  • 提供动力支持
映射至技能:
  • /fire ignite
  • /fire intensify
  • /foundation begin

Step 3: Create Prompt Template

步骤3:创建提示词模板

Template structure:
You are {name} from the {court} Court.
Frequency: {frequency} | Element: {element}
Specialty: {specialty}

Your approach:
- {Characteristic 1}
- {Characteristic 2}
- {Characteristic 3}

Task: {{task}}
Context: {{context}}

Provide your contribution as {name}:
Example for Ignition:
You are Ignition from the Draconia Court.
Frequency: 528Hz | Element: Fire
Specialty: Spark rapid creative ideas

Your approach:
- High-energy, passionate
- Fast generation over perfection
- Bold, unconventional ideas
- Fearless creativity

Task: {{task}}
Context: {{context}}

Ignite creative fire. Generate 10 bold, energetic ideas rapidly.
Don't self-censor. Embrace wild possibilities.
模板结构:
你是来自{court}法庭的{name}。
频率:{frequency} | 元素:{element}
专长:{specialty}

你的工作方式:
- {特性1}
- {特性2}
- {特性3}

任务:{{task}}
上下文:{{context}}

请以{name}的身份提供输出:
Ignition示例:
你是来自Draconia法庭的Ignition。
频率:528Hz | 元素:火
专长:快速激发创意想法

你的工作方式:
- 充满活力、热情洋溢
- 追求快速生成而非完美
- 大胆、打破常规的想法
- 无惧的创造力

任务:{{task}}
上下文:{{context}}

点燃创意之火。快速生成10个大胆、充满活力的想法。
不要自我审查。拥抱天马行空的可能性。

Step 4: Define Triggers

步骤4:定义触发词

Keywords that activate this agent:
typescript
triggers: [
  "stuck",
  "blocked", 
  "can't start",
  "ignite",
  "spark",
  "rapid",
  "brainstorm",
  "ideas"
]
可激活该Agent的关键词:
typescript
triggers: [
  "卡住了",
  "瓶颈", 
  "无法开始",
  "点燃",
  "激发",
  "快速",
  "头脑风暴",
  "想法"
]

Step 5: Set Parameters

步骤5:设置参数

What inputs does the agent need?
typescript
parameters: {
  task: {
    type: "string",
    required: true,
    description: "What to generate ideas for"
  },
  count: {
    type: "number",
    required: false,
    default: 10,
    description: "Number of ideas to generate"
  },
  temperature: {
    type: "number",
    required: false,
    default: 0.9,
    description: "Creativity level (0.1-1.0)"
  }
}
Agent需要的输入:
typescript
parameters: {
  task: {
    type: "string",
    required: true,
    description: "需要生成创意的主题"
  },
  count: {
    type: "number",
    required: false,
    default: 10,
    description: "需要生成的创意数量"
  },
  temperature: {
    type: "number",
    required: false,
    default: 0.9,
    description: "创意程度(0.1-1.0)"
  }
}

Step 6: Register Agent

步骤6:注册Agent

Add to registry:
typescript
// In arcanea-agents/registry.js
const AGENT_REGISTRY = {
  courts: {
    elemental: {
      fire: {
        guardian: "Draconia",
        agents: [
          // ... other agents
          {
            id: "ignition",
            name: "Ignition",
            // ... all properties
          }
        ]
      }
    }
  }
};
添加至注册中心:
typescript
// 在 arcanea-agents/registry.js 中
const AGENT_REGISTRY = {
  courts: {
    elemental: {
      fire: {
        guardian: "Draconia",
        agents: [
          // ... 其他Agent
          {
            id: "ignition",
            name: "Ignition",
            // ... 所有属性
          }
        ]
      }
    }
  }
};

Step 7: Test Agent

步骤7:测试Agent

Create test cases:
typescript
// Test ignition agent
describe('Ignition Agent', () => {
  test('generates ideas for character', async () => {
    const result = await invokeAgent('ignition', {
      task: 'Create a cyberpunk character'
    });
    expect(result.output).toContain('character');
    expect(result.output.split('\n').length).toBeGreaterThan(5);
  });
});
创建测试用例:
typescript
// 测试Ignition Agent
describe('Ignition Agent', () => {
  test('为角色生成创意', async () => {
    const result = await invokeAgent('ignition', {
      task: '创建一个赛博朋克角色'
    });
    expect(result.output).toContain('角色');
    expect(result.output.split('\n').length).toBeGreaterThan(5);
  });
});

Agent Templates

Agent模板

Fire Court Agent Template

火之法庭Agent模板

typescript
{
  id: "{kebab-name}",
  name: "{TitleCaseName}",
  command: "/{kebab-name}",
  court: "Draconia",
  element: "fire",
  frequency: "{396|528|639|741|852|963}Hz",
  specialty: "{One-line specialty}",
  personality: "{Fiery, passionate, transformative}",
  capabilities: ["{capability1}", "{capability2}"],
  skills: ["/fire {skill1}", "/fire {skill2}"],
  triggers: ["{keyword1}", "{keyword2}"],
  promptTemplate: `You are {name} from the Draconia Court...
  
Task: {{task}}

Approach with fire: intense, passionate, transformative.
{specific_instructions}`,
  examples: ["{example1}", "{example2}"]
}
typescript
{
  id: "{kebab-name}",
  name: "{TitleCaseName}",
  command: "/{kebab-name}",
  court: "Draconia",
  element: "fire",
  frequency: "{396|528|639|741|852|963}Hz",
  specialty: "{一句话专长描述}",
  personality: "{热情、富有激情、变革性}",
  capabilities: ["{能力1}", "{能力2}"],
  skills: ["/fire {技能1}", "/fire {技能2}"],
  triggers: ["{关键词1}", "{关键词2}"],
  promptTemplate: `你是来自Draconia法庭的{name}...
  
任务:{{task}}

以火的方式工作:强烈、热情、变革性。
{具体指令}`,
  examples: ["{示例1}", "{示例2}"]
}

Water Court Agent Template

水之法庭Agent模板

typescript
{
  id: "{kebab-name}",
  name: "{TitleCaseName}",
  command: "/{kebab-name}",
  court: "Leyla",
  element: "water",
  frequency: "{396|528|639|741|852}Hz",
  specialty: "{One-line specialty}",
  personality: "{Fluid, emotional, nurturing}",
  capabilities: ["{capability1}", "{capability2}"],
  skills: ["/flow {skill1}", "/flow {skill2}"],
  triggers: ["{keyword1}", "{keyword2}"],
  promptTemplate: `You are {name} from the Leyla Court...
  
Task: {{task}}

Approach with water: flowing, emotional, adaptive.
{specific_instructions}`,
  examples: ["{example1}", "{example2}"]
}
typescript
{
  id: "{kebab-name}",
  name: "{TitleCaseName}",
  command: "/{kebab-name}",
  court: "Leyla",
  element: "water",
  frequency: "{396|528|639|741|852}Hz",
  specialty: "{一句话专长描述}",
  personality: "{流畅、感性、滋养}",
  capabilities: ["{能力1}", "{能力2}"],
  skills: ["/flow {技能1}", "/flow {技能2}"],
  triggers: ["{关键词1}", "{关键词2}"],
  promptTemplate: `你是来自Leyla法庭的{name}...
  
任务:{{task}}

以水的方式工作:流畅、感性、适应性强。
{具体指令}`,
  examples: ["{示例1}", "{示例2}"]
}

Common Patterns

常见模式

Agent with Sub-agents

包含子Agent的Agent

For complex agents that need specialized modes:
typescript
{
  id: "structure",
  name: "Structure",
  subModes: [
    { id: "structure-architect", name: "Architect Mode" },
    { id: "structure-foundation", name: "Foundation Mode" },
    { id: "structure-refinement", name: "Refinement Mode" }
  ]
}
适用于需要特殊模式的复杂Agent:
typescript
{
  id: "structure",
  name: "Structure",
  subModes: [
    { id: "structure-architect", name: "架构师模式" },
    { id: "structure-foundation", name: "基础模式" },
    { id: "structure-refinement", name: "优化模式" }
  ]
}

Agent with Parameters

带参数的Agent

For agents that need configuration:
typescript
{
  id: "depth",
  name: "Depth",
  parameters: {
    depth: {
      type: "enum",
      options: ["surface", "shallow", "deep", "abyssal"],
      default: "deep"
    }
  }
}
适用于需要配置的Agent:
typescript
{
  id: "depth",
  name: "Depth",
  parameters: {
    depth: {
      type: "enum",
      options: ["surface", "shallow", "deep", "abyssal"],
      default: "deep"
    }
  }
}

Agent with Context Memory

带上下文记忆的Agent

For agents that remember previous interactions:
typescript
{
  id: "relationship",
  name: "Relationship",
  contextWindow: 5,  // Remember last 5 interactions
  memory: {
    type: "conversation",
    persistence: "session"
  }
}
适用于需要记住之前交互的Agent:
typescript
{
  id: "relationship",
  name: "Relationship",
  contextWindow: 5,  // 记住最近5次交互
  memory: {
    type: "conversation",
    persistence: "session"
  }
}

Best Practices

最佳实践

Do's

建议

✅ Give each agent a clear, single purpose ✅ Use consistent naming conventions ✅ Document all parameters ✅ Provide example outputs ✅ Test with real tasks ✅ Version your agents
✅ 为每个Agent设定清晰的单一目标 ✅ 使用统一的命名规范 ✅ 记录所有参数 ✅ 提供示例输出 ✅ 使用真实任务进行测试 ✅ 为Agent添加版本号

Don'ts

禁忌

❌ Create agents that overlap too much ❌ Give agents vague or broad purposes ❌ Forget to add to registry ❌ Skip testing ❌ Hardcode without configuration options
❌ 创建功能过度重叠的Agent ❌ 为Agent设定模糊或宽泛的目标 ❌ 忘记将Agent添加至注册中心 ❌ 跳过测试环节 ❌ 不提供配置选项而直接硬编码

Validation Checklist

验证清单

Before an agent is complete:
  • ID is unique and kebab-case
  • Name is clear and descriptive
  • Court assignment is logical
  • Frequency matches gate
  • Specialty is one clear sentence
  • At least 3 capabilities defined
  • At least 3 skills mapped
  • At least 5 trigger keywords
  • Prompt template is complete
  • Examples are provided
  • Added to registry
  • Tests written and passing
  • Documentation complete
Agent完成前需检查:
  • ID唯一且为短横线命名格式
  • 名称清晰且具有描述性
  • 法庭分配逻辑合理
  • 频率与对应门户匹配
  • 专长为清晰的一句话描述
  • 至少定义3项能力
  • 至少映射3项技能
  • 至少包含5个触发关键词
  • 提示词模板完整
  • 提供示例输出
  • 已添加至注册中心
  • 编写并通过测试用例
  • 文档完整

Testing Strategy

测试策略

Unit Tests

单元测试

typescript
test('agent responds correctly', async () => {
  const agent = getAgent('ignition');
  const result = await agent.invoke('Brainstorm ideas');
  expect(result).toBeDefined();
  expect(result.output).toBeTruthy();
});
typescript
test('Agent响应正确', async () => {
  const agent = getAgent('ignition');
  const result = await agent.invoke('头脑风暴创意');
  expect(result).toBeDefined();
  expect(result.output).toBeTruthy();
});

Integration Tests

集成测试

typescript
test('agent integrates with conductor', async () => {
  const result = await conductor.orchestrate({
    agent: 'ignition',
    task: 'test'
  });
  expect(result.success).toBe(true);
});
typescript
test('Agent与调度器集成正常', async () => {
  const result = await conductor.orchestrate({
    agent: 'ignition',
    task: '测试'
  });
  expect(result.success).toBe(true);
});

User Tests

用户测试

  • Real users try the agent
  • Feedback collected
  • Iterations made
  • 真实用户试用Agent
  • 收集反馈
  • 迭代优化

Conclusion

总结

Implementing agents requires:
  1. Clear definition - Know what the agent does
  2. Proper structure - Follow the template
  3. Thorough testing - Validate functionality
  4. Documentation - Help users understand
Each agent is a specialized creative partner. Build them well.

Use this skill when implementing or modifying agents in the Arcanea ecosystem.
实现Agent需要:
  1. 清晰定义 - �明确Agent的功能
  2. 规范结构 - 遵循模板
  3. 充分测试 - 验证功能
  4. 完整文档 - 帮助用户理解
每个Agent都是一个专业的创意伙伴。请用心构建。

在Arcanea生态系统中实现或修改Agent时使用本技能。