You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RFC: Decouple /workflow from Claude Code, cross-platform parallel workflow implementation based on native CAT architecture
Summary
The original design of /workflow in Issue #2 heavily relies on Claude Code exclusive run_in_background sub-agent API, restricting this large-scale parallel multi-agent capability to environments with Claude Code extension installed. Combined with the cross-platform parallel task verification data from Issue #3, this RFC delivers a complete technical design to implement full-featured /workflow without binding to any proprietary platform interface.
The core idea: Reuse all upper-layer native CAT modules including /discuss staff planning system, standardized PLAN-*.md task specification, unified workspace archiving mechanism. Only add a cross-platform agent scheduler abstraction layer at the bottom execution layer, take Cursor native Background Task / multitask as the core parallel execution carrier, and retain all original /workflow user experience, constraint rules and archive logic.
The initial workflow scheme proposed in #2 uses Claude Code exclusive background sub-agent as the only underlying runtime:
Only available when the user installs Claude Code extension;
Pure stock Cursor IDE environment cannot activate /workflow, splitting CAT's functional experience;
The whole feature is bound to a single LLM plugin, lacking long-term architecture scalability.
1.2 Sufficient verified alternative capabilities
Issue #3 finished comprehensive parallel execution tests on 3 carriers: Claude Code Agent, TRAE SOLO Task, Cursor IDE native Task. Key verified conclusions:
Cursor built-in multitask / Background Task can provide fully isolated sub-agent context, independent runtime, asynchronous result aggregation, same as Claude Code sub-agent;
Independent task read-only scanning, multi-branch Git audit, full directory traversal and other core workflow scenarios run stably under Cursor native task;
Sub-task logs can be separated and stored, only summary data is aggregated to the main session, avoiding main context bloat.
1.3 Core value to retain
All business logic of the original /workflow remains unchanged, including:
Equal peer executor status with /crew;
Driven entirely by standardized PLAN-*.md documents;
Main agent supervision, autonomous block resolution within task scope;
Offline unattended batch delivery support;
Full traceable execution records stored under ai_workspace.
2. Overall Technical Architecture Adjustment
CAT three-layer core architecture remains untouched, only inject a cross-platform scheduling abstraction layer between PLAN parsing layer and underlying platform execution API.
PLAN marking syntax unchanged: Executor: workflow at global or single-stage level
Archive specification unchanged: All runtime records, task IDs, subtask logs uniformly stored in ai_workspace theme directory, full two-way traceability
3.2 Core capability equivalence implementation on pure Cursor
All original Claude sub-agent features replaced by Cursor native capability:
Original Claude Code exclusive feature
Equivalent Cursor native implementation
Isolated background sub-agent context
Cursor Background Task independent runtime
Batch parallel subtask execution
Single-round batch multitask task group scheduling
Asynchronous block notification to main session
Task pause callback alert mechanism
Offline unattended batch run
Cursor background persistent task process
Separate storage of subtask detailed logs
Independent subfolder under ai_workspace for each subtask
3.3 Automatic downgrade compatibility logic
For old low-version Cursor without Background Task capability:
/workflow will not throw runtime error;
Automatically downgrade to serial batch task execution;
Add warning prompt in output: Parallel acceleration unavailable under current IDE version.
3.4 File & Code Modification Scope (Low workload)
New file: src/scheduler/agent_scheduler.py unified cross-platform scheduler
Minor modification: PLAN parser module, inject scheduler instead of direct platform API call
Minor modification: /workflow command entry, forward all requests to unified scheduler
No modification: /discuss planning module, /crew serial executor, full archive system, workspace storage logic
4. Scene Adaptation & Execution Split Rules
Consistent with the definition in Issue #2, two equal executors still exist after refactoring:
/crew serial executor
Applicable: Multi-stage dependent modification tasks, release, paper revision, scenarios requiring strict process control
Cross-platform /workflow parallel executor
Applicable: Full warehouse scan, multi-Git-branch comparison, batch document audit, mass independent read-only subtasks, offline batch delivery
Constraint supplement: All subtasks launched by /workflow are limited to read-only reconnaissance by default. Any file bulk write, code refactor, multi-stage dependent modification tasks are forced to switch to /crew to guarantee execution determinism.
5. Advantages After Decoupling Refactor
Platform neutrality: /workflow becomes native general CAT capability, no longer limited to users with Claude Code installed, expanding full user coverage
Architecture scalability: Adding new runtime platforms only requires adding a branch in AgentScheduler, zero changes to planning & archive upper layers
Zero user migration cost: PLAN syntax, command names, output format, archive structure fully consistent with original design
Retain all core innovations of CAT: Separation of staff planning layer and execution layer, standardized persistent PLAN file, traceable task records
Lower usage threshold: Cursor native multitask does not require handwritten JS workflow scripts; subtask splitting auto-generated from PLAN document
6. Undecided Discussion Items (To be confirmed in review)
Naming: Keep /workflow as official command, retain /ultra as optional alias
Auto conversion script: Whether to provide plan_to_workflow.py to convert PLAN stages into platform task batch definitions
Mandatory marking rule: Whether PLAN must explicitly write Executor: workflow to enable parallel mode
Offline delivery standard: Complete PLAN integrity requirements to allow user exit after submission
Log storage strategy: Unified separate subtask log directory under ai_workspace
RFC: Decouple
/workflowfrom Claude Code, cross-platform parallel workflow implementation based on native CAT architectureSummary
The original design of
/workflowin Issue #2 heavily relies on Claude Code exclusiverun_in_backgroundsub-agent API, restricting this large-scale parallel multi-agent capability to environments with Claude Code extension installed. Combined with the cross-platform parallel task verification data from Issue #3, this RFC delivers a complete technical design to implement full-featured/workflowwithout binding to any proprietary platform interface.The core idea: Reuse all upper-layer native CAT modules including
/discussstaff planning system, standardizedPLAN-*.mdtask specification, unified workspace archiving mechanism. Only add a cross-platform agent scheduler abstraction layer at the bottom execution layer, take Cursor native Background Task /multitaskas the core parallel execution carrier, and retain all original/workflowuser experience, constraint rules and archive logic.Related Issues:
/workflowcapability RFC: [RFC] Peer executors under CAT:/crewvs Claude Code Dynamic Workflows (/workflowor/ultra) #21. Background & Existing Pain Points
1.1 Defect of the original tied design
The initial workflow scheme proposed in #2 uses Claude Code exclusive background sub-agent as the only underlying runtime:
/workflow, splitting CAT's functional experience;1.2 Sufficient verified alternative capabilities
Issue #3 finished comprehensive parallel execution tests on 3 carriers: Claude Code Agent, TRAE SOLO Task, Cursor IDE native Task. Key verified conclusions:
multitask/ Background Task can provide fully isolated sub-agent context, independent runtime, asynchronous result aggregation, same as Claude Code sub-agent;1.3 Core value to retain
All business logic of the original
/workflowremains unchanged, including:/crew;PLAN-*.mddocuments;ai_workspace.2. Overall Technical Architecture Adjustment
CAT three-layer core architecture remains untouched, only inject a cross-platform scheduling abstraction layer between PLAN parsing layer and underlying platform execution API.
2.1 Original CAT Hierarchy (Unchanged)
/discusscommand, generate standardized PLAN task fileExecutor: crew / workflowtag from PLAN, split subtasks2.2 New Abstraction Layer:
AgentSchedulerUnified Scheduling ModuleSingle unified entry for all parallel task requests, with automatic environment detection branch logic:
run_in_backgroundsub-agent logic (compatible with old usage)multitaskbatch background task as parallel carrierExpose identical calling parameters to upper PLAN parsing module, upper code zero modification, no user syntax change.
Uniformly implement core workflow rules at scheduler layer, regardless of underlying platform:
/crewserial executor3. Detailed Implementation Design
3.1 Zero modification for upper user layer
/workflow(alias/ultra) keep consistent with original RFC [RFC] Peer executors under CAT:/crewvs Claude Code Dynamic Workflows (/workflowor/ultra) #2Executor: workflowat global or single-stage levelai_workspacetheme directory, full two-way traceability3.2 Core capability equivalence implementation on pure Cursor
All original Claude sub-agent features replaced by Cursor native capability:
multitasktask group schedulingai_workspacefor each subtask3.3 Automatic downgrade compatibility logic
For old low-version Cursor without Background Task capability:
/workflowwill not throw runtime error;3.4 File & Code Modification Scope (Low workload)
src/scheduler/agent_scheduler.pyunified cross-platform scheduler/workflowcommand entry, forward all requests to unified scheduler/discussplanning module,/crewserial executor, full archive system, workspace storage logic4. Scene Adaptation & Execution Split Rules
Consistent with the definition in Issue #2, two equal executors still exist after refactoring:
/crewserial executorApplicable: Multi-stage dependent modification tasks, release, paper revision, scenarios requiring strict process control
/workflowparallel executorApplicable: Full warehouse scan, multi-Git-branch comparison, batch document audit, mass independent read-only subtasks, offline batch delivery
Constraint supplement: All subtasks launched by
/workfloware limited to read-only reconnaissance by default. Any file bulk write, code refactor, multi-stage dependent modification tasks are forced to switch to/crewto guarantee execution determinism.5. Advantages After Decoupling Refactor
/workflowbecomes native general CAT capability, no longer limited to users with Claude Code installed, expanding full user coverageAgentScheduler, zero changes to planning & archive upper layersmultitaskdoes not require handwritten JS workflow scripts; subtask splitting auto-generated from PLAN document6. Undecided Discussion Items (To be confirmed in review)
/workflowas official command, retain/ultraas optional aliasplan_to_workflow.pyto convert PLAN stages into platform task batch definitionsExecutor: workflowto enable parallel modeai_workspace7. Acceptance Standard for Merge
/workflowcan launch multiple parallel isolated subtasks, complete audit & directory scan test cases from Issue Capability Test: Parallel Background Sub-Agent Execution #3/crewvs Claude Code Dynamic Workflows (/workflowor/ultra) #2