agentleFS
mhyllemhylle/claude-skills-collection/skills/agent-creator/SKILL.md

agent-creator

Skill20 starsChanged 36 days agoMITView on GitHub

Create composable AI agent systems in NestJS projects following the "tools all the way down" architecture. Use this skill when users want to: (1) Create new AI agents with orchestrator/planner/executor/evaluator components, (2) Build agentic systems that can call other agents as tools, (3) Implement DAG-based planning with parallel execution, (4) Add database-backed state persistence for agent runs, (5) Create custom evaluators for quality assurance. Triggers on "create agent", "build agent", "agent system", "agentic", "orchestrator", "planner/executor pattern", or NestJS AI agent requests.

26 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security and skill-creator.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • 0xSeroSkill

    security

    Also in 4 projects that use this

  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 10 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create composable AI agent systems in NestJS with uniform tool interfaces, DAG-based planning, and database-backed state.

    line 32
  2. Very specific:

    Every agent system exposes the same Tool interface as a simple tool.

    line 36
  3. Distinctive:

    Create this NestJS module structure:

    line 52
  4. Distinctive:

    State Persistence: All context, messages, plans, executions stored in PostgreSQL

    line 110
  5. Very specific:

    After creating research-agent and document-generator:

    line 163

“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent Creator

<!-- contents: generated by tests/skill_structure.py --write; edit headings, not this block -->

Contents

  • Core Concept
  • Workflow
    • 1. Gather Requirements
    • 2. Generate Agent Structure
    • 3. Implement Components
    • 4. Wire Up Module
  • Key Architecture Rules
  • Quick Reference
    • Tool Interface
    • Plan Structure
    • Default Config
  • Composition Example

Reference files (open one when a step points to it):

  • references/architecture.md: Agent Architecture Reference
  • references/evaluators.md: Evaluators Reference
  • references/nestjs-patterns.md: NestJS Patterns Reference
  • references/prompts.md: System Prompts Reference
<!-- /contents -->

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:

  1. Purpose: What should this agent accomplish?
  2. Inputs/Outputs: What data goes in and comes out?
  3. Tools: What capabilities does it need? (existing tools or other agents)
  4. Success Criteria: How do we know the output is good?
  5. 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

  1. Uniform Interface: Agent's public API is always Tool.execute(input, context)
  2. Planning Loop: plan → evaluate plan → revise → repeat (max iterations)
  3. Execution Loop: execute step → evaluate → retry with feedback → repeat
  4. DAG Plans: Steps declare dependencies; independent steps run in parallel
  5. State Persistence: All context, messages, plans, executions stored in PostgreSQL
  6. 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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.