mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
fix(cli): 更新提示格式以包含协议和模板信息
This commit is contained in:
@@ -767,20 +767,20 @@ async function execAction(positionalPrompt: string | undefined, options: CliExec
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Concatenate systemRules and roles to the end of prompt (if loaded)
|
// Concatenate systemRules and roles to the end of prompt (if loaded)
|
||||||
// Format: [USER_PROMPT]\n[SYSTEM_RULES]\n[ROLES]
|
// Format: [USER_PROMPT]\n\nProtocol (mode): [content]\n\nTemplate (rule): [content]
|
||||||
// Skip concatenation when using --commit with review mode (prompt not allowed)
|
// Skip concatenation when using --commit with review mode (prompt not allowed)
|
||||||
if (!skipTemplates && (systemRules || roles)) {
|
if (!skipTemplates && (systemRules || roles)) {
|
||||||
const parts: string[] = [actualPrompt];
|
const parts: string[] = [actualPrompt];
|
||||||
if (systemRules) {
|
if (systemRules) {
|
||||||
parts.push(`=== SYSTEM RULES ===\n${systemRules}`);
|
parts.push(`Protocol (${mode}):\n${systemRules}`);
|
||||||
}
|
}
|
||||||
if (roles) {
|
if (roles) {
|
||||||
parts.push(`=== ROLES ===\n${roles}`);
|
parts.push(`Template (${effectiveRule}):\n${roles}`);
|
||||||
}
|
}
|
||||||
actualPrompt = parts.join('\n\n');
|
actualPrompt = parts.join('\n\n');
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log(chalk.gray(` Prompt structure: USER_PROMPT(${prompt_to_use.length}) + SYSTEM_RULES(${systemRules.length}) + ROLES(${roles.length})`));
|
console.log(chalk.gray(` Prompt structure: USER_PROMPT(${prompt_to_use.length}) + Protocol(${systemRules.length}) + Template(${roles.length})`));
|
||||||
console.log(chalk.gray(` Total prompt length: ${actualPrompt.length} chars`));
|
console.log(chalk.gray(` Total prompt length: ${actualPrompt.length} chars`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user