Agent Smith 智能体定义(YAML)
create-agent
当需要使用 YAML 在 Agent Smith 中创建、定义或修改 agent(智能体)时使用,可选择将其暴露为子代理工具。
- License 许可
- MIT
- 最近更新
- 2026-10-13
- Stars
- ★ 48
- Forks
- 3
01 前言 Front Matter
- name
- create-agent
- description
- use when asked to create, define, or modify an agent in YAML for Agent Smith, optionally exposes it as a subagent tool
03 SKILL.md 正文
Create an Agent in YAML
Define, register, and verify an AI agent from a YAML file in the Agent Smith framework.
Workflow
- Ensure a registered features directory (first time only) — edit the conf file to add your
features/root path, then runlm conf. The conf file lists the directories the framework scans for feature files; it is the source of truth for feature paths. - Write the agent YAML — create
<name>.ymlinfeatures/agents/. The filename becomes the agent's default name (e.g.,my-agent.yml→ agentmy-agent). Fill in the required fields (description,prompt,model) plus any optional ones from the field reference below. - Register — run
lm update. This triggers feature discovery: it scans registered directories, parses agent metadata, and upserts into theagentSQLite table (and createsToolSpecentries in thetooltable). - (Optional) Expose as a subagent — add a
tool:section to the YAML so other agents can call it, then runlm updateagain. - Verify:
lm agents # agent appears in the list
lm my-agent "Hello" # runs the agent interactively
Field reference
Required: name (from filename), prompt (system prompt template; {prompt} = user input), description, model (e.g., qwen4b).
Optional: category (UI navigation), template (system prompt, stop sequences), inferParams (sampling: temperature, top_p, top_k, min_p, repetition_penalty), variables (input variable definitions with required:/optional:), toolsList (references to registered tools by name), tools (inline tool definitions), models (alternative models for UI selection), shots (few-shot examples), skills, workflow (pre/post steps), mcp.
Examples
Minimal agent:
description: "My first agent"
category: myagents/general
prompt: |-
User query: {prompt}
model: qwen4b
Full annotated example:
# features/agents/my-coder.yml
description: "A coding agent with file and shell access"
category: development/coding
prompt: |-
{prompt}
template:
system: |-
You are a coding agent. Follow instructions precisely.
Report back with a short summary when done.
model: qwen35b
inferParams:
min_p: 0
top_k: 20
top_p: 0.85
temperature: 0.6
repetition_penalty: 1
variables:
required:
workspace:
description: The local directory path where to operate
toolsList:
- read-file
- write-file
- edit-search-replace
- shell
Subagent (callable by other agents) — add a tool: section defining the interface:
# features/agents/my-search.yml
tool:
name: my-search
description: Perform web search and return results
arguments:
prompt:
description: The search query or question
required: true
description: "A web search agent"
prompt: |-
Research the following: {prompt}
model: qwen4b
toolsList:
- ddsearch
- openpage
Other agents reference it by its tool name in their toolsList (e.g., - my-search), then run lm update.
Gotchas
- Simply running
lm confwithout first editing the conf file will NOT add a new features directory — the conf file is the source of truth for feature paths. - Every change to an agent's tool list requires re-registration: after adding, removing, or modifying entries in
toolsList(or inlinetools), runlm updateagain — the agent will not see new tools until then. - A subagent is NOT usable until registered: the
tool:section only defines the interface;lm updatecreates theToolSpecentry in thetooltable that makes it callable. Without this step, parent agents referencing it in theirtoolsListget a "tool not found" error. - Renaming the YAML file changes the agent's default name — keep filenames stable or update references in other agents'
toolsList.
References (load when needed)
- Full schema and field-by-field guide:
agent-smith/docsite/public/doc/reference/1.howto-agents.md - Minimal example agent:
agent-smith/examples/features/agents/general-agent.yml - Complex real-world example with template, variables, tools:
lynx-coder/dist/agents/lx-coder.yml - Feature discovery pipeline internals:
agent-smith/docsite/public/doc/libraries/core/3.feature-discovery.md
04 同仓库更多 Skills
Agent Smith 工作流编排
create-workflow
当需要在 Agent Smith 中创建、定义或修改 workflow(工作流)时使用——在 features/workflows/ 中写入 .yml 文件,串联 action/agent/adaptater/command,并通过 lm update 注册,使其可作为 `lm <name>` 运行,并可暴露为 agent 工具。
Agent Smith 适配器创建
create-adaptater
当需要在 Agent Smith 中创建、定义或修改 adaptater(适配器)时使用——在 features/adaptaters/ 中写入 .js 文件,并通过 lm update 注册,使工作流可将其用作 action 与 agent 之间的数据转换步骤。
Agent Smith 动作创建与修改
create-action
当用户要求在 Agent Smith 中创建、定义或修改某个 action(动作)时使用——在 features/actions/ 目录中写入 .js/.py/.yml 文件,并添加……(原文在此截断)
文档地图更新
update-doc-map
仅在收到更新文档地图(documentation map)的指示时读取此技能。
agent-smith 包文档撰写
document-agent-smith-package
当被要求在文档站点(docsite)中创建或更新包文档时使用。