feat(skills): 独立维护智能体生命周期操作说明 (#90)

## 中文

### 变更
- 新增 `clone-agent` 内置 Skill,覆盖私有数据复制和团队分发边界
- 将 Smart routing、reasoning、头像和确认流程迁入 action-specific Skills
- 修正 `update-agent` 与当前 ManageAgent 白名单的漂移
- 保持所有市场 Skill 按需加载,并加入 builtin 清单

### 验证
- `uv run --quiet scripts/i18n/test_validate_i18n.py`
- `uv run --quiet scripts/i18n/validate-i18n.py`
- `uv run --quiet scripts/i18n/translate.py --check`
- 公共信息边界检查通过

## English

### Changes
- Add the built-in `clone-agent` Skill for private-data copy and
team-distribution boundaries
- Move Smart routing, reasoning, avatar, and confirmation workflows into
action-specific Skills
- Align `update-agent` with the current ManageAgent configuration
whitelist
- Keep every marketplace Skill on-demand and add the new Skill to the
built-in manifest

### Verification
- `uv run --quiet scripts/i18n/test_validate_i18n.py`
- `uv run --quiet scripts/i18n/validate-i18n.py`
- `uv run --quiet scripts/i18n/translate.py --check`
- Public information boundary review passed
This commit is contained in:
2026-08-25 16:13:09 +08:00
committed by GitHub
parent e58c37d74f
commit 22b128f185
12 changed files with 343 additions and 40 deletions

128
skills/clone-agent/SKILL.md Normal file
View File

@@ -0,0 +1,128 @@
---
name: clone-agent
description: >-
完整克隆现有智能体为独立本地副本并安全处理私有记忆、偏好、关系与团队分发影响。Use when 用户要求复制、克隆或基于现有 Agent 创建独立变体。
version: 1.0.0
type: meta
risk_level: medium
status: enabled
disable-model-invocation: true
tags:
- agent
- clone
- meta
metadata:
author: desirecore
updated_at: '2026-08-25'
i18n:
default_locale: en-US
source_locale: zh-CN
locales:
- zh-CN
- en-US
zh-CN:
name: 克隆智能体
short_desc: 完整复制现有智能体为独立本地副本,可选继承用户私有数据
description: >-
完整克隆现有智能体为独立本地副本并安全处理私有记忆、偏好、关系与团队分发影响。Use when 用户要求复制、克隆或基于现有 Agent 创建独立变体。
body: ./SKILL.zh-CN.md
source_hash: sha256:d97c5736c37e1bcf
translated_by: human
en-US:
name: Clone Agent
short_desc: Clone an existing Agent into an independent local copy with optional private user data
description: >-
Clone an existing Agent into an independent local copy while safely handling private memory, preferences, relationships, and team distribution impact. Use when the user asks to copy, clone, or create an independent variant from an existing Agent.
body: ./SKILL.md
source_hash: sha256:d97c5736c37e1bcf
translated_by: human
market:
icon: >-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><defs><linearGradient id="cl-a" x1="3" y1="3" x2="21" y2="21" gradientUnits="userSpaceOnUse"><stop stop-color="#007AFF"/><stop offset="1" stop-color="#AF52DE"/></linearGradient></defs><rect x="7" y="7" width="13" height="13" rx="3" fill="url(#cl-a)" fill-opacity="0.12" stroke="url(#cl-a)" stroke-width="1.5"/><path d="M16 7V6a3 3 0 0 0-3-3H6a3 3 0 0 0-3 3v7a3 3 0 0 0 3 3h1" stroke="url(#cl-a)" stroke-width="1.5" stroke-linecap="round"/><path d="M11 13h5m-2.5-2.5V16" stroke="#34C759" stroke-width="1.8" stroke-linecap="round"/></svg>
category: productivity
maintainer:
name: DesireCore Official
verified: true
compatible_agents: []
channel: latest
required_client_version: 10.0.96
---
# clone-agent Skill
## L0: One-Sentence Summary
Clone an existing Agent into an independent local copy while explicitly handling private user data and team distribution impact.
## L1: Overview
Use this skill when the user wants to copy an Agent or create an independent variant that keeps the source Agent's persona, principles, skills, and configuration. The clone receives a new ID and UUID. It is not an empty-template create operation and never creates a fork in GitHub, Gitee, or another code hosting account.
## L2: Detailed Specification
Flow: decide whether cloning is appropriate → inspect the source Agent → confirm the clone name and private-data choices → call ManageAgent → report the clone's local and distribution properties.
### 1. Choose Clone or Create
- Use `clone` when the user wants to retain an existing Agent's persona, rules, skills, and configuration in an independent copy or variant.
- Use `create-agent` when the user wants a new Agent in a similar domain but with independently designed behavior.
- Do not recreate an Agent merely to make it “similar”; `create` produces a fresh template and does not inherit the source capability package.
### 2. Confirm the Source
If the user did not provide an exact ID, call `ManageAgent(action='list')`; use `ManageAgent(action='get', id)` when name, status, or description needs verification.
The tool rejects these cases and they must not be bypassed:
- The core `desirecore` Agent cannot be cloned.
- An Agent whose routing was fixed by the human model selector cannot be cloned autonomously; ask the user to use the UI.
- The source Agent does not exist.
### 3. Name and Private User Data
- `name` is optional; the default is “Source Name (Copy)”.
- Private user data is not copied by default. Pass `copyUserData` only when the user explicitly asks the clone to inherit memory, preferences, or relationship state.
- `copyUserData.memory` copies private memory between the user and the source Agent.
- `copyUserData.preferences` copies user preferences for the source Agent.
- `copyUserData.relationship` copies the user-Agent relationship profile.
Before enabling any of these fields, explain the exact scope and obtain confirmation. Do not interpret “full clone” as consent to copy private user data.
### 4. Execute
Basic call:
```json
{
"action": "clone",
"id": "source-agent-id",
"name": "New Copy Name"
}
```
When private-data copying was explicitly confirmed:
```json
{
"action": "clone",
"id": "source-agent-id",
"name": "New Copy Name",
"copyUserData": {
"memory": true,
"preferences": false,
"relationship": false
}
}
```
ManageAgent performs a local-only copy, applies both caller and source Provider ceilings, registers the new Agent, and compensates by removing an incomplete clone if registration fails. Never use a git hosting fork, local HTTP API, or direct AgentFS directory copy instead.
### 5. Receipt and Team Impact
After success, report:
- The new Agent ID and that it is ready for Delegate / ManageTeam.
- Which private-data categories were actually copied; missing source categories are skipped, so trust the tool receipt rather than the request.
- The clone has `local` origin. Adding it to a team makes that team `distributable=false`. If the team must later be published or forked by others, use an Agent published to a remote repository instead.
On failure, follow the tool's exact result. If compensation cleanup also failed, preserve the evidence and clearly request human governance rather than retrying blindly.

View File

@@ -0,0 +1,80 @@
<!-- locale: zh-CN -->
# clone-agent 技能
## L0一句话摘要
把一个现有智能体完整克隆为独立的本地副本,并明确处理私有数据与团队分发影响。
## L1概述
当用户需要“复制一个相同能力的 Agent”“基于现有 Agent 做独立变体”时使用本技能。克隆会保留源 Agent 的 persona、principles、技能与配置但生成新的 ID 和 UUID它不是重新创建空模板也不会在 GitHub、Gitee 等代码托管平台创建 fork。
## L2详细规范
流程:确认 clone 是否合适 → 检查源 Agent → 确认副本名称与私有数据选项 → 调用 ManageAgent → 报告副本性质与后续影响。
### 1. 判断 clone 还是 create
- 用户要保留现有 Agent 的人格、规则、技能和配置,只做独立副本或后续变体:用 `clone`
- 用户只想创建同领域但设定不同的新 Agent加载 `create-agent`,用 `create`
- 不要为了“像某个 Agent”而重新 createcreate 只生成新模板,不会继承源 Agent 的能力包。
### 2. 确认源 Agent
用户未给准确 ID 时先调用 `ManageAgent(action='list')`;必要时用 `ManageAgent(action='get', id)` 核对名称、状态和描述。
以下情况工具会拒绝,直接解释原因,不要绕过:
- 核心智能体 `desirecore` 不可克隆。
- 由人类固定为 fixed 模型路由的 Agent 不允许模型自主克隆,应请用户使用界面完成。
- 源 Agent 不存在。
### 3. 副本名称与私有数据
- `name` 可选;不传时默认为“源名称 (副本)”。
- 默认不复制用户私有数据。只有用户明确要求副本继承记忆、偏好或关系时才传 `copyUserData`
- `copyUserData.memory`:复制用户与源 Agent 的私有记忆。
- `copyUserData.preferences`:复制用户对源 Agent 的偏好配置。
- `copyUserData.relationship`:复制用户与源 Agent 的关系档案。
启用任一私有数据复制前,向用户说明复制范围并确认;不要根据“完整克隆”自行推断用户同意复制私有数据。
### 4. 执行克隆
基础调用:
```json
{
"action": "clone",
"id": "source-agent-id",
"name": "新副本名称"
}
```
明确复制私有数据时:
```json
{
"action": "clone",
"id": "source-agent-id",
"name": "新副本名称",
"copyUserData": {
"memory": true,
"preferences": false,
"relationship": false
}
}
```
ManageAgent 会执行纯本地复制、应用调用方与源 Agent 的 Provider ceiling、注册新 Agent并在注册失败时清理不完整副本。不要自行调用 git fork、HTTP API 或直接复制 AgentFS 目录。
### 5. 回执与团队影响
成功后向用户说明:
- 新 Agent 的 ID以及它已经可以用于 Delegate / ManageTeam。
- 实际复制了哪些私有数据;源没有的数据会被跳过,以工具回执为准。
- 副本属于 `local` 来源。把它加入团队会使团队 `distributable=false`;如果团队未来需要发布或供他人 fork应改用已发布到远程仓库的 Agent。
克隆失败时只按工具返回的原因处理。若工具报告补偿清理失败,保留现场并明确提示需要人工治理,不要再次盲目克隆。