mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
refactor: Update workflow plan system and template organization
- Remove --analyze|--deep parameters from plan.md, use default analysis - Change .analysis to .process directory structure for better organization - Create ANALYSIS_RESULTS.md template focused on verified results - Add .process folder to workflow-architecture.md file structure - Template emphasizes verification of files, methods, and commands - Prevent execution errors from non-existent references 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
143
.claude/workflows/ANALYSIS_RESULTS.md
Normal file
143
.claude/workflows/ANALYSIS_RESULTS.md
Normal file
@@ -0,0 +1,143 @@
|
||||
# Analysis Results Documentation
|
||||
|
||||
## Metadata
|
||||
- **Generated by**: `/workflow:plan` command
|
||||
- **Session**: `WFS-[session-id]`
|
||||
- **Task Context**: `[task-description]`
|
||||
- **Analysis Date**: `[timestamp]`
|
||||
|
||||
## 1. Verified Project Assets
|
||||
|
||||
### Confirmed Documentation Files
|
||||
```bash
|
||||
# Verified file existence with full paths:
|
||||
✓ [/absolute/path/to/CLAUDE.md] - [file size] - Contains: [key sections found]
|
||||
✓ [/absolute/path/to/README.md] - [file size] - Contains: [technical info]
|
||||
✓ [/absolute/path/to/package.json] - [file size] - Dependencies: [list]
|
||||
```
|
||||
|
||||
### Confirmed Technical Stack
|
||||
- **Package Manager**: [npm/yarn/pnpm] (confirmed via `[specific file path]`)
|
||||
- **Framework**: [React/Vue/Angular/etc] (version: [x.x.x])
|
||||
- **Build Tool**: [webpack/vite/etc] (config: `[config file path]`)
|
||||
- **Test Framework**: [jest/vitest/etc] (config: `[config file path]`)
|
||||
|
||||
## 2. Verified Code Structure
|
||||
|
||||
### Confirmed Directory Structure
|
||||
```
|
||||
[project-root]/
|
||||
├── [actual-folder-name]/ # [purpose - verified]
|
||||
│ ├── [actual-file.ext] # [size] [last-modified]
|
||||
│ └── [actual-file.ext] # [size] [last-modified]
|
||||
└── [actual-folder-name]/ # [purpose - verified]
|
||||
├── [actual-file.ext] # [size] [last-modified]
|
||||
└── [actual-file.ext] # [size] [last-modified]
|
||||
```
|
||||
|
||||
### Confirmed Key Modules
|
||||
- **Module 1**: `[/absolute/path/to/module]`
|
||||
- **Entry Point**: `[actual-file.js]` (exports: [verified-exports])
|
||||
- **Key Methods**: `[method1()]`, `[method2()]` (line numbers: [X-Y])
|
||||
- **Dependencies**: `[import statements verified]`
|
||||
|
||||
- **Module 2**: `[/absolute/path/to/module]`
|
||||
- **Entry Point**: `[actual-file.js]` (exports: [verified-exports])
|
||||
- **Key Methods**: `[method1()]`, `[method2()]` (line numbers: [X-Y])
|
||||
- **Dependencies**: `[import statements verified]`
|
||||
|
||||
## 3. Confirmed Implementation Standards
|
||||
|
||||
### Verified Coding Patterns
|
||||
- **Naming Convention**: [verified pattern from actual files]
|
||||
- Files: `[example1.js]`, `[example2.js]` (pattern: [pattern])
|
||||
- Functions: `[actualFunction()]` from `[file:line]`
|
||||
- Classes: `[ActualClass]` from `[file:line]`
|
||||
|
||||
### Confirmed Build Commands
|
||||
```bash
|
||||
# Verified commands (tested successfully):
|
||||
✓ [npm run build] - Output: [build result]
|
||||
✓ [npm run test] - Framework: [test framework found]
|
||||
✓ [npm run lint] - Tool: [linter found]
|
||||
```
|
||||
|
||||
## 4. Task Decomposition Results
|
||||
|
||||
### Task Count Determination
|
||||
- **Identified Tasks**: [exact number] (based on functional boundaries)
|
||||
- **Structure**: [Flat ≤5 | Hierarchical 6-10 | Re-scope >10]
|
||||
- **Merge Rationale**: [specific reasons for combining related files]
|
||||
|
||||
### Confirmed Task Breakdown
|
||||
- **IMPL-001**: `[Specific functional description]`
|
||||
- **Target Files**: `[/absolute/path/file1.js]`, `[/absolute/path/file2.js]` (verified)
|
||||
- **Key Methods to Implement**: `[method1()]`, `[method2()]` (signatures defined)
|
||||
- **Size**: [X files, ~Y lines] (measured from similar existing code)
|
||||
- **Dependencies**: Uses `[existingModule.method()]` from `[verified-path]`
|
||||
|
||||
- **IMPL-002**: `[Specific functional description]`
|
||||
- **Target Files**: `[/absolute/path/file3.js]`, `[/absolute/path/file4.js]` (verified)
|
||||
- **Key Methods to Implement**: `[method3()]`, `[method4()]` (signatures defined)
|
||||
- **Size**: [X files, ~Y lines] (measured from similar existing code)
|
||||
- **Dependencies**: Uses `[existingModule.method()]` from `[verified-path]`
|
||||
|
||||
### Verified Dependency Chain
|
||||
```bash
|
||||
# Confirmed execution order (based on actual imports):
|
||||
IMPL-001 → Uses: [existing-file:method]
|
||||
IMPL-002 → Depends: IMPL-001.[method] → Uses: [existing-file:method]
|
||||
```
|
||||
|
||||
## 5. Implementation Execution Plan
|
||||
|
||||
### Confirmed Integration Points
|
||||
- **Existing Entry Points**:
|
||||
- `[actual-file.js:line]` exports `[verified-method]`
|
||||
- `[actual-config.json]` contains `[verified-setting]`
|
||||
- **Integration Methods**:
|
||||
- Hook into `[existing-method()]` at `[file:line]`
|
||||
- Extend `[ExistingClass]` from `[file:line]`
|
||||
|
||||
### Validated Commands
|
||||
```bash
|
||||
# Commands verified to work in current environment:
|
||||
✓ [exact build command] - Tested: [timestamp]
|
||||
✓ [exact test command] - Tested: [timestamp]
|
||||
✓ [exact lint command] - Tested: [timestamp]
|
||||
```
|
||||
|
||||
## 6. Success Validation Criteria
|
||||
|
||||
### Testable Outcomes
|
||||
- **IMPL-001 Success**:
|
||||
- `[specific test command]` passes
|
||||
- `[integration point]` correctly calls `[new method]`
|
||||
- No regression in `[existing test suite]`
|
||||
|
||||
- **IMPL-002 Success**:
|
||||
- `[specific test command]` passes
|
||||
- Feature accessible via `[verified UI path]`
|
||||
- Performance: `[measurable criteria]`
|
||||
|
||||
### Quality Gates
|
||||
- **Code Standards**: Must pass `[verified lint command]`
|
||||
- **Test Coverage**: Maintain `[current coverage %]` (measured by `[tool]`)
|
||||
- **Build**: Must complete `[verified build command]` without errors
|
||||
|
||||
---
|
||||
|
||||
## Template Instructions
|
||||
|
||||
**CRITICAL**: Every bracketed item MUST be filled with verified, existing information:
|
||||
- File paths must be confirmed with `ls` or `find`
|
||||
- Method names must be found in actual source code
|
||||
- Commands must be tested and work
|
||||
- Line numbers should reference actual code locations
|
||||
- Dependencies must trace to real imports/requires
|
||||
|
||||
**Verification Required Before Use**:
|
||||
1. All file paths exist and are readable
|
||||
2. All referenced methods/classes exist in specified locations
|
||||
3. All commands execute successfully
|
||||
4. All integration points are actual, not assumed
|
||||
@@ -1,160 +0,0 @@
|
||||
# Agent Orchestration Patterns
|
||||
|
||||
## Core Agent Coordination Features
|
||||
|
||||
- **Gemini Context Analysis**: MANDATORY context gathering before any agent execution
|
||||
- **Context-Driven Coordination**: Agents work with comprehensive codebase understanding
|
||||
- **Dynamic Agent Selection**: Choose agents based on discovered context and patterns
|
||||
- **Continuous Context Updates**: Refine understanding throughout agent execution
|
||||
- **Cross-Agent Context Sharing**: Maintain shared context state across all agents
|
||||
- **Pattern-Aware Execution**: Leverage discovered patterns for optimal implementation
|
||||
- **Quality Gates**: Each Agent validates input and ensures output standards
|
||||
- **Error Recovery**: Graceful handling of Agent coordination failures
|
||||
|
||||
## Workflow Implementation Patterns
|
||||
|
||||
### Simple Workflow Pattern
|
||||
```pseudocode
|
||||
Flow: Gemini Context Analysis → TodoWrite Creation → Context-Aware Implementation → Review
|
||||
|
||||
1. MANDATORY Gemini Context Analysis:
|
||||
- Analyze target files and immediate dependencies
|
||||
- Discover existing patterns and conventions
|
||||
- Identify utilities and libraries to use
|
||||
- Generate context package for agents
|
||||
|
||||
2. TodoWrite Creation (Context-informed):
|
||||
- "Execute Gemini context analysis"
|
||||
- "Implement solution following discovered patterns"
|
||||
- "Review against codebase standards"
|
||||
- "Complete task with context validation"
|
||||
|
||||
3. Context-Aware Implementation:
|
||||
Task(code-developer): Implementation with Gemini context package
|
||||
Input: CONTEXT_PACKAGE, PATTERNS_DISCOVERED, CONVENTIONS_IDENTIFIED
|
||||
Output: SUMMARY, FILES_MODIFIED, TESTS, VERIFICATION
|
||||
|
||||
4. Context-Aware Review:
|
||||
Task(code-review-agent): Review with codebase standards context
|
||||
Input: CONTEXT_PACKAGE, IMPLEMENTATION_RESULTS
|
||||
Output: STATUS, SCORE, ISSUES, RECOMMENDATIONS
|
||||
|
||||
Resume Support: Load todos + full context state from checkpoint
|
||||
```
|
||||
|
||||
### Medium Workflow Pattern
|
||||
```pseudocode
|
||||
Flow: Comprehensive Gemini Analysis → TodoWrite → Multi-Context Implementation → Review
|
||||
|
||||
1. MANDATORY Comprehensive Gemini Context Analysis:
|
||||
- Analyze feature area and related components
|
||||
- Discover cross-file patterns and architectural decisions
|
||||
- Identify integration points and dependencies
|
||||
- Generate comprehensive context packages for multiple agents
|
||||
|
||||
2. TodoWrite Creation (Context-driven, 5-7 todos):
|
||||
- "Execute comprehensive Gemini context analysis"
|
||||
- "Coordinate multi-agent implementation with shared context"
|
||||
- "Implement following discovered architectural patterns"
|
||||
- "Validate against existing system patterns", "Review", "Complete"
|
||||
|
||||
3. Multi-Context Implementation:
|
||||
Task(code-developer): Implementation with comprehensive context
|
||||
Input: CONTEXT_PACKAGES, ARCHITECTURAL_PATTERNS, INTEGRATION_POINTS
|
||||
Update context as new patterns discovered
|
||||
|
||||
4. Context-Aware Review:
|
||||
Task(code-review-agent): Comprehensive review with system context
|
||||
Input: FULL_CONTEXT_STATE, IMPLEMENTATION_RESULTS, PATTERN_COMPLIANCE
|
||||
Verify against discovered architectural patterns
|
||||
|
||||
Resume Support: Full context state + pattern discovery restoration
|
||||
```
|
||||
|
||||
### Complex Workflow Pattern
|
||||
```pseudocode
|
||||
Flow: Deep Gemini Analysis → TodoWrite → Orchestrated Multi-Agent → Review → Iterate (max 2)
|
||||
|
||||
1. MANDATORY Deep Gemini Context Analysis:
|
||||
- System-wide architectural understanding
|
||||
- Deep pattern analysis across entire codebase
|
||||
- Integration complexity assessment
|
||||
- Multi-agent coordination requirements discovery
|
||||
- Risk pattern identification
|
||||
|
||||
2. TodoWrite Creation (Context-orchestrated, 7-10 todos):
|
||||
- "Execute deep system-wide Gemini analysis"
|
||||
- "Orchestrate multi-agent coordination with shared context"
|
||||
- "Implement with continuous context refinement"
|
||||
- "Validate against system architectural patterns", "Review", "Iterate", "Complete"
|
||||
|
||||
3. Orchestrated Multi-Agent Implementation:
|
||||
Multiple specialized agents with shared deep context
|
||||
Input: SYSTEM_CONTEXT, ARCHITECTURAL_PATTERNS, RISK_ASSESSMENT
|
||||
Continuous Gemini context updates throughout execution
|
||||
Cross-agent context synchronization
|
||||
|
||||
4. Deep Context Review & Iteration Loop (max 2 iterations):
|
||||
Task(code-review-agent): Production-ready review with full system context
|
||||
If CRITICAL_ISSUES found: Re-analyze context and coordinate fixes
|
||||
Continue until no critical issues or max iterations reached
|
||||
|
||||
Context Validation: Verify deep context analysis maintained throughout
|
||||
Resume Support: Full context state + iteration tracking + cross-agent coordination
|
||||
```
|
||||
|
||||
## Workflow Characteristics by Pattern
|
||||
|
||||
| Pattern | Context Analysis | Agent Coordination | Iteration Strategy |
|
||||
|---------|------------------|--------------------|--------------------|
|
||||
| **Complex** | Deep system-wide Gemini analysis | Multi-agent orchestration with shared context | Multiple rounds with context refinement |
|
||||
| **Medium** | Comprehensive multi-file analysis | Context-driven coordination | Single thorough pass with pattern validation |
|
||||
| **Simple** | Focused file-level analysis | Direct context-aware execution | Quick context validation |
|
||||
|
||||
## Context-Driven Task Invocation Examples
|
||||
|
||||
```bash
|
||||
# Gemini Context Analysis (Always First)
|
||||
gemini "Analyze authentication patterns in codebase - identify existing implementations,
|
||||
conventions, utilities, and integration patterns"
|
||||
|
||||
# Context-Aware Research Task
|
||||
Task(subagent_type="general-purpose",
|
||||
prompt="Research authentication patterns in codebase",
|
||||
context="[GEMINI_CONTEXT_PACKAGE]")
|
||||
|
||||
# Context-Informed Implementation Task
|
||||
Task(subagent_type="code-developer",
|
||||
prompt="Implement email validation function following discovered patterns",
|
||||
context="PATTERNS: [pattern_list], UTILITIES: [util_list], CONVENTIONS: [conv_list]")
|
||||
|
||||
# Context-Driven Review Task
|
||||
Task(subagent_type="code-review-agent",
|
||||
prompt="Review authentication service against codebase standards and patterns",
|
||||
context="STANDARDS: [discovered_standards], PATTERNS: [existing_patterns]")
|
||||
|
||||
# Cross-Agent Context Sharing
|
||||
Task(subagent_type="code-developer",
|
||||
prompt="Coordinate with previous agent results using shared context",
|
||||
context="PREVIOUS_CONTEXT: [agent_context], SHARED_STATE: [context_state]")
|
||||
```
|
||||
|
||||
## Gemini Context Integration Points
|
||||
|
||||
### Pre-Agent Context Gathering
|
||||
```bash
|
||||
# Always execute before agent coordination
|
||||
gemini "Comprehensive analysis for [task] - discover patterns, conventions, and optimal approach"
|
||||
```
|
||||
|
||||
### During-Agent Context Updates
|
||||
```bash
|
||||
# Continuous context refinement
|
||||
gemini "Update context understanding based on agent discoveries in [area]"
|
||||
```
|
||||
|
||||
### Cross-Agent Context Synchronization
|
||||
```bash
|
||||
# Ensure context consistency across agents
|
||||
gemini "Synchronize context between [agent1] and [agent2] work on [feature]"
|
||||
```
|
||||
@@ -245,6 +245,8 @@ All workflows use the same file structure definition regardless of complexity. *
|
||||
├── [.chat/] # CLI interaction sessions (created when analysis is run)
|
||||
│ ├── chat-*.md # Saved chat sessions
|
||||
│ └── analysis-*.md # Analysis results
|
||||
├── [.process/] # Planning analysis results (created by /workflow:plan)
|
||||
│ └── ANALYSIS_RESULTS.md # Analysis results and planning artifacts
|
||||
├── IMPL_PLAN.md # Planning document (REQUIRED)
|
||||
├── TODO_LIST.md # Progress tracking (REQUIRED)
|
||||
├── [.summaries/] # Task completion summaries (created when tasks complete)
|
||||
|
||||
Reference in New Issue
Block a user