mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-14 02:42:04 +08:00
refactor(workflow): complete migration from .workflow/sessions/ to .workflow/active/ directory structure
Update all command files to use the new standardized directory structure:
- Active sessions: .workflow/active/WFS-{session}/
- Archived sessions: .workflow/archives/WFS-{session}/
Changes:
- Updated workflow-architecture.md with new directory structure (active/ not sessions/)
- Fixed 31 path references across 12 command files
- Verified compliance across all 73 command files using parallel agent checks
- Confirmed directory naming: active/ (adjective, no plural) + archives/ (noun plural)
Files modified:
- .claude/workflows/workflow-architecture.md (directory structure definition)
- .claude/commands/cli/*.md (8 files: analyze, chat, codex-execute, discuss-plan, execute, mode/*)
- .claude/commands/memory/docs.md (4 path fixes)
- .claude/commands/task/*.md (execute, replan)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -75,7 +75,7 @@ Task(
|
|||||||
4. Execution & Output:
|
4. Execution & Output:
|
||||||
- Execute CLI tool with assembled context
|
- Execute CLI tool with assembled context
|
||||||
- Generate comprehensive analysis report
|
- Generate comprehensive analysis report
|
||||||
- Save to .workflow/WFS-[id]/.chat/analyze-[timestamp].md (or .scratchpad/)
|
- Save to .workflow/active/WFS-[id]/.chat/analyze-[timestamp].md (or .scratchpad/)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
@@ -84,4 +84,4 @@ Task(
|
|||||||
|
|
||||||
- **Read-only**: Analyzes code, does NOT modify files
|
- **Read-only**: Analyzes code, does NOT modify files
|
||||||
- **Auto-pattern**: Detects file patterns from keywords (auth→auth files, component→components, API→api/routes, test→test files)
|
- **Auto-pattern**: Detects file patterns from keywords (auth→auth files, component→components, API→api/routes, test→test files)
|
||||||
- **Output**: `.workflow/WFS-[id]/.chat/analyze-[timestamp].md` (or `.scratchpad/` if no session)
|
- **Output**: `.workflow/active/WFS-[id]/.chat/analyze-[timestamp].md` (or `.scratchpad/` if no session)
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Task(
|
|||||||
3. Execution & Output:
|
3. Execution & Output:
|
||||||
- Execute CLI tool with assembled context
|
- Execute CLI tool with assembled context
|
||||||
- Validate answer completeness
|
- Validate answer completeness
|
||||||
- Save to .workflow/WFS-[id]/.chat/chat-[timestamp].md (or .scratchpad/)
|
- Save to .workflow/active/WFS-[id]/.chat/chat-[timestamp].md (or .scratchpad/)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
@@ -79,4 +79,4 @@ Task(
|
|||||||
|
|
||||||
- **Read-only**: Provides answers, does NOT modify code
|
- **Read-only**: Provides answers, does NOT modify code
|
||||||
- **Context**: `@CLAUDE.md` + inferred or all files (`@**/*`)
|
- **Context**: `@CLAUDE.md` + inferred or all files (`@**/*`)
|
||||||
- **Output**: `.workflow/WFS-[id]/.chat/chat-[timestamp].md` (or `.scratchpad/` if no session)
|
- **Output**: `.workflow/active/WFS-[id]/.chat/chat-[timestamp].md` (or `.scratchpad/` if no session)
|
||||||
|
|||||||
@@ -468,9 +468,9 @@ Summary: [file references, changes, next steps]
|
|||||||
|
|
||||||
**Execution Log Destination**:
|
**Execution Log Destination**:
|
||||||
- **IF** active workflow session exists:
|
- **IF** active workflow session exists:
|
||||||
- Execution log: `.workflow/WFS-[id]/.chat/codex-execute-[timestamp].md`
|
- Execution log: `.workflow/active/WFS-[id]/.chat/codex-execute-[timestamp].md`
|
||||||
- Task summaries: `.workflow/WFS-[id]/.summaries/[TASK-ID]-summary.md` (if task ID)
|
- Task summaries: `.workflow/active/WFS-[id]/.summaries/[TASK-ID]-summary.md` (if task ID)
|
||||||
- Task updates: `.workflow/WFS-[id]/.task/[TASK-ID].json` status updates
|
- Task updates: `.workflow/active/WFS-[id]/.task/[TASK-ID].json` status updates
|
||||||
- TodoWrite tracking: Embedded in execution log
|
- TodoWrite tracking: Embedded in execution log
|
||||||
- **ELSE** (no active session):
|
- **ELSE** (no active session):
|
||||||
- **Recommended**: Create workflow session first (`/workflow:session:start`)
|
- **Recommended**: Create workflow session first (`/workflow:session:start`)
|
||||||
@@ -478,7 +478,7 @@ Summary: [file references, changes, next steps]
|
|||||||
|
|
||||||
**Output Files** (during execution):
|
**Output Files** (during execution):
|
||||||
```
|
```
|
||||||
.workflow/WFS-[session-id]/
|
.workflow/active/WFS-[session-id]/
|
||||||
├── .chat/
|
├── .chat/
|
||||||
│ └── codex-execute-20250105-143022.md # Full execution log with task flow
|
│ └── codex-execute-20250105-143022.md # Full execution log with task flow
|
||||||
├── .summaries/
|
├── .summaries/
|
||||||
@@ -492,9 +492,9 @@ Summary: [file references, changes, next steps]
|
|||||||
|
|
||||||
**Examples**:
|
**Examples**:
|
||||||
- During session `WFS-auth-system`, executing multi-stage auth implementation:
|
- During session `WFS-auth-system`, executing multi-stage auth implementation:
|
||||||
- Log: `.workflow/WFS-auth-system/.chat/codex-execute-20250105-143022.md`
|
- Log: `.workflow/active/WFS-auth-system/.chat/codex-execute-20250105-143022.md`
|
||||||
- Summaries: `.workflow/WFS-auth-system/.summaries/IMPL-001.{1,2,3}-summary.md`
|
- Summaries: `.workflow/active/WFS-auth-system/.summaries/IMPL-001.{1,2,3}-summary.md`
|
||||||
- Task status: `.workflow/WFS-auth-system/.task/IMPL-001.json` (status: completed)
|
- Task status: `.workflow/active/WFS-auth-system/.task/IMPL-001.json` (status: completed)
|
||||||
- No session, ad-hoc multi-stage task:
|
- No session, ad-hoc multi-stage task:
|
||||||
- Log: `.workflow/.scratchpad/codex-execute-auth-refactor-20250105-143045.md`
|
- Log: `.workflow/.scratchpad/codex-execute-auth-refactor-20250105-143045.md`
|
||||||
|
|
||||||
|
|||||||
@@ -167,9 +167,9 @@ TodoWrite({
|
|||||||
## Output Routing
|
## Output Routing
|
||||||
|
|
||||||
- **Primary Log**: Entire multi-round discussion logged to single file:
|
- **Primary Log**: Entire multi-round discussion logged to single file:
|
||||||
- `.workflow/WFS-[id]/.chat/discuss-plan-[topic]-[timestamp].md`
|
- `.workflow/active/WFS-[id]/.chat/discuss-plan-[topic]-[timestamp].md`
|
||||||
- **Final Plan**: Clean final version saved upon conclusion:
|
- **Final Plan**: Clean final version saved upon conclusion:
|
||||||
- `.workflow/WFS-[id]/.summaries/plan-[topic].md`
|
- `.workflow/active/WFS-[id]/.summaries/plan-[topic].md`
|
||||||
- **Scratchpad**: If no session active:
|
- **Scratchpad**: If no session active:
|
||||||
- `.workflow/.scratchpad/discuss-plan-[topic]-[timestamp].md`
|
- `.workflow/.scratchpad/discuss-plan-[topic]-[timestamp].md`
|
||||||
|
|
||||||
|
|||||||
@@ -127,8 +127,8 @@ Task(
|
|||||||
- Ensure working implementation with proper error handling
|
- Ensure working implementation with proper error handling
|
||||||
|
|
||||||
5. Output & Documentation:
|
5. Output & Documentation:
|
||||||
- Save execution log: .workflow/WFS-[id]/.chat/execute-[timestamp].md
|
- Save execution log: .workflow/active/WFS-[id]/.chat/execute-[timestamp].md
|
||||||
${task_id ? '- Generate task summary: .workflow/WFS-[id]/.summaries/' + task_id + '-summary.md' : ''}
|
${task_id ? '- Generate task summary: .workflow/active/WFS-[id]/.summaries/' + task_id + '-summary.md' : ''}
|
||||||
${task_id ? '- Update task status in .task/' + task_id + '.json' : ''}
|
${task_id ? '- Update task status in .task/' + task_id + '.json' : ''}
|
||||||
- Document all code changes made
|
- Document all code changes made
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ Task(
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Output**: `.workflow/WFS-[id]/.chat/execute-[timestamp].md` + `.summaries/[TASK-ID]-summary.md` (or `.scratchpad/` if no session)
|
**Output**: `.workflow/active/WFS-[id]/.chat/execute-[timestamp].md` + `.workflow/active/WFS-[id]/.summaries/[TASK-ID]-summary.md` (or `.scratchpad/` if no session)
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ Task(
|
|||||||
- Root cause diagnosis with evidence
|
- Root cause diagnosis with evidence
|
||||||
- Fix suggestions and recommendations
|
- Fix suggestions and recommendations
|
||||||
- Prevention strategies
|
- Prevention strategies
|
||||||
- Save to .workflow/WFS-[id]/.chat/bug-diagnosis-[timestamp].md (or .scratchpad/)
|
- Save to .workflow/active/WFS-[id]/.chat/bug-diagnosis-[timestamp].md (or .scratchpad/)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
@@ -93,4 +93,4 @@ Task(
|
|||||||
|
|
||||||
- **Read-only**: Diagnoses bugs, does NOT modify code
|
- **Read-only**: Diagnoses bugs, does NOT modify code
|
||||||
- **Template**: `~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt`
|
- **Template**: `~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt`
|
||||||
- **Output**: `.workflow/WFS-[id]/.chat/bug-diagnosis-[timestamp].md` (or `.scratchpad/` if no session)
|
- **Output**: `.workflow/active/WFS-[id]/.chat/bug-diagnosis-[timestamp].md` (or `.scratchpad/` if no session)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ Task(
|
|||||||
- Execution trace documentation
|
- Execution trace documentation
|
||||||
- Call flow analysis with diagrams
|
- Call flow analysis with diagrams
|
||||||
- Performance and optimization insights
|
- Performance and optimization insights
|
||||||
- Save to .workflow/WFS-[id]/.chat/code-analysis-[timestamp].md (or .scratchpad/)
|
- Save to .workflow/active/WFS-[id]/.chat/code-analysis-[timestamp].md (or .scratchpad/)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
@@ -95,4 +95,4 @@ Task(
|
|||||||
|
|
||||||
- **Read-only**: Analyzes code, does NOT modify files
|
- **Read-only**: Analyzes code, does NOT modify files
|
||||||
- **Template**: `~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt`
|
- **Template**: `~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt`
|
||||||
- **Output**: `.workflow/WFS-[id]/.chat/code-analysis-[timestamp].md` (or `.scratchpad/` if no session)
|
- **Output**: `.workflow/active/WFS-[id]/.chat/code-analysis-[timestamp].md` (or `.scratchpad/` if no session)
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ Task(
|
|||||||
- Strategic modification plan
|
- Strategic modification plan
|
||||||
- Impact analysis and risk assessment
|
- Impact analysis and risk assessment
|
||||||
- Implementation roadmap
|
- Implementation roadmap
|
||||||
- Save to .workflow/WFS-[id]/.chat/plan-[timestamp].md (or .scratchpad/)
|
- Save to .workflow/active/WFS-[id]/.chat/plan-[timestamp].md (or .scratchpad/)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
@@ -90,4 +90,4 @@ Task(
|
|||||||
|
|
||||||
- **Read-only**: Creates modification plans, does NOT generate code
|
- **Read-only**: Creates modification plans, does NOT generate code
|
||||||
- **Template**: `~/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt`
|
- **Template**: `~/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt`
|
||||||
- **Output**: `.workflow/WFS-[id]/.chat/plan-[timestamp].md` (or `.scratchpad/` if no session)
|
- **Output**: `.workflow/active/WFS-[id]/.chat/plan-[timestamp].md` (or `.scratchpad/` if no session)
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ bash(if [ -d .workflow/docs/\${project_name} ]; then find .workflow/docs/\${proj
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Count existing docs from phase2-analysis.json
|
# Count existing docs from phase2-analysis.json
|
||||||
bash(cat .workflow/WFS-docs-{timestamp}/.process/phase2-analysis.json | jq '.existing_docs.file_list | length')
|
bash(cat .workflow/active/WFS-docs-{timestamp}/.process/phase2-analysis.json | jq '.existing_docs.file_list | length')
|
||||||
```
|
```
|
||||||
|
|
||||||
**Data Processing**: Use count result, then use **Edit tool** to update `workflow-session.json`:
|
**Data Processing**: Use count result, then use **Edit tool** to update `workflow-session.json`:
|
||||||
@@ -183,10 +183,10 @@ Large Projects (single dir >10 docs):
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Get top-level directories from phase2-analysis.json
|
# 1. Get top-level directories from phase2-analysis.json
|
||||||
bash(cat .workflow/WFS-docs-{timestamp}/.process/phase2-analysis.json | jq -r '.top_level_dirs[]')
|
bash(cat .workflow/active/WFS-docs-{timestamp}/.process/phase2-analysis.json | jq -r '.top_level_dirs[]')
|
||||||
|
|
||||||
# 2. Get mode from workflow-session.json
|
# 2. Get mode from workflow-session.json
|
||||||
bash(cat .workflow/WFS-docs-{timestamp}/workflow-session.json | jq -r '.mode // "full"')
|
bash(cat .workflow/active/WFS-docs-{timestamp}/workflow-session.json | jq -r '.mode // "full"')
|
||||||
|
|
||||||
# 3. Check for HTTP API
|
# 3. Check for HTTP API
|
||||||
bash(grep -r "router\.|@Get\|@Post" src/ 2>/dev/null && echo "API_FOUND" || echo "NO_API")
|
bash(grep -r "router\.|@Get\|@Post" src/ 2>/dev/null && echo "API_FOUND" || echo "NO_API")
|
||||||
@@ -215,7 +215,7 @@ bash(grep -r "router\.|@Get\|@Post" src/ 2>/dev/null && echo "API_FOUND" || echo
|
|||||||
|
|
||||||
**Task ID Calculation**:
|
**Task ID Calculation**:
|
||||||
```bash
|
```bash
|
||||||
group_count=$(jq '.groups.count' .workflow/WFS-docs-{timestamp}/.process/phase2-analysis.json)
|
group_count=$(jq '.groups.count' .workflow/active/WFS-docs-{timestamp}/.process/phase2-analysis.json)
|
||||||
readme_id=$((group_count + 1)) # Next ID after groups
|
readme_id=$((group_count + 1)) # Next ID after groups
|
||||||
arch_id=$((group_count + 2))
|
arch_id=$((group_count + 2))
|
||||||
api_id=$((group_count + 3))
|
api_id=$((group_count + 3))
|
||||||
|
|||||||
@@ -199,10 +199,10 @@ This is the simplified data structure loaded to provide context for task executi
|
|||||||
"session": "WFS-user-auth",
|
"session": "WFS-user-auth",
|
||||||
"phase": "IMPLEMENT",
|
"phase": "IMPLEMENT",
|
||||||
"session_context": {
|
"session_context": {
|
||||||
"workflow_directory": ".workflow/WFS-user-auth/",
|
"workflow_directory": ".workflow/active/WFS-user-auth/",
|
||||||
"todo_list_location": ".workflow/WFS-user-auth/TODO_LIST.md",
|
"todo_list_location": ".workflow/active/WFS-user-auth/TODO_LIST.md",
|
||||||
"summaries_directory": ".workflow/WFS-user-auth/.summaries/",
|
"summaries_directory": ".workflow/active/WFS-user-auth/.summaries/",
|
||||||
"task_json_location": ".workflow/WFS-user-auth/.task/"
|
"task_json_location": ".workflow/active/WFS-user-auth/.task/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"execution": {
|
"execution": {
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ Backup saved to .task/backup/IMPL-2-v1.0.json
|
|||||||
|
|
||||||
### Batch Mode - From Verification Report
|
### Batch Mode - From Verification Report
|
||||||
```bash
|
```bash
|
||||||
/task:replan --batch .workflow/WFS-{session}/.process/ACTION_PLAN_VERIFICATION.md
|
/task:replan --batch .workflow/active/WFS-{session}/.process/ACTION_PLAN_VERIFICATION.md
|
||||||
|
|
||||||
Parsing verification report...
|
Parsing verification report...
|
||||||
Found 4 tasks requiring replanning:
|
Found 4 tasks requiring replanning:
|
||||||
|
|||||||
@@ -29,19 +29,19 @@ This document defines the complete workflow system architecture using a **JSON-o
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
.workflow/
|
.workflow/
|
||||||
├── sessions/
|
├── active/
|
||||||
│ ├── WFS-oauth-integration/ # Session directory (active or paused)
|
│ ├── WFS-oauth-integration/ # Active session directory
|
||||||
│ ├── WFS-user-profile/ # Session directory (active or paused)
|
│ ├── WFS-user-profile/ # Active session directory
|
||||||
│ └── WFS-bug-fix-123/ # Session directory (completed)
|
│ └── WFS-bug-fix-123/ # Active session directory
|
||||||
└── archives/
|
└── archives/
|
||||||
└── WFS-old-feature/ # Archived session (completed)
|
└── WFS-old-feature/ # Archived session (completed)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Directory-Based Benefits**:
|
**Directory-Based Benefits**:
|
||||||
- **Simple Discovery**: Session location determines state (sessions/ = active/paused, archives/ = completed)
|
- **Simple Discovery**: Session location determines state (active/ = active sessions, archives/ = completed)
|
||||||
- **No Marker Files**: Location is the state
|
- **No Marker Files**: Location is the state
|
||||||
- **Clean Structure**: Clear separation between active and completed sessions
|
- **Clean Structure**: Clear separation between active and completed sessions
|
||||||
- **Easy Migration**: Move between sessions/ and archives/ to change state
|
- **Easy Migration**: Move between active/ and archives/ to change state
|
||||||
|
|
||||||
### Session Operations
|
### Session Operations
|
||||||
|
|
||||||
@@ -709,7 +709,7 @@ All workflows use the same file structure definition regardless of complexity. *
|
|||||||
│ │ └── index.html # Navigation page
|
│ │ └── index.html # Navigation page
|
||||||
│ └── .run-metadata.json # Run configuration
|
│ └── .run-metadata.json # Run configuration
|
||||||
│
|
│
|
||||||
├── sessions/ # Active/paused workflow sessions
|
├── active/ # Active workflow sessions
|
||||||
│ └── WFS-[topic-slug]/
|
│ └── WFS-[topic-slug]/
|
||||||
│ ├── workflow-session.json # Session metadata and state (REQUIRED)
|
│ ├── workflow-session.json # Session metadata and state (REQUIRED)
|
||||||
│ ├── [.brainstorming/] # Optional brainstorming phase (created when needed)
|
│ ├── [.brainstorming/] # Optional brainstorming phase (created when needed)
|
||||||
|
|||||||
Reference in New Issue
Block a user