agent-creator
1
总安装量
1
周安装量
#49585
全站排名
安装命令
npx skills add https://github.com/mhylle/claude-skills-collection --skill agent-creator
Agent 安装分布
cursor
1
codex
1
Skill 文档
Agent Creator
Create composable AI agent systems in NestJS with uniform tool interfaces, DAG-based planning, and database-backed state.
Core Concept
Every agent system exposes the same Tool interface as a simple tool. Callers don’t know if they’re calling a web search API or a complex research system. This enables arbitrary composition and nesting.
Workflow
1. Gather Requirements
Ask the user:
- Purpose: What should this agent accomplish?
- Inputs/Outputs: What data goes in and comes out?
- Tools: What capabilities does it need? (existing tools or other agents)
- Success Criteria: How do we know the output is good?
- Evaluator Types: What quality dimensions matter? (see evaluators.md)
2. Generate Agent Structure
Create this NestJS module structure:
src/agents/{agent-name}/
âââ {agent-name}.module.ts # NestJS module
âââ {agent-name}.tool.ts # Tool interface (public API)
âââ services/
â âââ orchestrator.service.ts # Workflow coordination
â âââ planner.service.ts # Plan generation
â âââ executor.service.ts # Tool execution
â âââ state.service.ts # State management
âââ evaluators/
â âââ evaluator.registry.ts # Registry service
â âââ {type}.evaluator.ts # Per evaluator type
âââ tools/
â âââ tool.registry.ts # Available tools
âââ entities/ # TypeORM entities
âââ dto/ # Input/output DTOs
âââ prompts/ # LLM prompts
âââ config/
â âââ {agent-name}.config.ts
âââ interfaces/
3. Implement Components
For each component, follow the patterns in:
- architecture.md – Core interfaces, component roles, loops
- nestjs-patterns.md – NestJS service templates
- prompts.md – System prompts for planner/executor/evaluators
- evaluators.md – Built-in evaluator types
4. Wire Up Module
@Module({
imports: [TypeOrmModule.forFeature([...entities])],
providers: [
OrchestratorService,
PlannerService,
ExecutorService,
StateService,
EvaluatorRegistry,
...evaluators,
ToolRegistry,
AgentTool,
],
exports: [AgentTool], // Only export the Tool interface
})
export class AgentNameModule {}
Key Architecture Rules
- Uniform Interface: Agent’s public API is always
Tool.execute(input, context) - Planning Loop: plan â evaluate plan â revise â repeat (max iterations)
- Execution Loop: execute step â evaluate â retry with feedback â repeat
- DAG Plans: Steps declare dependencies; independent steps run in parallel
- State Persistence: All context, messages, plans, executions stored in PostgreSQL
- Composition: Agents can use other agents as tools transparently
Quick Reference
Tool Interface
interface Tool {
id: string;
name: string;
description: string;
inputSchema: JSONSchema;
outputSchema: JSONSchema;
execute(input: any, context?: ExecutionContext): Promise<ToolResult>;
}
Plan Structure
interface Plan {
id: string;
goal: string;
success_criteria: string[];
steps: PlanStep[];
}
interface PlanStep {
id: string;
description: string;
tool_id: string;
input: any;
success_criteria: string[];
evaluator_type: string;
depends_on: string[]; // DAG dependencies
}
Default Config
export const agentConfig = {
maxDepth: 3,
maxPlanIterations: 3,
maxStepRetries: 3,
timeoutMs: 300000,
llm: { model: 'claude-sonnet-4-20250514', maxTokens: 4096 },
};
Composition Example
After creating research-agent and document-generator:
// document-generator/tools/tool.registry.ts
@Injectable()
export class ToolRegistry {
constructor(private readonly researchTool: ResearchTool) {
this.register(this.researchTool);
}
}
The document generator’s planner can now create steps using research-system-v1 as a tool_id.