refactor: 完成domain到role目录结构统一和硬编码清理

## 核心变更
1. **女娲角色知识更新**
   - dpml-authoring.execution.md: 更新镜像结构约束为.promptx/resource/role/
   - role-generation.execution.md: 4处domain路径更新为role
   - role-creation.thought.md: 文件组织思维从domain改为role

2. **命令类硬编码清理**
   - InitCommand.js: 移除domain目录创建,改为按需创建
   - RegisterCommand.js: 使用ResourceManager协议查找替代硬编码路径
   - WelcomeCommand.js: 简化loadRoleRegistry()方法,直接使用注册表

3. **包注册表同步**
   - 重新生成package.registry.json确保资源发现一致性

## 技术价值
-  统一目录语义:role比domain更准确描述AI角色
-  清理边角料代码:移除不必要的硬编码路径依赖
-  增强系统架构:基于注册表的资源发现更稳定
-  女娲知识同步:包含最新的role目录结构认知

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
sean
2025-06-28 19:59:28 +08:00
parent eea46a8ee1
commit 071138ef57
7 changed files with 120 additions and 176 deletions

View File

@ -4,8 +4,8 @@
"metadata": {
"version": "2.0.0",
"description": "package 级资源注册表",
"createdAt": "2025-06-28T11:40:17.935Z",
"updatedAt": "2025-06-28T11:40:17.951Z",
"createdAt": "2025-06-28T11:53:03.703Z",
"updatedAt": "2025-06-28T11:53:03.717Z",
"resourceCount": 29
},
"resources": [
@ -17,9 +17,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/assistant/assistant.role.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.941Z",
"updatedAt": "2025-06-28T11:40:17.941Z",
"scannedAt": "2025-06-28T11:40:17.941Z",
"createdAt": "2025-06-28T11:53:03.708Z",
"updatedAt": "2025-06-28T11:53:03.708Z",
"scannedAt": "2025-06-28T11:53:03.708Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/assistant/assistant.role.md",
"fileType": "role"
}
@ -32,9 +32,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/luban/luban.role.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.941Z",
"updatedAt": "2025-06-28T11:40:17.941Z",
"scannedAt": "2025-06-28T11:40:17.941Z",
"createdAt": "2025-06-28T11:53:03.708Z",
"updatedAt": "2025-06-28T11:53:03.708Z",
"scannedAt": "2025-06-28T11:53:03.708Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/luban.role.md",
"fileType": "role"
}
@ -47,9 +47,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/noface/noface.role.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.942Z",
"updatedAt": "2025-06-28T11:40:17.942Z",
"scannedAt": "2025-06-28T11:40:17.942Z",
"createdAt": "2025-06-28T11:53:03.708Z",
"updatedAt": "2025-06-28T11:53:03.708Z",
"scannedAt": "2025-06-28T11:53:03.708Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/noface/noface.role.md",
"fileType": "role"
}
@ -62,9 +62,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/nuwa/nuwa.role.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.942Z",
"updatedAt": "2025-06-28T11:40:17.942Z",
"scannedAt": "2025-06-28T11:40:17.942Z",
"createdAt": "2025-06-28T11:53:03.709Z",
"updatedAt": "2025-06-28T11:53:03.709Z",
"scannedAt": "2025-06-28T11:53:03.709Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/nuwa.role.md",
"fileType": "role"
}
@ -77,9 +77,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/sean/sean.role.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.942Z",
"updatedAt": "2025-06-28T11:40:17.942Z",
"scannedAt": "2025-06-28T11:40:17.942Z",
"createdAt": "2025-06-28T11:53:03.709Z",
"updatedAt": "2025-06-28T11:53:03.709Z",
"scannedAt": "2025-06-28T11:53:03.709Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/sean.role.md",
"fileType": "role"
}
@ -92,9 +92,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://resource/core/_deprecated/recall_v1.thought.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.943Z",
"updatedAt": "2025-06-28T11:40:17.943Z",
"scannedAt": "2025-06-28T11:40:17.943Z",
"createdAt": "2025-06-28T11:53:03.710Z",
"updatedAt": "2025-06-28T11:53:03.710Z",
"scannedAt": "2025-06-28T11:53:03.710Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/core/_deprecated/recall_v1.thought.md",
"fileType": "thought"
}
@ -107,9 +107,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://resource/core/_deprecated/remember_v1.thought.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.943Z",
"updatedAt": "2025-06-28T11:40:17.943Z",
"scannedAt": "2025-06-28T11:40:17.943Z",
"createdAt": "2025-06-28T11:53:03.710Z",
"updatedAt": "2025-06-28T11:53:03.710Z",
"scannedAt": "2025-06-28T11:53:03.710Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/core/_deprecated/remember_v1.thought.md",
"fileType": "thought"
}
@ -122,9 +122,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://resource/core/remember-xml.thought.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.944Z",
"updatedAt": "2025-06-28T11:40:17.944Z",
"scannedAt": "2025-06-28T11:40:17.944Z",
"createdAt": "2025-06-28T11:53:03.711Z",
"updatedAt": "2025-06-28T11:53:03.711Z",
"scannedAt": "2025-06-28T11:53:03.711Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/core/remember-xml.thought.md",
"fileType": "thought"
}
@ -137,9 +137,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://resource/core/remember.thought.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.944Z",
"updatedAt": "2025-06-28T11:40:17.944Z",
"scannedAt": "2025-06-28T11:40:17.944Z",
"createdAt": "2025-06-28T11:53:03.711Z",
"updatedAt": "2025-06-28T11:53:03.711Z",
"scannedAt": "2025-06-28T11:53:03.711Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/core/remember.thought.md",
"fileType": "thought"
}
@ -152,9 +152,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://resource/role/assistant/thought/assistant.thought.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.944Z",
"updatedAt": "2025-06-28T11:40:17.944Z",
"scannedAt": "2025-06-28T11:40:17.944Z",
"createdAt": "2025-06-28T11:53:03.711Z",
"updatedAt": "2025-06-28T11:53:03.711Z",
"scannedAt": "2025-06-28T11:53:03.711Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/assistant/thought/assistant.thought.md",
"fileType": "thought"
}
@ -167,9 +167,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://resource/role/luban/thought/craftsmanship.thought.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.944Z",
"updatedAt": "2025-06-28T11:40:17.944Z",
"scannedAt": "2025-06-28T11:40:17.944Z",
"createdAt": "2025-06-28T11:53:03.711Z",
"updatedAt": "2025-06-28T11:53:03.711Z",
"scannedAt": "2025-06-28T11:53:03.711Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/thought/craftsmanship.thought.md",
"fileType": "thought"
}
@ -182,9 +182,9 @@
"description": "思维模式指导AI的思考方式",
"reference": "@package://resource/role/nuwa/thought/role-creation.thought.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.945Z",
"updatedAt": "2025-06-28T11:40:17.945Z",
"scannedAt": "2025-06-28T11:40:17.945Z",
"createdAt": "2025-06-28T11:53:03.711Z",
"updatedAt": "2025-06-28T11:53:03.711Z",
"scannedAt": "2025-06-28T11:53:03.711Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/thought/role-creation.thought.md",
"fileType": "thought"
}
@ -197,9 +197,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/assistant/execution/assistant.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.946Z",
"updatedAt": "2025-06-28T11:40:17.946Z",
"scannedAt": "2025-06-28T11:40:17.946Z",
"createdAt": "2025-06-28T11:53:03.712Z",
"updatedAt": "2025-06-28T11:53:03.712Z",
"scannedAt": "2025-06-28T11:53:03.712Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/assistant/execution/assistant.execution.md",
"fileType": "execution"
}
@ -212,9 +212,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/luban/execution/tool-development-workflow.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.946Z",
"updatedAt": "2025-06-28T11:40:17.946Z",
"scannedAt": "2025-06-28T11:40:17.946Z",
"createdAt": "2025-06-28T11:53:03.713Z",
"updatedAt": "2025-06-28T11:53:03.713Z",
"scannedAt": "2025-06-28T11:53:03.713Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/execution/tool-development-workflow.execution.md",
"fileType": "execution"
}
@ -227,9 +227,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/luban/execution/toolsandbox-mastery.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.946Z",
"updatedAt": "2025-06-28T11:40:17.946Z",
"scannedAt": "2025-06-28T11:40:17.946Z",
"createdAt": "2025-06-28T11:53:03.713Z",
"updatedAt": "2025-06-28T11:53:03.713Z",
"scannedAt": "2025-06-28T11:53:03.713Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/execution/toolsandbox-mastery.execution.md",
"fileType": "execution"
}
@ -242,9 +242,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/noface/execution/adaptive-learning.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.946Z",
"updatedAt": "2025-06-28T11:40:17.946Z",
"scannedAt": "2025-06-28T11:40:17.946Z",
"createdAt": "2025-06-28T11:53:03.713Z",
"updatedAt": "2025-06-28T11:53:03.713Z",
"scannedAt": "2025-06-28T11:53:03.713Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/noface/execution/adaptive-learning.execution.md",
"fileType": "execution"
}
@ -257,9 +257,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/noface/execution/content-preservation.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.946Z",
"updatedAt": "2025-06-28T11:40:17.946Z",
"scannedAt": "2025-06-28T11:40:17.946Z",
"createdAt": "2025-06-28T11:53:03.713Z",
"updatedAt": "2025-06-28T11:53:03.713Z",
"scannedAt": "2025-06-28T11:53:03.713Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/noface/execution/content-preservation.execution.md",
"fileType": "execution"
}
@ -272,9 +272,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/nuwa/execution/dpml-authoring.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.947Z",
"updatedAt": "2025-06-28T11:40:17.947Z",
"scannedAt": "2025-06-28T11:40:17.947Z",
"createdAt": "2025-06-28T11:53:03.713Z",
"updatedAt": "2025-06-28T11:53:03.713Z",
"scannedAt": "2025-06-28T11:53:03.713Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/execution/dpml-authoring.execution.md",
"fileType": "execution"
}
@ -287,9 +287,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/nuwa/execution/role-design-patterns.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.947Z",
"updatedAt": "2025-06-28T11:40:17.947Z",
"scannedAt": "2025-06-28T11:40:17.947Z",
"createdAt": "2025-06-28T11:53:03.713Z",
"updatedAt": "2025-06-28T11:53:03.713Z",
"scannedAt": "2025-06-28T11:53:03.713Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/execution/role-design-patterns.execution.md",
"fileType": "execution"
}
@ -302,9 +302,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/nuwa/execution/role-generation.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.947Z",
"updatedAt": "2025-06-28T11:40:17.947Z",
"scannedAt": "2025-06-28T11:40:17.947Z",
"createdAt": "2025-06-28T11:53:03.714Z",
"updatedAt": "2025-06-28T11:53:03.714Z",
"scannedAt": "2025-06-28T11:53:03.714Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/execution/role-generation.execution.md",
"fileType": "execution"
}
@ -317,9 +317,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/nuwa/execution/visualization-enhancement.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.947Z",
"updatedAt": "2025-06-28T11:40:17.947Z",
"scannedAt": "2025-06-28T11:40:17.947Z",
"createdAt": "2025-06-28T11:53:03.714Z",
"updatedAt": "2025-06-28T11:53:03.714Z",
"scannedAt": "2025-06-28T11:53:03.714Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/execution/visualization-enhancement.execution.md",
"fileType": "execution"
}
@ -332,9 +332,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/sean/execution/template-adherence.execution.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.948Z",
"updatedAt": "2025-06-28T11:40:17.948Z",
"scannedAt": "2025-06-28T11:40:17.948Z",
"createdAt": "2025-06-28T11:53:03.714Z",
"updatedAt": "2025-06-28T11:53:03.714Z",
"scannedAt": "2025-06-28T11:53:03.714Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/execution/template-adherence.execution.md",
"fileType": "execution"
}
@ -347,9 +347,9 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/luban/knowledge/dpml-tool-tagging.knowledge.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.949Z",
"updatedAt": "2025-06-28T11:40:17.949Z",
"scannedAt": "2025-06-28T11:40:17.949Z",
"createdAt": "2025-06-28T11:53:03.715Z",
"updatedAt": "2025-06-28T11:53:03.715Z",
"scannedAt": "2025-06-28T11:53:03.715Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/knowledge/dpml-tool-tagging.knowledge.md",
"fileType": "knowledge"
}
@ -362,9 +362,9 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/luban/knowledge/javascript-ecosystem.knowledge.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.949Z",
"updatedAt": "2025-06-28T11:40:17.949Z",
"scannedAt": "2025-06-28T11:40:17.949Z",
"createdAt": "2025-06-28T11:53:03.715Z",
"updatedAt": "2025-06-28T11:53:03.715Z",
"scannedAt": "2025-06-28T11:53:03.715Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/knowledge/javascript-ecosystem.knowledge.md",
"fileType": "knowledge"
}
@ -377,9 +377,9 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/luban/knowledge/promptx-tool-architecture.knowledge.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.949Z",
"updatedAt": "2025-06-28T11:40:17.949Z",
"scannedAt": "2025-06-28T11:40:17.949Z",
"createdAt": "2025-06-28T11:53:03.715Z",
"updatedAt": "2025-06-28T11:53:03.715Z",
"scannedAt": "2025-06-28T11:53:03.715Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/knowledge/promptx-tool-architecture.knowledge.md",
"fileType": "knowledge"
}
@ -392,9 +392,9 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/luban/knowledge/tool-best-practices.knowledge.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.949Z",
"updatedAt": "2025-06-28T11:40:17.949Z",
"scannedAt": "2025-06-28T11:40:17.949Z",
"createdAt": "2025-06-28T11:53:03.716Z",
"updatedAt": "2025-06-28T11:53:03.716Z",
"scannedAt": "2025-06-28T11:53:03.716Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/knowledge/tool-best-practices.knowledge.md",
"fileType": "knowledge"
}
@ -407,9 +407,9 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/sean/knowledge/contradiction-methodology.knowledge.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.949Z",
"updatedAt": "2025-06-28T11:40:17.949Z",
"scannedAt": "2025-06-28T11:40:17.949Z",
"createdAt": "2025-06-28T11:53:03.716Z",
"updatedAt": "2025-06-28T11:53:03.716Z",
"scannedAt": "2025-06-28T11:53:03.716Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/knowledge/contradiction-methodology.knowledge.md",
"fileType": "knowledge"
}
@ -422,9 +422,9 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/sean/knowledge/product-philosophy.knowledge.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.950Z",
"updatedAt": "2025-06-28T11:40:17.950Z",
"scannedAt": "2025-06-28T11:40:17.950Z",
"createdAt": "2025-06-28T11:53:03.716Z",
"updatedAt": "2025-06-28T11:53:03.716Z",
"scannedAt": "2025-06-28T11:53:03.716Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/knowledge/product-philosophy.knowledge.md",
"fileType": "knowledge"
}
@ -437,9 +437,9 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/sean/knowledge/promptx-evolution.knowledge.md",
"metadata": {
"createdAt": "2025-06-28T11:40:17.950Z",
"updatedAt": "2025-06-28T11:40:17.950Z",
"scannedAt": "2025-06-28T11:40:17.950Z",
"createdAt": "2025-06-28T11:53:03.716Z",
"updatedAt": "2025-06-28T11:53:03.716Z",
"scannedAt": "2025-06-28T11:53:03.716Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/knowledge/promptx-evolution.knowledge.md",
"fileType": "knowledge"
}