mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
fix: Preserve user intent in test workflow session creation
- Add Step 1.0 to test-gen.md to load source session task_description - Add Step 1.0 to test-fix-gen.md (Session Mode) to load original user intent - Include originalTaskDescription in session creation to enable semantic CLI selection - Fixes data flow gap identified by Gemini review: user's CLI tool preferences (e.g., "use Codex for fixes") now propagate through test workflow sessions This ensures semantic CLI tool selection works correctly in derivative test sessions by preserving the original user's task description from the source session. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -143,13 +143,25 @@ This command is a **pure planning coordinator**:
|
||||
|
||||
#### Phase 1: Create Test Session
|
||||
|
||||
**Step 1.1: Dispatch** - Create test workflow session
|
||||
**Step 1.0: Load Source Session Intent (Session Mode Only)** - Preserve user's original task description for semantic CLI selection
|
||||
|
||||
```javascript
|
||||
// Session Mode
|
||||
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]\"")
|
||||
// Session Mode: Read source session metadata to get original task description
|
||||
Read(".workflow/active/[sourceSessionId]/workflow-session.json")
|
||||
// OR if context-package exists:
|
||||
Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
|
||||
|
||||
// Prompt Mode
|
||||
// Extract: metadata.task_description or project/description field
|
||||
// This preserves user's CLI tool preferences (e.g., "use Codex for fixes")
|
||||
```
|
||||
|
||||
**Step 1.1: Dispatch** - Create test workflow session with preserved intent
|
||||
|
||||
```javascript
|
||||
// Session Mode - Include original task description to enable semantic CLI selection
|
||||
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
|
||||
|
||||
// Prompt Mode - User's description already contains their intent
|
||||
SlashCommand(command="/workflow:session:start --new \"Test generation for: [description]\"")
|
||||
```
|
||||
|
||||
@@ -158,8 +170,8 @@ SlashCommand(command="/workflow:session:start --new \"Test generation for: [desc
|
||||
**Expected Behavior**:
|
||||
- Creates new session: `WFS-test-[slug]`
|
||||
- Writes `workflow-session.json` metadata:
|
||||
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`
|
||||
- **Prompt Mode**: Includes `workflow_type: "test_session"` only
|
||||
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`, description with original user intent
|
||||
- **Prompt Mode**: Includes `workflow_type: "test_session"` only (user's description already contains intent)
|
||||
- Returns new session ID
|
||||
|
||||
**Parse Output**:
|
||||
|
||||
@@ -57,19 +57,35 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
|
||||
|
||||
### Phase 1: Create Test Session
|
||||
|
||||
**Step 1.1: Dispatch** - Create new test workflow session
|
||||
**Step 1.0: Load Source Session Intent** - Preserve user's original task description for semantic CLI selection
|
||||
|
||||
```javascript
|
||||
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]\"")
|
||||
// Read source session metadata to get original task description
|
||||
Read(".workflow/active/[sourceSessionId]/workflow-session.json")
|
||||
// OR if context-package exists:
|
||||
Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
|
||||
|
||||
// Extract: metadata.task_description or project/description field
|
||||
// This preserves user's CLI tool preferences (e.g., "use Codex for fixes")
|
||||
```
|
||||
|
||||
**Input**: `sourceSessionId` from user argument (e.g., `WFS-user-auth`)
|
||||
**Step 1.1: Dispatch** - Create new test workflow session with preserved intent
|
||||
|
||||
```javascript
|
||||
// Include original task description to enable semantic CLI selection
|
||||
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
|
||||
```
|
||||
|
||||
**Input**:
|
||||
- `sourceSessionId` from user argument (e.g., `WFS-user-auth`)
|
||||
- `originalTaskDescription` from source session metadata (preserves CLI tool preferences)
|
||||
|
||||
**Expected Behavior**:
|
||||
- Creates new session with pattern `WFS-test-[source-slug]` (e.g., `WFS-test-user-auth`)
|
||||
- Writes metadata to `workflow-session.json`:
|
||||
- `workflow_type: "test_session"`
|
||||
- `source_session_id: "[sourceSessionId]"`
|
||||
- Description includes original user intent for semantic CLI selection
|
||||
- Returns new session ID for subsequent phases
|
||||
|
||||
**Parse Output**:
|
||||
|
||||
@@ -143,13 +143,25 @@ This command is a **pure planning coordinator**:
|
||||
|
||||
#### Phase 1: Create Test Session
|
||||
|
||||
**Step 1.1: Dispatch** - Create test workflow session
|
||||
**Step 1.0: Load Source Session Intent (Session Mode Only)** - Preserve user's original task description for semantic CLI selection
|
||||
|
||||
```javascript
|
||||
// Session Mode
|
||||
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]\"")
|
||||
// Session Mode: Read source session metadata to get original task description
|
||||
Read(".workflow/active/[sourceSessionId]/workflow-session.json")
|
||||
// OR if context-package exists:
|
||||
Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
|
||||
|
||||
// Prompt Mode
|
||||
// Extract: metadata.task_description or project/description field
|
||||
// This preserves user's CLI tool preferences (e.g., "use Codex for fixes")
|
||||
```
|
||||
|
||||
**Step 1.1: Dispatch** - Create test workflow session with preserved intent
|
||||
|
||||
```javascript
|
||||
// Session Mode - Include original task description to enable semantic CLI selection
|
||||
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
|
||||
|
||||
// Prompt Mode - User's description already contains their intent
|
||||
SlashCommand(command="/workflow:session:start --new \"Test generation for: [description]\"")
|
||||
```
|
||||
|
||||
@@ -158,8 +170,8 @@ SlashCommand(command="/workflow:session:start --new \"Test generation for: [desc
|
||||
**Expected Behavior**:
|
||||
- Creates new session: `WFS-test-[slug]`
|
||||
- Writes `workflow-session.json` metadata:
|
||||
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`
|
||||
- **Prompt Mode**: Includes `workflow_type: "test_session"` only
|
||||
- **Session Mode**: Includes `workflow_type: "test_session"`, `source_session_id: "[sourceId]"`, description with original user intent
|
||||
- **Prompt Mode**: Includes `workflow_type: "test_session"` only (user's description already contains intent)
|
||||
- Returns new session ID
|
||||
|
||||
**Parse Output**:
|
||||
|
||||
@@ -57,19 +57,35 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
|
||||
|
||||
### Phase 1: Create Test Session
|
||||
|
||||
**Step 1.1: Dispatch** - Create new test workflow session
|
||||
**Step 1.0: Load Source Session Intent** - Preserve user's original task description for semantic CLI selection
|
||||
|
||||
```javascript
|
||||
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]\"")
|
||||
// Read source session metadata to get original task description
|
||||
Read(".workflow/active/[sourceSessionId]/workflow-session.json")
|
||||
// OR if context-package exists:
|
||||
Read(".workflow/active/[sourceSessionId]/.process/context-package.json")
|
||||
|
||||
// Extract: metadata.task_description or project/description field
|
||||
// This preserves user's CLI tool preferences (e.g., "use Codex for fixes")
|
||||
```
|
||||
|
||||
**Input**: `sourceSessionId` from user argument (e.g., `WFS-user-auth`)
|
||||
**Step 1.1: Dispatch** - Create new test workflow session with preserved intent
|
||||
|
||||
```javascript
|
||||
// Include original task description to enable semantic CLI selection
|
||||
SlashCommand(command="/workflow:session:start --new \"Test validation for [sourceSessionId]: [originalTaskDescription]\"")
|
||||
```
|
||||
|
||||
**Input**:
|
||||
- `sourceSessionId` from user argument (e.g., `WFS-user-auth`)
|
||||
- `originalTaskDescription` from source session metadata (preserves CLI tool preferences)
|
||||
|
||||
**Expected Behavior**:
|
||||
- Creates new session with pattern `WFS-test-[source-slug]` (e.g., `WFS-test-user-auth`)
|
||||
- Writes metadata to `workflow-session.json`:
|
||||
- `workflow_type: "test_session"`
|
||||
- `source_session_id: "[sourceSessionId]"`
|
||||
- Description includes original user intent for semantic CLI selection
|
||||
- Returns new session ID for subsequent phases
|
||||
|
||||
**Parse Output**:
|
||||
|
||||
Reference in New Issue
Block a user