Merge branch 'main' of https://git.nianxx.cn/wangxuming/makelore
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
unlinkSync,
|
||||
} from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { BUNDLED_OPENCODE_SKILL_IDS } from '../../shared/opencode-skills';
|
||||
|
||||
export interface BundledSkillsPathInput {
|
||||
isPackaged: boolean;
|
||||
@@ -19,9 +20,7 @@ export interface EnsureBundledCourseSkillsOptions {
|
||||
sourceDir?: string;
|
||||
}
|
||||
|
||||
export const BUNDLED_COURSE_SKILL_IDS = [
|
||||
'agent-browser',
|
||||
] as const;
|
||||
export const BUNDLED_COURSE_SKILL_IDS = BUNDLED_OPENCODE_SKILL_IDS;
|
||||
const RETIRED_COURSE_SKILL_IDS = [
|
||||
'course-stage-review',
|
||||
'student-growth-logger',
|
||||
|
||||
@@ -199,7 +199,10 @@ function buildAgentMarkdown(config: ProjectConfig, agent: ProjectAgentConfig): s
|
||||
].join('\n');
|
||||
const shellPermission = agent.skillIds.includes('game-assets') ? ' bash: allow\n' : '';
|
||||
const model = agent.model;
|
||||
const prompt = agent.prompt.trim() || buildProjectAgentPrompt(config, agent);
|
||||
const prompt = [
|
||||
agent.prompt.trim() || buildProjectAgentPrompt(config, agent),
|
||||
buildSelectedSkillGuidance(agent.skillIds),
|
||||
].filter(Boolean).join('\n\n');
|
||||
return `---
|
||||
description: ${yamlString(agent.name)}
|
||||
mode: all
|
||||
@@ -212,6 +215,29 @@ ${skills}
|
||||
${prompt}`;
|
||||
}
|
||||
|
||||
function buildSelectedSkillGuidance(skillIds: string[]): string {
|
||||
const guidance: string[] = [];
|
||||
if (skillIds.includes('frontend-slides')) {
|
||||
guidance.push([
|
||||
'## 自动调用:项目演示',
|
||||
'当用户要求项目汇报、结题展示、答辩、项目介绍或其他演示文稿时,主动调用 `frontend-slides`,把当前项目的真实内容整理成可播放的本地 HTML 幻灯片。项目接近完成且交付清单需要项目演示时,主动提醒用户并准备生成;不要生成 PPTX、不要部署到云端。',
|
||||
].join('\n'));
|
||||
}
|
||||
if (skillIds.includes('grilling')) {
|
||||
guidance.push([
|
||||
'## 自动调用:方案质询',
|
||||
'当任务涉及重要实现、设计、架构或其他未确认的高影响决策时,主动调用 `grilling`。在用户确认共享理解前,不要修改项目状态。',
|
||||
].join('\n'));
|
||||
}
|
||||
if (skillIds.includes('planning-with-files')) {
|
||||
guidance.push([
|
||||
'## 自动调用:项目规划',
|
||||
'当任务包含多个阶段、需要研究或可能跨会话继续时,主动调用 `planning-with-files`,并按该技能在 `.niancode/agent-planning/` 中维护规划文件。',
|
||||
].join('\n'));
|
||||
}
|
||||
return guidance.join('\n\n');
|
||||
}
|
||||
|
||||
async function areMaterializedAgentsCurrent(projectPath: string, config: ProjectConfig): Promise<boolean> {
|
||||
if (!config.initialized || config.agents.length === 0) return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user