mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
feat: enhance MCP server management and system settings
- Added functionality to save MCP server configurations as templates in the MCP Manager. - Implemented new hooks for managing system settings including Chinese response, Windows platform, and Codex CLI enhancements. - Updated API calls to support fetching and toggling system settings. - Introduced UI components for displaying and managing response language settings and system status. - Enhanced error handling and notifications for server deletion and template saving actions. - Updated localization files for new settings and descriptions in English and Chinese.
This commit is contained in:
@@ -1,44 +1,40 @@
|
||||
---
|
||||
name: workflow-lite-plan-execute
|
||||
description: Unified lightweight planning skill with mode selection (Lite Plan, Multi-CLI Plan, Lite Fix). Supports exploration, diagnosis, multi-CLI collaboration, and shared execution via lite-execute.
|
||||
description: Lightweight planning and execution skill. Exploration → Clarification → Planning → Confirmation → Execution via lite-execute.
|
||||
allowed-tools: spawn_agent, wait, send_input, close_agent, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep, mcp__ace-tool__search_context
|
||||
---
|
||||
|
||||
# Planning Workflow
|
||||
|
||||
Unified lightweight planning skill that consolidates multiple planning approaches into a single entry point with mode selection. Default mode: **Lite Plan**. All planning modes share a common execution phase (lite-execute).
|
||||
Lightweight planning skill: Lite Plan produces an implementation plan, then hands off to Lite Execute for task execution.
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────┐
|
||||
│ Planning Workflow Orchestrator (SKILL.md) │
|
||||
│ → Parse args → Mode selection → Load phase → Execute │
|
||||
└────────────┬─────────────────────────────────────────────┘
|
||||
│ Mode Selection (default: Lite Plan)
|
||||
┌────────┼────────┬──────────┐
|
||||
↓ ↓ ↓ ↓ (shared)
|
||||
┌────────┐ ┌────────┐ ┌────────┐ ┌────────────┐
|
||||
│Phase 1 │ │Phase 2 │ │Phase 3 │ │ Phase 4 │
|
||||
│ Lite │ │Multi- │ │ Lite │ │ Lite │
|
||||
│ Plan │ │CLI Plan│ │ Fix │ │ Execute │
|
||||
└────────┘ └────────┘ └────────┘ └────────────┘
|
||||
│ │ │ ↑
|
||||
└──────────┴──────────┴───────────┘
|
||||
(all hand off to Phase 4)
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ Planning Workflow Orchestrator (SKILL.md) │
|
||||
│ → Parse args → Lite Plan → Lite Execute │
|
||||
└────────────┬─────────────────────────────────────┘
|
||||
│
|
||||
┌────────┴────────┐
|
||||
↓ ↓
|
||||
┌────────┐ ┌────────────┐
|
||||
│Phase 1 │────→│ Phase 4 │
|
||||
│ Lite │ │ Lite │
|
||||
│ Plan │ │ Execute │
|
||||
└────────┘ └────────────┘
|
||||
```
|
||||
|
||||
## Key Design Principles
|
||||
|
||||
1. **Mode Selection First**: User chooses planning approach before any work begins
|
||||
2. **Shared Execution**: All planning modes produce `executionContext` consumed by Phase 4 (lite-execute)
|
||||
3. **Progressive Phase Loading**: Only load the selected planning phase + execution phase
|
||||
4. **Auto-Continue**: Planning phase completes → automatically loads execution phase
|
||||
5. **Default Lite Plan**: When no mode specified, use Lite Plan (most common)
|
||||
1. **Shared Execution**: Lite Plan produces `executionContext` consumed by Phase 4 (lite-execute)
|
||||
2. **Progressive Phase Loading**: Only load phase docs when about to execute
|
||||
3. **Auto-Continue**: Planning completes → automatically loads execution phase
|
||||
4. **Default Auto Mode**: When `--yes`, skip confirmations and auto-approve plan
|
||||
|
||||
## Auto Mode
|
||||
|
||||
When `--yes` or `-y`: Skip mode selection (use default or flag-specified mode), auto-approve plan, skip clarifications.
|
||||
When `--yes` or `-y`: Auto-approve plan, skip clarifications, use default execution settings.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -47,17 +43,13 @@ Skill(skill="workflow-lite-plan-execute", args="<task description>")
|
||||
Skill(skill="workflow-lite-plan-execute", args="[FLAGS] \"<task description>\"")
|
||||
|
||||
# Flags
|
||||
--mode lite-plan|multi-cli|lite-fix Planning mode selection (default: lite-plan)
|
||||
-y, --yes Skip all confirmations (auto mode)
|
||||
-e, --explore Force exploration (lite-plan only)
|
||||
--hotfix Fast hotfix mode (lite-fix only)
|
||||
-e, --explore Force exploration phase
|
||||
|
||||
# Examples
|
||||
Skill(skill="workflow-lite-plan-execute", args="\"Implement JWT authentication\"") # Default: lite-plan
|
||||
Skill(skill="workflow-lite-plan-execute", args="--mode multi-cli \"Refactor payment module\"") # Multi-CLI planning
|
||||
Skill(skill="workflow-lite-plan-execute", args="--mode lite-fix \"Login fails with 500 error\"") # Bug fix mode
|
||||
Skill(skill="workflow-lite-plan-execute", args="-y \"Add user profile page\"") # Auto mode
|
||||
Skill(skill="workflow-lite-plan-execute", args="--mode lite-fix --hotfix \"Production DB timeout\"") # Hotfix mode
|
||||
Skill(skill="workflow-lite-plan-execute", args="\"Implement JWT authentication\"")
|
||||
Skill(skill="workflow-lite-plan-execute", args="-y \"Add user profile page\"")
|
||||
Skill(skill="workflow-lite-plan-execute", args="-e \"Refactor payment module\"")
|
||||
```
|
||||
|
||||
## Subagent API Reference
|
||||
@@ -129,30 +121,15 @@ close_agent({ id: agentId })
|
||||
|
||||
```
|
||||
Input Parsing:
|
||||
├─ Extract flags: --mode, --yes, --explore, --hotfix
|
||||
├─ Extract flags: --yes, --explore
|
||||
└─ Extract task description (string or file path)
|
||||
|
||||
Mode Selection:
|
||||
└─ Decision:
|
||||
├─ --mode lite-plan (or no --mode flag) → Read phases/01-lite-plan.md
|
||||
├─ --mode multi-cli → Read phases/02-multi-cli-plan.md
|
||||
├─ --mode lite-fix → Read phases/03-lite-fix.md
|
||||
└─ No flag + not --yes → AskUserQuestion (default: Lite Plan)
|
||||
Planning Phase:
|
||||
└─ Phase 1: Lite Plan
|
||||
└─ Ref: phases/01-lite-plan.md
|
||||
└─ Output: executionContext (plan.json + explorations + selections)
|
||||
|
||||
Planning Phase (one of):
|
||||
├─ Phase 1: Lite Plan
|
||||
│ └─ Ref: phases/01-lite-plan.md
|
||||
│ └─ Output: executionContext (plan.json + explorations + selections)
|
||||
│
|
||||
├─ Phase 2: Multi-CLI Plan
|
||||
│ └─ Ref: phases/02-multi-cli-plan.md
|
||||
│ └─ Output: executionContext (plan.json + synthesis rounds + selections)
|
||||
│
|
||||
└─ Phase 3: Lite Fix
|
||||
└─ Ref: phases/03-lite-fix.md
|
||||
└─ Output: executionContext (fix-plan.json + diagnoses + selections)
|
||||
|
||||
Execution Phase (always):
|
||||
Execution Phase:
|
||||
└─ Phase 4: Lite Execute
|
||||
└─ Ref: phases/04-lite-execute.md
|
||||
└─ Input: executionContext from planning phase
|
||||
@@ -164,64 +141,33 @@ Execution Phase (always):
|
||||
| Phase | Document | Purpose |
|
||||
|-------|----------|---------|
|
||||
| 1 | [phases/01-lite-plan.md](phases/01-lite-plan.md) | Lightweight planning with exploration, clarification, and plan generation |
|
||||
| 2 | [phases/02-multi-cli-plan.md](phases/02-multi-cli-plan.md) | Multi-CLI collaborative planning with ACE context and cross-verification |
|
||||
| 3 | [phases/03-lite-fix.md](phases/03-lite-fix.md) | Bug diagnosis and fix planning with severity-based workflow |
|
||||
| 4 | [phases/04-lite-execute.md](phases/04-lite-execute.md) | Shared execution engine: task grouping, batch execution, code review |
|
||||
|
||||
## Mode Selection Logic
|
||||
## Orchestrator Logic
|
||||
|
||||
```javascript
|
||||
// Flag parsing
|
||||
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
|
||||
const modeFlag = extractFlag($ARGUMENTS, '--mode') // 'lite-plan' | 'multi-cli' | 'lite-fix' | null
|
||||
const forceExplore = $ARGUMENTS.includes('--explore') || $ARGUMENTS.includes('-e')
|
||||
const taskDescription = extractTaskDescription($ARGUMENTS)
|
||||
|
||||
// Mode determination
|
||||
let selectedMode
|
||||
|
||||
if (modeFlag) {
|
||||
// Explicit mode flag
|
||||
selectedMode = modeFlag
|
||||
} else if (autoYes) {
|
||||
// Auto mode: default to lite-plan
|
||||
selectedMode = 'lite-plan'
|
||||
} else {
|
||||
// Interactive: ask user
|
||||
const selection = AskUserQuestion({
|
||||
questions: [{
|
||||
question: "Select planning approach:",
|
||||
header: "Mode",
|
||||
multiSelect: false,
|
||||
options: [
|
||||
{ label: "Lite Plan (Recommended)", description: "Lightweight planning with exploration and clarification" },
|
||||
{ label: "Multi-CLI Plan", description: "Multi-model collaborative planning (Gemini + Codex + Claude)" },
|
||||
{ label: "Lite Fix", description: "Bug diagnosis and fix planning with severity assessment" }
|
||||
]
|
||||
}]
|
||||
})
|
||||
selectedMode = parseSelection(selection) // Map to 'lite-plan' | 'multi-cli' | 'lite-fix'
|
||||
}
|
||||
|
||||
// Load phase document
|
||||
const phaseDoc = {
|
||||
'lite-plan': 'phases/01-lite-plan.md',
|
||||
'multi-cli': 'phases/02-multi-cli-plan.md',
|
||||
'lite-fix': 'phases/03-lite-fix.md'
|
||||
}[selectedMode]
|
||||
|
||||
Read(phaseDoc) // Load selected planning phase
|
||||
// Phase 1: Lite Plan
|
||||
Read('phases/01-lite-plan.md')
|
||||
// Execute planning phase...
|
||||
|
||||
// After planning completes:
|
||||
Read('phases/04-lite-execute.md') // Load execution phase
|
||||
Read('phases/04-lite-execute.md')
|
||||
// Execute execution phase with executionContext from Phase 1
|
||||
```
|
||||
|
||||
## Data Flow
|
||||
|
||||
```
|
||||
Planning Phase (01/02/03)
|
||||
Phase 1: Lite Plan
|
||||
│
|
||||
├─ Produces: executionContext = {
|
||||
│ planObject: plan.json or fix-plan.json,
|
||||
│ explorationsContext / diagnosisContext / synthesis rounds,
|
||||
│ planObject: plan.json,
|
||||
│ explorationsContext,
|
||||
│ clarificationContext,
|
||||
│ executionMethod: "Agent" | "Codex" | "Auto",
|
||||
│ codeReviewTool: "Skip" | "Gemini Review" | ...,
|
||||
@@ -230,7 +176,7 @@ Planning Phase (01/02/03)
|
||||
│ }
|
||||
│
|
||||
↓
|
||||
Execution Phase (04)
|
||||
Phase 4: Lite Execute
|
||||
│
|
||||
├─ Consumes: executionContext
|
||||
├─ Task grouping → Batch creation → Parallel/sequential execution
|
||||
@@ -240,10 +186,10 @@ Execution Phase (04)
|
||||
|
||||
## TodoWrite Pattern
|
||||
|
||||
**Initialization** (after mode selection):
|
||||
**Initialization**:
|
||||
```json
|
||||
[
|
||||
{"content": "Mode: {selectedMode} - Planning", "status": "in_progress", "activeForm": "Planning ({selectedMode})"},
|
||||
{"content": "Lite Plan - Planning", "status": "in_progress", "activeForm": "Planning"},
|
||||
{"content": "Execution (Phase 4)", "status": "pending", "activeForm": "Executing tasks"}
|
||||
]
|
||||
```
|
||||
@@ -251,7 +197,7 @@ Execution Phase (04)
|
||||
**After planning completes**:
|
||||
```json
|
||||
[
|
||||
{"content": "Mode: {selectedMode} - Planning", "status": "completed", "activeForm": "Planning ({selectedMode})"},
|
||||
{"content": "Lite Plan - Planning", "status": "completed", "activeForm": "Planning"},
|
||||
{"content": "Execution (Phase 4)", "status": "in_progress", "activeForm": "Executing tasks"}
|
||||
]
|
||||
```
|
||||
@@ -260,20 +206,17 @@ Phase-internal sub-tasks are managed by each phase document (attach/collapse pat
|
||||
|
||||
## Core Rules
|
||||
|
||||
1. **Planning phases NEVER execute code** - all execution delegated to Phase 4
|
||||
2. **Only ONE planning phase runs** per invocation (Phase 1, 2, or 3)
|
||||
3. **Phase 4 ALWAYS runs** after planning completes
|
||||
4. **executionContext is the contract** between planning and execution phases
|
||||
5. **Progressive loading**: Read phase doc ONLY when about to execute
|
||||
6. **No cross-phase loading**: Don't load Phase 2 if user selected Phase 1
|
||||
7. **Explicit Lifecycle**: Always close_agent after wait completes to free resources
|
||||
1. **Planning phase NEVER executes code** - all execution delegated to Phase 4
|
||||
2. **Phase 4 ALWAYS runs** after planning completes
|
||||
3. **executionContext is the contract** between planning and execution phases
|
||||
4. **Progressive loading**: Read phase doc ONLY when about to execute
|
||||
5. **Explicit Lifecycle**: Always close_agent after wait completes to free resources
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Error | Resolution |
|
||||
|-------|------------|
|
||||
| Unknown --mode value | Default to lite-plan with warning |
|
||||
| Planning phase failure | Display error, offer retry or mode switch |
|
||||
| Planning phase failure | Display error, offer retry |
|
||||
| executionContext missing | Error: planning phase did not produce context |
|
||||
| Phase file not found | Error with file path for debugging |
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: workflow-test-fix-cycle
|
||||
description: End-to-end test-fix workflow: generate test sessions with progressive layers (L0-L3), then execute iterative fix cycles until pass rate >= 95%. Combines test-fix-gen and test-cycle-execute into a unified pipeline. Triggers on "workflow:test-fix-cycle".
|
||||
description: End-to-end test-fix workflow generate test sessions with progressive layers (L0-L3), then execute iterative fix cycles until pass rate >= 95%. Combines test-fix-gen and test-cycle-execute into a unified pipeline. Triggers on "workflow:test-fix-cycle".
|
||||
allowed-tools: spawn_agent, wait, send_input, close_agent, AskUserQuestion, Read, Write, Edit, Bash, Glob, Grep
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user