feat(cli): 添加 --rule 选项支持模板自动发现

重构 ccw cli 模板系统:

- 新增 template-discovery.ts 模块,支持扁平化模板自动发现
- 添加 --rule <template> 选项,自动加载 protocol 和 template
- 模板目录从嵌套结构 (prompts/category/file.txt) 迁移到扁平结构 (prompts/category-function.txt)
- 更新所有 agent/command 文件,使用 $PROTO $TMPL 环境变量替代 $(cat ...) 模式
- 支持模糊匹配:--rule 02-review-architecture 可匹配 analysis-review-architecture.txt

其他更新:
- Dashboard: 添加 Claude Manager 和 Issue Manager 页面
- Codex-lens: 增强 chain_search 和 clustering 模块

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2026-01-17 19:20:24 +08:00
parent 1fae35c05d
commit f14418603a
137 changed files with 13125 additions and 301 deletions

View File

@@ -159,8 +159,15 @@ export function buildCommand(params: {
nativeResume?: NativeResumeConfig;
/** Claude CLI settings file path (for --settings parameter) */
settingsFile?: string;
/** Codex review options */
reviewOptions?: {
uncommitted?: boolean;
base?: string;
commit?: string;
title?: string;
};
}): { command: string; args: string[]; useStdin: boolean } {
const { tool, prompt, mode = 'analysis', model, dir, include, nativeResume, settingsFile } = params;
const { tool, prompt, mode = 'analysis', model, dir, include, nativeResume, settingsFile, reviewOptions } = params;
debugLog('BUILD_CMD', `Building command for tool: ${tool}`, {
mode,
@@ -227,10 +234,25 @@ export function buildCommand(params: {
// codex review mode: non-interactive code review
// Format: codex review [OPTIONS] [PROMPT]
args.push('review');
// Default to --uncommitted if no specific review target in prompt
args.push('--uncommitted');
// Review target: --uncommitted (default), --base <branch>, or --commit <sha>
if (reviewOptions?.base) {
args.push('--base', reviewOptions.base);
} else if (reviewOptions?.commit) {
args.push('--commit', reviewOptions.commit);
} else {
// Default to --uncommitted if no specific target
args.push('--uncommitted');
}
// Optional title for review summary
if (reviewOptions?.title) {
args.push('--title', reviewOptions.title);
}
if (model) {
args.push('-m', model);
// codex review uses -c key=value for config override, not -m
args.push('-c', `model=${model}`);
}
// codex review uses positional prompt argument, not stdin
useStdin = false;