diff --git a/.claude/skills/copyright-docs/SKILL.md b/.claude/skills/copyright-docs/SKILL.md index d311a7a7..da6d89f6 100644 --- a/.claude/skills/copyright-docs/SKILL.md +++ b/.claude/skills/copyright-docs/SKILL.md @@ -86,11 +86,17 @@ Generate CPCC-compliant software design specification documents (软件设计说 ## Directory Setup -```bash -timestamp=$(date +%Y%m%d-%H%M%S) -dir=".workflow/.scratchpad/copyright-$timestamp" -mkdir -p "$dir/sections" "$dir/iterations" -echo "$dir" +```javascript +// 跨平台目录创建 +const timestamp = new Date().toISOString().replace(/[-:]/g, '').slice(0, 15); +const dir = `.workflow/.scratchpad/copyright-${timestamp}`; + +// Windows +Bash(`if not exist "${dir}\\sections" mkdir "${dir}\\sections"`); +Bash(`if not exist "${dir}\\iterations" mkdir "${dir}\\iterations"`); + +// Unix/macOS +// Bash(`mkdir -p "${dir}/sections" "${dir}/iterations"`); ``` ## Output Structure diff --git a/.claude/skills/project-analyze/SKILL.md b/.claude/skills/project-analyze/SKILL.md index 3bba09b0..435402f7 100644 --- a/.claude/skills/project-analyze/SKILL.md +++ b/.claude/skills/project-analyze/SKILL.md @@ -116,11 +116,17 @@ Generate comprehensive project analysis reports through multi-phase iterative wo ## Directory Setup -```bash -timestamp=$(date +%Y%m%d-%H%M%S) -dir=".workflow/.scratchpad/analyze-$timestamp" -mkdir -p "$dir/sections" "$dir/iterations" -echo "$dir" +```javascript +// 跨平台目录创建 +const timestamp = new Date().toISOString().replace(/[-:]/g, '').slice(0, 15); +const dir = `.workflow/.scratchpad/analyze-${timestamp}`; + +// Windows +Bash(`if not exist "${dir}\\sections" mkdir "${dir}\\sections"`); +Bash(`if not exist "${dir}\\iterations" mkdir "${dir}\\iterations"`); + +// Unix/macOS +// Bash(`mkdir -p "${dir}/sections" "${dir}/iterations"`); ``` ## Output Structure diff --git a/ccw/src/commands/cli.ts b/ccw/src/commands/cli.ts index 887cc922..d30a700e 100644 --- a/ccw/src/commands/cli.ts +++ b/ccw/src/commands/cli.ts @@ -788,7 +788,10 @@ async function historyAction(options: HistoryOptions): Promise { return; } - console.log(chalk.gray(` Total executions: ${history.total}\n`)); + // Compact table header + console.log(chalk.gray(` Total: ${history.total} | Showing: ${history.executions.length}\n`)); + console.log(chalk.gray(' Status Tool Time Duration ID')); + console.log(chalk.gray(' ' + '─'.repeat(70))); for (const exec of history.executions) { const statusIcon = exec.status === 'success' ? chalk.green('●') : @@ -798,13 +801,18 @@ async function historyAction(options: HistoryOptions): Promise { : `${exec.duration_ms}ms`; const timeAgo = getTimeAgo(new Date(exec.updated_at || exec.timestamp)); - const turnInfo = exec.turn_count && exec.turn_count > 1 ? chalk.cyan(` [${exec.turn_count} turns]`) : ''; + const turnInfo = exec.turn_count && exec.turn_count > 1 ? chalk.cyan(`[${exec.turn_count}t]`) : ' '; - console.log(` ${statusIcon} ${chalk.bold.white(exec.tool.padEnd(8))} ${chalk.gray(timeAgo.padEnd(12))} ${chalk.gray(duration.padEnd(8))}${turnInfo}`); - console.log(chalk.gray(` ${exec.prompt_preview}`)); - console.log(chalk.dim(` ID: ${exec.id}`)); - console.log(); + // Compact single-line format: status tool time duration [turns] id + const shortId = exec.id.length > 25 ? exec.id.substring(0, 22) + '...' : exec.id; + console.log(` ${statusIcon} ${chalk.bold.white(exec.tool.padEnd(8))} ${chalk.gray(timeAgo.padEnd(11))} ${chalk.gray(duration.padEnd(8))} ${turnInfo} ${chalk.dim(shortId)}`); } + + // Usage hint + console.log(); + console.log(chalk.gray(' ' + '─'.repeat(70))); + console.log(chalk.dim(' View output: ccw cli output --final')); + console.log(); } /** diff --git a/ccw/src/templates/dashboard-js/components/cli-history.js b/ccw/src/templates/dashboard-js/components/cli-history.js index 4e3cfc7e..7ef70042 100644 --- a/ccw/src/templates/dashboard-js/components/cli-history.js +++ b/ccw/src/templates/dashboard-js/components/cli-history.js @@ -145,8 +145,9 @@ function renderCliHistory() { ` : ''; - // Escape sourceDir for use in onclick - const sourceDirEscaped = exec.sourceDir ? exec.sourceDir.replace(/'/g, "\\'") : ''; + // Normalize and escape sourceDir for use in onclick + // Convert backslashes to forward slashes to prevent JS escape issues in onclick + const sourceDirEscaped = exec.sourceDir ? exec.sourceDir.replace(/\\/g, '/').replace(/'/g, "\\'") : ''; return `
diff --git a/ccw/src/templates/dashboard-js/views/history.js b/ccw/src/templates/dashboard-js/views/history.js index 1a1d35b0..328e244d 100644 --- a/ccw/src/templates/dashboard-js/views/history.js +++ b/ccw/src/templates/dashboard-js/views/history.js @@ -96,10 +96,10 @@ async function renderCliHistoryView() { '' + - '' + - '' + '
' +