claude-code-workflow 6.3.50 → 6.3.52
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/.claude/commands/view.md +367 -0
- package/.claude/commands/workflow/merge-plans-with-file.md +807 -0
- package/.claude/commands/workflow/quick-plan-with-file.md +808 -0
- package/.claude/commands/workflow/unified-execute-with-file.md +807 -0
- package/.claude/skills/ccw-help/SKILL.md +72 -12
- package/.claude/skills/ccw-help/command.json +922 -520
- package/.claude/skills/ccw-help/index/all-agents.json +97 -0
- package/.claude/skills/ccw-help/index/all-commands.json +805 -0
- package/.claude/skills/ccw-help/index/by-category.json +833 -0
- package/.claude/skills/ccw-help/index/by-use-case.json +819 -0
- package/.claude/skills/ccw-help/index/command-relationships.json +160 -0
- package/.claude/skills/ccw-help/index/essential-commands.json +90 -0
- package/.claude/skills/ccw-help/scripts/auto-update.py +34 -0
- package/.claude/skills/skill-generator/SKILL.md +255 -208
- package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +238 -228
- package/.claude/skills/skill-generator/phases/02-structure-generation.md +261 -262
- package/.claude/skills/skill-generator/phases/03-phase-generation.md +976 -969
- package/.claude/skills/skill-generator/phases/04-specs-templates.md +398 -398
- package/.claude/skills/skill-generator/phases/05-validation.md +417 -417
- package/.claude/skills/skill-generator/specs/cli-integration.md +131 -131
- package/.claude/skills/skill-generator/specs/execution-modes.md +399 -396
- package/.claude/skills/skill-generator/specs/reference-docs-spec.md +271 -0
- package/.claude/skills/skill-generator/specs/scripting-integration.md +265 -265
- package/.claude/skills/skill-generator/specs/skill-requirements.md +466 -466
- package/.claude/skills/skill-generator/templates/autonomous-action.md +91 -88
- package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +89 -89
- package/.claude/skills/skill-generator/templates/code-analysis-action.md +148 -149
- package/.claude/skills/skill-generator/templates/llm-action.md +367 -367
- package/.claude/skills/skill-generator/templates/script-template.md +79 -79
- package/.claude/skills/skill-generator/templates/sequential-phase.md +129 -129
- package/.claude/skills/skill-generator/templates/skill-md.md +134 -75
- package/.codex/prompts/brainstorm-with-file.md +99 -32
- package/.codex/prompts/merge-plans-with-file.md +530 -0
- package/.codex/prompts/quick-plan-with-file.md +450 -0
- package/.codex/prompts/unified-execute-with-file.md +722 -0
- package/.codex/skills/codex-issue-plan-execute/SKILL.md +214 -0
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-complete.md +173 -0
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-execute.md +220 -0
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-init.md +86 -0
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-list.md +165 -0
- package/.codex/skills/codex-issue-plan-execute/phases/actions/action-plan.md +170 -0
- package/.codex/skills/codex-issue-plan-execute/phases/orchestrator.md +212 -0
- package/.codex/skills/codex-issue-plan-execute/phases/state-schema.md +136 -0
- package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent-system.md +32 -0
- package/.codex/skills/codex-issue-plan-execute/prompts/execution-agent.md +323 -0
- package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent-system.md +32 -0
- package/.codex/skills/codex-issue-plan-execute/prompts/planning-agent.md +224 -0
- package/.codex/skills/codex-issue-plan-execute/specs/agent-roles.md +468 -0
- package/.codex/skills/codex-issue-plan-execute/specs/issue-handling.md +187 -0
- package/.codex/skills/codex-issue-plan-execute/specs/quality-standards.md +231 -0
- package/.codex/skills/codex-issue-plan-execute/specs/solution-schema.md +270 -0
- package/.codex/skills/codex-issue-plan-execute/specs/subagent-roles.md +32 -0
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +23 -2
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/core/routes/help-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/help-routes.js +51 -1
- package/ccw/dist/core/routes/help-routes.js.map +1 -1
- package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-core.js +5 -3
- package/ccw/dist/tools/cli-executor-core.js.map +1 -1
- package/ccw/dist/tools/cli-executor-utils.d.ts +1 -0
- package/ccw/dist/tools/cli-executor-utils.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor-utils.js +9 -1
- package/ccw/dist/tools/cli-executor-utils.js.map +1 -1
- package/ccw/src/commands/cli.ts +26 -2
- package/ccw/src/core/routes/help-routes.ts +60 -1
- package/ccw/src/templates/dashboard-js/views/help.js +423 -1
- package/ccw/src/tools/cli-executor-core.ts +6 -3
- package/ccw/src/tools/cli-executor-utils.ts +11 -2
- package/package.json +1 -1
|
@@ -262,6 +262,8 @@ function renderCommandsTab(category) {
|
|
|
262
262
|
|
|
263
263
|
// Initialize accordion handlers
|
|
264
264
|
initializeAccordions();
|
|
265
|
+
// Initialize command card click handlers
|
|
266
|
+
initializeCommandCardHandlers();
|
|
265
267
|
}
|
|
266
268
|
|
|
267
269
|
function renderCommandCard(cmd) {
|
|
@@ -271,8 +273,13 @@ function renderCommandCard(cmd) {
|
|
|
271
273
|
'Advanced': 'bg-error-light text-error'
|
|
272
274
|
}[cmd.difficulty] || 'bg-muted text-muted-foreground';
|
|
273
275
|
|
|
276
|
+
// Create safe JSON string for command data
|
|
277
|
+
var cmdJson = escapeHtml(JSON.stringify(cmd));
|
|
278
|
+
|
|
274
279
|
return `
|
|
275
|
-
<div class="bg-background border border-border rounded-lg p-4 hover:border-primary transition-
|
|
280
|
+
<div class="command-card cursor-pointer bg-background border border-border rounded-lg p-4 hover:border-primary transition-all hover:shadow-md"
|
|
281
|
+
data-command='${cmdJson}'
|
|
282
|
+
title="Click to view details">
|
|
276
283
|
<div class="flex items-start justify-between mb-2">
|
|
277
284
|
<div class="flex-1">
|
|
278
285
|
<div class="flex items-center gap-2 mb-1">
|
|
@@ -281,6 +288,7 @@ function renderCommandCard(cmd) {
|
|
|
281
288
|
</div>
|
|
282
289
|
<p class="text-sm text-muted-foreground">${escapeHtml(cmd.description)}</p>
|
|
283
290
|
</div>
|
|
291
|
+
<i data-lucide="arrow-right" class="w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity ml-2"></i>
|
|
284
292
|
</div>
|
|
285
293
|
${cmd.arguments ? `
|
|
286
294
|
<div class="mt-2 text-xs">
|
|
@@ -854,3 +862,417 @@ function renderCodexLensQuickStart() {
|
|
|
854
862
|
container.innerHTML = html;
|
|
855
863
|
if (typeof lucide !== 'undefined') lucide.createIcons();
|
|
856
864
|
}
|
|
865
|
+
|
|
866
|
+
// ========== Command Detail Modal ==========
|
|
867
|
+
function showCommandDetailModal(cmd) {
|
|
868
|
+
var modal = document.createElement('div');
|
|
869
|
+
modal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4';
|
|
870
|
+
modal.id = 'commandDetailModal';
|
|
871
|
+
|
|
872
|
+
var difficultyColor = {
|
|
873
|
+
'Beginner': 'bg-success/10 text-success',
|
|
874
|
+
'Intermediate': 'bg-warning/10 text-warning',
|
|
875
|
+
'Advanced': 'bg-error/10 text-error'
|
|
876
|
+
}[cmd.difficulty] || 'bg-muted/10 text-muted-foreground';
|
|
877
|
+
|
|
878
|
+
var sourceLink = cmd.source ? cmd.source.replace(/\.\.\/..\/..\//g, '') : '';
|
|
879
|
+
|
|
880
|
+
var html = `
|
|
881
|
+
<div class="bg-card border border-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col">
|
|
882
|
+
<!-- Header -->
|
|
883
|
+
<div class="sticky top-0 bg-card border-b border-border px-6 py-4 flex items-start justify-between">
|
|
884
|
+
<div class="flex-1">
|
|
885
|
+
<div class="flex items-center gap-2 mb-2">
|
|
886
|
+
<code class="text-lg font-mono text-primary font-bold">${escapeHtml(cmd.command)}</code>
|
|
887
|
+
<span class="text-xs px-3 py-1 rounded-full ${difficultyColor} font-medium">${escapeHtml(cmd.difficulty || 'Intermediate')}</span>
|
|
888
|
+
</div>
|
|
889
|
+
<p class="text-sm text-muted-foreground">${escapeHtml(cmd.category || 'general')}${cmd.subcategory ? ' / ' + escapeHtml(cmd.subcategory) : ''}</p>
|
|
890
|
+
</div>
|
|
891
|
+
<button class="close-modal text-muted-foreground hover:text-foreground transition-colors" title="Close">
|
|
892
|
+
<i data-lucide="x" class="w-6 h-6"></i>
|
|
893
|
+
</button>
|
|
894
|
+
</div>
|
|
895
|
+
|
|
896
|
+
<!-- Content - Tabs -->
|
|
897
|
+
<div class="border-b border-border flex">
|
|
898
|
+
<button class="detail-tab active px-4 py-3 text-sm font-medium transition-colors border-b-2 border-primary" data-tab="overview">
|
|
899
|
+
Overview
|
|
900
|
+
</button>
|
|
901
|
+
${cmd.source ? `
|
|
902
|
+
<button class="detail-tab px-4 py-3 text-sm font-medium transition-colors border-b-2 border-transparent text-muted-foreground hover:text-foreground" data-tab="document">
|
|
903
|
+
<i data-lucide="file-text" class="w-4 h-4 inline-block mr-1"></i>
|
|
904
|
+
Full Document
|
|
905
|
+
</button>
|
|
906
|
+
` : ''}
|
|
907
|
+
</div>
|
|
908
|
+
|
|
909
|
+
<!-- Tab Content -->
|
|
910
|
+
<div class="flex-1 overflow-y-auto">
|
|
911
|
+
<!-- Overview Tab -->
|
|
912
|
+
<div id="overview-tab" class="detail-tab-content p-6 space-y-6 active">
|
|
913
|
+
<!-- Description -->
|
|
914
|
+
<div>
|
|
915
|
+
<h3 class="text-sm font-semibold text-foreground mb-2">Description</h3>
|
|
916
|
+
<p class="text-sm text-muted-foreground leading-relaxed">${escapeHtml(cmd.description || 'No description available')}</p>
|
|
917
|
+
</div>
|
|
918
|
+
|
|
919
|
+
<!-- Usage Scenario -->
|
|
920
|
+
${cmd.usage_scenario ? `
|
|
921
|
+
<div>
|
|
922
|
+
<h3 class="text-sm font-semibold text-foreground mb-2">Use Case</h3>
|
|
923
|
+
<p class="text-sm text-muted-foreground">${escapeHtml(cmd.usage_scenario)}</p>
|
|
924
|
+
</div>
|
|
925
|
+
` : ''}
|
|
926
|
+
|
|
927
|
+
<!-- Arguments -->
|
|
928
|
+
${cmd.arguments ? `
|
|
929
|
+
<div>
|
|
930
|
+
<h3 class="text-sm font-semibold text-foreground mb-2">Arguments</h3>
|
|
931
|
+
<div class="bg-background rounded-lg p-3 border border-border">
|
|
932
|
+
<code class="text-xs font-mono text-foreground">${escapeHtml(cmd.arguments)}</code>
|
|
933
|
+
</div>
|
|
934
|
+
</div>
|
|
935
|
+
` : ''}
|
|
936
|
+
|
|
937
|
+
<!-- Flow Information -->
|
|
938
|
+
${cmd.flow ? `
|
|
939
|
+
<div>
|
|
940
|
+
<h3 class="text-sm font-semibold text-foreground mb-3">Workflow</h3>
|
|
941
|
+
<div class="space-y-2">
|
|
942
|
+
${cmd.flow.prerequisites ? `
|
|
943
|
+
<div class="text-xs">
|
|
944
|
+
<span class="text-muted-foreground">Prerequisites:</span>
|
|
945
|
+
<div class="mt-1 space-y-1">
|
|
946
|
+
${cmd.flow.prerequisites.map(p => `
|
|
947
|
+
<div class="inline-block px-2 py-1 bg-primary/10 text-primary rounded text-xs mr-2">
|
|
948
|
+
${escapeHtml(p)}
|
|
949
|
+
</div>
|
|
950
|
+
`).join('')}
|
|
951
|
+
</div>
|
|
952
|
+
</div>
|
|
953
|
+
` : ''}
|
|
954
|
+
|
|
955
|
+
${cmd.flow.next_steps ? `
|
|
956
|
+
<div class="text-xs">
|
|
957
|
+
<span class="text-muted-foreground">Next Steps:</span>
|
|
958
|
+
<div class="mt-1 space-y-1">
|
|
959
|
+
${cmd.flow.next_steps.map(n => `
|
|
960
|
+
<div class="inline-block px-2 py-1 bg-success/10 text-success rounded text-xs mr-2">
|
|
961
|
+
${escapeHtml(n)}
|
|
962
|
+
</div>
|
|
963
|
+
`).join('')}
|
|
964
|
+
</div>
|
|
965
|
+
</div>
|
|
966
|
+
` : ''}
|
|
967
|
+
|
|
968
|
+
${cmd.flow.alternatives ? `
|
|
969
|
+
<div class="text-xs">
|
|
970
|
+
<span class="text-muted-foreground">Alternatives:</span>
|
|
971
|
+
<div class="mt-1 space-y-1">
|
|
972
|
+
${cmd.flow.alternatives.map(a => `
|
|
973
|
+
<div class="inline-block px-2 py-1 bg-warning/10 text-warning rounded text-xs mr-2">
|
|
974
|
+
${escapeHtml(a)}
|
|
975
|
+
</div>
|
|
976
|
+
`).join('')}
|
|
977
|
+
</div>
|
|
978
|
+
</div>
|
|
979
|
+
` : ''}
|
|
980
|
+
</div>
|
|
981
|
+
</div>
|
|
982
|
+
` : ''}
|
|
983
|
+
|
|
984
|
+
<!-- Source -->
|
|
985
|
+
${sourceLink ? `
|
|
986
|
+
<div>
|
|
987
|
+
<h3 class="text-sm font-semibold text-foreground mb-2">Source File</h3>
|
|
988
|
+
<div class="text-xs text-muted-foreground font-mono break-all">${escapeHtml(sourceLink)}</div>
|
|
989
|
+
</div>
|
|
990
|
+
` : ''}
|
|
991
|
+
</div>
|
|
992
|
+
|
|
993
|
+
<!-- Document Tab -->
|
|
994
|
+
${cmd.source ? `
|
|
995
|
+
<div id="document-tab" class="detail-tab-content p-6">
|
|
996
|
+
<div class="bg-background border border-border rounded-lg p-4">
|
|
997
|
+
<div id="document-loader" class="flex items-center justify-center py-8">
|
|
998
|
+
<i data-lucide="loader-2" class="w-5 h-5 animate-spin text-primary mr-2"></i>
|
|
999
|
+
<span class="text-sm text-muted-foreground">Loading document...</span>
|
|
1000
|
+
</div>
|
|
1001
|
+
<div id="document-content" class="hidden prose prose-invert max-w-none text-sm">
|
|
1002
|
+
<!-- Markdown content will be loaded here -->
|
|
1003
|
+
</div>
|
|
1004
|
+
<div id="document-error" class="hidden text-sm text-error">
|
|
1005
|
+
Failed to load document
|
|
1006
|
+
</div>
|
|
1007
|
+
</div>
|
|
1008
|
+
</div>
|
|
1009
|
+
` : ''}
|
|
1010
|
+
</div>
|
|
1011
|
+
|
|
1012
|
+
<!-- Footer -->
|
|
1013
|
+
<div class="border-t border-border px-6 py-3 flex gap-2 justify-end bg-background rounded-b-lg">
|
|
1014
|
+
<button class="close-modal px-4 py-2 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg transition-colors">
|
|
1015
|
+
Close
|
|
1016
|
+
</button>
|
|
1017
|
+
</div>
|
|
1018
|
+
</div>
|
|
1019
|
+
`;
|
|
1020
|
+
|
|
1021
|
+
modal.innerHTML = html;
|
|
1022
|
+
document.body.appendChild(modal);
|
|
1023
|
+
|
|
1024
|
+
// Initialize tab switching
|
|
1025
|
+
var tabButtons = modal.querySelectorAll('.detail-tab');
|
|
1026
|
+
tabButtons.forEach(function(btn) {
|
|
1027
|
+
btn.addEventListener('click', function() {
|
|
1028
|
+
var tabName = this.getAttribute('data-tab');
|
|
1029
|
+
|
|
1030
|
+
// Update active tab button
|
|
1031
|
+
tabButtons.forEach(function(b) {
|
|
1032
|
+
b.classList.remove('active', 'border-primary', 'text-foreground');
|
|
1033
|
+
b.classList.add('border-transparent', 'text-muted-foreground');
|
|
1034
|
+
});
|
|
1035
|
+
this.classList.add('active', 'border-primary', 'text-foreground');
|
|
1036
|
+
this.classList.remove('border-transparent', 'text-muted-foreground');
|
|
1037
|
+
|
|
1038
|
+
// Show/hide tab content
|
|
1039
|
+
var tabContents = modal.querySelectorAll('.detail-tab-content');
|
|
1040
|
+
tabContents.forEach(function(content) {
|
|
1041
|
+
content.classList.remove('active');
|
|
1042
|
+
});
|
|
1043
|
+
var activeTab = modal.querySelector('#' + tabName + '-tab');
|
|
1044
|
+
if (activeTab) {
|
|
1045
|
+
activeTab.classList.add('active');
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
// Load document content if needed
|
|
1049
|
+
if (tabName === 'document' && cmd.source) {
|
|
1050
|
+
loadCommandDocument(modal, cmd.source);
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
});
|
|
1054
|
+
|
|
1055
|
+
// Close handlers
|
|
1056
|
+
var closeButtons = modal.querySelectorAll('.close-modal');
|
|
1057
|
+
closeButtons.forEach(function(btn) {
|
|
1058
|
+
btn.addEventListener('click', function() {
|
|
1059
|
+
modal.remove();
|
|
1060
|
+
});
|
|
1061
|
+
});
|
|
1062
|
+
|
|
1063
|
+
// Close on background click
|
|
1064
|
+
modal.addEventListener('click', function(e) {
|
|
1065
|
+
if (e.target === modal) {
|
|
1066
|
+
modal.remove();
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
|
|
1070
|
+
// Close on Escape key
|
|
1071
|
+
var closeOnEscape = function(e) {
|
|
1072
|
+
if (e.key === 'Escape') {
|
|
1073
|
+
modal.remove();
|
|
1074
|
+
document.removeEventListener('keydown', closeOnEscape);
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
document.addEventListener('keydown', closeOnEscape);
|
|
1078
|
+
|
|
1079
|
+
if (typeof lucide !== 'undefined') lucide.createIcons();
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
// ========== Load Command Document ==========
|
|
1083
|
+
function loadCommandDocument(modal, sourcePath) {
|
|
1084
|
+
var contentDiv = modal.querySelector('#document-content');
|
|
1085
|
+
var loaderDiv = modal.querySelector('#document-loader');
|
|
1086
|
+
var errorDiv = modal.querySelector('#document-error');
|
|
1087
|
+
|
|
1088
|
+
// Check if already loaded
|
|
1089
|
+
if (contentDiv && !contentDiv.classList.contains('hidden')) {
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
// Start loading
|
|
1094
|
+
if (loaderDiv) loaderDiv.classList.remove('hidden');
|
|
1095
|
+
if (errorDiv) errorDiv.classList.add('hidden');
|
|
1096
|
+
if (contentDiv) contentDiv.classList.add('hidden');
|
|
1097
|
+
|
|
1098
|
+
// Fetch document content
|
|
1099
|
+
fetch('/api/help/command-content?source=' + encodeURIComponent(sourcePath))
|
|
1100
|
+
.then(function(response) {
|
|
1101
|
+
if (!response.ok) {
|
|
1102
|
+
throw new Error('HTTP ' + response.status + ': ' + response.statusText);
|
|
1103
|
+
}
|
|
1104
|
+
return response.text();
|
|
1105
|
+
})
|
|
1106
|
+
.then(function(markdown) {
|
|
1107
|
+
// Parse markdown to HTML
|
|
1108
|
+
try {
|
|
1109
|
+
var html = parseMarkdown(markdown);
|
|
1110
|
+
if (!html) {
|
|
1111
|
+
throw new Error('parseMarkdown returned empty result');
|
|
1112
|
+
}
|
|
1113
|
+
} catch (parseError) {
|
|
1114
|
+
console.error('[Help] parseMarkdown failed:', parseError.message, parseError.stack);
|
|
1115
|
+
throw parseError;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
if (contentDiv) {
|
|
1119
|
+
contentDiv.innerHTML = html;
|
|
1120
|
+
contentDiv.classList.remove('hidden');
|
|
1121
|
+
}
|
|
1122
|
+
if (loaderDiv) loaderDiv.classList.add('hidden');
|
|
1123
|
+
|
|
1124
|
+
if (typeof lucide !== 'undefined') lucide.createIcons();
|
|
1125
|
+
})
|
|
1126
|
+
.catch(function(error) {
|
|
1127
|
+
console.error('[Help] Failed to load document:', error.message || error);
|
|
1128
|
+
if (contentDiv) contentDiv.classList.add('hidden');
|
|
1129
|
+
if (loaderDiv) loaderDiv.classList.add('hidden');
|
|
1130
|
+
if (errorDiv) {
|
|
1131
|
+
errorDiv.textContent = 'Failed to load document: ' + (error.message || 'Unknown error');
|
|
1132
|
+
errorDiv.classList.remove('hidden');
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
// ========== Markdown Parser (Simple) ==========
|
|
1138
|
+
function parseMarkdown(markdown) {
|
|
1139
|
+
// Remove frontmatter
|
|
1140
|
+
var lines = markdown.split('\n');
|
|
1141
|
+
var startIdx = 0;
|
|
1142
|
+
if (lines[0] === '---') {
|
|
1143
|
+
for (var i = 1; i < lines.length; i++) {
|
|
1144
|
+
if (lines[i] === '---') {
|
|
1145
|
+
startIdx = i + 1;
|
|
1146
|
+
break;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
var content = lines.slice(startIdx).join('\n').trim();
|
|
1152
|
+
|
|
1153
|
+
var html = '';
|
|
1154
|
+
var currentList = null;
|
|
1155
|
+
var inCodeBlock = false;
|
|
1156
|
+
var codeBlockContent = '';
|
|
1157
|
+
var codeBlockLang = '';
|
|
1158
|
+
|
|
1159
|
+
lines = content.split('\n');
|
|
1160
|
+
|
|
1161
|
+
for (var i = 0; i < lines.length; i++) {
|
|
1162
|
+
var line = lines[i];
|
|
1163
|
+
|
|
1164
|
+
// Code blocks
|
|
1165
|
+
if (line.startsWith('```')) {
|
|
1166
|
+
if (!inCodeBlock) {
|
|
1167
|
+
inCodeBlock = true;
|
|
1168
|
+
codeBlockLang = line.substring(3).trim();
|
|
1169
|
+
codeBlockContent = '';
|
|
1170
|
+
} else {
|
|
1171
|
+
inCodeBlock = false;
|
|
1172
|
+
var langClass = codeBlockLang ? ' language-' + escapeHtml(codeBlockLang) : '';
|
|
1173
|
+
html += '<pre class="bg-background border border-border rounded-lg p-4 overflow-x-auto my-3"><code class="text-xs font-mono text-foreground' + langClass + '">' +
|
|
1174
|
+
escapeHtml(codeBlockContent).replace(/\n/g, '<br>') + '</code></pre>';
|
|
1175
|
+
}
|
|
1176
|
+
continue;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
if (inCodeBlock) {
|
|
1180
|
+
codeBlockContent += line + '\n';
|
|
1181
|
+
continue;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
// Headings
|
|
1185
|
+
if (line.startsWith('# ')) {
|
|
1186
|
+
html += '<h1 class="text-2xl font-bold text-foreground mt-6 mb-3">' + escapeHtml(line.substring(2)) + '</h1>';
|
|
1187
|
+
continue;
|
|
1188
|
+
}
|
|
1189
|
+
if (line.startsWith('## ')) {
|
|
1190
|
+
html += '<h2 class="text-xl font-bold text-foreground mt-5 mb-2">' + escapeHtml(line.substring(3)) + '</h2>';
|
|
1191
|
+
continue;
|
|
1192
|
+
}
|
|
1193
|
+
if (line.startsWith('### ')) {
|
|
1194
|
+
html += '<h3 class="text-lg font-semibold text-foreground mt-4 mb-2">' + escapeHtml(line.substring(4)) + '</h3>';
|
|
1195
|
+
continue;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
// Lists
|
|
1199
|
+
if (line.match(/^[\s]*[-*+]\s/)) {
|
|
1200
|
+
var listContent = line.replace(/^[\s]*[-*+]\s/, '');
|
|
1201
|
+
if (currentList !== 'ul') {
|
|
1202
|
+
if (currentList === 'ol') html += '</ol>';
|
|
1203
|
+
html += '<ul class="list-disc list-inside text-sm text-muted-foreground space-y-1 my-2">';
|
|
1204
|
+
currentList = 'ul';
|
|
1205
|
+
}
|
|
1206
|
+
html += '<li>' + escapeHtml(listContent) + '</li>';
|
|
1207
|
+
continue;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
if (line.match(/^[\s]*\d+\.\s/)) {
|
|
1211
|
+
var listContent = line.replace(/^[\s]*\d+\.\s/, '');
|
|
1212
|
+
if (currentList !== 'ol') {
|
|
1213
|
+
if (currentList === 'ul') html += '</ul>';
|
|
1214
|
+
html += '<ol class="list-decimal list-inside text-sm text-muted-foreground space-y-1 my-2">';
|
|
1215
|
+
currentList = 'ol';
|
|
1216
|
+
}
|
|
1217
|
+
html += '<li>' + escapeHtml(listContent) + '</li>';
|
|
1218
|
+
continue;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
// Close list if we encounter non-list content
|
|
1222
|
+
if (line.trim() && (currentList === 'ul' || currentList === 'ol')) {
|
|
1223
|
+
html += currentList === 'ul' ? '</ul>' : '</ol>';
|
|
1224
|
+
currentList = null;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
// Paragraphs
|
|
1228
|
+
if (line.trim()) {
|
|
1229
|
+
// Convert inline formatting
|
|
1230
|
+
var formatted = line
|
|
1231
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong class="font-semibold text-foreground">$1</strong>')
|
|
1232
|
+
.replace(/\*([^*]+)\*/g, '<em class="italic">$1</em>')
|
|
1233
|
+
.replace(/`([^`]+)`/g, '<code class="bg-background px-1 rounded text-xs font-mono text-primary">$1</code>')
|
|
1234
|
+
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" class="text-primary hover:underline">$1</a>');
|
|
1235
|
+
|
|
1236
|
+
html += '<p class="text-sm text-muted-foreground leading-relaxed my-2">' + formatted + '</p>';
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
// Close any open lists
|
|
1241
|
+
if (currentList === 'ul') html += '</ul>';
|
|
1242
|
+
if (currentList === 'ol') html += '</ol>';
|
|
1243
|
+
|
|
1244
|
+
return html;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
// ========== Command Card Click Handlers ==========
|
|
1248
|
+
function initializeCommandCardHandlers() {
|
|
1249
|
+
var cards = document.querySelectorAll('.command-card');
|
|
1250
|
+
cards.forEach(function(card) {
|
|
1251
|
+
card.addEventListener('click', function(e) {
|
|
1252
|
+
e.preventDefault();
|
|
1253
|
+
var cmdJson = this.getAttribute('data-command');
|
|
1254
|
+
if (cmdJson) {
|
|
1255
|
+
try {
|
|
1256
|
+
var cmd = JSON.parse(unescapeHtml(cmdJson));
|
|
1257
|
+
showCommandDetailModal(cmd);
|
|
1258
|
+
} catch (err) {
|
|
1259
|
+
console.error('Failed to parse command data:', err);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
// Helper function to unescape HTML
|
|
1267
|
+
function unescapeHtml(html) {
|
|
1268
|
+
var map = {
|
|
1269
|
+
'&': '&',
|
|
1270
|
+
'<': '<',
|
|
1271
|
+
'>': '>',
|
|
1272
|
+
'"': '"',
|
|
1273
|
+
''': "'"
|
|
1274
|
+
};
|
|
1275
|
+
return html.replace(/&(?:amp|lt|gt|quot|#039);/g, function(match) {
|
|
1276
|
+
return map[match];
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
@@ -795,7 +795,7 @@ async function executeCliTool(
|
|
|
795
795
|
const effectiveModel = model || getPrimaryModel(workingDir, tool);
|
|
796
796
|
|
|
797
797
|
// Build command
|
|
798
|
-
const { command, args, useStdin } = buildCommand({
|
|
798
|
+
const { command, args, useStdin, outputFormat: autoDetectedFormat } = buildCommand({
|
|
799
799
|
tool,
|
|
800
800
|
prompt: finalPrompt,
|
|
801
801
|
mode,
|
|
@@ -806,8 +806,11 @@ async function executeCliTool(
|
|
|
806
806
|
reviewOptions: mode === 'review' ? { uncommitted, base, commit, title } : undefined
|
|
807
807
|
});
|
|
808
808
|
|
|
809
|
+
// Use auto-detected format (from buildCommand) if available, otherwise use passed outputFormat
|
|
810
|
+
const finalOutputFormat = autoDetectedFormat || outputFormat;
|
|
811
|
+
|
|
809
812
|
// Create output parser and IR storage
|
|
810
|
-
const parser = createOutputParser(
|
|
813
|
+
const parser = createOutputParser(finalOutputFormat);
|
|
811
814
|
const allOutputUnits: CliOutputUnit[] = [];
|
|
812
815
|
|
|
813
816
|
const startTime = Date.now();
|
|
@@ -820,7 +823,7 @@ async function executeCliTool(
|
|
|
820
823
|
promptLength: finalPrompt.length,
|
|
821
824
|
hasResume: !!resume,
|
|
822
825
|
hasCustomId: !!customId,
|
|
823
|
-
outputFormat
|
|
826
|
+
outputFormat: finalOutputFormat
|
|
824
827
|
});
|
|
825
828
|
|
|
826
829
|
return new Promise((resolve, reject) => {
|
|
@@ -166,7 +166,7 @@ export function buildCommand(params: {
|
|
|
166
166
|
commit?: string;
|
|
167
167
|
title?: string;
|
|
168
168
|
};
|
|
169
|
-
}): { command: string; args: string[]; useStdin: boolean } {
|
|
169
|
+
}): { command: string; args: string[]; useStdin: boolean; outputFormat?: 'text' | 'json-lines' } {
|
|
170
170
|
const { tool, prompt, mode = 'analysis', model, dir, include, nativeResume, settingsFile, reviewOptions } = params;
|
|
171
171
|
|
|
172
172
|
debugLog('BUILD_CMD', `Building command for tool: ${tool}`, {
|
|
@@ -254,6 +254,8 @@ export function buildCommand(params: {
|
|
|
254
254
|
// codex review uses -c key=value for config override, not -m
|
|
255
255
|
args.push('-c', `model=${model}`);
|
|
256
256
|
}
|
|
257
|
+
// Skip git repo check by default for codex (allows non-git directories)
|
|
258
|
+
args.push('--skip-git-repo-check');
|
|
257
259
|
// codex review uses positional prompt argument, not stdin
|
|
258
260
|
useStdin = false;
|
|
259
261
|
if (prompt) {
|
|
@@ -280,6 +282,8 @@ export function buildCommand(params: {
|
|
|
280
282
|
args.push('--add-dir', addDir);
|
|
281
283
|
}
|
|
282
284
|
}
|
|
285
|
+
// Skip git repo check by default for codex (allows non-git directories)
|
|
286
|
+
args.push('--skip-git-repo-check');
|
|
283
287
|
// Enable JSON output for structured parsing
|
|
284
288
|
args.push('--json');
|
|
285
289
|
// codex resume uses positional prompt argument, not stdin
|
|
@@ -302,6 +306,8 @@ export function buildCommand(params: {
|
|
|
302
306
|
args.push('--add-dir', addDir);
|
|
303
307
|
}
|
|
304
308
|
}
|
|
309
|
+
// Skip git repo check by default for codex (allows non-git directories)
|
|
310
|
+
args.push('--skip-git-repo-check');
|
|
305
311
|
// Enable JSON output for structured parsing
|
|
306
312
|
args.push('--json');
|
|
307
313
|
args.push('-');
|
|
@@ -381,5 +387,8 @@ export function buildCommand(params: {
|
|
|
381
387
|
fullCommand: `${command} ${args.join(' ')}${useStdin ? ' (stdin)' : ''}`,
|
|
382
388
|
});
|
|
383
389
|
|
|
384
|
-
|
|
390
|
+
// Auto-detect output format: Codex uses --json flag for JSONL output
|
|
391
|
+
const outputFormat = tool.toLowerCase() === 'codex' ? 'json-lines' : 'text';
|
|
392
|
+
|
|
393
|
+
return { command, args, useStdin, outputFormat };
|
|
385
394
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-workflow",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.52",
|
|
4
4
|
"description": "JSON-driven multi-agent development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "ccw/src/index.js",
|