mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-01 14:23:54 +08:00
Refactor and optimize various components and files
- Removed deprecated `ccw-contentPattern-optimization-summary.md` and related files. - Updated `A2UIPopupCard.tsx` to clarify comments on interaction handling. - Enhanced `QueueListColumn.tsx` and `QueuePanel.tsx` to handle potential undefined values for `config`. - Added `useEffect` in `QueuePanel.tsx` to load scheduler state on mount. - Improved `SchedulerPanel.tsx` to handle potential undefined values for `sessionPool`. - Introduced auto-initialization logic in `queueSchedulerStore.ts` to prevent multiple initialization calls. - Updated `A2UIWebSocketHandler.ts` to refine selection handling logic. - Enhanced `hooks-routes.ts` to support multi-question surfaces. - Added submit and cancel buttons in `ask-question.ts` for better user interaction. - Deleted `codex_prompt.md` and `contentPattern-library-options.md` as part of cleanup. - Removed `status-reference.md` to streamline documentation.
This commit is contained in:
@@ -154,6 +154,27 @@ Write `<session-folder>/task-analysis.json`:
|
||||
}
|
||||
```
|
||||
|
||||
## Complexity Interpretation
|
||||
|
||||
**CRITICAL**: Complexity score is for **role design optimization**, NOT for skipping team workflow.
|
||||
|
||||
| Complexity | Team Structure | Coordinator Action |
|
||||
|------------|----------------|-------------------|
|
||||
| Low (1-2 roles) | Minimal team | Generate 1-2 role-specs, create team, spawn workers |
|
||||
| Medium (2-3 roles) | Standard team | Generate role-specs, create team, spawn workers |
|
||||
| High (3-5 roles) | Full team | Generate role-specs, create team, spawn workers |
|
||||
|
||||
**All complexity levels use team-worker architecture**:
|
||||
- Single-role tasks still spawn team-worker agent
|
||||
- Coordinator NEVER executes task work directly
|
||||
- Team infrastructure provides session management, message bus, fast-advance
|
||||
|
||||
**Purpose of complexity score**:
|
||||
- ✅ Determine optimal role count (merge vs separate)
|
||||
- ✅ Guide dependency graph design
|
||||
- ✅ Inform user about task scope
|
||||
- ❌ NOT for deciding whether to use team workflow
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
@@ -161,4 +182,4 @@ Write `<session-folder>/task-analysis.json`:
|
||||
| No capabilities detected | Default to single `general` role with TASK prefix |
|
||||
| Circular dependency in graph | Break cycle at lowest-tier edge, warn |
|
||||
| Task description too vague | Return minimal analysis, coordinator will AskUserQuestion |
|
||||
| All capabilities merge into one | Valid -- single-role execution, no team overhead |
|
||||
| All capabilities merge into one | Valid -- single-role execution via team-worker |
|
||||
|
||||
@@ -33,6 +33,27 @@ Orchestrate the team-coordinate workflow: task analysis, dynamic role-spec gener
|
||||
|
||||
---
|
||||
|
||||
## Command Execution Protocol
|
||||
|
||||
When coordinator needs to execute a command (analyze-task, dispatch, monitor):
|
||||
|
||||
1. **Read the command file**: `roles/coordinator/commands/<command-name>.md`
|
||||
2. **Follow the workflow** defined in the command file (Phase 2-4 structure)
|
||||
3. **Commands are inline execution guides** - NOT separate agents or subprocesses
|
||||
4. **Execute synchronously** - complete the command workflow before proceeding
|
||||
|
||||
Example:
|
||||
```
|
||||
Phase 1 needs task analysis
|
||||
-> Read roles/coordinator/commands/analyze-task.md
|
||||
-> Execute Phase 2 (Context Loading)
|
||||
-> Execute Phase 3 (Task Analysis)
|
||||
-> Execute Phase 4 (Output)
|
||||
-> Continue to Phase 2
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Entry Router
|
||||
|
||||
When coordinator is invoked, first detect the invocation type:
|
||||
@@ -44,10 +65,24 @@ When coordinator is invoked, first detect the invocation type:
|
||||
| Manual resume | Arguments contain "resume" or "continue" | -> handleResume |
|
||||
| Capability gap | Message contains "capability_gap" | -> handleAdapt |
|
||||
| Pipeline complete | All tasks completed, no pending/in_progress | -> handleComplete |
|
||||
| New session | None of above | -> Phase 0 |
|
||||
| Interrupted session | Active/paused session exists in `.workflow/.team/TC-*` | -> Phase 0 (Resume Check) |
|
||||
| New session | None of above | -> Phase 1 (Task Analysis) |
|
||||
|
||||
For callback/check/resume/adapt/complete: load `commands/monitor.md` and execute the appropriate handler, then STOP.
|
||||
|
||||
### Router Implementation
|
||||
|
||||
1. **Load session context** (if exists):
|
||||
- Scan `.workflow/.team/TC-*/team-session.json` for active/paused sessions
|
||||
- If found, extract `session.roles[].name` for callback detection
|
||||
|
||||
2. **Parse $ARGUMENTS** for detection keywords
|
||||
|
||||
3. **Route to handler**:
|
||||
- For monitor handlers: Read `commands/monitor.md`, execute matched handler section, STOP
|
||||
- For Phase 0: Execute Session Resume Check below
|
||||
- For Phase 1: Execute Task Analysis below
|
||||
|
||||
---
|
||||
|
||||
## Phase 0: Session Resume Check
|
||||
@@ -103,6 +138,21 @@ For callback/check/resume/adapt/complete: load `commands/monitor.md` and execute
|
||||
|
||||
**Success**: Task analyzed, capabilities detected, dependency graph built, roles designed with role-spec metadata.
|
||||
|
||||
**CRITICAL - Team Workflow Enforcement**:
|
||||
|
||||
Regardless of complexity score or role count, coordinator MUST:
|
||||
- ✅ **Always proceed to Phase 2** (generate role-specs)
|
||||
- ✅ **Always create team** and spawn workers via team-worker agent
|
||||
- ❌ **NEVER execute task work directly**, even for single-role low-complexity tasks
|
||||
- ❌ **NEVER skip team workflow** based on complexity assessment
|
||||
|
||||
**Single-role execution is still team-based** - just with one worker. The team architecture provides:
|
||||
- Consistent message bus communication
|
||||
- Session state management
|
||||
- Artifact tracking
|
||||
- Fast-advance capability
|
||||
- Resume/recovery mechanisms
|
||||
|
||||
---
|
||||
|
||||
## Phase 2: Generate Role-Specs + Initialize Session
|
||||
|
||||
Reference in New Issue
Block a user