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:
catlog22
2025-11-20 10:25:28 +08:00
parent c3818fdb79
commit 292dc113e3
12 changed files with 38 additions and 38 deletions

View File

@@ -75,7 +75,7 @@ Task(
4. Execution & Output:
- Execute CLI tool with assembled context
- 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
- **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)

View File

@@ -70,7 +70,7 @@ Task(
3. Execution & Output:
- Execute CLI tool with assembled context
- 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
- **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)

View File

@@ -468,9 +468,9 @@ Summary: [file references, changes, next steps]
**Execution Log Destination**:
- **IF** active workflow session exists:
- Execution log: `.workflow/WFS-[id]/.chat/codex-execute-[timestamp].md`
- Task summaries: `.workflow/WFS-[id]/.summaries/[TASK-ID]-summary.md` (if task ID)
- Task updates: `.workflow/WFS-[id]/.task/[TASK-ID].json` status updates
- Execution log: `.workflow/active/WFS-[id]/.chat/codex-execute-[timestamp].md`
- Task summaries: `.workflow/active/WFS-[id]/.summaries/[TASK-ID]-summary.md` (if task ID)
- Task updates: `.workflow/active/WFS-[id]/.task/[TASK-ID].json` status updates
- TodoWrite tracking: Embedded in execution log
- **ELSE** (no active session):
- **Recommended**: Create workflow session first (`/workflow:session:start`)
@@ -478,7 +478,7 @@ Summary: [file references, changes, next steps]
**Output Files** (during execution):
```
.workflow/WFS-[session-id]/
.workflow/active/WFS-[session-id]/
├── .chat/
│ └── codex-execute-20250105-143022.md # Full execution log with task flow
├── .summaries/
@@ -492,9 +492,9 @@ Summary: [file references, changes, next steps]
**Examples**:
- During session `WFS-auth-system`, executing multi-stage auth implementation:
- Log: `.workflow/WFS-auth-system/.chat/codex-execute-20250105-143022.md`
- Summaries: `.workflow/WFS-auth-system/.summaries/IMPL-001.{1,2,3}-summary.md`
- Task status: `.workflow/WFS-auth-system/.task/IMPL-001.json` (status: completed)
- Log: `.workflow/active/WFS-auth-system/.chat/codex-execute-20250105-143022.md`
- Summaries: `.workflow/active/WFS-auth-system/.summaries/IMPL-001.{1,2,3}-summary.md`
- Task status: `.workflow/active/WFS-auth-system/.task/IMPL-001.json` (status: completed)
- No session, ad-hoc multi-stage task:
- Log: `.workflow/.scratchpad/codex-execute-auth-refactor-20250105-143045.md`

View File

@@ -167,9 +167,9 @@ TodoWrite({
## Output Routing
- **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:
- `.workflow/WFS-[id]/.summaries/plan-[topic].md`
- `.workflow/active/WFS-[id]/.summaries/plan-[topic].md`
- **Scratchpad**: If no session active:
- `.workflow/.scratchpad/discuss-plan-[topic]-[timestamp].md`

View File

@@ -127,8 +127,8 @@ Task(
- Ensure working implementation with proper error handling
5. Output & Documentation:
- Save execution log: .workflow/WFS-[id]/.chat/execute-[timestamp].md
${task_id ? '- Generate task summary: .workflow/WFS-[id]/.summaries/' + task_id + '-summary.md' : ''}
- Save execution log: .workflow/active/WFS-[id]/.chat/execute-[timestamp].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' : ''}
- 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

View File

@@ -84,7 +84,7 @@ Task(
- Root cause diagnosis with evidence
- Fix suggestions and recommendations
- 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
- **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)

View File

@@ -86,7 +86,7 @@ Task(
- Execution trace documentation
- Call flow analysis with diagrams
- 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
- **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)

View File

@@ -81,7 +81,7 @@ Task(
- Strategic modification plan
- Impact analysis and risk assessment
- 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
- **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)

View File

@@ -128,7 +128,7 @@ bash(if [ -d .workflow/docs/\${project_name} ]; then find .workflow/docs/\${proj
```bash
# 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`:
@@ -183,10 +183,10 @@ Large Projects (single dir >10 docs):
```bash
# 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
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
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**:
```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
arch_id=$((group_count + 2))
api_id=$((group_count + 3))

View File

@@ -199,10 +199,10 @@ This is the simplified data structure loaded to provide context for task executi
"session": "WFS-user-auth",
"phase": "IMPLEMENT",
"session_context": {
"workflow_directory": ".workflow/WFS-user-auth/",
"todo_list_location": ".workflow/WFS-user-auth/TODO_LIST.md",
"summaries_directory": ".workflow/WFS-user-auth/.summaries/",
"task_json_location": ".workflow/WFS-user-auth/.task/"
"workflow_directory": ".workflow/active/WFS-user-auth/",
"todo_list_location": ".workflow/active/WFS-user-auth/TODO_LIST.md",
"summaries_directory": ".workflow/active/WFS-user-auth/.summaries/",
"task_json_location": ".workflow/active/WFS-user-auth/.task/"
}
},
"execution": {

View File

@@ -274,7 +274,7 @@ Backup saved to .task/backup/IMPL-2-v1.0.json
### Batch Mode - From Verification Report
```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...
Found 4 tasks requiring replanning:

View File

@@ -29,19 +29,19 @@ This document defines the complete workflow system architecture using a **JSON-o
```bash
.workflow/
├── sessions/
│ ├── WFS-oauth-integration/ # Session directory (active or paused)
│ ├── WFS-user-profile/ # Session directory (active or paused)
│ └── WFS-bug-fix-123/ # Session directory (completed)
├── active/
│ ├── WFS-oauth-integration/ # Active session directory
│ ├── WFS-user-profile/ # Active session directory
│ └── WFS-bug-fix-123/ # Active session directory
└── archives/
└── WFS-old-feature/ # Archived session (completed)
```
**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
- **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
@@ -709,7 +709,7 @@ All workflows use the same file structure definition regardless of complexity. *
│ │ └── index.html # Navigation page
│ └── .run-metadata.json # Run configuration
├── sessions/ # Active/paused workflow sessions
├── active/ # Active workflow sessions
│ └── WFS-[topic-slug]/
│ ├── workflow-session.json # Session metadata and state (REQUIRED)
│ ├── [.brainstorming/] # Optional brainstorming phase (created when needed)