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

@ -136,11 +136,10 @@ ${registryStats.message}
// 1. 使用统一的目录服务获取项目根目录
const projectRoot = await this.directoryService.getProjectRoot(context)
const resourceDir = await this.directoryService.getResourceDirectory(context)
const domainDir = path.join(resourceDir, 'domain')
// 2. 确保目录结构存在
await fs.ensureDir(domainDir)
logger.debug(`[InitCommand] 确保目录结构存在: ${domainDir}`)
// 2. 确保资源目录存在具体子目录由ResourceManager扫描时按需创建
await fs.ensureDir(resourceDir)
logger.debug(`[InitCommand] 确保资源目录存在: ${resourceDir}`)
// 3. 使用 ProjectDiscovery 的正确方法生成注册表
logger.step('正在扫描项目资源...')