Files
market/skills/update-agent/SKILL.md
Yige 13c72eba29 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
文件无命中,不声称执行私有词表匹配。
2026-10-07 21:03:40 -07:00

14 KiB
Raw Blame History

license, name, description, version, compatibility, type, risk_level, status, disable-model-invocation, tags, metadata, market
license name description version compatibility type risk_level status disable-model-invocation tags metadata market
MIT update-agent 安全更新现有智能体的配置、人格、原则、技能与记忆,输出可审阅 diff 并在确认后应用与提交。Use when 用户要求修改 Agent 行为、安装/卸载技能、调整配置、回滚变更或修订规则。可选头像生成需配置图像服务,适用供应商条款/额度及独立费用。 3.4.0 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. meta low enabled true
agent
update
meta
author updated_at i18n
desirecore 2026-10-08
default_locale source_locale locales zh-CN en-US
en-US zh-CN
zh-CN
en-US
name short_desc description body source_hash translated_by
更新智能体 安全更新智能体配置、人格、规则与技能,支持 diff 预览与版本回滚 安全更新现有智能体的配置、人格、原则、技能与记忆,输出可审阅 diff 并在确认后应用与提交。Use when 用户要求修改 Agent 行为、安装/卸载技能、调整配置、回滚变更或修订规则。可选头像生成需配置图像服务,适用供应商条款/额度及独立费用。 ./SKILL.zh-CN.md sha256:b20d14b1dc7d4afb human
name short_desc description body source_hash translated_by
Update Agent Safely update Agent config, persona, principles, and skills, with diff preview and version rollback 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. ./SKILL.md sha256:b20d14b1dc7d4afb human
icon category maintainer compatible_agents channel required_client_version
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><defs><linearGradient id="ua-a" x1="2" y1="7" x2="14" y2="21" gradientUnits="userSpaceOnUse"><stop stop-color="#AF52DE"/><stop offset="1" stop-color="#007AFF"/></linearGradient></defs><circle cx="9" cy="7" r="4" fill="url(#ua-a)" fill-opacity="0.15" stroke="url(#ua-a)" stroke-width="1.5"/><path d="M10 15H6a4 4 0 0 0-4 4v2" fill="url(#ua-a)" fill-opacity="0.1" stroke="url(#ua-a)" stroke-width="1.5"/><circle cx="18" cy="15" r="3" fill="#007AFF" fill-opacity="0.12" stroke="#007AFF" stroke-width="1.3"/><path d="m14.3 16.53.92-.38m.01-2.3-.92-.38m1.5-1.24-.38-.92m0 5.54-.38.92m2.3.01.38-.92m.3-4.84-.38-.92m1.24 1.5.92-.38m0 2.3.92.38" stroke="#AF52DE" stroke-width="1.3" stroke-linecap="round"/></svg> productivity
name verified
DesireCore Official true
latest 10.0.179

update-agent skill

L0: One-Sentence Summary

Safely modify an Agent's configuration, persona, rules, and skills through natural-language conversation.

L1: Overview

Meta-skill: recognize the edit intent → generate a reviewable diff → user confirmation → apply (structured fields via ManageAgent, free-form files via Read/Write) → receipt. Use it to adjust communication style, add/change behavior rules, install/uninstall skills, or batch-upgrade config. The agent directory is version-managed by git with a traceable history, so rollback is supported. Its value is what the tool can't give: diff preview confirmation, two-path orchestration, version rollback; structured fields go through ManageAgent's whitelist + schema validation so invalid config never lands.

L2: Detailed Spec

Update Types and the Two Paths

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)
Rename (display name) ManageAgent(update, name=...) agent.json (med)
Change description ManageAgent(update, description=...) agent.json (low)
Default reasoning/retry config ManageAgent(update, config={llm:{...}}) agent.json (med)
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)
Change tool config Read/Write tools/ (high, watch protected paths)

Flow: intent recognition → change analysis → diff generation → user confirmation → apply → receipt.

Stage 1: Intent Recognition

Trigger (any): user says "modify/update/adjust your …", "from now on you should… / remember this rule…", "install/uninstall this skill…", or describes dissatisfaction with current behavior and wants change. Identify the update type and target scope.

Stage 2: Change Analysis

Assess impact (which files/behaviors), dependencies, and conflicts, and set a risk level → matching confirmation strength:

  • Low (non-core, e.g. memory entries): simple confirmation
  • Medium (persona / ordinary principles): show diff, then confirm
  • High (core principles / tool permissions): detailed explanation + diff + confirm
  • Protected (touches a protected path): block, requires owner permission

Stage 3: Diff Generation

Generate a before/after diff for the user (show only the actual change), e.g.:

# persona.md → ## Communication style
- friendly, easygoing, light humor
+ professional, rigorous, measured humor

Stage 4: User Confirmation

Show the diff preview (affected file, risk level, impact note + diff) and ask the user to confirm "Apply / Cancel / Modify"; "Modify" enters fine-tuning then re-confirms. (The tool layer also enforces confirmation for updating other/core agents; see Stage 5.)

Stage 5: Apply Changes

Do not call the HTTP API (unreachable under instance auth), do not operate git directly (the backend auto-commits). Split by target into two paths:

Path A · Structured fields → ManageAgent (mandatory; never Write agent.json / persona.md / principles.md directly)

Fields and constraints: name (1–50 chars), description (≤200), config.llm / config.avatar (shallow-merge deltas), avatarImage, smartRouting, and persona / principles (structured object {L0, L1:{...}, L2} or markdown string). Calls:

ManageAgent(action='update', id='<agent-id>', name='New Name')
ManageAgent(action='update', id='<agent-id>', persona={ L1: { personality: ["professional","rigorous"] } })
ManageAgent(action='update', id='<agent-id>', principles='…full markdown…')
ManageAgent(action='update', id='<agent-id>', config={ llm: { reasoning: "high" } })
ManageAgent(action='update', id='<agent-id>', avatarImage={ source: "dc-media://<mediaId>" })

Merge semantics: structured persona/principles are field-level merges (omitted fields keep their original values — passing only L1.personality won't clear L0/role); a markdown string is a full replacement (whole-file rewrite); config.llm is a shallow-merge delta. The merged result is validated against the whole schema; invalid config never lands.

Key points:

  • Read before write: first ManageAgent(action='get', id) to fetch current values, for diff generation and field-name checking. Structured field names are fixed: persona's L1.role / personality (string array) / communication_style; principles' L1.must_do / must_not (string arrays) / priority; plus top-level L0 / L2.
  • Confirmation and boundaries: updating self skips the extra confirmation; updating another agent triggers user confirmation (on top of this skill's diff confirmation); the core agent (desirecore / core) is refused.
  • config whitelist: config accepts only llm and avatar. config.llm currently exposes reasoning, thinkingBudgets, and maxRetryDelayMs; config.avatar exposes only char and color. mcp_servers, tool_permissions, version, id, and other fields are rejected with the field named.
  • model governance: concrete model, provider, providerId, and Smart/fixed selection are governed only by the human model selector and cannot be changed through ManageAgent. Adjust Smart workload, required capabilities, and reasoning intent through smartRouting.
  • reasoning levels: natural-language requests such as “deepest/highest/max it out” normally map to xhigh; use max only when explicitly requested and supported. auto is an explicit value; use config.llm.reasoning=null when the user wants to restore the global default.
  • avatars: character/color settings use config.avatar; image avatars use avatarImage.source, accepting a current-turn media ID or a PNG/JPEG/WebP file inside the working directory. URLs and base64 are rejected. avatarImage.remove=true removes the image and falls back to the declarative avatar.
  • Partial write failure: the tool reports exactly which fields landed / which failed; retry only the failed fields, don't resend everything.
  • Rename in one call: to change the display name, call ManageAgent(action='update', id, name='Y') directly (writes agent.json and refreshes the list); if the persona doc title should match, append a persona update in the same turn. Never claim a rename happened without actually calling ManageAgent.

Path B · Free-form files → Read/Write (memory/ / skills/ / tools/, root ${DESIRECORE_ROOT}/agents/<agentId>/): Read current values, then Write/Edit, re-read after writing to confirm. Before editing, check _protected-paths.yaml; touching a protected path should be blocked with an owner-permission notice. After writing, the backend file watcher auto-commits — no manual git.

Stage 6: Receipt

Present the change summary in a user-friendly way (no internal paths / technical details), and note the user can say "undo the last change" to roll back anytime.

Version Rollback

Trigger: user says "undo / roll back / restore the previous settings". Flow:

  1. In the Agent directory, git log --oneline -10 for history and git show <commit>:<file> for the target version content; show it to the user to confirm.
  2. After confirmation, write back by type: structured fields (persona/principles, agent.json name/description/llm) → ManageAgent(action='update', ...) (persona/principles as a markdown string, full replacement with the historical content); free-form files (memory/skills) → Write directly.
  3. Show the diff to confirm the rollback.

(git is only for reading history; write-back always goes through the two paths above — never rewrite working-tree files with git commands.)

Background and Error Handling

  • AgentFS structure and protected paths: see _agentfs-background.md and _protected-paths.yaml.
  • On tool errors: non-whitelisted config field / schema validation failure / core-agent refusal → fix per the tool's hint or inform the user; protected path → block with an owner-permission notice; rollback version not found → list available versions and ask the user to reselect.

Avatar customization

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.