fix: 系统化优化角色输出显示,解决角色名称混淆问题

- 优化WelcomeCommand输出格式,角色列表显示为 `id` - name 格式
- 优化ActionCommand输出格式,激活成功时显示 `id` (name) 格式
- 更新package.registry.json中7个角色的name和description:
  * nuwa: "Nuwa 角色" → "女娲",描述更新为专业的角色创造能力
  * sean: "Sean 角色" → "Sean",描述更新为CEO身份
  * product-manager: 更新为"产品经理",描述强调价值平衡能力
  * java-backend-developer: 更新为"Java后端开发工程师",描述强调架构能力
  * frontend-developer: 更新为"前端开发工程师",描述强调用户体验
  * xiaohongshu-marketer: 更新为"小红书营销专家",描述强调平台运营
  * assistant: 更新为"总经理秘书",描述强调执行和协调能力
- 解决角色名称显示不一致和描述过于通用的问题
- 提升用户体验,避免角色身份混淆

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
sean
2025-06-26 16:24:07 +08:00
parent 1cc01bf1ef
commit 5181bfeff1
3 changed files with 29 additions and 30 deletions

View File

@ -75,7 +75,7 @@ class ActionCommand extends BasePouchCommand {
const dependencies = await this.analyzeRoleDependencies(roleInfo)
// 3. 生成学习计划并直接加载所有内容
return await this.generateLearningPlan(roleInfo.id, dependencies)
return await this.generateLearningPlan(roleInfo, dependencies)
} catch (error) {
logger.error('Action command error:', error)
return `❌ 激活角色 "${roleId}" 时发生错误。
@ -325,10 +325,11 @@ ${result.content}
/**
* 生成学习计划并直接加载所有内容(包含完整的角色语义)
*/
async generateLearningPlan (roleId, dependencies) {
async generateLearningPlan (roleInfo, dependencies) {
const { thoughts, executions, roleSemantics } = dependencies
const { id: roleId } = roleInfo
let content = `🎭 **角色激活完成:${roleId}** - 所有技能已自动加载\n`
let content = `🎭 **角色激活完成:\`${roleId}\` (${roleInfo.name})** - 所有技能已自动加载\n`
// 加载思维模式技能仅包含独立的thought引用
if (thoughts.size > 0) {
@ -388,7 +389,7 @@ ${result.content}
// 激活总结
content += `# 🎯 角色激活总结\n`
content += `✅ **${roleId} 角色已完全激活!**\n`
content += `✅ **\`${roleId}\` (${roleInfo.name}) 角色已完全激活!**\n`
content += `📋 **已获得能力**\n`
if (thoughts.size > 0) content += `- 🧠 思维模式:${Array.from(thoughts).join(', ')}\n`
if (executions.size > 0) content += `- ⚡ 执行技能:${Array.from(executions).join(', ')}\n`
@ -402,7 +403,7 @@ ${result.content}
content += `- 🎭 角色组件:${roleComponents.join(', ')}\n`
}
content += `💡 **现在可以立即开始以 ${roleId} 身份提供专业服务!**\n`
content += `💡 **现在可以立即开始以 \`${roleId}\` (${roleInfo.name}) 身份提供专业服务!**\n`
// 自动执行 recall 命令
content += await this.executeRecall(roleId)

View File

@ -201,10 +201,8 @@ class WelcomeCommand extends BasePouchCommand {
content += `### ${sourceLabel}\n\n`
rolesBySource[source].forEach(role => {
content += `#### ${roleIndex}. ${role.name}
**角色ID**: \`${role.id}\`
content += `#### ${roleIndex}. \`${role.id}\` - ${role.name}
**专业能力**: ${role.description}
**文件路径**: ${role.file}
**来源**: ${sourceLabel}
---