Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix(web): improve skill experience display

z2tngf57879ceb621
diff --git a/docs/en/Skills.md b/docs/en/Skills.md
index dd33f9fcc1..76e402c246 100644
--- a/docs/en/Skills.md
+++ b/docs/en/Skills.md
@@ -206,10 +206,10 @@ In the **My Skills** list, each entry shows:
In the list, use **View skill experience** to browse evolution entries for that skill, one record at a time.
**Each entry typically includes:**
-- **Source**: where the entry came from (e.g. detected signal, chat, or execution context)
-- **Time**: when the record was created or written
-- **Context**: session/task background that triggered the entry
-- **Experience content**: the concrete change text, corresponding to the `change.content` field
+- **Type**: the content category, such as usage instructions, examples, or troubleshooting
+- **Improvement target**: the Skill area the experience improves, such as the description, body, or scripts
+- **Created at**: when the experience record was generated
+- **Experience content**: the concrete improvement guidance
> **How to see data:** When a skill already has saved evolution experience, **View skill experience** becomes available in the skill list. If there is no data yet, that skill has no saved evolution records. Records can be generated manually with `/evolve <skill_name> [user_query]`, or automatically in failure/correction scenarios after enabling **Auto-detect evolution signals** under **Self-Evolution Configuration**. See [Configuration](Configuration.md) and [Skill self-evolution](SkillSelfEvolution.md).
diff --git "a/docs/zh/\346\212\200\350\203\275.md" "b/docs/zh/\346\212\200\350\203\275.md"
index f47d28d385..0db316c3d3 100644
--- "a/docs/zh/\346\212\200\350\203\275.md"
+++ "b/docs/zh/\346\212\200\350\203\275.md"
@@ -203,10 +203,10 @@ ClawHub 访问地址:https://clawhub.ai/skills
在技能列表中,点击某个技能的 **查看技能经验**,可逐条查看该技能产生的演进经验。
**每条经验通常包含:**
-- **来源**:经验产生的来源(如检测到的信号、对话或执行上下文)
-- **时间**:记录生成或写入的时间
-- **上下文**:触发该条经验时的会话/任务背景说明
-- **经验内容**:具体改进说明,对应数据中的 `change.content` 字段
+- **类型**:经验所属的内容类别,如使用说明、使用示例或问题排查
+- **改进对象**:经验将改进的 Skill 区域,如技能简介、技能正文或技能脚本
+- **生成时间**:经验记录生成的时间
+- **经验内容**:具体的改进说明
> **如何能看到数据:** 当某个技能已经保存演进经验时,技能列表中的 **查看技能经验** 会变为可用,点击即可查看。若暂时没有数据,说明该技能还没有已保存的演进记录;这些记录可以通过 `/evolve <skill_name> [user_query]` 手动生成,也可以在 **自演进配置** 中开启 **自动检测可演进信号** 后,由系统在失败、纠错等场景中自动产生。详见[配置信息](配置信息.md)与 [Skill 自演进](Skill自演进.md)。
@@ -616,4 +616,3 @@ allowed_tools: [webSearch, readFile]
再次调用,输出结果不仅包含气温、风速等基础项,还带上了紫外线强度
![Skill effect after improved](../assets/images/skill优化后效果.png)
-
diff --git a/jiuwenswarm/channels/web/frontend/src/features/SkillEvolutionModal/index.tsx b/jiuwenswarm/channels/web/frontend/src/features/SkillEvolutionModal/index.tsx
index 147f88d37e..56205f948c 100644
--- a/jiuwenswarm/channels/web/frontend/src/features/SkillEvolutionModal/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/features/SkillEvolutionModal/index.tsx
@@ -27,6 +27,23 @@ type EvolutionGetResponse = {
type LoadState = "idle" | "loading" | "success" | "error";
+const SECTION_LABEL_KEYS: Record<string, string> = {
+ Instructions: "skills.evolution.values.section.instructions",
+ Examples: "skills.evolution.values.section.examples",
+ Troubleshooting: "skills.evolution.values.section.troubleshooting",
+ Workflow: "skills.evolution.values.section.workflow",
+ Constraints: "skills.evolution.values.section.constraints",
+ Roles: "skills.evolution.values.section.roles",
+ Collaboration: "skills.evolution.values.section.collaboration",
+ Scripts: "skills.evolution.values.section.scripts",
+};
+
+const TARGET_LABEL_KEYS: Record<string, string> = {
+ description: "skills.evolution.values.target.description",
+ body: "skills.evolution.values.target.body",
+ script: "skills.evolution.values.target.script",
+};
+
interface SkillEvolutionModalProps {
open: boolean;
sessionId: string;
@@ -246,24 +263,32 @@ export function SkillEvolutionModal({
className="rounded-lg border border-border bg-panel p-4"
>
<div className="flex items-start justify-between gap-3">
- <div className="min-w-0 text-xs text-text-muted space-y-1">
- <div>
- {t("skills.evolution.fields.id")}: {entry.id}
+ <div className="flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-2">
+ <div className="rounded-md bg-card px-2 py-1 text-sm">
+ <span className="text-text-muted">
+ {t("skills.evolution.fields.section")}:
+ </span>{" "}
+ <span className="font-medium text-text">
+ {entry.change?.section
+ ? SECTION_LABEL_KEYS[entry.change.section]
+ ? t(SECTION_LABEL_KEYS[entry.change.section])
+ : entry.change.section
+ : "-"}
+ </span>
</div>
- <div>
- {t("skills.evolution.fields.source")}: {entry.source || "-"}
+ <div className="rounded-md bg-card px-2 py-1 text-sm">
+ <span className="text-text-muted">
+ {t("skills.evolution.fields.target")}:
+ </span>{" "}
+ <span className="font-medium text-text">
+ {entry.change?.target
+ ? TARGET_LABEL_KEYS[entry.change.target]
+ ? t(TARGET_LABEL_KEYS[entry.change.target])
+ : entry.change.target
+ : "-"}
+ </span>
</div>
- <div>
- {t("skills.evolution.fields.section")}: {entry.change?.section || "-"}
- </div>
- <div>
- {t("skills.evolution.fields.target")}: {entry.change?.target || "-"}
- </div>
- <div>
- {t("skills.evolution.fields.applied")}: {String(Boolean(entry.applied))}
- </div>
- <div>
- {t("skills.evolution.fields.timestamp")}:{" "}
+ <div className="ml-auto whitespace-nowrap text-xs text-text-muted">
{entry.timestamp
? new Date(entry.timestamp).toLocaleString(i18n.language)
: "-"}
@@ -282,10 +307,8 @@ export function SkillEvolutionModal({
</div>
<div className="mt-3">
- <div className="text-sm font-medium text-text mb-2">
- {t("skills.evolution.fields.content")}
- </div>
<textarea
+ aria-label={t("skills.evolution.fields.content")}
value={entry.change?.content || ""}
onChange={(event) => handleChangeContent(entry.id, event.target.value)}
className="w-full min-h-28 px-3 py-2 rounded-md bg-card border border-border text-sm text-text placeholder:text-text-muted"
diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json
index b558a07b82..5654fd3bd2 100644
--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json
+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json
@@ -1594,7 +1594,7 @@
"evolution": {
"closeAria": "Close skill experience dialog",
"title": "Skill Experience: {{name}}",
- "subtitle": "You can edit experience content (change.content), delete entries, and save.",
+ "subtitle": "Edit or delete experiences, then save to apply your changes.",
"empty": "No experience entries",
"deleteConfirm": "Delete this experience entry?",
"actions": {
@@ -1603,13 +1603,30 @@
"fields": {
"id": "ID",
"source": "Source",
- "section": "Section",
- "target": "Target",
+ "section": "Type",
+ "target": "Improvement target",
"applied": "Applied",
- "timestamp": "Timestamp",
+ "timestamp": "Created at",
"context": "Context",
"content": "Experience Content"
},
+ "values": {
+ "section": {
+ "instructions": "Usage instructions",
+ "examples": "Examples",
+ "troubleshooting": "Troubleshooting",
+ "workflow": "Workflow",
+ "constraints": "Constraints",
+ "roles": "Roles",
+ "collaboration": "Collaboration",
+ "scripts": "Scripts"
+ },
+ "target": {
+ "description": "Skill description",
+ "body": "Skill body",
+ "script": "Skill scripts"
+ }
+ },
"messages": {
"saved": "Saved successfully"
},
diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json
index dcf80d76ff..801b11221e 100644
--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json
+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json
@@ -1595,7 +1595,7 @@
"evolution": {
"closeAria": "关闭技能经验弹窗",
"title": "技能经验:{{name}}",
- "subtitle": "可编辑经验内容(change.content),并支持删除条目后保存。",
+ "subtitle": "可编辑或删除经验,保存后生效。",
"empty": "暂无经验条目",
"deleteConfirm": "确认删除该条经验吗?",
"actions": {
@@ -1604,13 +1604,30 @@
"fields": {
"id": "ID",
"source": "来源",
- "section": "Section",
- "target": "Target",
+ "section": "类型",
+ "target": "改进对象",
"applied": "已应用",
- "timestamp": "时间",
+ "timestamp": "生成时间",
"context": "上下文",
"content": "经验内容"
},
+ "values": {
+ "section": {
+ "instructions": "使用说明",
+ "examples": "使用示例",
+ "troubleshooting": "问题排查",
+ "workflow": "工作流程",
+ "constraints": "约束条件",
+ "roles": "角色定义",
+ "collaboration": "协作方式",
+ "scripts": "脚本"
+ },
+ "target": {
+ "description": "技能简介",
+ "body": "技能正文",
+ "script": "技能脚本"
+ }
+ },
"messages": {
"saved": "保存成功"
},