ethan-skill 1.15.1 → 1.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -638,6 +638,48 @@ program
638
638
  lingma: path.join(dir, '.lingma/rules'),
639
639
  };
640
640
  let total = 0;
641
+ /** 生成 Agent 嵌入式 Auto-Pilot 提示词(不依赖 ethan agent run,直接注入执行指令) */
642
+ const buildAgentAutoContent = (agent, agentSkills, isClaudeCodePlatform) => {
643
+ const skillCount = agentSkills.length;
644
+ const skillList = agentSkills
645
+ .map((s, i) => `${i + 1}. **${s.name}** (\`${s.id}\`): ${s.description}`)
646
+ .join('\n');
647
+ const taskSection = isClaudeCodePlatform
648
+ ? `## 任务\n$ARGUMENTS`
649
+ : `## 任务\n请描述您想完成的任务。`;
650
+ return [
651
+ `你是 **Ethan ${agent.emoji} ${agent.name}**,专注于:${agent.role}。`,
652
+ '',
653
+ taskSection,
654
+ '',
655
+ '---',
656
+ '',
657
+ `## 执行指令(Auto-Pilot 模式)`,
658
+ '',
659
+ `请严格按以下顺序**自动执行**全部 ${skillCount} 个 Skill,**无需用户逐步确认**:`,
660
+ '',
661
+ skillList,
662
+ '',
663
+ '### 执行规范',
664
+ '',
665
+ '1. 对每个 Skill 完整执行其全部步骤(严格遵循已加载的 Skill 定义)',
666
+ '2. 每步完成后,用以下格式折叠展示:',
667
+ '',
668
+ '```',
669
+ '<details>',
670
+ '<summary>✅ Step N: [Skill名] — 已完成</summary>',
671
+ '',
672
+ '[本步骤完整输出]',
673
+ '',
674
+ '</details>',
675
+ '```',
676
+ '',
677
+ '3. 将本步**核心产出**(≤200字摘要)作为下一步的背景,自动继续执行',
678
+ '4. 全部步骤完成后,输出完整**合并报告**',
679
+ '',
680
+ '> 立即开始执行 Step 1,无需等待用户确认。',
681
+ ].join('\n');
682
+ };
641
683
  for (const p of targets) {
642
684
  const outDir = platformDirMap[p];
643
685
  if (!fs.existsSync(outDir))
@@ -769,12 +811,14 @@ program
769
811
  const agentNewContent = `---\ndescription: "Ethan — 创建自定义 Agent,生成 .ethan/agents/<id>.yaml"\n---\n\n` +
770
812
  `$(ethan agent new $ARGUMENTS 2>/dev/null)\n`;
771
813
  fs.writeFileSync(path.join(outDir, 'ethan-agent-new.md'), agentNewContent, 'utf-8');
772
- // 每个内置 Agent 生成独立快捷命令(动态)
814
+ // 每个内置 Agent 生成独立快捷命令(静态嵌入式 Auto-Pilot 提示词 + $ARGUMENTS)
773
815
  let agentFileCount = 3;
774
816
  for (const agent of agents) {
775
- const agentSkillList = agent.skillIds.slice(0, 8).join('、') + (agent.skillIds.length > 8 ? '...' : '');
817
+ const agentSkills = agent.skillIds
818
+ .map((id) => skills.find((s) => s.id === id))
819
+ .filter((s) => !!s);
776
820
  const agentContent = `---\ndescription: "Ethan — ${agent.emoji} ${agent.name}:${agent.role}"\n---\n\n` +
777
- `$(![ -n "$ARGUMENTS" ] && ethan agent run --no-copy -c "$ARGUMENTS" 2>/dev/null || printf "## ${agent.emoji} ${agent.name}\\n\\n**职责**: ${agent.role}\\n\\n**负责 Skill**: ${agentSkillList}\\n\\n用法: /ethan-agent-${agent.id} <任务描述>")\n`;
821
+ buildAgentAutoContent(agent, agentSkills, true) + '\n';
778
822
  fs.writeFileSync(path.join(outDir, `ethan-agent-${agent.id}.md`), agentContent, 'utf-8');
779
823
  agentFileCount++;
780
824
  total++;
@@ -815,16 +859,14 @@ program
815
859
  `# 创建自定义 Agent\n\n` +
816
860
  `运行:\`ethan agent new\`\n\n` +
817
861
  `将在 \`.ethan/agents/\` 目录下生成 Agent 配置文件。\n`, 'utf-8');
818
- // 每个内置 Agent 生成独立静态命令文件
862
+ // 每个内置 Agent 生成独立静态命令文件(嵌入式 Auto-Pilot 提示词)
819
863
  let staticAgentFileCount = 3;
820
864
  for (const agent of agentsStatic) {
821
- const agentSkillList = agent.skillIds.slice(0, 8).join('、') + (agent.skillIds.length > 8 ? '...' : '');
865
+ const agentSkills = agent.skillIds
866
+ .map((id) => skills.find((s) => s.id === id))
867
+ .filter((s) => !!s);
822
868
  const agentContent = `---\ndescription: "Ethan — ${agent.emoji} ${agent.name}:${agent.role}"\n---\n\n` +
823
- `# ${agent.emoji} ${agent.name}\n\n` +
824
- `**职责**: ${agent.role}\n\n` +
825
- `**负责 Skill**: ${agentSkillList}\n\n` +
826
- `**运行方式**:\`ethan agent run --no-copy -c "<任务描述>"\`\n\n` +
827
- `**示例**:\`ethan agent run --no-copy -c "对当前代码进行安全审查"\`\n`;
869
+ buildAgentAutoContent(agent, agentSkills, false) + '\n';
828
870
  fs.writeFileSync(path.join(outDir, `ethan-agent-${agent.id}.md`), agentContent, 'utf-8');
829
871
  staticAgentFileCount++;
830
872
  total++;