claude-code-workflow 6.3.46 → 6.3.48
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/ccw-coordinator.md +144 -238
- package/README.md +43 -0
- package/codex-lens/README.md +59 -0
- package/codex-lens/pyproject.toml +1 -1
- package/package.json +1 -1
|
@@ -401,17 +401,19 @@ async function executeCommandChain(chain, analysis) {
|
|
|
401
401
|
state.updated_at = new Date().toISOString();
|
|
402
402
|
Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
|
|
403
403
|
|
|
404
|
-
// Assemble prompt
|
|
405
|
-
let
|
|
404
|
+
// Assemble prompt: Command first, then context
|
|
405
|
+
let promptContent = formatCommand(cmd, state.execution_results, analysis);
|
|
406
|
+
|
|
407
|
+
// Build full prompt: Command → Task → Previous Results
|
|
408
|
+
let prompt = `${promptContent}\n\nTask: ${analysis.goal}`;
|
|
406
409
|
if (state.execution_results.length > 0) {
|
|
407
|
-
prompt += '\nPrevious results:\n';
|
|
410
|
+
prompt += '\n\nPrevious results:\n';
|
|
408
411
|
state.execution_results.forEach(r => {
|
|
409
412
|
if (r.session_id) {
|
|
410
413
|
prompt += `- ${r.command}: ${r.session_id} (${r.artifacts?.join(', ') || 'completed'})\n`;
|
|
411
414
|
}
|
|
412
415
|
});
|
|
413
416
|
}
|
|
414
|
-
prompt += `\n${formatCommand(cmd, state.execution_results, analysis)}\n`;
|
|
415
417
|
|
|
416
418
|
// Record prompt used
|
|
417
419
|
state.prompts_used.push({
|
|
@@ -421,9 +423,12 @@ async function executeCommandChain(chain, analysis) {
|
|
|
421
423
|
});
|
|
422
424
|
|
|
423
425
|
// Execute CLI command in background and stop
|
|
426
|
+
// Format: ccw cli -p "PROMPT" --tool <tool> --mode <mode>
|
|
427
|
+
// Note: -y is a command parameter INSIDE the prompt, not a ccw cli parameter
|
|
428
|
+
// Example prompt: "/workflow:plan -y \"task description here\""
|
|
424
429
|
try {
|
|
425
430
|
const taskId = Bash(
|
|
426
|
-
`ccw cli -p "${escapePrompt(prompt)}" --tool claude --mode write
|
|
431
|
+
`ccw cli -p "${escapePrompt(prompt)}" --tool claude --mode write`,
|
|
427
432
|
{ run_in_background: true }
|
|
428
433
|
).task_id;
|
|
429
434
|
|
|
@@ -486,69 +491,71 @@ async function executeCommandChain(chain, analysis) {
|
|
|
486
491
|
}
|
|
487
492
|
|
|
488
493
|
// Smart parameter assembly
|
|
494
|
+
// Returns prompt content to be used with: ccw cli -p "RETURNED_VALUE" --tool claude --mode write
|
|
489
495
|
function formatCommand(cmd, previousResults, analysis) {
|
|
490
|
-
|
|
496
|
+
// Format: /workflow:<command> -y <parameters>
|
|
497
|
+
let prompt = `/workflow:${cmd.name} -y`;
|
|
491
498
|
const name = cmd.name;
|
|
492
499
|
|
|
493
500
|
// Planning commands - take task description
|
|
494
501
|
if (['lite-plan', 'plan', 'tdd-plan', 'multi-cli-plan'].includes(name)) {
|
|
495
|
-
|
|
502
|
+
prompt += ` "${analysis.goal}"`;
|
|
496
503
|
|
|
497
504
|
// Lite execution - use --in-memory if plan exists
|
|
498
505
|
} else if (name === 'lite-execute') {
|
|
499
506
|
const hasPlan = previousResults.some(r => r.command.includes('plan'));
|
|
500
|
-
|
|
507
|
+
prompt += hasPlan ? ' --in-memory' : ` "${analysis.goal}"`;
|
|
501
508
|
|
|
502
509
|
// Standard execution - resume from planning session
|
|
503
510
|
} else if (name === 'execute') {
|
|
504
511
|
const plan = previousResults.find(r => r.command.includes('plan'));
|
|
505
|
-
if (plan?.session_id)
|
|
512
|
+
if (plan?.session_id) prompt += ` --resume-session="${plan.session_id}"`;
|
|
506
513
|
|
|
507
514
|
// Bug fix commands - take bug description
|
|
508
515
|
} else if (['lite-fix', 'debug'].includes(name)) {
|
|
509
|
-
|
|
516
|
+
prompt += ` "${analysis.goal}"`;
|
|
510
517
|
|
|
511
518
|
// Brainstorm - take topic description
|
|
512
519
|
} else if (name === 'brainstorm:auto-parallel' || name === 'auto-parallel') {
|
|
513
|
-
|
|
520
|
+
prompt += ` "${analysis.goal}"`;
|
|
514
521
|
|
|
515
522
|
// Test generation from session - needs source session
|
|
516
523
|
} else if (name === 'test-gen') {
|
|
517
524
|
const impl = previousResults.find(r =>
|
|
518
525
|
r.command.includes('execute') || r.command.includes('lite-execute')
|
|
519
526
|
);
|
|
520
|
-
if (impl?.session_id)
|
|
521
|
-
else
|
|
527
|
+
if (impl?.session_id) prompt += ` "${impl.session_id}"`;
|
|
528
|
+
else prompt += ` "${analysis.goal}"`;
|
|
522
529
|
|
|
523
530
|
// Test fix generation - session or description
|
|
524
531
|
} else if (name === 'test-fix-gen') {
|
|
525
532
|
const latest = previousResults.filter(r => r.session_id).pop();
|
|
526
|
-
if (latest?.session_id)
|
|
527
|
-
else
|
|
533
|
+
if (latest?.session_id) prompt += ` "${latest.session_id}"`;
|
|
534
|
+
else prompt += ` "${analysis.goal}"`;
|
|
528
535
|
|
|
529
536
|
// Review commands - take session or use latest
|
|
530
537
|
} else if (name === 'review') {
|
|
531
538
|
const latest = previousResults.filter(r => r.session_id).pop();
|
|
532
|
-
if (latest?.session_id)
|
|
539
|
+
if (latest?.session_id) prompt += ` --session="${latest.session_id}"`;
|
|
533
540
|
|
|
534
541
|
// Review fix - takes session from review
|
|
535
542
|
} else if (name === 'review-fix') {
|
|
536
543
|
const review = previousResults.find(r => r.command.includes('review'));
|
|
537
544
|
const latest = review || previousResults.filter(r => r.session_id).pop();
|
|
538
|
-
if (latest?.session_id)
|
|
545
|
+
if (latest?.session_id) prompt += ` --session="${latest.session_id}"`;
|
|
539
546
|
|
|
540
547
|
// TDD verify - takes execution session
|
|
541
548
|
} else if (name === 'tdd-verify') {
|
|
542
549
|
const exec = previousResults.find(r => r.command.includes('execute'));
|
|
543
|
-
if (exec?.session_id)
|
|
550
|
+
if (exec?.session_id) prompt += ` --session="${exec.session_id}"`;
|
|
544
551
|
|
|
545
552
|
// Session-based commands (test-cycle, review-session, plan-verify)
|
|
546
553
|
} else if (name.includes('test') || name.includes('review') || name.includes('verify')) {
|
|
547
554
|
const latest = previousResults.filter(r => r.session_id).pop();
|
|
548
|
-
if (latest?.session_id)
|
|
555
|
+
if (latest?.session_id) prompt += ` --session="${latest.session_id}"`;
|
|
549
556
|
}
|
|
550
557
|
|
|
551
|
-
return
|
|
558
|
+
return prompt;
|
|
552
559
|
}
|
|
553
560
|
|
|
554
561
|
// Hook callback: Called when background CLI completes
|
|
@@ -663,12 +670,12 @@ function parseOutput(output) {
|
|
|
663
670
|
{
|
|
664
671
|
"index": 0,
|
|
665
672
|
"command": "/workflow:plan",
|
|
666
|
-
"prompt": "
|
|
673
|
+
"prompt": "/workflow:plan -y \"Implement user registration...\"\n\nTask: Implement user registration..."
|
|
667
674
|
},
|
|
668
675
|
{
|
|
669
676
|
"index": 1,
|
|
670
677
|
"command": "/workflow:execute",
|
|
671
|
-
"prompt": "
|
|
678
|
+
"prompt": "/workflow:execute -y --resume-session=\"WFS-plan-20250124\"\n\nTask: Implement user registration\n\nPrevious results:\n- /workflow:plan: WFS-plan-20250124 (IMPL_PLAN.md)"
|
|
672
679
|
}
|
|
673
680
|
]
|
|
674
681
|
}
|
|
@@ -728,226 +735,68 @@ const cmd = registry.getCommand('lite-plan');
|
|
|
728
735
|
// {name, command, description, argumentHint, allowedTools, filePath}
|
|
729
736
|
```
|
|
730
737
|
|
|
731
|
-
##
|
|
738
|
+
## Universal Prompt Template
|
|
732
739
|
|
|
733
|
-
###
|
|
734
|
-
```
|
|
735
|
-
Goal: Add API endpoint for user profile
|
|
736
|
-
Scope: [api]
|
|
737
|
-
Complexity: simple
|
|
738
|
-
Constraints: []
|
|
739
|
-
Task Type: feature
|
|
740
|
-
|
|
741
|
-
Pipeline (with Minimum Execution Units):
|
|
742
|
-
需求 →【lite-plan → lite-execute】→ 代码 →【test-fix-gen → test-cycle-execute】→ 测试通过
|
|
743
|
-
|
|
744
|
-
Chain:
|
|
745
|
-
# Unit 1: Quick Implementation
|
|
746
|
-
1. /workflow:lite-plan --yes "Add API endpoint..."
|
|
747
|
-
2. /workflow:lite-execute --yes --in-memory
|
|
748
|
-
|
|
749
|
-
# Unit 2: Test Validation
|
|
750
|
-
3. /workflow:test-fix-gen --yes --session="WFS-xxx"
|
|
751
|
-
4. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
|
|
752
|
-
```
|
|
740
|
+
### Standard Format
|
|
753
741
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
Goal: Implement OAuth2 authentication system
|
|
757
|
-
Scope: [auth, database, api, frontend]
|
|
758
|
-
Complexity: complex
|
|
759
|
-
Constraints: [no breaking changes]
|
|
760
|
-
Task Type: feature
|
|
761
|
-
|
|
762
|
-
Pipeline (with Minimum Execution Units):
|
|
763
|
-
需求 →【plan → plan-verify】→ 验证计划 → execute → 代码
|
|
764
|
-
→【review-session-cycle → review-fix】→ 修复代码
|
|
765
|
-
→【test-fix-gen → test-cycle-execute】→ 测试通过
|
|
766
|
-
|
|
767
|
-
Chain:
|
|
768
|
-
# Unit 1: Full Planning (plan + plan-verify)
|
|
769
|
-
1. /workflow:plan --yes "Implement OAuth2..."
|
|
770
|
-
2. /workflow:plan-verify --yes --session="WFS-xxx"
|
|
771
|
-
|
|
772
|
-
# Execution phase
|
|
773
|
-
3. /workflow:execute --yes --resume-session="WFS-xxx"
|
|
774
|
-
|
|
775
|
-
# Unit 2: Code Review (review-session-cycle + review-fix)
|
|
776
|
-
4. /workflow:review-session-cycle --yes --session="WFS-xxx"
|
|
777
|
-
5. /workflow:review-fix --yes --session="WFS-xxx"
|
|
778
|
-
|
|
779
|
-
# Unit 3: Test Validation (test-fix-gen + test-cycle-execute)
|
|
780
|
-
6. /workflow:test-fix-gen --yes --session="WFS-xxx"
|
|
781
|
-
7. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
|
|
742
|
+
```bash
|
|
743
|
+
ccw cli -p "PROMPT_CONTENT" --tool <tool> --mode <mode>
|
|
782
744
|
```
|
|
783
745
|
|
|
784
|
-
###
|
|
785
|
-
```
|
|
786
|
-
Goal: Fix login timeout issue
|
|
787
|
-
Scope: [auth]
|
|
788
|
-
Complexity: simple
|
|
789
|
-
Constraints: [urgent]
|
|
790
|
-
Task Type: bugfix
|
|
791
|
-
|
|
792
|
-
Pipeline:
|
|
793
|
-
Bug报告 → lite-fix → 修复代码 → test-fix-gen → 测试任务 → test-cycle-execute → 测试通过
|
|
794
|
-
|
|
795
|
-
Chain:
|
|
796
|
-
1. /workflow:lite-fix --yes "Fix login timeout..."
|
|
797
|
-
2. /workflow:test-fix-gen --yes --session="WFS-xxx"
|
|
798
|
-
3. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
|
|
799
|
-
```
|
|
746
|
+
### Prompt Content Template
|
|
800
747
|
|
|
801
|
-
### Skip Tests
|
|
802
|
-
```
|
|
803
|
-
Goal: Update documentation
|
|
804
|
-
Scope: [docs]
|
|
805
|
-
Complexity: simple
|
|
806
|
-
Constraints: [skip-tests]
|
|
807
|
-
Task Type: feature
|
|
808
|
-
|
|
809
|
-
Pipeline:
|
|
810
|
-
需求 → lite-plan → 计划 → lite-execute → 代码
|
|
811
|
-
|
|
812
|
-
Chain:
|
|
813
|
-
1. /workflow:lite-plan --yes "Update documentation..."
|
|
814
|
-
2. /workflow:lite-execute --yes --in-memory
|
|
815
748
|
```
|
|
749
|
+
/workflow:<command> -y <command_parameters>
|
|
816
750
|
|
|
817
|
-
|
|
818
|
-
```
|
|
819
|
-
Goal: Implement user authentication with test-first approach
|
|
820
|
-
Scope: [auth]
|
|
821
|
-
Complexity: medium
|
|
822
|
-
Constraints: [test-driven]
|
|
823
|
-
Task Type: tdd
|
|
824
|
-
|
|
825
|
-
Pipeline:
|
|
826
|
-
需求 → tdd-plan → TDD任务 → execute → 代码 → tdd-verify → TDD验证通过
|
|
827
|
-
|
|
828
|
-
Chain:
|
|
829
|
-
1. /workflow:tdd-plan --yes "Implement user authentication..."
|
|
830
|
-
2. /workflow:execute --yes --resume-session="WFS-xxx"
|
|
831
|
-
3. /workflow:tdd-verify --yes --session="WFS-xxx"
|
|
832
|
-
```
|
|
751
|
+
Task: <task_description>
|
|
833
752
|
|
|
834
|
-
|
|
753
|
+
<optional_previous_results>
|
|
835
754
|
```
|
|
836
|
-
Goal: Fix memory leak in WebSocket handler
|
|
837
|
-
Scope: [websocket]
|
|
838
|
-
Complexity: medium
|
|
839
|
-
Constraints: [production-issue]
|
|
840
|
-
Task Type: bugfix
|
|
841
755
|
|
|
842
|
-
|
|
843
|
-
Bug报告 → lite-fix → 修复代码 → test-cycle-execute → 测试通过
|
|
756
|
+
### Template Variables
|
|
844
757
|
|
|
845
|
-
|
|
846
|
-
|
|
758
|
+
| Variable | Description | Examples |
|
|
759
|
+
|----------|-------------|----------|
|
|
760
|
+
| `<command>` | Workflow command name | `plan`, `lite-execute`, `test-cycle-execute` |
|
|
761
|
+
| `-y` | Auto-confirm flag (inside prompt) | Always include for automation |
|
|
762
|
+
| `<command_parameters>` | Command-specific parameters | Task description, session ID, flags |
|
|
763
|
+
| `<task_description>` | Brief task description | "Implement user authentication", "Fix memory leak" |
|
|
764
|
+
| `<optional_previous_results>` | Context from previous commands | "Previous results:\n- /workflow:plan: WFS-xxx" |
|
|
847
765
|
|
|
848
|
-
|
|
849
|
-
1. /workflow:lite-fix --yes "Fix memory leak in WebSocket..."
|
|
850
|
-
2. /workflow:test-cycle-execute --yes --session="WFS-xxx"
|
|
766
|
+
### Command Parameter Patterns
|
|
851
767
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
768
|
+
| Command Type | Parameter Pattern | Example |
|
|
769
|
+
|--------------|------------------|---------|
|
|
770
|
+
| **Planning** | `"task description"` | `/workflow:plan -y "Implement OAuth2"` |
|
|
771
|
+
| **Execution (with plan)** | `--resume-session="WFS-xxx"` | `/workflow:execute -y --resume-session="WFS-plan-001"` |
|
|
772
|
+
| **Execution (standalone)** | `--in-memory` or `"task"` | `/workflow:lite-execute -y --in-memory` |
|
|
773
|
+
| **Session-based** | `--session="WFS-xxx"` | `/workflow:test-fix-gen -y --session="WFS-impl-001"` |
|
|
774
|
+
| **Fix/Debug** | `"problem description"` | `/workflow:lite-fix -y "Fix timeout bug"` |
|
|
855
775
|
|
|
856
|
-
###
|
|
857
|
-
```
|
|
858
|
-
Goal: Fix failing authentication tests
|
|
859
|
-
Scope: [auth, tests]
|
|
860
|
-
Complexity: simple
|
|
861
|
-
Constraints: []
|
|
862
|
-
Task Type: test-fix
|
|
863
|
-
|
|
864
|
-
Pipeline:
|
|
865
|
-
失败测试 → test-fix-gen → 测试任务 → test-cycle-execute → 测试通过
|
|
866
|
-
|
|
867
|
-
Chain:
|
|
868
|
-
1. /workflow:test-fix-gen --yes "WFS-auth-impl-001"
|
|
869
|
-
2. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
|
|
870
|
-
```
|
|
776
|
+
### Complete Examples
|
|
871
777
|
|
|
872
|
-
|
|
873
|
-
```
|
|
874
|
-
|
|
875
|
-
Scope: [auth, tests]
|
|
876
|
-
Complexity: medium
|
|
877
|
-
Constraints: []
|
|
878
|
-
Task Type: test-gen
|
|
879
|
-
|
|
880
|
-
Pipeline (with Minimum Execution Units):
|
|
881
|
-
代码/会话 →【test-gen → execute】→ 测试通过
|
|
882
|
-
|
|
883
|
-
Chain:
|
|
884
|
-
# Unit: Test Generation (test-gen + execute)
|
|
885
|
-
1. /workflow:test-gen --yes "WFS-registration-20250124"
|
|
886
|
-
2. /workflow:execute --yes --session="WFS-test-registration"
|
|
887
|
-
|
|
888
|
-
Note: test-gen creates IMPL-001 (test generation) and IMPL-002 (test execution & fix)
|
|
889
|
-
execute runs both tasks - this is a Minimum Execution Unit
|
|
890
|
-
```
|
|
778
|
+
**Planning Command**:
|
|
779
|
+
```bash
|
|
780
|
+
ccw cli -p '/workflow:plan -y "Implement user registration with email validation"
|
|
891
781
|
|
|
892
|
-
|
|
893
|
-
```
|
|
894
|
-
Goal: Code review of payment module
|
|
895
|
-
Scope: [payment]
|
|
896
|
-
Complexity: medium
|
|
897
|
-
Constraints: []
|
|
898
|
-
Task Type: review
|
|
899
|
-
|
|
900
|
-
Pipeline (with Minimum Execution Units):
|
|
901
|
-
代码 →【review-session-cycle → review-fix】→ 修复代码
|
|
902
|
-
→【test-fix-gen → test-cycle-execute】→ 测试通过
|
|
903
|
-
|
|
904
|
-
Chain:
|
|
905
|
-
# Unit 1: Code Review (review-session-cycle + review-fix)
|
|
906
|
-
1. /workflow:review-session-cycle --yes --session="WFS-payment-impl"
|
|
907
|
-
2. /workflow:review-fix --yes --session="WFS-payment-impl"
|
|
908
|
-
|
|
909
|
-
# Unit 2: Test Validation (test-fix-gen + test-cycle-execute)
|
|
910
|
-
3. /workflow:test-fix-gen --yes --session="WFS-payment-impl"
|
|
911
|
-
4. /workflow:test-cycle-execute --yes --session="WFS-test-payment-impl"
|
|
782
|
+
Task: Implement user registration' --tool claude --mode write
|
|
912
783
|
```
|
|
913
784
|
|
|
914
|
-
|
|
915
|
-
```
|
|
916
|
-
|
|
917
|
-
Scope: [notifications, architecture]
|
|
918
|
-
Complexity: complex
|
|
919
|
-
Constraints: []
|
|
920
|
-
Task Type: brainstorm
|
|
921
|
-
|
|
922
|
-
Pipeline:
|
|
923
|
-
探索主题 → brainstorm:auto-parallel → 分析结果 → plan → 详细计划
|
|
924
|
-
→ plan-verify → 验证计划 → execute → 代码 → test-fix-gen → 测试任务 → test-cycle-execute → 测试通过
|
|
925
|
-
|
|
926
|
-
Chain:
|
|
927
|
-
1. /workflow:brainstorm:auto-parallel --yes "Explore solutions for real-time..."
|
|
928
|
-
2. /workflow:plan --yes "Implement chosen notification approach..."
|
|
929
|
-
3. /workflow:plan-verify --yes --session="WFS-xxx"
|
|
930
|
-
4. /workflow:execute --yes --resume-session="WFS-xxx"
|
|
931
|
-
5. /workflow:test-fix-gen --yes --session="WFS-xxx"
|
|
932
|
-
6. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
|
|
933
|
-
```
|
|
785
|
+
**Execution with Context**:
|
|
786
|
+
```bash
|
|
787
|
+
ccw cli -p '/workflow:execute -y --resume-session="WFS-plan-20250124"
|
|
934
788
|
|
|
935
|
-
|
|
789
|
+
Task: Implement user registration
|
|
790
|
+
|
|
791
|
+
Previous results:
|
|
792
|
+
- /workflow:plan: WFS-plan-20250124 (IMPL_PLAN.md)' --tool claude --mode write
|
|
936
793
|
```
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
Pipeline:
|
|
944
|
-
需求 → multi-cli-plan → 对比计划 → lite-execute → 代码 → test-fix-gen → 测试任务 → test-cycle-execute → 测试通过
|
|
945
|
-
|
|
946
|
-
Chain:
|
|
947
|
-
1. /workflow:multi-cli-plan --yes "Compare microservices vs monolith..."
|
|
948
|
-
2. /workflow:lite-execute --yes --in-memory
|
|
949
|
-
3. /workflow:test-fix-gen --yes --session="WFS-xxx"
|
|
950
|
-
4. /workflow:test-cycle-execute --yes --session="WFS-test-xxx"
|
|
794
|
+
|
|
795
|
+
**Standalone Lite Execution**:
|
|
796
|
+
```bash
|
|
797
|
+
ccw cli -p '/workflow:lite-fix -y "Fix login timeout in auth module"
|
|
798
|
+
|
|
799
|
+
Task: Fix login timeout' --tool claude --mode write
|
|
951
800
|
```
|
|
952
801
|
|
|
953
802
|
## Execution Flow
|
|
@@ -983,19 +832,76 @@ async function ccwCoordinator(taskDescription) {
|
|
|
983
832
|
|
|
984
833
|
## CLI Execution Model
|
|
985
834
|
|
|
986
|
-
|
|
835
|
+
### CLI Invocation Format
|
|
836
|
+
|
|
837
|
+
**IMPORTANT**: The `ccw cli` command executes prompts through external tools. The format is:
|
|
838
|
+
|
|
839
|
+
```bash
|
|
840
|
+
ccw cli -p "PROMPT_CONTENT" --tool <tool> --mode <mode>
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
**Parameters**:
|
|
844
|
+
- `-p "PROMPT_CONTENT"`: The prompt content to execute (required)
|
|
845
|
+
- `--tool <tool>`: CLI tool to use (e.g., `claude`, `gemini`, `qwen`)
|
|
846
|
+
- `--mode <mode>`: Execution mode (`analysis` or `write`)
|
|
847
|
+
|
|
848
|
+
**Note**: `-y` is a **command parameter inside the prompt**, NOT a `ccw cli` parameter.
|
|
849
|
+
|
|
850
|
+
### Prompt Assembly
|
|
851
|
+
|
|
852
|
+
The prompt content MUST start with the workflow command, followed by task context:
|
|
853
|
+
|
|
854
|
+
```
|
|
855
|
+
/workflow:<command> -y <parameters>
|
|
856
|
+
|
|
857
|
+
Task: <description>
|
|
858
|
+
|
|
859
|
+
<optional_context>
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
**Examples**:
|
|
863
|
+
```bash
|
|
864
|
+
# Planning command
|
|
865
|
+
ccw cli -p '/workflow:plan -y "Implement user registration feature"
|
|
866
|
+
|
|
867
|
+
Task: Implement user registration' --tool claude --mode write
|
|
868
|
+
|
|
869
|
+
# Execution command (with session reference)
|
|
870
|
+
ccw cli -p '/workflow:execute -y --resume-session="WFS-plan-20250124"
|
|
871
|
+
|
|
872
|
+
Task: Implement user registration
|
|
873
|
+
|
|
874
|
+
Previous results:
|
|
875
|
+
- /workflow:plan: WFS-plan-20250124' --tool claude --mode write
|
|
876
|
+
|
|
877
|
+
# Lite execution (in-memory from previous plan)
|
|
878
|
+
ccw cli -p '/workflow:lite-execute -y --in-memory
|
|
879
|
+
|
|
880
|
+
Task: Implement user registration' --tool claude --mode write
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
### Serial Blocking
|
|
884
|
+
|
|
885
|
+
**CRITICAL**: Commands execute one-by-one. After launching CLI in background:
|
|
886
|
+
1. Orchestrator stops immediately (`break`)
|
|
887
|
+
2. Wait for hook callback - **DO NOT use TaskOutput polling**
|
|
888
|
+
3. Hook callback triggers next command
|
|
889
|
+
|
|
890
|
+
**Prompt Structure**: Command must be first in prompt content
|
|
987
891
|
|
|
988
892
|
```javascript
|
|
989
893
|
// Example: Execute command and stop
|
|
990
|
-
const
|
|
894
|
+
const prompt = '/workflow:plan -y "Implement user authentication"\n\nTask: Implement user auth system';
|
|
895
|
+
const taskId = Bash(`ccw cli -p "${prompt}" --tool claude --mode write`, { run_in_background: true }).task_id;
|
|
991
896
|
state.execution_results.push({ status: 'in-progress', task_id: taskId, ... });
|
|
992
897
|
Write(`${stateDir}/state.json`, JSON.stringify(state, null, 2));
|
|
993
|
-
break; //
|
|
898
|
+
break; // ⚠️ STOP HERE - DO NOT use TaskOutput polling
|
|
994
899
|
|
|
995
|
-
// Hook
|
|
900
|
+
// Hook callback will call handleCliCompletion(sessionId, taskId, output) when done
|
|
996
901
|
// → Updates state → Triggers next command via resumeChainExecution()
|
|
997
902
|
```
|
|
998
903
|
|
|
904
|
+
|
|
999
905
|
## Available Commands
|
|
1000
906
|
|
|
1001
907
|
All from `~/.claude/commands/workflow/`:
|
|
@@ -1023,20 +929,20 @@ All from `~/.claude/commands/workflow/`:
|
|
|
1023
929
|
- **test-gen → execute**: 生成全面的测试套件,execute 执行生成和测试
|
|
1024
930
|
- **test-fix-gen → test-cycle-execute**: 针对特定问题生成修复任务,test-cycle-execute 迭代测试和修复直到通过
|
|
1025
931
|
|
|
1026
|
-
### Task Type Routing (Pipeline
|
|
932
|
+
### Task Type Routing (Pipeline Summary)
|
|
1027
933
|
|
|
1028
934
|
**Note**: `【 】` marks Minimum Execution Units (最小执行单元) - these commands must execute together.
|
|
1029
935
|
|
|
1030
|
-
| Task Type | Pipeline |
|
|
1031
|
-
|
|
1032
|
-
| **feature** (simple) | 需求 →【lite-plan → lite-execute】→ 代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
|
|
1033
|
-
| **feature** (complex) | 需求 →【plan → plan-verify】→
|
|
1034
|
-
| **bugfix** | Bug报告 → lite-fix → 修复代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
|
|
1035
|
-
| **tdd** | 需求 → tdd-plan → TDD任务 → execute → 代码 → tdd-verify
|
|
1036
|
-
| **test-fix** | 失败测试 →【test-fix-gen → test-cycle-execute】→ 测试通过 |
|
|
1037
|
-
| **test-gen** | 代码/会话 →【test-gen → execute】→ 测试通过 |
|
|
1038
|
-
| **review** | 代码 →【review
|
|
1039
|
-
| **brainstorm** | 探索主题 → brainstorm
|
|
1040
|
-
| **multi-cli** | 需求 → multi-cli-plan →
|
|
936
|
+
| Task Type | Pipeline | Minimum Units |
|
|
937
|
+
|-----------|----------|---|
|
|
938
|
+
| **feature** (simple) | 需求 →【lite-plan → lite-execute】→ 代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 | Quick Implementation + Test Validation |
|
|
939
|
+
| **feature** (complex) | 需求 →【plan → plan-verify】→ validate → execute → 代码 → review → fix | Full Planning + Code Review + Testing |
|
|
940
|
+
| **bugfix** | Bug报告 → lite-fix → 修复代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 | Bug Fix + Test Validation |
|
|
941
|
+
| **tdd** | 需求 → tdd-plan → TDD任务 → execute → 代码 → tdd-verify | TDD Planning + Execution |
|
|
942
|
+
| **test-fix** | 失败测试 →【test-fix-gen → test-cycle-execute】→ 测试通过 | Test Validation |
|
|
943
|
+
| **test-gen** | 代码/会话 →【test-gen → execute】→ 测试通过 | Test Generation + Execution |
|
|
944
|
+
| **review** | 代码 →【review-* → review-fix】→ 修复代码 →【test-fix-gen → test-cycle-execute】→ 测试通过 | Code Review + Testing |
|
|
945
|
+
| **brainstorm** | 探索主题 → brainstorm → 分析 →【plan → plan-verify】→ execute → test | Exploration + Planning + Execution |
|
|
946
|
+
| **multi-cli** | 需求 → multi-cli-plan → 对比分析 → lite-execute → test | Multi-Perspective + Testing |
|
|
1041
947
|
|
|
1042
948
|
Use `CommandRegistry.getAllCommandsSummary()` to discover all commands dynamically.
|
package/README.md
CHANGED
|
@@ -263,6 +263,49 @@ Open Dashboard via `ccw view`, manage indexes and execute searches in **CodexLen
|
|
|
263
263
|
|
|
264
264
|
## 💻 CCW CLI Commands
|
|
265
265
|
|
|
266
|
+
### 🌟 Recommended Commands (Main Features)
|
|
267
|
+
|
|
268
|
+
<div align="center">
|
|
269
|
+
<table>
|
|
270
|
+
<tr><th>Command</th><th>Description</th><th>When to Use</th></tr>
|
|
271
|
+
<tr>
|
|
272
|
+
<td><b>/ccw</b></td>
|
|
273
|
+
<td>Auto workflow orchestrator - analyzes intent, selects workflow level, executes command chain in main process</td>
|
|
274
|
+
<td>✅ General tasks, auto workflow selection, quick development</td>
|
|
275
|
+
</tr>
|
|
276
|
+
<tr>
|
|
277
|
+
<td><b>/ccw-coordinator</b></td>
|
|
278
|
+
<td>Smart orchestrator - intelligently recommends command chains, allows manual adjustment, executes via external CLI with state persistence</td>
|
|
279
|
+
<td>🔧 Complex multi-step workflows, customizable chains, resumable sessions</td>
|
|
280
|
+
</tr>
|
|
281
|
+
</table>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
**Quick Examples**:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# /ccw - Auto workflow selection (Main Process)
|
|
288
|
+
/ccw "Add user authentication" # Auto-selects workflow based on intent
|
|
289
|
+
/ccw "Fix memory leak in WebSocket" # Detects bugfix workflow
|
|
290
|
+
/ccw "Implement with TDD" # Routes to TDD workflow
|
|
291
|
+
|
|
292
|
+
# /ccw-coordinator - Manual chain orchestration (External CLI)
|
|
293
|
+
/ccw-coordinator "Implement OAuth2 system" # Analyzes → Recommends chain → User confirms → Executes
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
**Key Differences**:
|
|
297
|
+
|
|
298
|
+
| Aspect | /ccw | /ccw-coordinator |
|
|
299
|
+
|--------|------|------------------|
|
|
300
|
+
| **Execution** | Main process (SlashCommand) | External CLI (background tasks) |
|
|
301
|
+
| **Selection** | Auto intent-based | Smart recommendation + optional adjustment |
|
|
302
|
+
| **State** | TodoWrite tracking | Persistent state.json |
|
|
303
|
+
| **Use Case** | General tasks, quick dev | Complex chains, resumable |
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
### Other CLI Commands
|
|
308
|
+
|
|
266
309
|
```bash
|
|
267
310
|
ccw install # Install workflow files
|
|
268
311
|
ccw view # Open dashboard
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# CodexLens
|
|
2
|
+
|
|
3
|
+
CodexLens is a multi-modal code analysis platform designed to provide comprehensive code understanding and analysis capabilities.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multi-language Support**: Analyze code in Python, JavaScript, TypeScript and more using Tree-sitter parsers
|
|
8
|
+
- **Semantic Search**: Find relevant code snippets using semantic understanding with fastembed and HNSWLIB
|
|
9
|
+
- **Code Parsing**: Advanced code structure parsing with tree-sitter
|
|
10
|
+
- **Flexible Architecture**: Modular design for easy extension and customization
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
### Basic Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install codex-lens
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### With Semantic Search
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install codex-lens[semantic]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### With GPU Acceleration (NVIDIA CUDA)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install codex-lens[semantic-gpu]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### With DirectML (Windows - NVIDIA/AMD/Intel)
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install codex-lens[semantic-directml]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### With All Optional Features
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install codex-lens[full]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
- Python >= 3.10
|
|
47
|
+
- See `pyproject.toml` for detailed dependency list
|
|
48
|
+
|
|
49
|
+
## Development
|
|
50
|
+
|
|
51
|
+
This project uses setuptools for building and packaging.
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT License
|
|
56
|
+
|
|
57
|
+
## Authors
|
|
58
|
+
|
|
59
|
+
CodexLens Contributors
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-workflow",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.48",
|
|
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",
|