Commit Graph

26 Commits

Author SHA1 Message Date
d52e61e041 perf(skills): 智能体 CRUD 四技能提示词改写压缩(功能不变,~65%) (#56)
## 摘要 / Summary

### 中文

四个智能体管理技能(create/update/delete/discover-agent)改用 `ManageAgent`
内置工具后,正文与工具契约大量重叠——ManageAgent 的 description + params 已**常驻每次 query
的上下文**,声明了五个 action 语义、参数约束、权限硬边界、错误语义、字段级合并、确认行为、list/get
返回格式;技能正文里再复述即冗余。本次对四技能做**强改写·语境融合**压缩:

- 与工具契约重复的说明(参数/权限/错误码/确认行为/成功返回话术)**改写融入对应流程步骤**(如错误处理表 → 阶段一句、确认行为 →
阶段一句),不再照抄、不再表格化。
- 装饰性 ASCII 流程框图 → 一行文字流程;update 内部两张重复更新表 → 合并;YAML
元数据块(diff_metadata/context_handoff)融入流程;冗长示例(create 三份 JSON、update 附录 4
示例、discover ASCII 卡片)就地精简为代表示意。
- **不外置 references、不净删除任何内容**:所有决策/领域/交互意图完整保留——领域匹配表、persona/principles
的 L0/L1/L2 生成规范、update 两路径分流与字段级合并 vs 整体替换、防幻觉改名、回滚流程、discover
需求维度与无匹配衔接 create 等核心一字未丢。

zh 正文合计 **26542 → 9196 字符(降 ~65%)**;中英双份同步改写、逐段对齐,重算 i18n
source_hash(validate-i18n 通过)。版本 create 2.5.1 / update 3.1.2 / delete
2.5.1 / discover 2.6.1,manifest 1.2.12。

### English

After the four agent-management skills adopted the `ManageAgent` builtin
tool, their bodies heavily duplicated the tool contract — ManageAgent's
description + params are **resident in every query's context** (action
semantics, param constraints, permission hard-boundaries, error
semantics, field-level merge, confirmation behavior, list/get return
formats). This PR compresses all four via **aggressive rewrite +
contextual fusion**: contract-duplicating text is rewritten into the
relevant flow steps (not copied, not tabularized), decorative ASCII flow
boxes become one-line text, update's two duplicate tables are merged,
YAML metadata blocks are folded in, and long examples are trimmed in
place to representative sketches. **No references externalization, no
net deletion** — every decision/domain/interaction intent is preserved
(domain matching table, persona/principles L0/L1/L2 generation spec,
update's two-path split and field-level-merge-vs-full-replace,
anti-hallucination rename, rollback flow, discover's need dimensions and
create hand-off). zh bodies total **26542 → 9196 chars (~65% down)**;
both locales rewritten and aligned, i18n source hashes recomputed
(validate-i18n passes). Versions bumped, manifest 1.2.12.
2026-07-19 15:16:43 +08:00
b2ef6a1f19 fix(skills): update-agent 示例字段名修正 + get 返回示例对齐真实输出 (#53)
## 摘要 / Summary

### 中文

market#52 的修正:update-agent
附录示例使用了错误的字段名(`communicationStyle`/`must`),照示例调用会被 ManageAgent 的 Ajv
校验(additionalProperties: false)直接拒绝;`personality` 示例应为字符串数组。同时把 `get`
的返回示例对齐真实输出格式(`## persona.md` / `## principles.md` 段落含分层 markdown 原文,对应
desirecore#1230),并在附录固定列出结构化字段名清单。update-agent 3.1.1,manifest 1.2.11。

### English

Correction to market#52: the update-agent appendix examples used wrong
field names (`communicationStyle`/`must`) that ManageAgent's Ajv
validation (additionalProperties: false) would reject outright;
`personality` must be a string array. The `get` response example is
aligned with the actual output format (`## persona.md` / `##
principles.md` sections, per desirecore#1230), and the appendix now
lists the fixed structured field names. update-agent 3.1.1, manifest
1.2.11.
2026-07-18 23:35:50 +08:00
1c00b8e6c8 feat(skills): 智能体 CRUD 四技能改经 ManageAgent 内置工具(实例鉴权适配) (#52)
## 摘要 / Summary

### 中文

主仓库 desirecore#1225 新增 `ManageAgent` 内置工具后,智能体 CRUD 四技能从"调本机 HTTP
API/curl"改写为调用该工具(实例鉴权上线后 Agent 直接访问本机 API 会 401):

- **create-agent 2.5.0**:`POST /api/agents` →
`ManageAgent(action='create', ...)`;补充保留标识(core/desirecore)拒创、config 仅允许
llm 白名单的错误处理
- **delete-agent 2.5.0**:`DELETE /api/agents/:id` →
`action='delete'`(工具层强制用户确认);错误处理改为工具拒绝语义(核心智能体/自删/活跃状态);补团队级联说明
- **discover-agent 2.6.0**:`GET /api/agents(/:id)` →
`action='list'/'get'`
- **update-agent
3.1.0**:结构化字段(name/description/llm/persona/principles)改经
`action='update'`(白名单+schema 校验+字段级合并语义),自由格式文件仍 Read/Write

四技能声明 `market.required_client_version:
10.0.90`,老客户端在市场端被门控禁装。中英双语正文同步改写,i18n source_hash 已重算(validate-i18n.py
通过);manifest 1.2.10。

### English

After desirecore#1225 shipped the `ManageAgent` builtin tool, the four
agent-CRUD skills are rewritten from local-HTTP-API/curl instructions to
tool calls (direct local API access now returns 401 under instance
auth). Each skill declares `market.required_client_version: 10.0.90` so
older clients are gated from installing. Both locales are rewritten in
sync and i18n source hashes recomputed (validate-i18n.py passes);
manifest bumped to 1.2.10.

主仓库回填:合并后将在 desirecore 主仓库执行 `npm run sync-market` 生成新的
defaults/market.zip 并单独提 PR。
2026-07-18 23:05:18 +08:00
Zxy-y
ac6e5a850c chore(update-agent): version 3.0.4 → 3.0.5 补发改名指引更新 (#44)
## 背景 / Context

上一个 PR(#43)修改了 update-agent 技能正文(改名改用 Edit 同步 agent.json +
persona.md),但**未升 version**(仍 3.0.4)。

技能同步的更新判定**纯按
semver**(`lib/agent-service/sync/builtin-skill.ts`:`compareSemver(local,
source)`,版本一致即跳过、不比内容),因此已安装 3.0.4 的存量用户会因'版本一致→跳过'而**收不到**上个 PR 的正文更新。

The previous PR (#43) changed the update-agent skill body but did not
bump the version. Skill sync decides updates purely by semver (same
version → skip, content ignored), so existing 3.0.4 installs would never
receive the content update. Bumping to 3.0.5 forces propagation.

## 变更 / Change

- `skills/update-agent/SKILL.md`: `version: 3.0.4 → 3.0.5`(仅此一行,不动正文,不影响
source_hash / i18n 校验)

Co-authored-by: 张馨元 <zhangxy@iynss.com>
2026-07-08 14:49:11 +08:00
Zxy-y
a59f223e56 docs(update-agent): 改名改用 Edit 同步 agent.json 与 persona.md 标题 (#43)
## 变更 / Changes

update-agent 技能:纯改名场景改为用 **Edit 工具同时更新两个文件**——`agent.json` 的 `name` 字段 与
`persona.md` 的首行标题(`# 名称`),避免两者脱节;并强调不实际编辑文件不得声称已改名。

The update-agent skill now instructs: for a pure display-name change,
use the **Edit tool to update both files** — the `name` field in
`agent.json` and the first-line title heading (`# Name`) in `persona.md`
— so the display name and persona title never fall out of sync. Also
emphasizes never claiming a rename is done without actually editing the
files.

## 背景 / Context

此前改名只改了 `agent.json` 的 name,`persona.md`
标题残留旧名(显示名与人格文档脱节);且模型有时只口头声称完成而不真正落盘。本改动通过技能引导修正这两点。

Previously renaming only touched `agent.json`'s name while
`persona.md`'s title kept the old name (desync), and the model would
sometimes claim completion without actually writing. This skill guidance
fixes both.

## 改动范围 / Scope

- `skills/update-agent/SKILL.md`(+3)
- `skills/update-agent/SKILL.zh-CN.md`(+3)
- 纯文档/技能引导改动,version 保持 3.0.4 不变

Co-authored-by: 张馨元 <zhangxy@iynss.com>
2026-07-07 22:30:26 +08:00
a4718379d9 强化市场校验与索引元数据
合并市场索引、分类、i18n 校验、skill-creator 工具和已修改 skill 版本号更新。
2026-07-07 21:14:31 +08:00
xyx
a582f0f4f9 fix: 为 #16 路径替换涉及的技能补 per-skill version (#22)
## 背景 / Background

#16 (4f7037a) 将 16 个 SKILL.md 的 `~/.desirecore` 路径批量替换为
`${DESIRECORE_ROOT}`,但只升了 `manifest.json`,**未升任何 per-skill version**。

客户端按 SKILL.md frontmatter 的 per-skill `version` 做 semver 同步:version
不变即判定「无更新」而永久跳过,导致已升级用户的全局技能正文停留在替换前的旧内容(与线上不同步)。

#16 (4f7037a) bulk-replaced `~/.desirecore` with `${DESIRECORE_ROOT}` in
16 SKILL.md files but only bumped `manifest.json`, leaving every
per-skill `version` untouched. Clients sync by per-skill semver, so an
unchanged version is treated as "no update" and skipped forever —
upgraded users' global skills stay frozen on pre-replacement content.

## 改动 / Changes

- 对 #16 触及且至今仍未升号的 **14 个在册技能** 各 patch +1
- `manifest.json` 1.2.2 → 1.2.3(沿用 #16「内容改动同步升 manifest」的约定)
- 退役技能 `minimax-image-gen` / `minimax-tts`(不在 builtin-skills.json,不下发)跳过
- diff 为纯 version 行,未触动正文

Bumps the 14 in-manifest skills changed by #16 that were never
version-bumped; manifest 1.2.2 → 1.2.3; retired skills skipped.
Version-line-only diff.
2026-06-03 17:46:13 +08:00
xyx
4f7037a6b6 fix: replace hardcoded ~/.desirecore paths with ${DESIRECORE_ROOT} variable (#16)
## Summary

- 将所有技能文件中的硬编码 `~/.desirecore/` 和 `$HOME/.desirecore/` 路径替换为
`${DESIRECORE_ROOT}/` 变量
- 递增 manifest.json version 至 1.2.1

## Why

dev 模式下 `DESIRECORE_HOME=~/.desirecore-dev`,硬编码路径导致技能读取错误的端口文件和目录。主仓库的
`variable-substitutor.ts` 会在运行时将 `${DESIRECORE_ROOT}` 替换为实际根目录。

## Test plan

- [ ] `npm run dev` 启动后触发任意技能,确认端口路径解析为
`~/.desirecore-dev/agent-service.port`
- [ ] prod 模式确认路径为 `~/.desirecore/agent-service.port`

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-29 15:36:19 +08:00
1f7c8b9673 feat: skills i18n 改造(schemaVersion 1.1,零向后兼容) (#1)
* feat: skills i18n 改造 — schemaVersion 1.1,零向后兼容

把 21 个 skills + 1 个 agent + manifest/categories 全量迁移到 schemaVersion 1.1
的 i18n 结构,配套 CI AI 翻译流水线(GitHub Models)与本地工具链。

## 关键变更

### 数据结构(破坏性,schemaVersion 1.0 → 1.1)
- SKILL.md: 顶层 name 改为 ASCII slug(== 目录名,符合 agentskills.io 规范);
  中文显示名/short_desc/description 全部迁入 metadata.i18n.<locale>
- agents/<id>/agent.json: shortDesc/fullDesc/tags/persona.{role,traits} 迁入
  i18n.<locale>;changelog[].changes 改为 { <locale>: string[] } 对象
- categories.json: 每个分类的 label/description 迁入 i18n.<locale>,顶层只剩
  color/icon
- manifest.json: 加 supportedLocales / defaultLocale;顶层 description 迁入
  i18n.<locale>

### Body 文件结构
- 根 SKILL.md = frontmatter + default_locale (en-US) body
- SKILL.<locale>.md = 各 locale 的 markdown body(首行 <!-- locale: xx --> 自校验)

### 工具链(scripts/i18n/)
- glossary.json: zh→en 术语表 + do_not_translate 白名单
- schema/skill-frontmatter.schema.json: i18n frontmatter JSON Schema
- validate-i18n.py: 8 条校验规则(name 合规 / locale 完整性 / hash 一致性等)
- translate.py: GitHub Models / Anthropic 双 backend,sha256 增量翻译
- migrate.py: 一次性迁移脚本(旧格式 → i18n 结构)

### CI(.github/workflows/)
- i18n-validate.yml: PR 触发跑 validate + translate --check
- i18n-translate.yml: PR 触发用 GitHub Models(默认 openai/gpt-5-mini)翻译缺失
  locale,自动追加 commit;可切到 ANTHROPIC_API_KEY 走 Claude

### 文档
- docs/I18N.md: 作者贡献指南(schema 说明 / 提交流程 / 常见问题)
- README.md: 加多语言段落

## 验证

- uv run scripts/i18n/validate-i18n.py: OK,49 文件 0 错误
- uv run scripts/i18n/translate.py --check: 0 stale locale
- 21 skills 标题数 zh-CN == en-US 严格对齐(最大 66=66)
- skills-ref 规范校验:全部通过(顶层 name ASCII slug + description 单字段)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(i18n): 修复 PR #1 review 反馈的 6 项问题

- schema: translated_by 正则放宽为 ^(human|ai:[A-Za-z0-9._:/-]+)$,接受
  'ai:github:openai/gpt-5-mini' 这类 backend:model 形式(CI 翻译输出格式)
- README + docs/I18N.md: 修正"CI 用 Claude API"误导描述,正确说明默认是
  GitHub Models(openai/gpt-5-mini)+ GITHUB_TOKEN,可选切到 Anthropic
- skills/minimax-tts/SKILL.md & SKILL.zh-CN.md: 删除多余的 ``` 闭合,避免
  Markdown 后续渲染错乱
- skills/docx/SKILL.md: 翻译时丢失的 • Unicode escape 示例已恢复,
  与 zh-CN 版本对齐

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 00:26:33 +08:00
3bed41d7a1 fix: 全局技能 disable-model-invocation 改为 true,按需加载减少 system prompt 体积
13 个技能从 false(自动注入 ~160KB)改为 true(按需加载),
大幅减少每次 LLM 请求的 system prompt token 占用。

涉及技能(版本号 patch +1):
- create-agent 2.4.1→2.4.2
- delete-agent 2.4.1→2.4.2
- discover-agent 2.5.1→2.5.2
- docx 1.0.1→1.0.2
- frontend-design 1.0.1→1.0.2
- mail-operations 1.0.1→1.0.2
- manage-skills 1.0.1→1.0.2
- pdf 1.0.1→1.0.2
- pptx 1.0.1→1.0.2
- s3-storage-operations 2.0.1→2.0.2
- skill-creator 1.0.0→1.0.1
- update-agent 3.0.1→3.0.2
- xlsx 1.0.1→1.0.2
2026-04-13 16:28:52 +08:00
aa6b1389fe fix: 为 9 个 skill 补全 L0/L1/L2 分层结构,版本号 +1
按照 desirecore-format.md 规范,为以下 skill 添加标准分层结构:
- docx (1.0.0→1.0.1), pdf (1.0.0→1.0.1), pptx (1.0.0→1.0.1), xlsx (1.0.0→1.0.1)
- frontend-design (1.0.0→1.0.1), mail-operations (1.0.0→1.0.1)
- environment-setup (1.1.0→1.1.1), web-access (1.1.0→1.1.1)
- manage-teams (1.2.0→1.2.1)

每个文件增加 L0(一句话摘要)、L1(概述与使用场景)、L2(详细规范)三层,
原有技术内容保持不变,metadata.updated_at 更新为 2026-04-13。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:33:56 +08:00
36f0f5d384 refactor: update-agent v3.0.0 — 从 HTTP API 迁移到 AgentFS 直接文件操作
- 变更应用改为直接读写 ~/.desirecore/agents/<agentId>/ 下的文件
- 移除所有 HTTP API 端点引用(PUT persona/principles/files)
- 回滚流程改用 git log/show 命令查看历史版本
- 错误处理改为文件系统错误

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 02:32:21 +08:00
0e013567d3 refactor: 四个全局技能复盘优化(v2.4.0)
P0 结构性修复:
- update-agent 阶段 5 统一为 HTTP API,移除所有 Git 操作示例
- create-agent 响应格式与实际 API 对齐
- delete-agent 合并"前置检查"与"错误处理"

P1 一致性修复:
- 统一 frontmatter 字段顺序、tags 英文化
- 提取 AgentFS 背景知识到共享 _agentfs-background.md
- 受保护路径统一引用 _protected-paths.yaml

P2 缺失补充:
- discover-agent 补充"了解更多"API 实现
- update-agent 新增 Persona 修改示例
- create-agent 补充"修改"分支交互流程
- delete-agent 补充停止 Agent 方式

P3 精简优化:
- 精简版本回滚、删除范围、匹配算法描述

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:47:09 +08:00
41afa07fbe chore: 全局技能升版至 v2.3.0
- 统一版本来源(移除 metadata.version 冗余)
- create-agent / update-agent risk_level 降为 low
- 技能名称中文化

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:53:47 +08:00
5b46a51eba fix: create-agent / update-agent risk_level 降为 low
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:52:33 +08:00
cb52235673 refactor: 移除 metadata.version 冗余,顶层 version 为唯一来源
- 所有 SKILL.md 的版本号统一由顶层 version 字段定义
- 删除 metadata 中的冗余 version 副本
- 参考 OpenClaw 实践:version 作为顶层一等公民

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:50:59 +08:00
53fbc46150 refactor: 技能 name 改为中文 + update-agent 加入 AgentFS 背景知识
- 4 个技能 name 改为中文:创建智能体、更新智能体、发现智能体、删除智能体
- update-agent 新增 AgentFS 仓库结构背景知识(仅 Agent 内部使用)
- update-agent 回执改为用户友好格式,移除内部路径和 YAML 回执
- 合并重复的受保护路径段到背景知识中
2026-02-28 18:46:26 +08:00
386c1c2e43 feat: create-agent / update-agent v2.2.0 — 结构化 L0/L1/L2 API 输入
- create-agent: API 改为结构化 PersonaInput/PrinciplesInput JSON 输入
- create-agent: 用户确认预览从原始 markdown 改为表格形式
- create-agent: 支持最简创建(仅 name),自动补全所有默认值
- update-agent: 新增结构化 GET/PUT persona/principles 端点说明
2026-02-28 10:12:53 +08:00
b8ba404577 refactor: 消灭 skill.json,SKILL.md 成为唯一真相源
- 将 skill.json 中的 icon、shortDesc、category、maintainer、
  compatibleAgents、channel 迁移到 SKILL.md frontmatter 的 market 段
- 将 skill.json 中的 changelog 字段提取为独立 CHANGELOG.md
- 删除所有 skill.json(downloads/rating/ratingCount 等虚假数据一并移除)
- 版本号统一从 SKILL.md frontmatter version 读取

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 20:38:00 +08:00
89e68de812 feat: 上架 DesireCore 核心智能体,新增管理分类,精简 latestVersion
- 新增 management 分类(系统管理与编排工具)
- 创建 DesireCore Agent 市场条目(id: desirecore, verified)
- 更新 manifest 统计(totalAgents: 1, lastUpdated: 2026-02-27)
- 移除 4 个 skill.json 中冗余的 latestVersion 字段(version 已够用)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 20:28:51 +08:00
b2926b3212 fix: 同步 skill.json 版本至 2.1.0,移除 fetch_api 依赖
- 4 个全局技能 skill.json version/latestVersion 统一为 2.1.0
- requires.tools 移除已废弃的 fetch_api
- 更新 updatedAt 和 changelog
2026-02-26 20:54:06 +08:00
761226d567 feat: 统一全局技能至 v2.1.0,简化 API 调用方式
- 4 个全局技能版本统一为 2.1.0
- 移除 fetch_api 工具引用,改为通过 Bash/curl 调用 HTTP API
- API 基础地址由 system prompt 注入,技能无需自行端口发现
- create-agent 改为以用户阅读体验优先的 blockquote 格式呈现 markdown 内容
2026-02-26 20:38:35 +08:00
c1ca91c80a style: 技能图标升级为色彩丰富的多色 SVG
将 9 个技能图标从单色 stroke 风格升级为带渐变、填充、多色的
丰富视觉风格,每个图标使用项目 3+2 色彩体系中的特征色:
- search: 蓝/青渐变镜片
- file-text: 蓝色文档+紫色文字行
- calendar-days: 绿色框架+蓝/青日期点
- compass: 紫色罗盘+橙色指针
- folder-open: 橙/黄渐变文件夹
- mail: 蓝色渐变信封
- user-plus: 绿色人物+绿色加号
- user-minus: 橙红色人物+红色减号
- user-cog: 紫蓝色人物+蓝色齿轮

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 11:15:28 +08:00
6837bd897a refactor: icon 字段从 Lucide 名称迁移到内联 SVG
将 9 个技能的 icon 字段从 Lucide 图标名称(如 "search")替换为
内联 SVG 字符串,使市场数据完全自包含,新增技能无需修改前端代码。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 10:17:01 +08:00
a787208db9 feat: 为 4 个 builtin 技能添加 skill.json 市场元数据
- create-agent: 创建智能体(元技能,medium 风险)
- delete-agent: 删除智能体(元技能,high 风险)
- discover-agent: 发现智能体(流程型,low 风险)
- update-agent: 更新智能体(元技能,high 风险)

使 market-sync 的 scanSkills() 能够索引这些技能,
在市场 UI 中正常展示。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 09:15:32 +08:00
15e8d1f0c8 feat: 添加 4 个全局技能到 builtin 通道
- 新增 builtin-skills.json 清单
- 添加 create-agent / delete-agent / discover-agent / update-agent SKILL.md
- 添加 _protected-paths.yaml 共享配置
- 与捆绑源版本一致,启用 Phase 2 热更新通道

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 09:10:44 +08:00