Manage and optimize custom agent definition files (IDENTITY.md, AGENTS.md, SOUL.md, TOOLS.md). Also handles first-time employee initialization when .workspace/ has no IDENTITY.md. Use when users want to edit agent identity, modify workflow instructions, adjust personality, add/remove tools, optimize prompts, or initialize a new employee from scratch. Trigger signals: 'modify prompt', 'change identity', 'add tool', 'remove tool', 'optimize workflow', 'adjust personality', 'initialize employee', '修改提示词', '改身份', '加工具', '去掉工具', '优化能力', '调性格', '初始化员工', '创建员工'. Do NOT use for: skill creation (use skill-creator), skill listing (use find-skill).
Manages the 4 core employee definition files under .magic/, helping users view, edit, and optimize their employee's identity, instructions, personality, and tool configuration.
Also handles first-time employee initialization when the workspace has no definition files.
When .magic/IDENTITY.md does not exist, the workspace has no employee yet and you should guide the user through initialization.
Use list_dir to check .magic/. If IDENTITY.md is missing, enter the initialization flow.
Collect information in rounds; you may combine questions but don't overwhelm the user:
Round 1 (required):
Round 2 (recommended but optional): 4. Role definition: A richer description of capabilities, expertise, and working style (goes into IDENTITY.md body) 5. Workflow / rules: What workflow should this employee follow? Any special rules? (goes into AGENTS.md)
Round 3 (optional, user may skip): 6. Personality and communication style: What personality should the employee have? (e.g. rigorous, lively, concise) (goes into SOUL.md)
If the user signals intent to skip ("先这样", "later", etc.), proceed immediately with whatever has been collected.
After collecting info, write a JSON config and call the init script:
# 1. Write collected info as JSON config
write_file(
path=".crew_init_config.json",
content='{"name": "Research Assistant", "name_cn": "研究助手", "role": "Academic Researcher", "role_cn": "学术研究员", "description": "...", "description_cn": "...", "role_body": "...", "role_body_cn": "...", "instructions": "...", "instructions_cn": "...", "personality": "...", "personality_cn": "..."}'
)
# 2. Call the init script
shell_exec(
command="python scripts/init_crew.py --config .workspace/.crew_init_config.json"
)
The script generates files based on the config (TOOLS.md and SKILLS.md are intentionally not created — the system uses defaults):
IDENTITY.md — always generated (YAML header + role definition body)AGENTS.md — generated if workflow instructions were providedSOUL.md — generated if personality was providedread_filesdelete_files(path=".crew_init_config.json")| 文件 | 维度 | 职责 | 是否必填 |
|---|---|---|---|
IDENTITY.md | WHO — 身份 | 名称、角色、描述 + 角色定义正文 | 必填 |
AGENTS.md | WHAT — 指令 | 工作流程、规则、特殊指令 | 推荐 |
SOUL.md | HOW — 性格 | 核心性格、沟通风格、行为准则 | 可选 |
TOOLS.md | WITH WHAT — 工具 | 工具白名单(YAML)+ 使用偏好 | 可选 |
read_files 读取目标文件的现有内容references/prompt-engineering-guide.mdreferences/crew-file-format.mdwrite_file 或 edit_file 写入文件每次完成编辑后,展示以下格式的摘要:
## 质量评估
| 检查项 | 状态 | 备注 |
|--------|------|------|
| 角色明确性 | ✅ | ... |
| 指令具体性 | ✅ | ... |
| 双语完整性 | ✅ | ... |
| 格式规范性 | ✅ | ... |
| ... | ... | ... |
IDENTITY.md 包含 YAML header(元数据)和正文(角色定义)两部分。
YAML header 字段:
name / name_cn — 员工名称(英文/中文)role / role_cn — 员工角色(英文/中文)description / description_cn — 员工描述(英文/中文)正文部分:使用 <!--zh ... --> 块级注释格式编写中英双语角色定义。
编辑要点:
纯 Markdown 文件,无 YAML header。定义此员工特有的工作方式和规则。
编辑要点:
纯 Markdown 文件,无 YAML header。定义员工的灵魂和行为准则。
编辑要点:
TOOLS.md 包含 YAML header(工具白名单)和可选正文(工具使用偏好)。
YAML header 格式:
---