agentleFS
ArtesianaArtesiana/agent2/.github/skills/creating-agents/SKILL.md

creating-agents

Skill36 starsChanged 7 months agoMITView on GitHub

Use when creating a new Agent2 agent, scaffolding a service, or when user says "new agent" or "add agent" — generates schema, tools, config, Dockerfile, and Docker Compose entry following Agent2 conventions

  • Sends data out

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the requested agent is a domain expert, regulated workflow, document reviewer, compliance worker, or professional brain clone, use …

    line 12
  2. Very specific:

    Create all files in agents/<name>/:

    line 35
  3. Very specific:

    Add a service block to docker-compose.yml.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “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

Creating Agents

Overview

Scaffold a complete Agent2 agent service. One agent = one schema, one API, one Docker service.

If the requested agent is a domain expert, regulated workflow, document reviewer, compliance worker, or professional brain clone, use brain-clone first and study agents/procurement-compliance-officer.

When to Activate

  • User says "create agent", "new agent", "scaffold agent", "add agent"
  • User describes a use case that needs a new agent service
  • User wants to add a new backend AI worker

Steps

1. Gather Requirements

Ask the user:

  1. Name (kebab-case, e.g. support-ticket)
  2. What it does (one sentence)
  3. Output fields (what the structured result should contain)
  4. Tools needed (what the agent should be able to call)
  5. Knowledge needed? (does it need to search documents?)

2. Generate Files

Create all files in agents/<name>/:

FileWhat to put
__init__.pyEmpty
schemas.pyPydantic BaseModel with Field() descriptions. Use Literal for enums, validators for constraints.
tools.pyOne function per tool. Include docstrings. Stub implementations.
agent.pycreate_agent() with instructions= and @agent.tool_plain registrations
config.yamlname, description, model (empty = use DEFAULT_MODEL), port, timeout, collections
main.pyfrom shared.api import create_app; app = create_app("<name>")
DockerfileCopy from agents/example-agent/Dockerfile, change agent paths
tests/promptfoo/<name>/eval.yamlFor domain agents, behavior-level evals

3. Key Rules

# agent.py — ALWAYS use instructions=, NEVER system_prompt=
agent = create_agent(
    name="my-agent",
    output_type=MySchema,
    instructions="You are...",
    toolsets=[knowledge_server] if needs_knowledge else [],
)

# Tools — ALWAYS @agent.tool_plain, delegate to tools.py
@agent.tool_plain
def my_tool(arg: str) -> dict:
    """Docstring is the tool description the LLM sees."""
    return tools.my_tool(arg)

4. Wire Into Docker Compose

Add a service block to docker-compose.yml. Use next available port. Copy environment block from example-agent.

5. Verify

uv run pytest tests/ -v                    # Unit tests still pass
docker compose build <name>                 # Image builds
docker compose up -d <name> redis           # Service starts
curl http://localhost:<port>/health          # Health check
curl -X POST http://localhost:<port>/tasks?mode=sync \
  -H "Authorization: Bearer dev-token-change-me" \
  -H "Content-Type: application/json" \
  -d '{"input":{"text":"test"}}'            # Mock mode returns schema-valid JSON

Common Mistakes

MistakeFix
Using system_prompt=Use instructions= — system_prompt is a compat alias
Putting business logic in shared/Business logic goes in agents/<name>/tools.py
Hardcoding model nameLeave model: "" in config, use DEFAULT_MODEL env var
Forgetting Dockerfile config copyMust mkdir -p agents/<name> && cp agent/config.yaml agents/<name>/config.yaml
Using toolsets=NoneUse toolsets=[] (empty list is safe, None can cause issues)
Building a domain expert from the tiny examplesUse agents/procurement-compliance-officer as the canonical full-pattern reference

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.