mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
refactor: Enforce 10-task limit and file cohesion across workflow system
- Update workflow-architecture.md: Streamline structure, enforce 10-task hard limit - Update workflow plan.md: Add file cohesion rules, similar functionality warnings - Update task breakdown.md: Manual breakdown controls, conflict detection - Update task-core.md: Sync JSON schema with workflow-architecture.md - Establish consistent 10-task maximum across all workflow commands - Add file cohesion enforcement to prevent splitting related files - Replace "Complex" classification with "Over-scope" requiring re-planning 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -102,7 +102,7 @@ For tasks requiring >5 subtasks or spanning >3 modules:
|
||||
|
||||
### 4. Document Generation
|
||||
Create workflow documents with proper linking:
|
||||
- Todo items link to task JSON: `[📋 Details](./.task/impl-XXX.json)`
|
||||
- Todo items link to task JSON: `[📋 Details](./.task/IMPL-XXX.json)`
|
||||
- Completed tasks link to summaries: `[✅ Summary](./.summaries/IMPL-XXX-summary.md)`
|
||||
- Consistent ID schemes (IMPL-XXX, IMPL-XXX.Y, IMPL-XXX.Y.Z)
|
||||
|
||||
|
||||
@@ -37,27 +37,34 @@ You are a code execution specialist focused on implementing high-quality, produc
|
||||
```
|
||||
IF context sufficient for implementation:
|
||||
→ Proceed with execution
|
||||
ELIF context insufficient OR task has analysis marker:
|
||||
→ Check for [MULTI_STEP_ANALYSIS] marker:
|
||||
- Execute comprehensive pre-analysis BEFORE implementation begins
|
||||
- Process each step with specified method (gemini/codex/manual/auto-detected)
|
||||
- Expand brief actions into comprehensive analysis tasks
|
||||
→ Extract patterns and conventions
|
||||
ELIF context insufficient OR task has flow control marker:
|
||||
→ Check for [FLOW_CONTROL] marker:
|
||||
- Execute flow_control.pre_analysis steps sequentially BEFORE implementation
|
||||
- Process each step with command execution and context accumulation
|
||||
- Load dependency summaries and parent task context
|
||||
- Execute CLI tools, scripts, and agent commands as specified
|
||||
- Pass context between steps via [variable_name] references
|
||||
→ Extract patterns and conventions from accumulated context
|
||||
→ Proceed with execution
|
||||
```
|
||||
|
||||
**Pre-Execution Analysis System**:
|
||||
- **[MULTI_STEP_ANALYSIS]**: Mandatory pre-execution analysis flag
|
||||
- **Trigger**: Auto-added when task.pre_analysis is an array (default format)
|
||||
- **Action**: MUST run multi-step pre-analysis first to gather comprehensive context
|
||||
- **Purpose**: Ensures code aligns with existing patterns through comprehensive pre-execution analysis
|
||||
**Flow Control Execution System**:
|
||||
- **[FLOW_CONTROL]**: Mandatory flow control execution flag
|
||||
- **Sequential Processing**: Execute pre_analysis steps in order with context flow
|
||||
- **Variable Accumulation**: Build comprehensive context through step chain
|
||||
- **Error Handling**: Apply per-step error strategies (skip_optional, fail, retry_once, manual_intervention)
|
||||
- **Trigger**: Auto-added when task.flow_control.pre_analysis exists (default format)
|
||||
- **Action**: MUST run flow control steps first to gather comprehensive context
|
||||
- **Purpose**: Ensures code aligns with existing patterns through comprehensive context accumulation
|
||||
|
||||
**Pre-Analysis CLI Usage Standards**:
|
||||
- **Multi-step Processing**: Execute each analysis step sequentially with specified templates
|
||||
- **Method Selection**: Use method specified in each step (gemini/codex/manual/auto-detected)
|
||||
- **CLI Commands**:
|
||||
- **Gemini**: `bash(~/.claude/scripts/gemini-wrapper -p "$(cat template_path) [expanded_action]")`
|
||||
- **Codex**: `bash(codex --full-auto exec "$(cat template_path) [expanded_action]")`
|
||||
**Flow Control Execution Standards**:
|
||||
- **Sequential Step Processing**: Execute flow_control.pre_analysis steps in defined order
|
||||
- **Context Variable Handling**: Process [variable_name] references in commands
|
||||
- **Command Types**:
|
||||
- **CLI Analysis**: Execute gemini/codex commands with context variables
|
||||
- **Dependency Loading**: Read summaries from context.depends_on automatically
|
||||
- **Context Accumulation**: Pass step outputs to subsequent steps via [variable_name]
|
||||
- **Error Handling**: Apply on_error strategies per step (skip_optional, fail, retry_once, manual_intervention)
|
||||
- **Follow Guidelines**: @~/.claude/workflows/intelligent-tools-strategy.md and @~/.claude/workflows/tools-implementation-guide.md
|
||||
|
||||
|
||||
@@ -114,7 +121,7 @@ ELIF context insufficient OR task has analysis marker:
|
||||
```
|
||||
.workflow/WFS-[session-id]/ # (Path provided in session context)
|
||||
├── TODO_LIST.md # Progress tracking document
|
||||
├── .task/impl-*.json # Task definitions (source of truth)
|
||||
├── .task/IMPL-*.json # Task definitions (source of truth)
|
||||
└── .summaries/IMPL-*.md # Task completion summaries
|
||||
```
|
||||
|
||||
@@ -123,12 +130,12 @@ ELIF context insufficient OR task has analysis marker:
|
||||
# Tasks: User Authentication System
|
||||
|
||||
## Task Progress
|
||||
▸ **IMPL-001**: Create auth module → [📋](./.task/impl-001.json)
|
||||
- [x] **IMPL-001.1**: Database schema → [📋](./.task/impl-001.1.json) | [✅](./.summaries/IMPL-001.1.md)
|
||||
- [ ] **IMPL-001.2**: API endpoints → [📋](./.task/impl-001.2.json)
|
||||
▸ **IMPL-001**: Create auth module → [📋](./.task/IMPL-001.json)
|
||||
- [x] **IMPL-001.1**: Database schema → [📋](./.task/IMPL-001.1.json) | [✅](./.summaries/IMPL-001.1.md)
|
||||
- [ ] **IMPL-001.2**: API endpoints → [📋](./.task/IMPL-001.2.json)
|
||||
|
||||
- [ ] **IMPL-002**: Add JWT validation → [📋](./.task/impl-002.json)
|
||||
- [ ] **IMPL-003**: OAuth2 integration → [📋](./.task/impl-003.json)
|
||||
- [ ] **IMPL-002**: Add JWT validation → [📋](./.task/IMPL-002.json)
|
||||
- [ ] **IMPL-003**: OAuth2 integration → [📋](./.task/IMPL-003.json)
|
||||
|
||||
## Status Legend
|
||||
- `▸` = Container task (has subtasks)
|
||||
@@ -141,15 +148,44 @@ ELIF context insufficient OR task has analysis marker:
|
||||
- Use exact paths from session context (e.g., `.workflow/WFS-[session-id]/.summaries/`)
|
||||
- Link summary in TODO_LIST.md using relative path
|
||||
|
||||
**Summary Template**:
|
||||
**Enhanced Summary Template**:
|
||||
```markdown
|
||||
# Task: [Task-ID] [Name]
|
||||
|
||||
## Completed
|
||||
- Files modified: [list]
|
||||
- Tests added: [count]
|
||||
- Key changes: [brief list]
|
||||
|
||||
|
||||
## Implementation Summary
|
||||
|
||||
### Files Modified
|
||||
- `[file-path]`: [brief description of changes]
|
||||
- `[file-path]`: [brief description of changes]
|
||||
|
||||
### Content Added
|
||||
- **[ComponentName]** (`[file-path]`): [purpose/functionality]
|
||||
- **[functionName()]** (`[file:line]`): [purpose/parameters/returns]
|
||||
- **[InterfaceName]** (`[file:line]`): [properties/purpose]
|
||||
- **[CONSTANT_NAME]** (`[file:line]`): [value/purpose]
|
||||
|
||||
## Outputs for Dependent Tasks
|
||||
|
||||
### Available Components
|
||||
```typescript
|
||||
// New components ready for import/use
|
||||
import { ComponentName } from '[import-path]';
|
||||
import { functionName } from '[import-path]';
|
||||
import { InterfaceName } from '[import-path]';
|
||||
```
|
||||
|
||||
### Integration Points
|
||||
- **[Component/Function]**: Use `[import-statement]` to access `[functionality]`
|
||||
- **[API Endpoint]**: `[method] [url]` for `[purpose]`
|
||||
- **[Configuration]**: Set `[config-key]` in `[config-file]` for `[behavior]`
|
||||
|
||||
### Usage Examples
|
||||
```typescript
|
||||
// Basic usage patterns for new components
|
||||
const example = new ComponentName(params);
|
||||
const result = functionName(input);
|
||||
```
|
||||
|
||||
## Status: ✅ Complete
|
||||
```
|
||||
|
||||
@@ -178,6 +214,7 @@ Before completing any task, verify:
|
||||
- [ ] ASCII-only characters (no emojis/Unicode)
|
||||
- [ ] GBK encoding compatible
|
||||
- [ ] TODO list updated
|
||||
- [ ] Comprehensive summary document generated with all new components/methods listed
|
||||
|
||||
## Key Reminders
|
||||
|
||||
@@ -196,3 +233,5 @@ Before completing any task, verify:
|
||||
- Follow existing patterns and conventions
|
||||
- Handle errors appropriately
|
||||
- Keep functions small and focused
|
||||
- Generate detailed summary documents with complete component/method listings
|
||||
- Document all new interfaces, types, and constants for dependent task reference
|
||||
|
||||
@@ -49,33 +49,33 @@ You will review code changes AND handle test implementation by understanding the
|
||||
|
||||
## Analysis CLI Context Activation Rules
|
||||
|
||||
**🎯 Analysis Marker Detection**
|
||||
When task assignment includes analysis marker:
|
||||
- **[MULTI_STEP_ANALYSIS]**: Execute sequential analysis steps with specified templates, expanding brief actions
|
||||
**🎯 Flow Control Detection**
|
||||
When task assignment includes flow control marker:
|
||||
- **[FLOW_CONTROL]**: Execute sequential flow control steps with context accumulation and variable passing
|
||||
|
||||
**Multi-Step Analysis Support**:
|
||||
- **Process pre_analysis array**: Handle multi-step array format
|
||||
- **Expand brief actions**: Convert 2-3 word descriptions into comprehensive analysis tasks
|
||||
- **Sequential execution**: Execute each analysis step in order, accumulating context
|
||||
- **Template integration**: Use full template paths for enhanced analysis prompts
|
||||
**Flow Control Support**:
|
||||
- **Process flow_control.pre_analysis array**: Handle multi-step flow control format
|
||||
- **Context variable handling**: Process [variable_name] references in commands
|
||||
- **Sequential execution**: Execute each step in order, accumulating context through variables
|
||||
- **Error handling**: Apply per-step error strategies
|
||||
|
||||
**Context Gathering Decision Logic**:
|
||||
```
|
||||
IF task contains [MULTI_STEP_ANALYSIS] flag:
|
||||
→ Execute each analysis step sequentially with specified templates
|
||||
→ Expand brief actions into comprehensive analysis tasks
|
||||
→ Use method specified in each step (gemini/codex/manual/auto-detected)
|
||||
→ Accumulate results for comprehensive context
|
||||
IF task contains [FLOW_CONTROL] flag:
|
||||
→ Execute each flow control step sequentially with context variables
|
||||
→ Load dependency summaries from connections.depends_on
|
||||
→ Process [variable_name] references in commands
|
||||
→ Accumulate context through step outputs
|
||||
ELIF reviewing >3 files OR security changes OR architecture modifications:
|
||||
→ Execute default multi-step analysis (AUTO-TRIGGER)
|
||||
→ Execute default flow control analysis (AUTO-TRIGGER)
|
||||
ELSE:
|
||||
→ Proceed with review using standard quality checks
|
||||
```
|
||||
|
||||
## Multi-Step Pre-Analysis Phase (Execute When Required)
|
||||
## Flow Control Pre-Analysis Phase (Execute When Required)
|
||||
|
||||
### Multi-Step Analysis Execution
|
||||
When [MULTI_STEP_ANALYSIS] flag is present, execute comprehensive pre-review analysis:
|
||||
### Flow Control Execution
|
||||
When [FLOW_CONTROL] flag is present, execute comprehensive pre-review analysis:
|
||||
|
||||
Process each step from pre_analysis array sequentially:
|
||||
|
||||
@@ -163,12 +163,12 @@ if [FAST_MODE]: apply targeted review process
|
||||
- Concurrency issues (race conditions, deadlocks)
|
||||
- Input validation and sanitization
|
||||
|
||||
### Code Quality
|
||||
### Code Quality & Dependencies
|
||||
- Import/export correctness and path validation
|
||||
- Missing or unused imports identification
|
||||
- Circular dependency detection
|
||||
- Single responsibility principle
|
||||
- Clear variable and function names
|
||||
- Appropriate abstraction levels
|
||||
- No code duplication (DRY principle)
|
||||
- Proper documentation for complex logic
|
||||
|
||||
### Performance
|
||||
- Algorithm complexity (time and space)
|
||||
@@ -201,40 +201,15 @@ if [FAST_MODE]: apply targeted review process
|
||||
```markdown
|
||||
# Review Summary: [Task-ID] [Review Name]
|
||||
|
||||
## Review Scope
|
||||
- [Files/components reviewed]
|
||||
- [Lines of code reviewed]
|
||||
- [Review depth applied: Deep/Fast Mode]
|
||||
|
||||
## Critical Findings
|
||||
- [Bugs found and fixed]
|
||||
- [Security issues identified]
|
||||
- [Breaking changes prevented]
|
||||
|
||||
## Quality Improvements
|
||||
- [Code quality enhancements]
|
||||
- [Performance optimizations]
|
||||
- [Architecture improvements]
|
||||
|
||||
## Test Implementation
|
||||
- [Tests written or updated]
|
||||
## Issues Fixed
|
||||
- [Bugs/security issues resolved]
|
||||
- [Missing imports added]
|
||||
- [Unused imports removed]
|
||||
- [Import path errors corrected]
|
||||
|
||||
## Tests Added
|
||||
- [Test files created/updated]
|
||||
- [Coverage improvements]
|
||||
- [Test quality enhancements]
|
||||
|
||||
## Compliance Check
|
||||
- [Standards adherence verified]
|
||||
- [Convention violations fixed]
|
||||
- [Documentation completeness]
|
||||
|
||||
## Recommendations Implemented
|
||||
- [Suggested improvements applied]
|
||||
- [Refactoring performed]
|
||||
- [Test coverage added]
|
||||
|
||||
## Outstanding Items
|
||||
- [Deferred improvements]
|
||||
- [Future considerations]
|
||||
- [Technical debt noted]
|
||||
|
||||
## Approval Status
|
||||
- [x] Approved / [ ] Approved with minor changes / [ ] Needs revision / [ ] Rejected
|
||||
|
||||
@@ -37,8 +37,8 @@ You are a conceptual planning specialist focused on single-role strategic thinki
|
||||
## Analysis Method Integration
|
||||
|
||||
### Detection and Activation
|
||||
When receiving task prompt, check for analysis marker:
|
||||
- **[MULTI_STEP_ANALYSIS]** - Execute mandatory multi-step pre-execution analysis
|
||||
When receiving task prompt, check for flow control marker:
|
||||
- **[FLOW_CONTROL]** - Execute mandatory flow control steps with context accumulation
|
||||
- **ASSIGNED_ROLE** - Extract the specific role for focused analysis
|
||||
- **ANALYSIS_DIMENSIONS** - Load role-specific analysis dimensions
|
||||
|
||||
@@ -49,28 +49,28 @@ def handle_analysis_markers(prompt):
|
||||
dimensions = extract_value("ANALYSIS_DIMENSIONS", prompt)
|
||||
topic = extract_topic(prompt)
|
||||
|
||||
if "[MULTI_STEP_ANALYSIS]" in prompt:
|
||||
analysis_steps = extract_pre_analysis_array(prompt)
|
||||
for step in analysis_steps:
|
||||
if "[FLOW_CONTROL]" in prompt:
|
||||
flow_steps = extract_flow_control_array(prompt)
|
||||
context_vars = {}
|
||||
|
||||
for step in flow_steps:
|
||||
step_name = step["step"]
|
||||
action = step["action"]
|
||||
template = step["template"]
|
||||
method = step["method"]
|
||||
command = step["command"]
|
||||
output_to = step.get("output_to")
|
||||
on_error = step.get("on_error", "fail")
|
||||
|
||||
expanded_action = expand_brief_action(action, role, topic)
|
||||
# Process context variables in command
|
||||
processed_command = process_context_variables(command, context_vars)
|
||||
|
||||
if method == "gemini":
|
||||
result = execute_gemini_cli(
|
||||
command=f"bash(~/.claude/scripts/gemini-wrapper -p \"$(cat {template}) {expanded_action}\")",
|
||||
role_context=role,
|
||||
topic=topic
|
||||
)
|
||||
elif method == "codex":
|
||||
result = execute_codex_cli(
|
||||
command=f"bash(codex --full-auto exec \"$(cat {template}) {expanded_action}\")",
|
||||
role_context=role,
|
||||
topic=topic
|
||||
)
|
||||
integrate_autonomous_insights(result, role)
|
||||
try:
|
||||
result = execute_command(processed_command, role_context=role, topic=topic)
|
||||
if output_to:
|
||||
context_vars[output_to] = result
|
||||
except Exception as e:
|
||||
handle_step_error(e, on_error, step_name)
|
||||
|
||||
integrate_flow_results(context_vars, role)
|
||||
```
|
||||
|
||||
### Role-Specific Analysis Dimensions
|
||||
|
||||
Reference in New Issue
Block a user