feat: add category and scope to specs for enhanced filtering and organization

- Introduced SpecCategory and SpecScope types to categorize specs by workflow stage and scope (global/project).
- Updated Spec interface to include category and scope properties.
- Enhanced SpecCard component to display category and scope badges.
- Implemented category and scope filtering in SpecsSettingsPage.
- Updated localization files to support new category and scope labels.
- Modified spec loading commands to utilize category instead of keywords.
- Adjusted spec index builder to handle category and scope during spec parsing.
- Updated seed documents to include category information.
This commit is contained in:
catlog22
2026-02-26 23:43:55 +08:00
parent 052e25dddb
commit dfa8e0d9f5
47 changed files with 619 additions and 179 deletions

View File

@@ -10,16 +10,47 @@
"rebuildIndex": "重建索引",
"loading": "加载中...",
"noSpecs": "未找到规范。请在 .ccw/ 目录中创建规范文件。",
"required": "必读",
"dimension": {
"specs": "项目规范",
"personal": "个人规范"
},
"scope": {
"all": "全部",
"global": "全局",
"project": "项目"
},
"filterByScope": "按范围筛选:",
"category": {
"general": "通用",
"exploration": "探索",
"planning": "规划",
"execution": "执行"
},
"recommendedHooks": "推荐钩子",
"recommendedHooksDesc": "一键安装系统预设的规范注入钩子",
"installAll": "安装所有推荐钩子",
"installAllHooks": "安装所有钩子",
"allHooksInstalled": "已安装所有钩子",
"hooksInstalled": "已安装",
"manageHooks": "管理钩子",
"hookEvent": "事件",
"hookScope": "范围",
"install": "安装",
"installed": "已安装",
"installing": "安装中...",
"installedHooks": "已安装钩子",
"installedHooksDesc": "管理已安装的钩子配置",
"searchHooks": "搜索钩子...",
"noHooks": "未安装钩子。请安装上方的推荐钩子。",
"actions": {
"view": "查看内容",
"edit": "编辑",
"delete": "删除",
"reset": "重置",
@@ -45,6 +76,7 @@
},
"spec": {
"view": "查看内容",
"edit": "编辑规范",
"toggle": "切换状态",
"delete": "删除规范",
@@ -57,6 +89,23 @@
"file": "文件路径"
},
"content": {
"edit": "编辑",
"view": "查看",
"metadata": "元数据",
"markdownContent": "Markdown 内容",
"noContent": "无内容",
"editHint": "编辑完整的 Markdown 内容(包括 frontmatter。frontmatter 的更改将反映到规范元数据中。",
"placeholder": "# 规范标题\n\n内容..."
},
"common": {
"cancel": "取消",
"save": "保存",
"saving": "保存中...",
"close": "关闭"
},
"hook": {
"install": "安装",
"uninstall": "卸载",
@@ -88,6 +137,9 @@
},
"hooks": {
"installSuccess": "钩子安装成功",
"installError": "钩子安装失败",
"installAllSuccess": "所有钩子安装成功",
"dialog": {
"createTitle": "创建钩子",
"editTitle": "编辑钩子",
@@ -122,6 +174,12 @@
"continue": "继续执行",
"warn": "显示警告",
"block": "阻止操作"
},
"validation": {
"nameRequired": "名称为必填项",
"commandRequired": "命令为必填项",
"timeoutMin": "最小超时时间为 1000ms",
"timeoutMax": "最大超时时间为 300000ms"
}
},
@@ -133,18 +191,8 @@
"hookFailMode": "命令执行失败时的处理方式"
},
"common": {
"cancel": "取消",
"save": "保存",
"delete": "删除",
"edit": "编辑",
"reset": "重置",
"confirm": "确认"
},
"injection": {
"title": "注入控制",
"description": "监控和管理规范注入长度",
"statusTitle": "当前注入状态",
"settingsTitle": "注入控制设置",
"settingsDescription": "配置如何将规范内容注入到 AI 上下文中。",
@@ -198,5 +246,11 @@
"hookScope": "作用域",
"hookTimeout": "超时时间(ms)",
"hookFailMode": "失败模式"
},
"form": {
"readMode": "读取模式",
"priority": "优先级",
"keywords": "关键词"
}
}