How To
管理 Profile
创建和配置 Agent Profile,定义 Agent 的工作风格和能力范围
概述
Profile 定义了一个 Agent 的”工作人格”。它包含系统提示、关联的运行时、能力范围(Skills 和 MCP Server)和默认配置。
通过创建多个 Profile,你可以为不同的场景定义不同的 Agent 角色,比如”代码审查员”、“DevOps 工程师”等。
文件位置
Profile 文件存放在:
~/.sink/profiles/
每个 Profile 是一个独立的 Markdown 文件:
~/.sink/profiles/
├── code-reviewer.md
├── devops-engineer.md
└── research-assistant.md
创建 Profile
文件格式
Profile 由 YAML frontmatter + Markdown 正文组成:
---
name: 'code-reviewer'
description: 'Code quality analysis and review'
runtime: claude-code
skills:
- web-search
- code-analysis
mcpServers:
- filesystem
- api-client
configDefaults:
model: claude-opus-4
mode: code
temperature: '0.7'
metadata:
disabled: false
---
You are an experienced code reviewer with deep expertise in software quality and best practices...
Frontmatter 字段
必填字段
| 字段 | 类型 | 说明 |
|---|---|---|
name | string | Profile 的显示名称 |
description | string | Profile 的描述 |
runtime | string | 使用的 Runtime ID(如 claude-code) |
可选字段
| 字段 | 类型 | 说明 |
|---|---|---|
skills | array / object | 该 Profile 可用的 Skill 列表 |
mcpServers | array / object | 该 Profile 可用的 MCP Server 列表 |
configDefaults | object | Agent 会话的默认配置 |
executionModes | array / object | 允许的执行模式(如 individual 或 team) |
subtaskProfiles | array / object | 子任务可用的 Profile 限制 |
overrides | object | 特定 MCP Server 或命令的额外参数 |
metadata.disabled | boolean | 是否禁用该 Profile |
Markdown 正文
Frontmatter 之后的 Markdown 正文是该 Profile 的 系统提示(System Prompt)。Agent 会按照这个提示来理解自己的角色和工作方式。
一个好的系统提示应该包括:
- Agent 的角色和背景
- 工作原则和约束条件
- 思考方式和输出格式
- 安全和伦理指南
示例:
You are an experienced code reviewer with deep expertise in software quality and best practices.
Your responsibilities:
1. Identify bugs, code smells, and maintainability issues
2. Assess severity and impact of findings
3. Provide actionable improvement suggestions
Work principles:
- Always prioritize correctness and readability
- Document all findings with clear explanations
- Report critical issues with highest priority
- Suggest concrete fixes, not just problems
在 Web UI 中使用 Profile
创建任务时选择 Profile
- 打开 Sink Web UI
- 点击”新建任务”按钮
- 在”Profile”下拉菜单中选择一个 Profile
- 输入任务标题和描述
- (可选)如果该 Profile 的
configDefaults中有带candidates的字段,你可以在此处覆盖默认值 - 点击”创建”
查看 Profile 详情
在 Web UI 的”Profile”菜单中:
- 选择一个 Profile
- 可以查看:
- Frontmatter 信息(名称、描述、Runtime 等)
- 可用的 Skills 和 MCP Servers
- 系统提示的完整正文
常见场景
场景 1:创建一个代码审查 Profile
---
name: 'code-reviewer'
description: '代码质量分析和最佳实践审查'
runtime: claude-code
skills:
- code-analysis
- test-runner
- dependency-check
mcpServers:
- filesystem
configDefaults:
model: claude-opus-4
mode: code
metadata:
disabled: false
---
你是一位专注于代码质量的专家代码审查员。
你的任务:
1. 分析源代码的正确性和可维护性问题
2. 检查依赖项是否存在过时或有问题的版本
3. 审查配置文件的错误配置
4. 生成详细的审查报告,包含严重程度评级
标准:
- 遵循特定语言的最佳实践和风格指南
- 检查常见的反模式
- 提供具体的修复建议和代码示例
场景 2:创建一个 DevOps 工程师 Profile
---
name: 'devops-engineer'
description: '基础设施和部署工作流自动化'
runtime: claude-code
skills:
- docker-ops
- ci-cd
- infra-check
mcpServers:
- filesystem
- shell-execution
configDefaults:
model: claude-opus-4
temperature: '0.3'
executionModes:
- individual
metadata:
disabled: false
---
你是一位经验丰富的 DevOps 工程师。
你的工作方式:
1. 检查:审视基础设施配置、CI/CD 流水线和部署清单
2. 分析:识别错误配置、缺失的安全措施和优化机会
3. 验证:通过可复现的检查确认发现
4. 报告:记录问题和修复步骤
安全约束:
- 仅在明确授权时修改系统
- 未经明确批准不得删除资源
- 记录所有变更以便审计
场景 3:为 workspace 覆盖 Profile
在某个 workspace 中,创建
<workspace>/.sink/profiles/code-reviewer.md:
---
name: 'code-reviewer-internal'
description: '内部代码审查,具有更严格的控制'
runtime: claude-code
skills:
- code-analysis
- internal-tools
mcpServers:
- filesystem
- internal-api
configDefaults:
model: claude-opus-4
temperature: '0.1'
metadata:
disabled: false
---
[Internal system prompt...]
当在这个 workspace 中创建任务时,会使用这个本地 Profile 而非 user 层的全局 Profile。
最佳实践
- 命名清晰:Profile 名称要清楚表达 Agent 的角色(如”代码审查员”而非”助手1”)
- 描述具体:在
description字段中说明这个 Profile 适用于什么场景 - 管理 Skills:只开放当前 Profile 实际需要的 Skills,避免不必要的能力扩散
- 操作边界:在系统提示中明确声明操作边界和伦理约束
- 文档完整:在 Markdown 正文中详细说明 Agent 的思考方式和输出格式,帮助 Agent 理解期望
- 配置合理:根据场景选择合适的 model 和参数(如 temperature 影响创意程度)
- 测试验证:创建新 Profile 后,用实际任务测试是否达到预期效果
查看和编辑 Profile
通过文本编辑器
直接编辑 ~/.sink/profiles/*.md 文件。改动会在下一次任务创建时生效。
通过 Web UI
在 Web UI 的”Profile”菜单中可以查看 Profile 详情。编辑需要直接修改文件。
禁用 Profile
临时禁用
在 Profile 的 frontmatter 中设置:
metadata:
disabled: true
该 Profile 将被隐藏,不出现在任务创建的下拉菜单中。
删除 Profile
直接删除对应的文件:
rm ~/.sink/profiles/profile-id.md
后续步骤
- 了解 Skill:为 Profile 添加更多能力
- 配置 Runtime:设置 Agent 的启动方式
- 配置 MCP Server:让 Profile 访问外部工具
- 创建任务:使用 Profile 创建实际任务