feat: 创建与更新技能支持独立长期指令 (#211)

创建与更新技能增加可选 instructions 字符串:普通 Markdown
全文、省略保留、字符串整体替换、空字符串清空。内容归属明确为人格、原则、长期指令与技能方法;既有 AgentFS
直接编辑遵循实际权限与审批。create-agent 2.8.0 / update-agent 3.4.0 的最低客户端为
10.0.179,双语正文与 sidecar 同步。

Add optional plain-Markdown instructions to Agent creation and update
guidance, including preserve/replace/clear semantics and clear content
ownership. Existing direct AgentFS editing retains its permission and
approval rules. Both localized bodies and catalog sidecars require
DesireCore 10.0.179.

验证 / Validation:目录与 i18n 校验 0 errors;严格 sidecar 全覆盖检查 0
errors(既有证据警告保留);双语由人工同步并按真实 source body 计算 freshness
hash。依据用户明确授权,本次以全树凭据形状扫描、Git/PR 元数据扫描与客户中立性人工审阅代替缺失的私有敏感词表检查;凭据形状扫描 740
文件无命中,不声称执行私有词表匹配。
This commit is contained in:
2026-10-07 21:03:40 -07:00
committed by GitHub
parent 8f6aa67c96
commit 13c72eba29
6 changed files with 54 additions and 32 deletions

View File

@@ -4,7 +4,7 @@ name: update-agent
description: >-
安全更新现有智能体的配置、人格、原则、技能与记忆,输出可审阅 diff 并在确认后应用与提交。Use when 用户要求修改 Agent
行为、安装/卸载技能、调整配置、回滚变更或修订规则。可选头像生成需配置图像服务,适用供应商条款/额度及独立费用。
version: 3.3.0
version: 3.4.0
compatibility: "DesireCore ManageAgent; optional avatar generation requires a configured image provider under its own terms and quota, with separate charges; unavailable generation retains the existing avatar."
type: meta
risk_level: low
@@ -16,7 +16,7 @@ tags:
- meta
metadata:
author: desirecore
updated_at: '2026-10-03'
updated_at: '2026-10-08'
i18n:
default_locale: en-US
source_locale: zh-CN
@@ -29,7 +29,7 @@ metadata:
description: >-
安全更新现有智能体的配置、人格、原则、技能与记忆,输出可审阅 diff 并在确认后应用与提交。Use when 用户要求修改 Agent 行为、安装/卸载技能、调整配置、回滚变更或修订规则。可选头像生成需配置图像服务,适用供应商条款/额度及独立费用。
body: ./SKILL.zh-CN.md
source_hash: sha256:b2c95e40c280b162
source_hash: sha256:b20d14b1dc7d4afb
translated_by: human
en-US:
name: Update Agent
@@ -37,7 +37,7 @@ metadata:
description: >-
Safely update an existing Agent's config, persona, principles, skills, and memory, producing reviewable diffs that are applied and committed only after confirmation. Use when the user asks to modify Agent behavior, install/uninstall skills, adjust config, roll back changes, or revise rules. Optional avatar generation requires a configured image service under provider terms/quota and separate charges.
body: ./SKILL.md
source_hash: sha256:b2c95e40c280b162
source_hash: sha256:b20d14b1dc7d4afb
translated_by: human
market:
icon: >-
@@ -59,7 +59,7 @@ market:
verified: true
compatible_agents: []
channel: latest
required_client_version: 10.0.108
required_client_version: 10.0.179
---
# update-agent skill
@@ -76,7 +76,7 @@ Meta-skill: recognize the edit intent → generate a reviewable diff → user co
### Update Types and the Two Paths
Structured fields always go through `ManageAgent(action='update')` (whitelist + validation + merge semantics); free-form files (memory/skills/tools) are edited directly with Read/Write:
ManageAgent provides whitelist validation, structured field merging and receipts. Existing AgentFS files also support Read/Write/Edit under the same permissions and approval policy; direct editing is not a bypass. Free-form content remains in its owning file:
| User intent | Means | Target (risk) |
| --- | --- | --- |
@@ -86,6 +86,7 @@ Structured fields always go through `ManageAgent(action='update')` (whitelist +
| Declarative avatar | `ManageAgent(update, config={avatar:{...}})` | agent.json (low) |
| Image avatar | `ManageAgent(update, avatarImage={...})` | avatar (med) |
| Personality/style | `ManageAgent(update, persona=... or markdown)` | persona.md (med) |
| Stable duties/delivery | `ManageAgent(update, instructions="full Markdown")` or Read/Write/Edit | instructions.md (existing approval policy) |
| Behavior rules | `ManageAgent(update, principles=... or markdown)` | principles.md (high) |
| Install/uninstall skill | Read/Write | `skills/` (low/med) |
| Add memory | Read/Write | `memory/` (low) |
@@ -176,3 +177,9 @@ Trigger: user says "undo / roll back / restore the previous settings". Flow:
Check readiness through the current governed tool catalog: use `ManageCompute(action="list")` for enabled/credential status and `InspectModels(action="list", serviceType="image_gen")` for an eligible image model. Neither listing proves upstream quota or call success; follow provider terms/quota and separate charges. Do not read keys or use local HTTP. If these tools are absent, follow the configuring-compute skill's governed GUI observation. If generation is known unavailable, skip regeneration, preserve the current avatar and report the limitation. Unknown readiness is not success; inspect the background task result and do not fabricate completion.
Users may freely change the avatar's appearance, style, background, upload an existing image, or remove it with `avatarImage.remove:true`. On clients exposing `avatarGeneration`, pass a new generation request to `ManageAgent(action="update", avatarGeneration={prompt:"user requirements"})`; `transparentBackground:false` preserves a requested background and `enabled:false` cancels pending generation. Direct image replacement/removal invalidates older asynchronous results. The default automatic style is transparent and photorealistic; explicit user choices take precedence. `avatarImage.requireTransparency:true` opts into strict transparency checks; do not impose that check on a user who requested a background. Inspect `ManageAgent(get)` for task failures, and do not automatically retry paid requests. Older clients must use only fields in their actual tool schema.
## Standing instructions and content ownership
Persona owns identity and expression; principles own boundaries and tradeoffs; instructions.md owns stable duties, work strategies and delivery requirements; skills own detailed methods. instructions accepts only a full Markdown string: omit to preserve, pass a string to replace, or an empty string to clear. Read the original before editing and do not copy the same requirement into several files. Read/Write/Edit are also supported for existing files with the same permission, approval, optimistic-lock and audit rules. Saved instructions are read for new input, explicit continuation or restoration; an already accepted tool loop keeps its snapshot. Previously authorized work does not require another conversational confirmation; actual tool approval policy still applies.
Keep role/expression in persona, boundaries in principles, stable duties in instructions, and methods in skills. Never place private user or team data in distributable Agent files.

View File

@@ -14,7 +14,7 @@
### 更新类型与两条路径
结构化字段一律经 `ManageAgent(action='update')`(白名单 + 校验 + 合并语义);记忆/技能/工具等自由格式文件用 Read/Write 直接编辑:
ManageAgent 提供白名单校验、结构化字段合并和回执;既有 AgentFS 文件也支持 Read/Write/Edit,仍遵循相同权限与审批策略,直接编辑不是绕过安全边界。自由格式内容按归属维护:
| 用户意图 | 手段 | 目标(风险) |
| --- | --- | --- |
@@ -24,6 +24,7 @@
| 声明头像 | `ManageAgent(update, config={avatar:{...}})` | agent.json(低) |
| 图片头像 | `ManageAgent(update, avatarImage={...})` | avatar(中) |
| 性格/风格 | `ManageAgent(update, persona=... 或 markdown)` | persona.md(中) |
| 稳定职责/交付要求 | `ManageAgent(update, instructions="完整 Markdown")` 或 Read/Write/Edit | instructions.md(沿既有审批策略) |
| 行为规则 | `ManageAgent(update, principles=... 或 markdown)` | principles.md(高) |
| 安装/卸载技能 | Read/Write | `skills/`(低/中) |
| 添加记忆 | Read/Write | `memory/`(低) |
@@ -62,7 +63,7 @@
不要调 HTTP API(实例鉴权后不可达),不要直接操作 git(后端自动提交)。按目标分两路:
**路径 A · 结构化字段 → ManageAgent(强制;禁止直接 Write `agent.json` / `persona.md` / `principles.md`)**
**路径 A · 经 ManageAgent 便利接口校验并更新**
字段与约束:`name`(1–50 字符)、`description`(≤200)、`config.llm` / `config.avatar`(增量浅合并)、`avatarImage`、`smartRouting`、`persona` / `principles`(结构化对象 `{L0, L1:{...}, L2}` 或 markdown 字符串)。调用:
@@ -114,3 +115,9 @@ ManageAgent(action='update', id='<agent-id>', avatarImage={ source: "dc-media://
通过当前受治理工具目录检查就绪状态:用 `ManageCompute(action="list")` 查看启用/凭据状态,用 `InspectModels(action="list", serviceType="image_gen")` 查看可用图像模型。列表不证明上游额度或调用成功,遵守供应商条款/额度及独立费用;不读取密钥,不用本机 HTTP 旁路。缺少这些工具时,遵循 configuring-compute 技能的受治理 GUI 观察流程。已知生成不可用时,跳过重新生成,保留当前头像并报告限制。就绪状态未知不代表成功,检查后台任务结果,不伪造完成。
用户可自由改变头像外貌、风格、背景、上传已有图片或通过 `avatarImage.remove:true` 移除。提供 `avatarGeneration` 的新客户端可用 `ManageAgent(action="update", avatarGeneration={prompt:"用户要求"})` 重新生成;明确要求背景用 `transparentBackground:false`,`enabled:false` 取消未完成生成。后续设图/移除优先,旧异步结果不会覆盖用户新选择。透明真人风格只作为默认;明确用户要求优先。`avatarImage.requireTransparency:true` 可显式启用透明度检查,不对需要背景的用户强制该检查。用 `ManageAgent(get)` 查看失败,不自动重复付费请求;旧客户端只用实际 Schema 声明的字段。
## 长期指令与内容归属
人格负责身份与表达,原则负责边界与取舍,instructions.md 负责稳定职责、工作策略与交付要求,技能负责详细方法。instructions 只接受完整 Markdown 字符串:省略保留,字符串整份替换,空字符串清空。修改前先读原文,同一要求不复制到多份文件。既有文件也支持 Read/Write/Edit,仍遵循权限、审批、乐观锁和审计。保存后在新输入、显式继续或恢复时读取,同一已接纳工具循环保留快照。用户已明确授权的工作不重复要求对话确认,实际工具审批策略仍适用。
角色与表达归人格,边界归原则,稳定职责归长期指令,方法归技能。用户或团队私有数据不得写入可分发 Agent 本体。

View File

@@ -28,13 +28,13 @@
},
"release": {
"state": "known",
"version": "3.3.0",
"version": "3.4.0",
"versionScheme": "semver"
},
"timestamps": {
"catalogUpdatedAt": {
"state": "known",
"value": "2026-10-03",
"value": "2026-10-08",
"precision": "day"
},
"releasePublishedAt": {
@@ -65,7 +65,7 @@
"platforms": {
"state": "unknown"
},
"requiredClientVersion": "10.0.108"
"requiredClientVersion": "10.0.179"
},
"spec": {
"kind": "skill",