diff --git a/.claude/commands/workflow/action-plan-verify.md b/.claude/commands/workflow/action-plan-verify.md index 64da47b5..c20ee11b 100644 --- a/.claude/commands/workflow/action-plan-verify.md +++ b/.claude/commands/workflow/action-plan-verify.md @@ -32,7 +32,7 @@ Identify inconsistencies, duplications, ambiguities, and underspecified items be IF --session parameter provided: session_id = provided session ELSE: - CHECK: .workflow/.active-* marker files + CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() ELSE: @@ -40,7 +40,7 @@ ELSE: EXIT # Derive absolute paths -session_dir = .workflow/WFS-{session} +session_dir = .workflow/sessions/WFS-{session} brainstorm_dir = session_dir/.brainstorming task_dir = session_dir/.task @@ -333,7 +333,7 @@ Output a Markdown report (no file writes) with the following structure: #### TodoWrite-Based Remediation Workflow -**Report Location**: `.workflow/WFS-{session}/.process/ACTION_PLAN_VERIFICATION.md` +**Report Location**: `.workflow/sessions/WFS-{session}/.process/ACTION_PLAN_VERIFICATION.md` **Recommended Workflow**: 1. **Create TodoWrite Task List**: Extract all findings from report @@ -361,7 +361,7 @@ Priority Order: **Save Analysis Report**: ```bash -report_path = ".workflow/WFS-{session}/.process/ACTION_PLAN_VERIFICATION.md" +report_path = ".workflow/sessions/WFS-{session}/.process/ACTION_PLAN_VERIFICATION.md" Write(report_path, full_report_content) ``` @@ -404,12 +404,12 @@ TodoWrite([ **File Modification Workflow**: ```bash # For task JSON modifications: -1. Read(.workflow/WFS-{session}/.task/IMPL-X.Y.json) +1. Read(.workflow/sessions/WFS-{session}/.task/IMPL-X.Y.json) 2. Edit() to apply fixes 3. Mark todo as completed # For IMPL_PLAN modifications: -1. Read(.workflow/WFS-{session}/IMPL_PLAN.md) +1. Read(.workflow/sessions/WFS-{session}/IMPL_PLAN.md) 2. Edit() to apply strategic changes 3. Mark todo as completed ``` diff --git a/.claude/commands/workflow/brainstorm/api-designer.md b/.claude/commands/workflow/brainstorm/api-designer.md index 51361f6e..251ca8f9 100644 --- a/.claude/commands/workflow/brainstorm/api-designer.md +++ b/.claude/commands/workflow/brainstorm/api-designer.md @@ -46,10 +46,10 @@ allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*) ### Phase 1: Session & Framework Detection ```bash # Check active session and framework -CHECK: .workflow/.active-* marker files +CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() - brainstorm_dir = .workflow/WFS-{session}/.brainstorming/ + brainstorm_dir = .workflow/sessions/WFS-{session}/.brainstorming/ CHECK: brainstorm_dir/guidance-specification.md IF EXISTS: @@ -162,7 +162,7 @@ IF update_mode = "incremental": ### Output Files ``` -.workflow/WFS-[topic]/.brainstorming/ +.workflow/sessions/WFS-[topic]/.brainstorming/ ├── guidance-specification.md # Input: Framework (if exists) └── api-designer/ └── analysis.md # ★ OUTPUT: Framework-based analysis @@ -181,7 +181,7 @@ IF update_mode = "incremental": Session detection and selection: ```bash # Check for active sessions -active_sessions=$(find .workflow -name ".active-*" 2>/dev/null) +active_sessions=$(find .workflow/sessions/ -name "WFS-*" -type d 2>/dev/null) if [ multiple_sessions ]; then prompt_user_to_select_session() else @@ -280,7 +280,7 @@ TodoWrite tracking for two-step process: ### Output Location ``` -.workflow/WFS-{topic-slug}/.brainstorming/api-designer/ +.workflow/sessions/WFS-{topic-slug}/.brainstorming/api-designer/ ├── analysis.md # Primary API design analysis ├── api-specification.md # Detailed endpoint specifications (OpenAPI/Swagger) ├── data-contracts.md # Request/response schemas and validation rules @@ -531,7 +531,7 @@ Upon completion, update `workflow-session.json`: "api_designer": { "status": "completed", "completed_at": "timestamp", - "output_directory": ".workflow/WFS-{topic}/.brainstorming/api-designer/", + "output_directory": ".workflow/sessions/WFS-{topic}/.brainstorming/api-designer/", "key_insights": ["endpoint_design", "versioning_strategy", "data_contracts"] } } diff --git a/.claude/commands/workflow/brainstorm/artifacts.md b/.claude/commands/workflow/brainstorm/artifacts.md index f1669356..50408f10 100644 --- a/.claude/commands/workflow/brainstorm/artifacts.md +++ b/.claude/commands/workflow/brainstorm/artifacts.md @@ -10,7 +10,7 @@ allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*) Six-phase workflow: **Automatic project context collection** → Extract topic challenges → Select roles → Generate task-specific questions → Detect conflicts → Generate confirmed guidance (declarative statements only). **Input**: `"GOAL: [objective] SCOPE: [boundaries] CONTEXT: [background]" [--count N]` -**Output**: `.workflow/WFS-{topic}/.brainstorming/guidance-specification.md` (CONFIRMED/SELECTED format) +**Output**: `.workflow/sessions/WFS-{topic}/.brainstorming/guidance-specification.md` (CONFIRMED/SELECTED format) **Core Principle**: Questions dynamically generated from project context + topic keywords/challenges, NOT from generic templates **Parameters**: @@ -32,7 +32,7 @@ Six-phase workflow: **Automatic project context collection** → Extract topic c **Standalone Mode**: ```json [ - {"content": "Initialize session (.workflow/.active-* check, parse --count parameter)", "status": "pending", "activeForm": "Initializing"}, + {"content": "Initialize session (.workflow/sessions/ session check, parse --count parameter)", "status": "pending", "activeForm": "Initializing"}, {"content": "Phase 0: Automatic project context collection (call context-gather)", "status": "pending", "activeForm": "Phase 0 context collection"}, {"content": "Phase 1: Extract challenges, output 2-4 task-specific questions, wait for user input", "status": "pending", "activeForm": "Phase 1 topic analysis"}, {"content": "Phase 2: Recommend count+2 roles, output role selection, wait for user input", "status": "pending", "activeForm": "Phase 2 role selection"}, @@ -133,7 +133,7 @@ b) {role-name} ({中文名}) ## Execution Phases ### Session Management -- Check `.workflow/.active-*` markers first +- Check `.workflow/sessions/` for active sessions first - Multiple sessions → Prompt selection | Single → Use it | None → Create `WFS-[topic-slug]` - Parse `--count N` parameter from user input (default: 3 if not specified) - Store decisions in `workflow-session.json` including count parameter @@ -145,7 +145,7 @@ b) {role-name} ({中文名}) **Detection Mechanism** (execute first): ```javascript // Check if context-package already exists -const contextPackagePath = `.workflow/WFS-{session-id}/.process/context-package.json`; +const contextPackagePath = `.workflow/sessions/WFS-{session-id}/.process/context-package.json`; if (file_exists(contextPackagePath)) { // Validate package @@ -229,7 +229,7 @@ Report completion with statistics. **Steps**: 1. **Load Phase 0 context** (if available): - - Read `.workflow/WFS-{session-id}/.process/context-package.json` + - Read `.workflow/sessions/WFS-{session-id}/.process/context-package.json` - Extract: tech_stack, existing modules, conflict_risk, relevant files 2. **Deep topic analysis** (context-aware): @@ -449,7 +449,7 @@ FOR each selected role: ## Output Document Template -**File**: `.workflow/WFS-{topic}/.brainstorming/guidance-specification.md` +**File**: `.workflow/sessions/WFS-{topic}/.brainstorming/guidance-specification.md` ```markdown # [Project] - Confirmed Guidance Specification @@ -596,7 +596,7 @@ ELSE: ## File Structure ``` -.workflow/WFS-[topic]/ +.workflow/sessions/WFS-[topic]/ ├── .active-brainstorming ├── workflow-session.json # Session metadata ONLY └── .brainstorming/ diff --git a/.claude/commands/workflow/brainstorm/auto-parallel.md b/.claude/commands/workflow/brainstorm/auto-parallel.md index f731693d..20d932fd 100644 --- a/.claude/commands/workflow/brainstorm/auto-parallel.md +++ b/.claude/commands/workflow/brainstorm/auto-parallel.md @@ -85,7 +85,7 @@ This workflow runs **fully autonomously** once triggered. Phase 1 (artifacts) ha **Validation**: - guidance-specification.md created with confirmed decisions - workflow-session.json contains selected_roles[] (metadata only, no content duplication) -- Session directory `.workflow/WFS-{topic}/.brainstorming/` exists +- Session directory `.workflow/sessions/WFS-{topic}/.brainstorming/` exists **TodoWrite Update (Phase 1 SlashCommand invoked - tasks attached)**: ```json @@ -132,13 +132,13 @@ Execute {role-name} analysis for existing topic framework ## Context Loading ASSIGNED_ROLE: {role-name} -OUTPUT_LOCATION: .workflow/WFS-{session}/.brainstorming/{role}/ +OUTPUT_LOCATION: .workflow/sessions/WFS-{session}/.brainstorming/{role}/ TOPIC: {user-provided-topic} ## Flow Control Steps 1. **load_topic_framework** - Action: Load structured topic discussion framework - - Command: Read(.workflow/WFS-{session}/.brainstorming/guidance-specification.md) + - Command: Read(.workflow/sessions/WFS-{session}/.brainstorming/guidance-specification.md) - Output: topic_framework_content 2. **load_role_template** @@ -148,7 +148,7 @@ TOPIC: {user-provided-topic} 3. **load_session_metadata** - Action: Load session metadata and original user intent - - Command: Read(.workflow/WFS-{session}/workflow-session.json) + - Command: Read(.workflow/sessions/WFS-{session}/workflow-session.json) - Output: session_context (contains original user prompt as PRIMARY reference) 4. **load_style_skill** (ONLY for ui-designer role when style_skill_package exists) @@ -194,7 +194,7 @@ TOPIC: {user-provided-topic} - guidance-specification.md path **Validation**: -- Each role creates `.workflow/WFS-{topic}/.brainstorming/{role}/analysis.md` (primary file) +- Each role creates `.workflow/sessions/WFS-{topic}/.brainstorming/{role}/analysis.md` (primary file) - If content is large (>800 lines), may split to `analysis-1.md`, `analysis-2.md` (max 3 files total) - **File naming pattern**: ALL files MUST start with `analysis` prefix (use `analysis*.md` for globbing) - **FORBIDDEN naming**: No `recommendations.md`, `recommendations-*.md`, or any non-`analysis` prefixed files @@ -245,7 +245,7 @@ TOPIC: {user-provided-topic} **Input**: `sessionId` from Phase 1 **Validation**: -- `.workflow/WFS-{topic}/.brainstorming/synthesis-specification.md` exists +- `.workflow/sessions/WFS-{topic}/.brainstorming/synthesis-specification.md` exists - Synthesis references all role analyses **TodoWrite Update (Phase 3 SlashCommand invoked - tasks attached)**: @@ -280,7 +280,7 @@ TOPIC: {user-provided-topic} ``` Brainstorming complete for session: {sessionId} Roles analyzed: {count} -Synthesis: .workflow/WFS-{topic}/.brainstorming/synthesis-specification.md +Synthesis: .workflow/sessions/WFS-{topic}/.brainstorming/synthesis-specification.md ✅ Next Steps: 1. /workflow:concept-clarify --session {sessionId} # Optional refinement @@ -392,7 +392,7 @@ CONTEXT_VARS: ## Session Management -**⚡ FIRST ACTION**: Check for `.workflow/.active-*` markers before Phase 1 +**⚡ FIRST ACTION**: Check `.workflow/sessions/` for active sessions before Phase 1 **Multiple Sessions Support**: - Different Claude instances can have different active brainstorming sessions @@ -408,15 +408,15 @@ CONTEXT_VARS: ## Output Structure **Phase 1 Output**: -- `.workflow/WFS-{topic}/.brainstorming/guidance-specification.md` (framework content) -- `.workflow/WFS-{topic}/workflow-session.json` (metadata: selected_roles[], topic, timestamps, style_skill_package) +- `.workflow/sessions/WFS-{topic}/.brainstorming/guidance-specification.md` (framework content) +- `.workflow/sessions/WFS-{topic}/workflow-session.json` (metadata: selected_roles[], topic, timestamps, style_skill_package) **Phase 2 Output**: -- `.workflow/WFS-{topic}/.brainstorming/{role}/analysis.md` (one per role) +- `.workflow/sessions/WFS-{topic}/.brainstorming/{role}/analysis.md` (one per role) - `.superdesign/design_iterations/` (ui-designer artifacts, if --style-skill provided) **Phase 3 Output**: -- `.workflow/WFS-{topic}/.brainstorming/synthesis-specification.md` (integrated analysis) +- `.workflow/sessions/WFS-{topic}/.brainstorming/synthesis-specification.md` (integrated analysis) **⚠️ Storage Separation**: Guidance content in .md files, metadata in .json (no duplication) **⚠️ Style References**: When --style-skill provided, workflow-session.json stores style_skill_package name, ui-designer loads from `.claude/skills/style-{package-name}/` @@ -446,7 +446,7 @@ CONTEXT_VARS: **File Structure**: ``` -.workflow/WFS-[topic]/ +.workflow/sessions/WFS-[topic]/ ├── .active-brainstorming ├── workflow-session.json # Session metadata ONLY └── .brainstorming/ diff --git a/.claude/commands/workflow/brainstorm/data-architect.md b/.claude/commands/workflow/brainstorm/data-architect.md index 902fd95b..97678b99 100644 --- a/.claude/commands/workflow/brainstorm/data-architect.md +++ b/.claude/commands/workflow/brainstorm/data-architect.md @@ -47,10 +47,10 @@ allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*) ### Phase 1: Session & Framework Detection ```bash # Check active session and framework -CHECK: .workflow/.active-* marker files +CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() - brainstorm_dir = .workflow/WFS-{session}/.brainstorming/ + brainstorm_dir = .workflow/sessions/WFS-{session}/.brainstorming/ CHECK: brainstorm_dir/guidance-specification.md IF EXISTS: @@ -87,13 +87,13 @@ Execute data-architect analysis for existing topic framework ## Context Loading ASSIGNED_ROLE: data-architect -OUTPUT_LOCATION: .workflow/WFS-{session}/.brainstorming/data-architect/ +OUTPUT_LOCATION: .workflow/sessions/WFS-{session}/.brainstorming/data-architect/ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} ## Flow Control Steps 1. **load_topic_framework** - Action: Load structured topic discussion framework - - Command: Read(.workflow/WFS-{session}/.brainstorming/guidance-specification.md) + - Command: Read(.workflow/sessions/WFS-{session}/.brainstorming/guidance-specification.md) - Output: topic_framework_content 2. **load_role_template** @@ -103,7 +103,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} 3. **load_session_metadata** - Action: Load session metadata and existing context - - Command: Read(.workflow/WFS-{session}/workflow-session.json) + - Command: Read(.workflow/sessions/WFS-{session}/workflow-session.json) - Output: session_context ## Analysis Requirements @@ -163,7 +163,7 @@ TodoWrite({ ### Framework-Based Analysis ``` -.workflow/WFS-{session}/.brainstorming/data-architect/ +.workflow/sessions/WFS-{session}/.brainstorming/data-architect/ └── analysis.md # Structured analysis addressing guidance-specification.md discussion points ``` @@ -208,7 +208,7 @@ TodoWrite({ "data_architect": { "status": "completed", "framework_addressed": true, - "output_location": ".workflow/WFS-{session}/.brainstorming/data-architect/analysis.md", + "output_location": ".workflow/sessions/WFS-{session}/.brainstorming/data-architect/analysis.md", "framework_reference": "@../guidance-specification.md" } } diff --git a/.claude/commands/workflow/brainstorm/product-manager.md b/.claude/commands/workflow/brainstorm/product-manager.md index 21de941b..77145fef 100644 --- a/.claude/commands/workflow/brainstorm/product-manager.md +++ b/.claude/commands/workflow/brainstorm/product-manager.md @@ -27,10 +27,10 @@ allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*) ### Phase 1: Session & Framework Detection ```bash # Check active session and framework -CHECK: .workflow/.active-* marker files +CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() - brainstorm_dir = .workflow/WFS-{session}/.brainstorming/ + brainstorm_dir = .workflow/sessions/WFS-{session}/.brainstorming/ CHECK: brainstorm_dir/guidance-specification.md IF EXISTS: @@ -67,13 +67,13 @@ Execute product-manager analysis for existing topic framework ## Context Loading ASSIGNED_ROLE: product-manager -OUTPUT_LOCATION: .workflow/WFS-{session}/.brainstorming/product-manager/ +OUTPUT_LOCATION: .workflow/sessions/WFS-{session}/.brainstorming/product-manager/ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} ## Flow Control Steps 1. **load_topic_framework** - Action: Load structured topic discussion framework - - Command: Read(.workflow/WFS-{session}/.brainstorming/guidance-specification.md) + - Command: Read(.workflow/sessions/WFS-{session}/.brainstorming/guidance-specification.md) - Output: topic_framework_content 2. **load_role_template** @@ -83,7 +83,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} 3. **load_session_metadata** - Action: Load session metadata and existing context - - Command: Read(.workflow/WFS-{session}/workflow-session.json) + - Command: Read(.workflow/sessions/WFS-{session}/workflow-session.json) - Output: session_context ## Analysis Requirements @@ -143,7 +143,7 @@ TodoWrite({ ### Framework-Based Analysis ``` -.workflow/WFS-{session}/.brainstorming/product-manager/ +.workflow/sessions/WFS-{session}/.brainstorming/product-manager/ └── analysis.md # Structured analysis addressing guidance-specification.md discussion points ``` @@ -188,7 +188,7 @@ TodoWrite({ "product_manager": { "status": "completed", "framework_addressed": true, - "output_location": ".workflow/WFS-{session}/.brainstorming/product-manager/analysis.md", + "output_location": ".workflow/sessions/WFS-{session}/.brainstorming/product-manager/analysis.md", "framework_reference": "@../guidance-specification.md" } } diff --git a/.claude/commands/workflow/brainstorm/product-owner.md b/.claude/commands/workflow/brainstorm/product-owner.md index f1f5317c..72d5481e 100644 --- a/.claude/commands/workflow/brainstorm/product-owner.md +++ b/.claude/commands/workflow/brainstorm/product-owner.md @@ -27,10 +27,10 @@ allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*) ### Phase 1: Session & Framework Detection ```bash # Check active session and framework -CHECK: .workflow/.active-* marker files +CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() - brainstorm_dir = .workflow/WFS-{session}/.brainstorming/ + brainstorm_dir = .workflow/sessions/WFS-{session}/.brainstorming/ CHECK: brainstorm_dir/guidance-specification.md IF EXISTS: @@ -67,13 +67,13 @@ Execute product-owner analysis for existing topic framework ## Context Loading ASSIGNED_ROLE: product-owner -OUTPUT_LOCATION: .workflow/WFS-{session}/.brainstorming/product-owner/ +OUTPUT_LOCATION: .workflow/sessions/WFS-{session}/.brainstorming/product-owner/ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} ## Flow Control Steps 1. **load_topic_framework** - Action: Load structured topic discussion framework - - Command: Read(.workflow/WFS-{session}/.brainstorming/guidance-specification.md) + - Command: Read(.workflow/sessions/WFS-{session}/.brainstorming/guidance-specification.md) - Output: topic_framework_content 2. **load_role_template** @@ -83,7 +83,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} 3. **load_session_metadata** - Action: Load session metadata and existing context - - Command: Read(.workflow/WFS-{session}/workflow-session.json) + - Command: Read(.workflow/sessions/WFS-{session}/workflow-session.json) - Output: session_context ## Analysis Requirements @@ -143,7 +143,7 @@ TodoWrite({ ### Framework-Based Analysis ``` -.workflow/WFS-{session}/.brainstorming/product-owner/ +.workflow/sessions/WFS-{session}/.brainstorming/product-owner/ └── analysis.md # Structured analysis addressing guidance-specification.md discussion points ``` @@ -188,7 +188,7 @@ TodoWrite({ "product_owner": { "status": "completed", "framework_addressed": true, - "output_location": ".workflow/WFS-{session}/.brainstorming/product-owner/analysis.md", + "output_location": ".workflow/sessions/WFS-{session}/.brainstorming/product-owner/analysis.md", "framework_reference": "@../guidance-specification.md" } } diff --git a/.claude/commands/workflow/brainstorm/scrum-master.md b/.claude/commands/workflow/brainstorm/scrum-master.md index b909542d..85065e81 100644 --- a/.claude/commands/workflow/brainstorm/scrum-master.md +++ b/.claude/commands/workflow/brainstorm/scrum-master.md @@ -27,10 +27,10 @@ allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*) ### Phase 1: Session & Framework Detection ```bash # Check active session and framework -CHECK: .workflow/.active-* marker files +CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() - brainstorm_dir = .workflow/WFS-{session}/.brainstorming/ + brainstorm_dir = .workflow/sessions/WFS-{session}/.brainstorming/ CHECK: brainstorm_dir/guidance-specification.md IF EXISTS: @@ -67,13 +67,13 @@ Execute scrum-master analysis for existing topic framework ## Context Loading ASSIGNED_ROLE: scrum-master -OUTPUT_LOCATION: .workflow/WFS-{session}/.brainstorming/scrum-master/ +OUTPUT_LOCATION: .workflow/sessions/WFS-{session}/.brainstorming/scrum-master/ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} ## Flow Control Steps 1. **load_topic_framework** - Action: Load structured topic discussion framework - - Command: Read(.workflow/WFS-{session}/.brainstorming/guidance-specification.md) + - Command: Read(.workflow/sessions/WFS-{session}/.brainstorming/guidance-specification.md) - Output: topic_framework_content 2. **load_role_template** @@ -83,7 +83,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} 3. **load_session_metadata** - Action: Load session metadata and existing context - - Command: Read(.workflow/WFS-{session}/workflow-session.json) + - Command: Read(.workflow/sessions/WFS-{session}/workflow-session.json) - Output: session_context ## Analysis Requirements @@ -143,7 +143,7 @@ TodoWrite({ ### Framework-Based Analysis ``` -.workflow/WFS-{session}/.brainstorming/scrum-master/ +.workflow/sessions/WFS-{session}/.brainstorming/scrum-master/ └── analysis.md # Structured analysis addressing guidance-specification.md discussion points ``` @@ -188,7 +188,7 @@ TodoWrite({ "scrum_master": { "status": "completed", "framework_addressed": true, - "output_location": ".workflow/WFS-{session}/.brainstorming/scrum-master/analysis.md", + "output_location": ".workflow/sessions/WFS-{session}/.brainstorming/scrum-master/analysis.md", "framework_reference": "@../guidance-specification.md" } } diff --git a/.claude/commands/workflow/brainstorm/subject-matter-expert.md b/.claude/commands/workflow/brainstorm/subject-matter-expert.md index c111ed7d..c2e52db0 100644 --- a/.claude/commands/workflow/brainstorm/subject-matter-expert.md +++ b/.claude/commands/workflow/brainstorm/subject-matter-expert.md @@ -27,10 +27,10 @@ allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*) ### Phase 1: Session & Framework Detection ```bash # Check active session and framework -CHECK: .workflow/.active-* marker files +CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() - brainstorm_dir = .workflow/WFS-{session}/.brainstorming/ + brainstorm_dir = .workflow/sessions/WFS-{session}/.brainstorming/ CHECK: brainstorm_dir/guidance-specification.md IF EXISTS: @@ -67,13 +67,13 @@ Execute subject-matter-expert analysis for existing topic framework ## Context Loading ASSIGNED_ROLE: subject-matter-expert -OUTPUT_LOCATION: .workflow/WFS-{session}/.brainstorming/subject-matter-expert/ +OUTPUT_LOCATION: .workflow/sessions/WFS-{session}/.brainstorming/subject-matter-expert/ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} ## Flow Control Steps 1. **load_topic_framework** - Action: Load structured topic discussion framework - - Command: Read(.workflow/WFS-{session}/.brainstorming/guidance-specification.md) + - Command: Read(.workflow/sessions/WFS-{session}/.brainstorming/guidance-specification.md) - Output: topic_framework_content 2. **load_role_template** @@ -83,7 +83,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} 3. **load_session_metadata** - Action: Load session metadata and existing context - - Command: Read(.workflow/WFS-{session}/workflow-session.json) + - Command: Read(.workflow/sessions/WFS-{session}/workflow-session.json) - Output: session_context ## Analysis Requirements @@ -143,7 +143,7 @@ TodoWrite({ ### Framework-Based Analysis ``` -.workflow/WFS-{session}/.brainstorming/subject-matter-expert/ +.workflow/sessions/WFS-{session}/.brainstorming/subject-matter-expert/ └── analysis.md # Structured analysis addressing guidance-specification.md discussion points ``` @@ -188,7 +188,7 @@ TodoWrite({ "subject_matter_expert": { "status": "completed", "framework_addressed": true, - "output_location": ".workflow/WFS-{session}/.brainstorming/subject-matter-expert/analysis.md", + "output_location": ".workflow/sessions/WFS-{session}/.brainstorming/subject-matter-expert/analysis.md", "framework_reference": "@../guidance-specification.md" } } diff --git a/.claude/commands/workflow/brainstorm/synthesis.md b/.claude/commands/workflow/brainstorm/synthesis.md index 3625d671..3d0351f4 100644 --- a/.claude/commands/workflow/brainstorm/synthesis.md +++ b/.claude/commands/workflow/brainstorm/synthesis.md @@ -48,7 +48,7 @@ Three-phase workflow to eliminate ambiguities and enhance conceptual depth in ro ### Phase 1: Discovery & Validation -1. **Detect Session**: Use `--session` parameter or `.workflow/.active-*` marker +1. **Detect Session**: Use `--session` parameter or find `.workflow/sessions/WFS-*` directories 2. **Validate Files**: - `guidance-specification.md` (optional, warn if missing) - `*/analysis*.md` (required, error if empty) @@ -59,7 +59,7 @@ Three-phase workflow to eliminate ambiguities and enhance conceptual depth in ro **Main flow prepares file paths for Agent**: 1. **Discover Analysis Files**: - - Glob(.workflow/WFS-{session}/.brainstorming/*/analysis*.md) + - Glob(.workflow/sessions/WFS-{session}/.brainstorming/*/analysis*.md) - Supports: analysis.md, analysis-1.md, analysis-2.md, analysis-3.md - Validate: At least one file exists (error if empty) @@ -69,7 +69,7 @@ Three-phase workflow to eliminate ambiguities and enhance conceptual depth in ro 3. **Pass to Agent** (Phase 3): - `session_id` - - `brainstorm_dir`: .workflow/WFS-{session}/.brainstorming/ + - `brainstorm_dir`: .workflow/sessions/WFS-{session}/.brainstorming/ - `role_analysis_paths`: ["product-manager/analysis.md", "system-architect/analysis-1.md", ...] - `participating_roles`: ["product-manager", "system-architect", ...] @@ -361,7 +361,7 @@ Updated {role2}/analysis.md with Clarifications section + enhanced content ## Output -**Location**: `.workflow/WFS-{session}/.brainstorming/[role]/analysis*.md` (in-place updates) +**Location**: `.workflow/sessions/WFS-{session}/.brainstorming/[role]/analysis*.md` (in-place updates) **Updated Structure**: ```markdown diff --git a/.claude/commands/workflow/brainstorm/system-architect.md b/.claude/commands/workflow/brainstorm/system-architect.md index d11fce89..f08e0494 100644 --- a/.claude/commands/workflow/brainstorm/system-architect.md +++ b/.claude/commands/workflow/brainstorm/system-architect.md @@ -46,10 +46,10 @@ allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*) ### Phase 1: Session & Framework Detection ```bash # Check active session and framework -CHECK: .workflow/.active-* marker files +CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() - brainstorm_dir = .workflow/WFS-{session}/.brainstorming/ + brainstorm_dir = .workflow/sessions/WFS-{session}/.brainstorming/ CHECK: brainstorm_dir/guidance-specification.md IF EXISTS: @@ -162,7 +162,7 @@ IF update_mode = "incremental": ### Output Files ``` -.workflow/WFS-[topic]/.brainstorming/ +.workflow/sessions/WFS-[topic]/.brainstorming/ ├── guidance-specification.md # Input: Framework (if exists) └── system-architect/ └── analysis.md # ★ OUTPUT: Framework-based analysis @@ -279,7 +279,7 @@ TodoWrite tracking for two-step process: ### Output Location ``` -.workflow/WFS-{topic-slug}/.brainstorming/system-architect/ +.workflow/sessions/WFS-{topic-slug}/.brainstorming/system-architect/ ├── analysis.md # Primary architecture analysis ├── architecture-design.md # Detailed system design and diagrams ├── technology-stack.md # Technology stack recommendations and justifications @@ -340,7 +340,7 @@ Upon completion, update `workflow-session.json`: "system_architect": { "status": "completed", "completed_at": "timestamp", - "output_directory": ".workflow/WFS-{topic}/.brainstorming/system-architect/", + "output_directory": ".workflow/sessions/WFS-{topic}/.brainstorming/system-architect/", "key_insights": ["scalability_bottleneck", "architecture_pattern", "technology_recommendation"] } } diff --git a/.claude/commands/workflow/brainstorm/ui-designer.md b/.claude/commands/workflow/brainstorm/ui-designer.md index e245f83b..963b1228 100644 --- a/.claude/commands/workflow/brainstorm/ui-designer.md +++ b/.claude/commands/workflow/brainstorm/ui-designer.md @@ -48,10 +48,10 @@ allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*) ### Phase 1: Session & Framework Detection ```bash # Check active session and framework -CHECK: .workflow/.active-* marker files +CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() - brainstorm_dir = .workflow/WFS-{session}/.brainstorming/ + brainstorm_dir = .workflow/sessions/WFS-{session}/.brainstorming/ CHECK: brainstorm_dir/guidance-specification.md IF EXISTS: @@ -88,13 +88,13 @@ Execute ui-designer analysis for existing topic framework ## Context Loading ASSIGNED_ROLE: ui-designer -OUTPUT_LOCATION: .workflow/WFS-{session}/.brainstorming/ui-designer/ +OUTPUT_LOCATION: .workflow/sessions/WFS-{session}/.brainstorming/ui-designer/ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} ## Flow Control Steps 1. **load_topic_framework** - Action: Load structured topic discussion framework - - Command: Read(.workflow/WFS-{session}/.brainstorming/guidance-specification.md) + - Command: Read(.workflow/sessions/WFS-{session}/.brainstorming/guidance-specification.md) - Output: topic_framework_content 2. **load_role_template** @@ -104,7 +104,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} 3. **load_session_metadata** - Action: Load session metadata and existing context - - Command: Read(.workflow/WFS-{session}/workflow-session.json) + - Command: Read(.workflow/sessions/WFS-{session}/workflow-session.json) - Output: session_context ## Analysis Requirements @@ -164,7 +164,7 @@ TodoWrite({ ### Framework-Based Analysis ``` -.workflow/WFS-{session}/.brainstorming/ui-designer/ +.workflow/sessions/WFS-{session}/.brainstorming/ui-designer/ └── analysis.md # Structured analysis addressing guidance-specification.md discussion points ``` @@ -209,7 +209,7 @@ TodoWrite({ "ui_designer": { "status": "completed", "framework_addressed": true, - "output_location": ".workflow/WFS-{session}/.brainstorming/ui-designer/analysis.md", + "output_location": ".workflow/sessions/WFS-{session}/.brainstorming/ui-designer/analysis.md", "framework_reference": "@../guidance-specification.md" } } diff --git a/.claude/commands/workflow/brainstorm/ux-expert.md b/.claude/commands/workflow/brainstorm/ux-expert.md index 6b909a0d..b14443d4 100644 --- a/.claude/commands/workflow/brainstorm/ux-expert.md +++ b/.claude/commands/workflow/brainstorm/ux-expert.md @@ -48,10 +48,10 @@ allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*) ### Phase 1: Session & Framework Detection ```bash # Check active session and framework -CHECK: .workflow/.active-* marker files +CHECK: find .workflow/sessions/ -name "WFS-*" -type d IF active_session EXISTS: session_id = get_active_session() - brainstorm_dir = .workflow/WFS-{session}/.brainstorming/ + brainstorm_dir = .workflow/sessions/WFS-{session}/.brainstorming/ CHECK: brainstorm_dir/guidance-specification.md IF EXISTS: @@ -88,13 +88,13 @@ Execute ux-expert analysis for existing topic framework ## Context Loading ASSIGNED_ROLE: ux-expert -OUTPUT_LOCATION: .workflow/WFS-{session}/.brainstorming/ux-expert/ +OUTPUT_LOCATION: .workflow/sessions/WFS-{session}/.brainstorming/ux-expert/ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} ## Flow Control Steps 1. **load_topic_framework** - Action: Load structured topic discussion framework - - Command: Read(.workflow/WFS-{session}/.brainstorming/guidance-specification.md) + - Command: Read(.workflow/sessions/WFS-{session}/.brainstorming/guidance-specification.md) - Output: topic_framework_content 2. **load_role_template** @@ -104,7 +104,7 @@ ANALYSIS_MODE: {framework_mode ? "framework_based" : "standalone"} 3. **load_session_metadata** - Action: Load session metadata and existing context - - Command: Read(.workflow/WFS-{session}/workflow-session.json) + - Command: Read(.workflow/sessions/WFS-{session}/workflow-session.json) - Output: session_context ## Analysis Requirements @@ -164,7 +164,7 @@ TodoWrite({ ### Framework-Based Analysis ``` -.workflow/WFS-{session}/.brainstorming/ux-expert/ +.workflow/sessions/WFS-{session}/.brainstorming/ux-expert/ └── analysis.md # Structured analysis addressing guidance-specification.md discussion points ``` @@ -209,7 +209,7 @@ TodoWrite({ "ux_expert": { "status": "completed", "framework_addressed": true, - "output_location": ".workflow/WFS-{session}/.brainstorming/ux-expert/analysis.md", + "output_location": ".workflow/sessions/WFS-{session}/.brainstorming/ux-expert/analysis.md", "framework_reference": "@../guidance-specification.md" } } diff --git a/.claude/commands/workflow/session/complete.md b/.claude/commands/workflow/session/complete.md index 4c9ec28e..a510c872 100644 --- a/.claude/commands/workflow/session/complete.md +++ b/.claude/commands/workflow/session/complete.md @@ -19,9 +19,9 @@ Mark the currently active workflow session as complete, analyze it for lessons l ## Implementation Flow -### Phase 1: Prepare for Archival (Minimal Manual Operations) +### Phase 1: Pre-Archival Preparation (Transactional Setup) -**Purpose**: Find active session, move to archive location, pass control to agent. Minimal operations. +**Purpose**: Find active session, create archiving marker to prevent concurrent operations. Session remains in active location for agent processing. #### Step 1.1: Find Active Session and Get Name ```bash @@ -33,129 +33,202 @@ bash(basename .workflow/sessions/WFS-session-name) ``` **Output**: Session name `WFS-session-name` -#### Step 1.2: Move Session to Archive +#### Step 1.2: Check for Existing Archiving Marker (Resume Detection) ```bash -# Create archive directory if needed -bash(mkdir -p .workflow/archives/) - -# Move session to archive location -bash(mv .workflow/sessions/WFS-session-name .workflow/archives/WFS-session-name) +# Check if session is already being archived +bash(test -f .workflow/sessions/WFS-session-name/.archiving && echo "RESUMING" || echo "NEW") ``` -**Result**: Session now at `.workflow/archives/WFS-session-name/` -### Phase 2: Agent-Orchestrated Completion (All Data Processing) +**If RESUMING**: +- Previous archival attempt was interrupted +- Skip to Phase 2 to resume agent analysis -**Purpose**: Agent analyzes archived session, generates metadata, updates manifest, and removes active marker. +**If NEW**: +- Continue to Step 1.3 + +#### Step 1.3: Create Archiving Marker +```bash +# Mark session as "archiving in progress" +bash(touch .workflow/sessions/WFS-session-name/.archiving) +``` +**Purpose**: +- Prevents concurrent operations on this session +- Enables recovery if archival fails +- Session remains in `.workflow/sessions/` for agent analysis + +**Result**: Session still at `.workflow/sessions/WFS-session-name/` with `.archiving` marker + +### Phase 2: Agent Analysis (In-Place Processing) + +**Purpose**: Agent analyzes session WHILE STILL IN ACTIVE LOCATION. Generates metadata but does NOT move files or update manifest. #### Agent Invocation -Invoke `universal-executor` agent to complete the archival process. +Invoke `universal-executor` agent to analyze session and prepare archive metadata. **Agent Task**: ``` Task( subagent_type="universal-executor", - description="Complete session archival", + description="Analyze session for archival", prompt=` -Complete workflow session archival. Session already moved to archive location. +Analyze workflow session for archival preparation. Session is STILL in active location. ## Context -- Session: .workflow/archives/WFS-session-name/ +- Session: .workflow/sessions/WFS-session-name/ +- Status: Marked as archiving (.archiving marker present) +- Location: Active sessions directory (NOT archived yet) ## Tasks -1. **Extract session data** from workflow-session.json (session_id, description/topic, started_at/timestamp, completed_at, status) +1. **Extract session data** from workflow-session.json + - session_id, description/topic, started_at, completed_at, status - If status != "completed", update it with timestamp 2. **Count files**: tasks (.task/*.json) and summaries (.summaries/*.md) -3. **Generate lessons**: Use gemini with ~/.claude/workflows/cli-templates/prompts/archive/analysis-simple.txt (fallback: analyze files directly) +3. **Generate lessons**: Use gemini with ~/.claude/workflows/cli-templates/prompts/archive/analysis-simple.txt - Return: {successes, challenges, watch_patterns} 4. **Build archive entry**: - Calculate: duration_hours, success_rate, tags (3-5 keywords) - - Construct complete JSON with session_id, description, archived_at, archive_path, metrics, tags, lessons + - Construct complete JSON with session_id, description, archived_at, metrics, tags, lessons + - Include archive_path: ".workflow/archives/WFS-session-name" (future location) -5. **Update manifest**: Initialize .workflow/archives/manifest.json if needed, append entry +5. **Extract feature metadata** (for Phase 4): + - Parse IMPL_PLAN.md for title (first # heading) + - Extract description (first paragraph, max 200 chars) + - Generate feature tags (3-5 keywords from content) -6. **Return result**: {"status": "success", "session_id": "...", "archived_at": "...", "metrics": {...}, "lessons_summary": {...}} +6. **Return result**: Complete metadata package for atomic commit + { + "status": "success", + "session_id": "WFS-session-name", + "archive_entry": { + "session_id": "...", + "description": "...", + "archived_at": "...", + "archive_path": ".workflow/archives/WFS-session-name", + "metrics": {...}, + "tags": [...], + "lessons": {...} + }, + "feature_metadata": { + "title": "...", + "description": "...", + "tags": [...] + } + } + +## Important Constraints +- DO NOT move or delete any files +- DO NOT update manifest.json yet +- Session remains in .workflow/sessions/ during analysis +- Return complete metadata package for orchestrator to commit atomically ## Error Handling - On failure: return {"status": "error", "task": "...", "message": "..."} +- Do NOT modify any files on error ` ) ``` **Expected Output**: -- Agent returns JSON result confirming successful archival -- Display completion summary to user based on agent response +- Agent returns complete metadata package +- Session remains in `.workflow/sessions/` with `.archiving` marker +- No files moved or manifests updated yet -## Workflow Execution Strategy +### Phase 3: Atomic Commit (Transactional File Operations) -### Two-Phase Approach (Optimized) +**Purpose**: Atomically commit all changes. Only execute if Phase 2 succeeds. -**Phase 1: Minimal Manual Setup** (2 simple operations) -- Find active session and extract name -- Move session to archive location -- **No data extraction** - agent handles all data processing -- **No counting** - agent does this from archive location -- **Total**: 2 bash commands (find + move) +#### Step 3.1: Create Archive Directory +```bash +bash(mkdir -p .workflow/archives/) +``` -**Phase 2: Agent-Driven Completion** (1 agent invocation) -- Extract all session data from archived location -- Count tasks and summaries -- Generate lessons learned analysis -- Build complete archive metadata -- Update manifest -- Return success/error result +#### Step 3.2: Move Session to Archive +```bash +bash(mv .workflow/sessions/WFS-session-name .workflow/archives/WFS-session-name) +``` +**Result**: Session now at `.workflow/archives/WFS-session-name/` -### Phase 3: Update Project Feature Registry +#### Step 3.3: Update Manifest +```bash +# Read current manifest (or create empty array if not exists) +bash(test -f .workflow/archives/manifest.json && cat .workflow/archives/manifest.json || echo "[]") +``` + +**JSON Update Logic**: +```javascript +// Read agent result from Phase 2 +const agentResult = JSON.parse(agentOutput); +const archiveEntry = agentResult.archive_entry; + +// Read existing manifest +let manifest = []; +try { + const manifestContent = Read('.workflow/archives/manifest.json'); + manifest = JSON.parse(manifestContent); +} catch { + manifest = []; // Initialize if not exists +} + +// Append new entry +manifest.push(archiveEntry); + +// Write back +Write('.workflow/archives/manifest.json', JSON.stringify(manifest, null, 2)); +``` + +#### Step 3.4: Remove Archiving Marker +```bash +bash(rm .workflow/archives/WFS-session-name/.archiving) +``` +**Result**: Clean archived session without temporary markers + +**Output Confirmation**: +``` +✓ Session "${sessionId}" archived successfully + Location: .workflow/archives/WFS-session-name/ + Lessons: ${archiveEntry.lessons.successes.length} successes, ${archiveEntry.lessons.challenges.length} challenges + Manifest: Updated with ${manifest.length} total sessions +``` + +### Phase 4: Update Project Feature Registry **Purpose**: Record completed session as a project feature in `.workflow/project.json`. -**Execution**: After agent successfully completes archival, extract feature information and update project registry. +**Execution**: Uses feature metadata from Phase 2 agent result to update project registry. -#### Step 3.1: Check Project State Exists +#### Step 4.1: Check Project State Exists ```bash bash(test -f .workflow/project.json && echo "EXISTS" || echo "SKIP") ``` -**If SKIP**: Output warning and skip Phase 3 +**If SKIP**: Output warning and skip Phase 4 ``` WARNING: No project.json found. Run /workflow:session:start to initialize. ``` -#### Step 3.2: Extract Feature Information (Simple Text Processing) +#### Step 4.2: Extract Feature Information from Agent Result -```bash -# Read archived IMPL_PLAN.md -bash(cat .workflow/archives/WFS-session-name/IMPL_PLAN.md | head -20) -``` - -**Data Processing** (No agent needed): -1. Extract feature title: First `#` heading line -2. Extract description: First paragraph after heading (max 200 chars) -3. Get session_id from archive path -4. Get completion timestamp - -**Extraction Logic**: +**Data Processing** (Uses Phase 2 agent output): ```javascript -// Read IMPL_PLAN.md -const planContent = Read(`${archivePath}/IMPL_PLAN.md`); +// Extract feature metadata from agent result +const agentResult = JSON.parse(agentOutput); +const featureMeta = agentResult.feature_metadata; -// Extract title (first # heading) -const titleMatch = planContent.match(/^#\s+(.+)$/m); -const title = titleMatch ? titleMatch[1].trim() : sessionId.replace('WFS-', ''); - -// Extract description (first paragraph, max 200 chars) -const descMatch = planContent.match(/^#[^\n]+\n\n([^\n]+)/m); -const description = descMatch ? descMatch[1].substring(0, 200).trim() : ''; +// Data already prepared by agent: +const title = featureMeta.title; +const description = featureMeta.description; +const tags = featureMeta.tags; // Create feature ID (lowercase slug) const featureId = title.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 50); ``` -#### Step 3.3: Update project.json +#### Step 4.3: Update project.json ```bash # Read current project state @@ -245,7 +318,7 @@ function getLatestCommitHash() { } ``` -#### Step 3.4: Output Confirmation +#### Step 4.4: Output Confirmation ``` ✓ Feature "${title}" added to project registry @@ -256,7 +329,162 @@ function getLatestCommitHash() { **Error Handling**: - If project.json malformed: Output error, skip update -- If IMPL_PLAN.md missing: Use session_id as title +- If feature_metadata missing from agent result: Skip Phase 4 - If extraction fails: Use minimal defaults -**Phase 3 Total Commands**: 2 bash reads + JSON manipulation +**Phase 4 Total Commands**: 1 bash read + JSON manipulation + +## Error Recovery + +### If Agent Fails (Phase 2) + +**Symptoms**: +- Agent returns `{"status": "error", ...}` +- Agent crashes or times out +- Analysis incomplete + +**Recovery Steps**: +```bash +# Session still in .workflow/sessions/WFS-session-name +# Remove archiving marker +bash(rm .workflow/sessions/WFS-session-name/.archiving) +``` + +**User Notification**: +``` +ERROR: Session archival failed during analysis phase +Reason: [error message from agent] +Session remains active in: .workflow/sessions/WFS-session-name + +Recovery: +1. Fix any issues identified in error message +2. Retry: /workflow:session:complete + +Session state: SAFE (no changes committed) +``` + +### If Move Fails (Phase 3) + +**Symptoms**: +- `mv` command fails +- Permission denied +- Disk full + +**Recovery Steps**: +```bash +# Archiving marker still present +# Session still in .workflow/sessions/ (move failed) +# No manifest updated yet +``` + +**User Notification**: +``` +ERROR: Session archival failed during move operation +Reason: [mv error message] +Session remains in: .workflow/sessions/WFS-session-name + +Recovery: +1. Fix filesystem issues (permissions, disk space) +2. Retry: /workflow:session:complete + - System will detect .archiving marker + - Will resume from Phase 2 (agent analysis) + +Session state: SAFE (analysis complete, ready to retry move) +``` + +### If Manifest Update Fails (Phase 3) + +**Symptoms**: +- JSON parsing error +- Write permission denied +- Session moved but manifest not updated + +**Recovery Steps**: +```bash +# Session moved to .workflow/archives/WFS-session-name +# Manifest NOT updated +# Archiving marker still present in archived location +``` + +**User Notification**: +``` +ERROR: Session archived but manifest update failed +Reason: [error message] +Session location: .workflow/archives/WFS-session-name + +Recovery: +1. Fix manifest.json issues (syntax, permissions) +2. Manual manifest update: + - Add archive entry from agent output + - Remove .archiving marker: rm .workflow/archives/WFS-session-name/.archiving + +Session state: PARTIALLY COMPLETE (session archived, manifest needs update) +``` + +## Workflow Execution Strategy + +### Transactional Four-Phase Approach + +**Phase 1: Pre-Archival Preparation** (Marker creation) +- Find active session and extract name +- Check for existing `.archiving` marker (resume detection) +- Create `.archiving` marker if new +- **No data processing** - just state tracking +- **Total**: 2-3 bash commands (find + marker check/create) + +**Phase 2: Agent Analysis** (Read-only data processing) +- Extract all session data from active location +- Count tasks and summaries +- Generate lessons learned analysis +- Extract feature metadata from IMPL_PLAN.md +- Build complete archive + feature metadata package +- **No file modifications** - pure analysis +- **Total**: 1 agent invocation + +**Phase 3: Atomic Commit** (Transactional file operations) +- Create archive directory +- Move session to archive location +- Update manifest.json with archive entry +- Remove `.archiving` marker +- **All-or-nothing**: Either all succeed or session remains in safe state +- **Total**: 4 bash commands + JSON manipulation + +**Phase 4: Project Registry Update** (Optional feature tracking) +- Check project.json exists +- Use feature metadata from Phase 2 agent result +- Build feature object with complete traceability +- Update project statistics +- **Independent**: Can fail without affecting archival +- **Total**: 1 bash read + JSON manipulation + +### Transactional Guarantees + +**State Consistency**: +- Session NEVER in inconsistent state +- `.archiving` marker enables safe resume +- Agent failure leaves session in recoverable state +- Move/manifest operations grouped in Phase 3 + +**Failure Isolation**: +- Phase 1 failure: No changes made +- Phase 2 failure: Session still active, can retry +- Phase 3 failure: Clear error state, manual recovery documented +- Phase 4 failure: Does not affect archival success + +**Resume Capability**: +- Detect interrupted archival via `.archiving` marker +- Resume from Phase 2 (skip marker creation) +- Idempotent operations (safe to retry) + +### Benefits Over Previous Design + +**Old Design Weakness**: +- Move first → agent second +- Agent failure → session moved but metadata incomplete +- Inconsistent state requires manual cleanup + +**New Design Strengths**: +- Agent first → move second +- Agent failure → session still active, safe to retry +- Transactional commit → all-or-nothing file operations +- Marker-based state → resume capability diff --git a/.claude/commands/workflow/session/list.md b/.claude/commands/workflow/session/list.md index f46c90d9..784bf480 100644 --- a/.claude/commands/workflow/session/list.md +++ b/.claude/commands/workflow/session/list.md @@ -19,35 +19,35 @@ Display all workflow sessions with their current status, progress, and metadata. ### Step 1: Find All Sessions ```bash -ls .workflow/WFS-* 2>/dev/null +ls .workflow/sessions/WFS-* 2>/dev/null ``` ### Step 2: Check Active Session ```bash -ls .workflow/.active-* 2>/dev/null | head -1 +find .workflow/sessions/ -name "WFS-*" -type d 2>/dev/null | head -1 ``` ### Step 3: Read Session Metadata ```bash -jq -r '.session_id, .status, .project' .workflow/WFS-session/workflow-session.json +jq -r '.session_id, .status, .project' .workflow/sessions/WFS-session/workflow-session.json ``` ### Step 4: Count Task Progress ```bash -find .workflow/WFS-session/.task/ -name "*.json" -type f 2>/dev/null | wc -l -find .workflow/WFS-session/.summaries/ -name "*.md" -type f 2>/dev/null | wc -l +find .workflow/sessions/WFS-session/.task/ -name "*.json" -type f 2>/dev/null | wc -l +find .workflow/sessions/WFS-session/.summaries/ -name "*.md" -type f 2>/dev/null | wc -l ``` ### Step 5: Get Creation Time ```bash -jq -r '.created_at // "unknown"' .workflow/WFS-session/workflow-session.json +jq -r '.created_at // "unknown"' .workflow/sessions/WFS-session/workflow-session.json ``` ## Simple Bash Commands ### Basic Operations -- **List sessions**: `find .workflow/ -maxdepth 1 -type d -name "WFS-*"` -- **Find active**: `find .workflow/ -name ".active-*" -type f` +- **List sessions**: `find .workflow/sessions/ -name "WFS-*" -type d` +- **Find active**: `find .workflow/sessions/ -name "WFS-*" -type d` - **Read session data**: `jq -r '.session_id, .status' session.json` - **Count tasks**: `find .task/ -name "*.json" -type f | wc -l` - **Count completed**: `find .summaries/ -name "*.md" -type f 2>/dev/null | wc -l` @@ -89,11 +89,8 @@ Total: 3 sessions (1 active, 1 paused, 1 completed) ### Quick Commands ```bash # Count all sessions -ls .workflow/WFS-* | wc -l - -# Show only active -ls .workflow/.active-* | basename | sed 's/^\.active-//' +ls .workflow/sessions/WFS-* | wc -l # Show recent sessions -ls -t .workflow/WFS-*/workflow-session.json | head -3 +ls -t .workflow/sessions/WFS-*/workflow-session.json | head -3 ``` \ No newline at end of file diff --git a/.claude/commands/workflow/session/resume.md b/.claude/commands/workflow/session/resume.md index 19c8d390..77e99c54 100644 --- a/.claude/commands/workflow/session/resume.md +++ b/.claude/commands/workflow/session/resume.md @@ -17,45 +17,39 @@ Resume the most recently paused workflow session, restoring all context and stat ### Step 1: Find Paused Sessions ```bash -ls .workflow/WFS-* 2>/dev/null +ls .workflow/sessions/WFS-* 2>/dev/null ``` ### Step 2: Check Session Status ```bash -jq -r '.status' .workflow/WFS-session/workflow-session.json +jq -r '.status' .workflow/sessions/WFS-session/workflow-session.json ``` ### Step 3: Find Most Recent Paused ```bash -ls -t .workflow/WFS-*/workflow-session.json | head -1 +ls -t .workflow/sessions/WFS-*/workflow-session.json | head -1 ``` ### Step 4: Update Session Status ```bash -jq '.status = "active"' .workflow/WFS-session/workflow-session.json > temp.json -mv temp.json .workflow/WFS-session/workflow-session.json +jq '.status = "active"' .workflow/sessions/WFS-session/workflow-session.json > temp.json +mv temp.json .workflow/sessions/WFS-session/workflow-session.json ``` ### Step 5: Add Resume Timestamp ```bash -jq '.resumed_at = "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"' .workflow/WFS-session/workflow-session.json > temp.json -mv temp.json .workflow/WFS-session/workflow-session.json -``` - -### Step 6: Create Active Marker -```bash -touch .workflow/.active-WFS-session-name +jq '.resumed_at = "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"' .workflow/sessions/WFS-session/workflow-session.json > temp.json +mv temp.json .workflow/sessions/WFS-session/workflow-session.json ``` ## Simple Bash Commands ### Basic Operations -- **List sessions**: `ls .workflow/WFS-*` +- **List sessions**: `ls .workflow/sessions/WFS-*` - **Check status**: `jq -r '.status' session.json` -- **Find recent**: `ls -t .workflow/*/workflow-session.json | head -1` +- **Find recent**: `ls -t .workflow/sessions/*/workflow-session.json | head -1` - **Update status**: `jq '.status = "active"' session.json > temp.json` - **Add timestamp**: `jq '.resumed_at = "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"'` -- **Create marker**: `touch .workflow/.active-session` ### Resume Result ``` diff --git a/.claude/commands/workflow/tdd-plan.md b/.claude/commands/workflow/tdd-plan.md index 3cb1d4b7..f395561b 100644 --- a/.claude/commands/workflow/tdd-plan.md +++ b/.claude/commands/workflow/tdd-plan.md @@ -496,7 +496,7 @@ Supports action-planning-agent for more autonomous TDD planning with: **Session Structure**: ``` -.workflow/WFS-xxx/ +.workflow/sessions/WFS-xxx/ ├── IMPL_PLAN.md (unified plan with TDD Implementation Tasks section) ├── TODO_LIST.md (with internal TDD phase indicators) ├── .process/ diff --git a/.claude/commands/workflow/tdd-verify.md b/.claude/commands/workflow/tdd-verify.md index fbfb85da..395c1ed0 100644 --- a/.claude/commands/workflow/tdd-verify.md +++ b/.claude/commands/workflow/tdd-verify.md @@ -28,7 +28,7 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(gemini:*) sessionId = argument # Else auto-detect active session -find .workflow/ -name '.active-*' | head -1 | sed 's/.*active-//' +find .workflow/sessions/ -name "WFS-*" -type d | head -1 | sed 's/.*\///' ``` **Extract**: sessionId @@ -44,18 +44,18 @@ find .workflow/ -name '.active-*' | head -1 | sed 's/.*active-//' ```bash # Load all task JSONs -find .workflow/{sessionId}/.task/ -name '*.json' +find .workflow/sessions/{sessionId}/.task/ -name '*.json' # Extract task IDs -find .workflow/{sessionId}/.task/ -name '*.json' -exec jq -r '.id' {} \; +find .workflow/sessions/{sessionId}/.task/ -name '*.json' -exec jq -r '.id' {} \; # Check dependencies -find .workflow/{sessionId}/.task/ -name 'IMPL-*.json' -exec jq -r '.context.depends_on[]?' {} \; -find .workflow/{sessionId}/.task/ -name 'REFACTOR-*.json' -exec jq -r '.context.depends_on[]?' {} \; +find .workflow/sessions/{sessionId}/.task/ -name 'IMPL-*.json' -exec jq -r '.context.depends_on[]?' {} \; +find .workflow/sessions/{sessionId}/.task/ -name 'REFACTOR-*.json' -exec jq -r '.context.depends_on[]?' {} \; # Check meta fields -find .workflow/{sessionId}/.task/ -name '*.json' -exec jq -r '.meta.tdd_phase' {} \; -find .workflow/{sessionId}/.task/ -name '*.json' -exec jq -r '.meta.agent' {} \; +find .workflow/sessions/{sessionId}/.task/ -name '*.json' -exec jq -r '.meta.tdd_phase' {} \; +find .workflow/sessions/{sessionId}/.task/ -name '*.json' -exec jq -r '.meta.agent' {} \; ``` **Validation**: @@ -82,9 +82,9 @@ find .workflow/{sessionId}/.task/ -name '*.json' -exec jq -r '.meta.agent' {} \; - Compliance score **Validation**: -- `.workflow/{sessionId}/.process/test-results.json` exists -- `.workflow/{sessionId}/.process/coverage-report.json` exists -- `.workflow/{sessionId}/.process/tdd-cycle-report.md` exists +- `.workflow/sessions/{sessionId}/.process/test-results.json` exists +- `.workflow/sessions/{sessionId}/.process/coverage-report.json` exists +- `.workflow/sessions/{sessionId}/.process/tdd-cycle-report.md` exists **TodoWrite**: Mark phase 3 completed, phase 4 in_progress @@ -97,7 +97,7 @@ find .workflow/{sessionId}/.task/ -name '*.json' -exec jq -r '.meta.agent' {} \; cd project-root && gemini -p " PURPOSE: Generate TDD compliance report TASK: Analyze TDD workflow execution and generate quality report -CONTEXT: @{.workflow/{sessionId}/.task/*.json,.workflow/{sessionId}/.summaries/*,.workflow/{sessionId}/.process/tdd-cycle-report.md} +CONTEXT: @{.workflow/sessions/{sessionId}/.task/*.json,.workflow/sessions/{sessionId}/.summaries/*,.workflow/sessions/{sessionId}/.process/tdd-cycle-report.md} EXPECTED: - TDD compliance score (0-100) - Chain completeness verification @@ -106,7 +106,7 @@ EXPECTED: - Red-Green-Refactor cycle validation - Best practices adherence assessment RULES: Focus on TDD best practices and workflow adherence. Be specific about violations and improvements. -" > .workflow/{sessionId}/TDD_COMPLIANCE_REPORT.md +" > .workflow/sessions/{sessionId}/TDD_COMPLIANCE_REPORT.md ``` **Output**: TDD_COMPLIANCE_REPORT.md @@ -134,7 +134,7 @@ Function Coverage: {percentage}% ## Compliance Score: {score}/100 -Detailed report: .workflow/{sessionId}/TDD_COMPLIANCE_REPORT.md +Detailed report: .workflow/sessions/{sessionId}/TDD_COMPLIANCE_REPORT.md Recommendations: - Complete missing REFACTOR-3.1 task @@ -168,7 +168,7 @@ TodoWrite({todos: [ ### Chain Validation Algorithm ``` -1. Load all task JSONs from .workflow/{sessionId}/.task/ +1. Load all task JSONs from .workflow/sessions/{sessionId}/.task/ 2. Extract task IDs and group by feature number 3. For each feature: - Check TEST-N.M exists @@ -202,7 +202,7 @@ Final Score: Max(0, Base Score - Deductions) ## Output Files ``` -.workflow/{session-id}/ +.workflow/sessions/{session-id}/ ├── TDD_COMPLIANCE_REPORT.md # Comprehensive compliance report ⭐ └── .process/ ├── test-results.json # From tdd-coverage-analysis @@ -215,8 +215,8 @@ Final Score: Max(0, Base Score - Deductions) ### Session Discovery Errors | Error | Cause | Resolution | |-------|-------|------------| -| No active session | No .active-* file | Provide session-id explicitly | -| Multiple active sessions | Multiple .active-* files | Provide session-id explicitly | +| No active session | No WFS-* directories | Provide session-id explicitly | +| Multiple active sessions | Multiple WFS-* directories | Provide session-id explicitly | | Session not found | Invalid session-id | Check available sessions | ### Validation Errors diff --git a/.claude/commands/workflow/test-cycle-execute.md b/.claude/commands/workflow/test-cycle-execute.md index a2ea6fd6..59c40453 100644 --- a/.claude/commands/workflow/test-cycle-execute.md +++ b/.claude/commands/workflow/test-cycle-execute.md @@ -543,7 +543,7 @@ This package is passed to agents via the Task tool's prompt context. "coverage_target": 80 }, "session": { - "workflow_dir": ".workflow/WFS-test-{session}/", + "workflow_dir": ".workflow/sessions/WFS-test-{session}/", "iteration_state_file": ".process/iteration-state.json", "test_results_file": ".process/test-results.json", "fix_history_file": ".process/fix-history.json" @@ -555,7 +555,7 @@ This package is passed to agents via the Task tool's prompt context. ### Test-Fix Session Files ``` -.workflow/WFS-test-{session}/ +.workflow/sessions/WFS-test-{session}/ ├── workflow-session.json # Session metadata with workflow_type ├── IMPL_PLAN.md # Test plan ├── TODO_LIST.md # Progress tracking diff --git a/.claude/commands/workflow/test-fix-gen.md b/.claude/commands/workflow/test-fix-gen.md index 0e4119be..edad3b00 100644 --- a/.claude/commands/workflow/test-fix-gen.md +++ b/.claude/commands/workflow/test-fix-gen.md @@ -513,7 +513,7 @@ If quality gate fails: ### Output Files Structure -Created in `.workflow/WFS-test-[session]/`: +Created in `.workflow/sessions/WFS-test-[session]/`: ``` WFS-test-[session]/ @@ -579,7 +579,7 @@ Test-Fix-Gen Workflow Orchestrator (Dual-Mode Support) └─ Command ends, control returns to user Artifacts Created: -├── .workflow/WFS-test-[session]/ +├── .workflow/sessions/WFS-test-[session]/ │ ├── workflow-session.json │ ├── IMPL_PLAN.md │ ├── TODO_LIST.md diff --git a/.claude/commands/workflow/test-gen.md b/.claude/commands/workflow/test-gen.md index 6ae03370..00287e8f 100644 --- a/.claude/commands/workflow/test-gen.md +++ b/.claude/commands/workflow/test-gen.md @@ -397,7 +397,7 @@ Test-Gen Workflow Orchestrator └─ Command ends, control returns to user Artifacts Created: -├── .workflow/WFS-test-[session]/ +├── .workflow/sessions/WFS-test-[session]/ │ ├── workflow-session.json │ ├── IMPL_PLAN.md │ ├── TODO_LIST.md @@ -444,7 +444,7 @@ See `/workflow:tools:test-task-generate` for complete task JSON schemas. ## Output Files -Created in `.workflow/WFS-test-[session]/`: +Created in `.workflow/sessions/WFS-test-[session]/`: - `workflow-session.json` - Session metadata - `.process/test-context-package.json` - Coverage analysis - `.process/TEST_ANALYSIS_RESULTS.md` - Test requirements diff --git a/.claude/commands/workflow/tools/conflict-resolution.md b/.claude/commands/workflow/tools/conflict-resolution.md index 2c8b9fe6..01bd6b98 100644 --- a/.claude/commands/workflow/tools/conflict-resolution.md +++ b/.claude/commands/workflow/tools/conflict-resolution.md @@ -3,8 +3,8 @@ name: conflict-resolution description: Detect and resolve conflicts between plan and existing codebase using CLI-powered analysis with Gemini/Qwen argument-hint: "--session WFS-session-id --context path/to/context-package.json" examples: - - /workflow:tools:conflict-resolution --session WFS-auth --context .workflow/WFS-auth/.process/context-package.json - - /workflow:tools:conflict-resolution --session WFS-payment --context .workflow/WFS-payment/.process/context-package.json + - /workflow:tools:conflict-resolution --session WFS-auth --context .workflow/sessions/WFS-auth/.process/context-package.json + - /workflow:tools:conflict-resolution --session WFS-payment --context .workflow/sessions/WFS-payment/.process/context-package.json --- # Conflict Resolution Command diff --git a/.claude/commands/workflow/tools/context-gather.md b/.claude/commands/workflow/tools/context-gather.md index e3e602df..3e51cd9a 100644 --- a/.claude/commands/workflow/tools/context-gather.md +++ b/.claude/commands/workflow/tools/context-gather.md @@ -156,7 +156,7 @@ The context-search-agent MUST perform historical archive analysis as Track 1 in **Step 1: Check for Archive Manifest** ```bash # Check if archive manifest exists -if [[ -f .workflow/.archives/manifest.json ]]; then +if [[ -f .workflow/archives/manifest.json ]]; then # Manifest available for querying fi ``` @@ -235,7 +235,7 @@ if (historicalConflicts.length > 0 && currentRisk === "low") { ### Archive Query Algorithm ```markdown -1. IF .workflow/.archives/manifest.json does NOT exist → Skip Track 1, continue to Track 2 +1. IF .workflow/archives/manifest.json does NOT exist → Skip Track 1, continue to Track 2 2. IF manifest exists: a. Load manifest.json b. Extract keywords from task_description (nouns, verbs, technical terms) diff --git a/.claude/commands/workflow/tools/task-generate-agent.md b/.claude/commands/workflow/tools/task-generate-agent.md index c90bd32f..2c99ceea 100644 --- a/.claude/commands/workflow/tools/task-generate-agent.md +++ b/.claude/commands/workflow/tools/task-generate-agent.md @@ -231,13 +231,13 @@ const agentContext = { // Use memory if available, else load session_metadata: memory.has("workflow-session.json") ? memory.get("workflow-session.json") - : Read(.workflow/WFS-[id]/workflow-session.json), + : Read(.workflow/sessions/WFS-[id]/workflow-session.json), - context_package_path: ".workflow/WFS-[id]/.process/context-package.json", + context_package_path: ".workflow/sessions/WFS-[id]/.process/context-package.json", context_package: memory.has("context-package.json") ? memory.get("context-package.json") - : Read(".workflow/WFS-[id]/.process/context-package.json"), + : Read(".workflow/sessions/WFS-[id]/.process/context-package.json"), // Extract brainstorm artifacts from context package brainstorm_artifacts: extractBrainstormArtifacts(context_package), diff --git a/.claude/commands/workflow/tools/task-generate-tdd.md b/.claude/commands/workflow/tools/task-generate-tdd.md index 7cebed30..04e93a8a 100644 --- a/.claude/commands/workflow/tools/task-generate-tdd.md +++ b/.claude/commands/workflow/tools/task-generate-tdd.md @@ -338,19 +338,19 @@ const agentContext = { // Use memory if available, else load session_metadata: memory.has("workflow-session.json") ? memory.get("workflow-session.json") - : Read(.workflow/WFS-[id]/workflow-session.json), + : Read(.workflow/sessions/WFS-[id]/workflow-session.json), - context_package_path: ".workflow/WFS-[id]/.process/context-package.json", + context_package_path: ".workflow/sessions/WFS-[id]/.process/context-package.json", context_package: memory.has("context-package.json") ? memory.get("context-package.json") - : Read(".workflow/WFS-[id]/.process/context-package.json"), + : Read(".workflow/sessions/WFS-[id]/.process/context-package.json"), - test_context_package_path: ".workflow/WFS-[id]/.process/test-context-package.json", + test_context_package_path: ".workflow/sessions/WFS-[id]/.process/test-context-package.json", test_context_package: memory.has("test-context-package.json") ? memory.get("test-context-package.json") - : Read(".workflow/WFS-[id]/.process/test-context-package.json"), + : Read(".workflow/sessions/WFS-[id]/.process/test-context-package.json"), // Extract brainstorm artifacts from context package brainstorm_artifacts: extractBrainstormArtifacts(context_package), diff --git a/.claude/commands/workflow/tools/task-generate.md b/.claude/commands/workflow/tools/task-generate.md index 1c35fdaf..c3fe5213 100644 --- a/.claude/commands/workflow/tools/task-generate.md +++ b/.claude/commands/workflow/tools/task-generate.md @@ -224,7 +224,7 @@ Each task JSON embeds all necessary context, artifacts, and execution steps usin - `id`: Task identifier (format: `IMPL-N` or `IMPL-N.M` for subtasks) - `title`: Descriptive task name - `status`: Task state (`pending|active|completed|blocked|container`) -- `context_package_path`: Path to context package (`.workflow/WFS-[session]/.process/context-package.json`) +- `context_package_path`: Path to context package (`.workflow/sessions/WFS-[session]/.process/context-package.json`) - `meta`: Task metadata - `context`: Task-specific context and requirements - `flow_control`: Execution steps and workflow @@ -269,7 +269,7 @@ Each task JSON embeds all necessary context, artifacts, and execution steps usin "id": "IMPL-1", "title": "Implement feature X with Y components", "status": "pending", - "context_package_path": ".workflow/WFS-session/.process/context-package.json", + "context_package_path": ".workflow/sessions/WFS-session/.process/context-package.json", "meta": { "type": "feature", "agent": "@code-developer", @@ -291,7 +291,7 @@ Each task JSON embeds all necessary context, artifacts, and execution steps usin "depends_on": [], "artifacts": [ { - "path": ".workflow/WFS-session/.brainstorming/system-architect/analysis.md", + "path": ".workflow/sessions/WFS-session/.brainstorming/system-architect/analysis.md", "priority": "highest", "usage": "Architecture decisions and API specifications" } diff --git a/.claude/commands/workflow/tools/tdd-coverage-analysis.md b/.claude/commands/workflow/tools/tdd-coverage-analysis.md index 7f8a7c7d..1bdb1c2f 100644 --- a/.claude/commands/workflow/tools/tdd-coverage-analysis.md +++ b/.claude/commands/workflow/tools/tdd-coverage-analysis.md @@ -272,6 +272,6 @@ Function Coverage: 91% Overall Compliance: 93/100 -Detailed report: .workflow/WFS-auth/.process/tdd-cycle-report.md +Detailed report: .workflow/sessions/WFS-auth/.process/tdd-cycle-report.md ``` diff --git a/.claude/commands/workflow/tools/test-concept-enhanced.md b/.claude/commands/workflow/tools/test-concept-enhanced.md index 2fb173ee..e58aadde 100644 --- a/.claude/commands/workflow/tools/test-concept-enhanced.md +++ b/.claude/commands/workflow/tools/test-concept-enhanced.md @@ -3,7 +3,7 @@ name: test-concept-enhanced description: Analyze test requirements and generate test generation strategy using Gemini with test-context package argument-hint: "--session WFS-test-session-id --context path/to/test-context-package.json" examples: - - /workflow:tools:test-concept-enhanced --session WFS-test-auth --context .workflow/WFS-test-auth/.process/test-context-package.json + - /workflow:tools:test-concept-enhanced --session WFS-test-auth --context .workflow/sessions/WFS-test-auth/.process/test-context-package.json --- # Test Concept Enhanced Command diff --git a/.claude/commands/workflow/tools/test-task-generate.md b/.claude/commands/workflow/tools/test-task-generate.md index d05d1d70..84dedb1f 100644 --- a/.claude/commands/workflow/tools/test-task-generate.md +++ b/.claude/commands/workflow/tools/test-task-generate.md @@ -273,19 +273,19 @@ const agentContext = { // Use memory if available, else load session_metadata: memory.has("workflow-session.json") ? memory.get("workflow-session.json") - : Read(.workflow/WFS-test-[id]/workflow-session.json), + : Read(.workflow/sessions/WFS-test-[id]/workflow-session.json), - test_analysis_results_path: ".workflow/WFS-test-[id]/.process/TEST_ANALYSIS_RESULTS.md", + test_analysis_results_path: ".workflow/sessions/WFS-test-[id]/.process/TEST_ANALYSIS_RESULTS.md", test_analysis_results: memory.has("TEST_ANALYSIS_RESULTS.md") ? memory.get("TEST_ANALYSIS_RESULTS.md") - : Read(".workflow/WFS-test-[id]/.process/TEST_ANALYSIS_RESULTS.md"), + : Read(".workflow/sessions/WFS-test-[id]/.process/TEST_ANALYSIS_RESULTS.md"), - test_context_package_path: ".workflow/WFS-test-[id]/.process/test-context-package.json", + test_context_package_path: ".workflow/sessions/WFS-test-[id]/.process/test-context-package.json", test_context_package: memory.has("test-context-package.json") ? memory.get("test-context-package.json") - : Read(".workflow/WFS-test-[id]/.process/test-context-package.json"), + : Read(".workflow/sessions/WFS-test-[id]/.process/test-context-package.json"), // Load source session summaries if exists source_session_id: session_metadata.source_session_id || null, @@ -312,7 +312,7 @@ This section provides quick reference for test task JSON structure. For complete ## Output Files Structure ``` -.workflow/WFS-test-[session]/ +.workflow/sessions/WFS-test-[session]/ ├── workflow-session.json # Test session metadata ├── IMPL_PLAN.md # Test validation plan ├── TODO_LIST.md # Progress tracking diff --git a/.claude/commands/workflow/ui-design/animation-extract.md b/.claude/commands/workflow/ui-design/animation-extract.md index 92fdb4d2..4a13387b 100644 --- a/.claude/commands/workflow/ui-design/animation-extract.md +++ b/.claude/commands/workflow/ui-design/animation-extract.md @@ -67,7 +67,7 @@ if [ -n "$DESIGN_ID" ]; then relative_path=$(find .workflow -name "${DESIGN_ID}" -type d -print -quit) elif [ -n "$SESSION_ID" ]; then # Latest in session - relative_path=$(find .workflow/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) + relative_path=$(find .workflow/sessions/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) else # Latest globally relative_path=$(find .workflow -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) diff --git a/.claude/commands/workflow/ui-design/design-sync.md b/.claude/commands/workflow/ui-design/design-sync.md index 064e0211..5b1d8cc2 100644 --- a/.claude/commands/workflow/ui-design/design-sync.md +++ b/.claude/commands/workflow/ui-design/design-sync.md @@ -25,10 +25,10 @@ Synchronize finalized design system references to brainstorming artifacts, prepa ```bash # Validate session -CHECK: .workflow/.active-* marker files; VALIDATE: session_id matches active session +CHECK: find .workflow/sessions/ -name "WFS-*" -type d; VALIDATE: session_id matches active session # Verify design artifacts in latest design run -latest_design = find_latest_path_matching(".workflow/WFS-{session}/design-run-*") +latest_design = find_latest_path_matching(".workflow/sessions/WFS-{session}/design-run-*") # Detect design system structure IF exists({latest_design}/style-extraction/style-1/design-tokens.json): @@ -51,7 +51,7 @@ REPORT: "Found {count} design artifacts, {prototype_count} prototypes" ```bash # Check if role analysis documents contains current design run reference -synthesis_spec_path = ".workflow/WFS-{session}/.brainstorming/role analysis documents" +synthesis_spec_path = ".workflow/sessions/WFS-{session}/.brainstorming/role analysis documents" current_design_run = basename(latest_design) # e.g., "design-run-20250109-143022" IF exists(synthesis_spec_path): @@ -68,8 +68,8 @@ IF exists(synthesis_spec_path): ```bash # Load target brainstorming artifacts (files to be updated) -Read(.workflow/WFS-{session}/.brainstorming/role analysis documents) -IF exists(.workflow/WFS-{session}/.brainstorming/ui-designer/analysis.md): Read(analysis.md) +Read(.workflow/sessions/WFS-{session}/.brainstorming/role analysis documents) +IF exists(.workflow/sessions/WFS-{session}/.brainstorming/ui-designer/analysis.md): Read(analysis.md) # Optional: Read prototype notes for descriptions (minimal context) FOR each selected_prototype IN selected_list: @@ -113,7 +113,7 @@ Update `.brainstorming/role analysis documents` with design system references. **Implementation**: ```bash # Option 1: Edit existing section -Edit(file_path=".workflow/WFS-{session}/.brainstorming/role analysis documents", +Edit(file_path=".workflow/sessions/WFS-{session}/.brainstorming/role analysis documents", old_string="## UI/UX Guidelines\n[existing content]", new_string="## UI/UX Guidelines\n\n[new design reference content]") @@ -128,15 +128,15 @@ IF section not found: ```bash # Always update ui-designer -ui_designer_files = Glob(".workflow/WFS-{session}/.brainstorming/ui-designer/analysis*.md") +ui_designer_files = Glob(".workflow/sessions/WFS-{session}/.brainstorming/ui-designer/analysis*.md") # Conditionally update other roles has_animations = exists({latest_design}/animation-extraction/animation-tokens.json) has_layouts = exists({latest_design}/layout-extraction/layout-templates.json) -IF has_animations: ux_expert_files = Glob(".workflow/WFS-{session}/.brainstorming/ux-expert/analysis*.md") -IF has_layouts: architect_files = Glob(".workflow/WFS-{session}/.brainstorming/system-architect/analysis*.md") -IF selected_list: pm_files = Glob(".workflow/WFS-{session}/.brainstorming/product-manager/analysis*.md") +IF has_animations: ux_expert_files = Glob(".workflow/sessions/WFS-{session}/.brainstorming/ux-expert/analysis*.md") +IF has_layouts: architect_files = Glob(".workflow/sessions/WFS-{session}/.brainstorming/system-architect/analysis*.md") +IF selected_list: pm_files = Glob(".workflow/sessions/WFS-{session}/.brainstorming/product-manager/analysis*.md") ``` **Content Templates**: @@ -223,7 +223,7 @@ For complete token definitions and usage examples, see: **Implementation**: ```bash -Write(file_path=".workflow/WFS-{session}/.brainstorming/ui-designer/design-system-reference.md", +Write(file_path=".workflow/sessions/WFS-{session}/.brainstorming/ui-designer/design-system-reference.md", content="[generated content with @ references]") ``` @@ -259,7 +259,7 @@ Next: /workflow:plan [--agent] "" **Updated Files**: ``` -.workflow/WFS-{session}/.brainstorming/ +.workflow/sessions/WFS-{session}/.brainstorming/ ├── role analysis documents # Updated with UI/UX Guidelines section ├── ui-designer/ │ ├── analysis*.md # Updated with design system references diff --git a/.claude/commands/workflow/ui-design/explore-auto.md b/.claude/commands/workflow/ui-design/explore-auto.md index b5e83643..c467346c 100644 --- a/.claude/commands/workflow/ui-design/explore-auto.md +++ b/.claude/commands/workflow/ui-design/explore-auto.md @@ -265,7 +265,7 @@ STORE: device_type, device_source ### Phase 4: Run Initialization & Directory Setup ```bash design_id = "design-run-$(date +%Y%m%d)-$RANDOM" -relative_base_path = --session ? ".workflow/WFS-{session}/${design_id}" : ".workflow/${design_id}" +relative_base_path = --session ? ".workflow/sessions/WFS-{session}/${design_id}" : ".workflow/${design_id}" # Create directory and convert to absolute path Bash(mkdir -p "${relative_base_path}/style-extraction") diff --git a/.claude/commands/workflow/ui-design/generate.md b/.claude/commands/workflow/ui-design/generate.md index c8cb5f7b..01ba7e6f 100644 --- a/.claude/commands/workflow/ui-design/generate.md +++ b/.claude/commands/workflow/ui-design/generate.md @@ -31,7 +31,7 @@ if [ -n "$DESIGN_ID" ]; then relative_path=$(find .workflow -name "${DESIGN_ID}" -type d -print -quit) elif [ -n "$SESSION_ID" ]; then # Latest in session - relative_path=$(find .workflow/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) + relative_path=$(find .workflow/sessions/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) else # Latest globally relative_path=$(find .workflow -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) diff --git a/.claude/commands/workflow/ui-design/imitate-auto.md b/.claude/commands/workflow/ui-design/imitate-auto.md index 8bcc4472..3c631fd0 100644 --- a/.claude/commands/workflow/ui-design/imitate-auto.md +++ b/.claude/commands/workflow/ui-design/imitate-auto.md @@ -67,7 +67,7 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Write(*), Bash(*) **Optional Parameters**: - `--session `: Workflow session ID - - Integrate into existing session (`.workflow/WFS-{session}/`) + - Integrate into existing session (`.workflow/sessions/WFS-{session}/`) - Enable automatic design system integration (Phase 4) - If not provided: standalone mode (`.workflow/`) @@ -184,7 +184,7 @@ design_id = "design-run-$(date +%Y%m%d)-$RANDOM" IF --session: session_id = {provided_session} - relative_base_path = ".workflow/WFS-{session_id}/{design_id}" + relative_base_path = ".workflow/sessions/WFS-{session_id}/{design_id}" session_mode = "integrated" ELSE: session_id = null diff --git a/.claude/commands/workflow/ui-design/import-from-code.md b/.claude/commands/workflow/ui-design/import-from-code.md index 7aa40b89..8aa27a87 100644 --- a/.claude/commands/workflow/ui-design/import-from-code.md +++ b/.claude/commands/workflow/ui-design/import-from-code.md @@ -61,7 +61,7 @@ if [ -n "$DESIGN_ID" ]; then fi elif [ -n "$SESSION_ID" ]; then # Latest in session - relative_path=$(find .workflow/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) + relative_path=$(find .workflow/sessions/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) if [ -z "$relative_path" ]; then echo "ERROR: No design run found in session: $SESSION_ID" echo "HINT: Create a design run first or provide --design-id" diff --git a/.claude/commands/workflow/ui-design/layout-extract.md b/.claude/commands/workflow/ui-design/layout-extract.md index 68e8621d..098361bb 100644 --- a/.claude/commands/workflow/ui-design/layout-extract.md +++ b/.claude/commands/workflow/ui-design/layout-extract.md @@ -84,7 +84,7 @@ if [ -n "$DESIGN_ID" ]; then relative_path=$(find .workflow -name "${DESIGN_ID}" -type d -print -quit) elif [ -n "$SESSION_ID" ]; then # Latest in session - relative_path=$(find .workflow/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) + relative_path=$(find .workflow/sessions/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) else # Latest globally relative_path=$(find .workflow -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) diff --git a/.claude/commands/workflow/ui-design/style-extract.md b/.claude/commands/workflow/ui-design/style-extract.md index f686a3fe..9a36806b 100644 --- a/.claude/commands/workflow/ui-design/style-extract.md +++ b/.claude/commands/workflow/ui-design/style-extract.md @@ -62,7 +62,7 @@ if [ -n "$DESIGN_ID" ]; then relative_path=$(find .workflow -name "${DESIGN_ID}" -type d -print -quit) elif [ -n "$SESSION_ID" ]; then # Latest in session - relative_path=$(find .workflow/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) + relative_path=$(find .workflow/sessions/WFS-$SESSION_ID -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2) else # Latest globally relative_path=$(find .workflow -name "design-run-*" -type d -printf "%T@ %p\n" 2>/dev/null | sort -nr | head -1 | cut -d' ' -f2)