mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
feat: Add task-generate-agent and task-generate commands for autonomous task generation and manual task creation
- Implemented task-generate-agent for autonomous task generation using action-planning-agent with discovery and output phases. - Introduced task-generate command to generate task JSON files and IMPL_PLAN.md from analysis results with automatic artifact detection and integration. - Enhanced documentation for both commands, detailing execution lifecycle, phases, and output structures. - Established clear integration points and error handling for improved user experience.
This commit is contained in:
@@ -1,82 +1,221 @@
|
||||
---
|
||||
name: start
|
||||
description: Discover existing sessions or start a new workflow session with intelligent session management
|
||||
usage: /workflow:session:start [task_description]
|
||||
argument-hint: [optional: task description for new session]
|
||||
usage: /workflow:session:start [--auto|--new] [task_description]
|
||||
argument-hint: [--auto|--new] [optional: task description for new session]
|
||||
examples:
|
||||
- /workflow:session:start "implement OAuth2 authentication"
|
||||
- /workflow:session:start "fix login bug"
|
||||
- /workflow:session:start
|
||||
- /workflow:session:start --auto "implement OAuth2 authentication"
|
||||
- /workflow:session:start --new "fix login bug"
|
||||
---
|
||||
|
||||
# Start Workflow Session (/workflow:session:start)
|
||||
|
||||
## Overview
|
||||
Manages workflow sessions - discovers existing active sessions or creates new ones.
|
||||
Manages workflow sessions with three operation modes: discovery (manual), auto (intelligent), and force-new.
|
||||
|
||||
## Usage
|
||||
## Mode 1: Discovery Mode (Default)
|
||||
|
||||
### Usage
|
||||
```bash
|
||||
/workflow:session:start # Discover/select existing sessions
|
||||
/workflow:session:start "task description" # Create new session
|
||||
/workflow:session:start
|
||||
```
|
||||
|
||||
## Implementation Flow
|
||||
|
||||
### Step 1: Check for Active Sessions
|
||||
### Step 1: Check Active Sessions
|
||||
```bash
|
||||
ls .workflow/.active-* 2>/dev/null
|
||||
bash(ls .workflow/.active-* 2>/dev/null)
|
||||
```
|
||||
|
||||
### Step 2: List Existing Sessions
|
||||
### Step 2: List All Sessions
|
||||
```bash
|
||||
ls -1 .workflow/WFS-* 2>/dev/null | head -5
|
||||
bash(ls -1 .workflow/WFS-* 2>/dev/null | head -5)
|
||||
```
|
||||
|
||||
### Step 3: Create New Session (if needed)
|
||||
### Step 3: Display Session Metadata
|
||||
```bash
|
||||
mkdir -p .workflow
|
||||
echo "auth-system" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]'
|
||||
bash(cat .workflow/WFS-promptmaster-platform/workflow-session.json)
|
||||
```
|
||||
|
||||
### Step 4: Create Session Directory Structure
|
||||
### Step 4: User Decision
|
||||
Present session information and wait for user to select or create session.
|
||||
|
||||
**Output**: `SESSION_ID: WFS-[user-selected-id]`
|
||||
|
||||
## Mode 2: Auto Mode (Intelligent)
|
||||
|
||||
### Usage
|
||||
```bash
|
||||
mkdir -p .workflow/WFS-auth-system/.process
|
||||
mkdir -p .workflow/WFS-auth-system/.task
|
||||
mkdir -p .workflow/WFS-auth-system/.summaries
|
||||
/workflow:session:start --auto "task description"
|
||||
```
|
||||
|
||||
### Step 5: Create Session Metadata
|
||||
### Step 1: Check Active Sessions Count
|
||||
```bash
|
||||
echo '{"session_id":"WFS-auth-system","project":"authentication system","status":"planning"}' > .workflow/WFS-auth-system/workflow-session.json
|
||||
bash(ls .workflow/.active-* 2>/dev/null | wc -l)
|
||||
```
|
||||
|
||||
### Step 6: Mark Session as Active
|
||||
### Step 2a: No Active Sessions → Create New
|
||||
```bash
|
||||
touch .workflow/.active-WFS-auth-system
|
||||
# Generate session slug
|
||||
bash(echo "implement OAuth2 auth" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-50)
|
||||
|
||||
# Create directory structure
|
||||
bash(mkdir -p .workflow/WFS-implement-oauth2-auth/.process)
|
||||
bash(mkdir -p .workflow/WFS-implement-oauth2-auth/.task)
|
||||
bash(mkdir -p .workflow/WFS-implement-oauth2-auth/.summaries)
|
||||
|
||||
# Create metadata
|
||||
bash(echo '{"session_id":"WFS-implement-oauth2-auth","project":"implement OAuth2 auth","status":"planning"}' > .workflow/WFS-implement-oauth2-auth/workflow-session.json)
|
||||
|
||||
# Mark as active
|
||||
bash(touch .workflow/.active-WFS-implement-oauth2-auth)
|
||||
```
|
||||
|
||||
### Step 7: Clean Old Active Markers (if creating new)
|
||||
**Output**: `SESSION_ID: WFS-implement-oauth2-auth`
|
||||
|
||||
### Step 2b: Single Active Session → Check Relevance
|
||||
```bash
|
||||
rm .workflow/.active-WFS-* 2>/dev/null
|
||||
# Extract session ID
|
||||
bash(ls .workflow/.active-* 2>/dev/null | head -1 | xargs basename | sed 's/^\.active-//')
|
||||
|
||||
# Read project name from metadata
|
||||
bash(cat .workflow/WFS-promptmaster-platform/workflow-session.json | grep -o '"project":"[^"]*"' | cut -d'"' -f4)
|
||||
|
||||
# Check keyword match (manual comparison)
|
||||
# If task contains project keywords → Reuse session
|
||||
# If task unrelated → Create new session (use Step 2a)
|
||||
```
|
||||
|
||||
**Output (reuse)**: `SESSION_ID: WFS-promptmaster-platform`
|
||||
**Output (new)**: `SESSION_ID: WFS-[new-slug]`
|
||||
|
||||
### Step 2c: Multiple Active Sessions → Use First
|
||||
```bash
|
||||
# Get first active session
|
||||
bash(ls .workflow/.active-* 2>/dev/null | head -1 | xargs basename | sed 's/^\.active-//')
|
||||
|
||||
# Output warning and session ID
|
||||
# WARNING: Multiple active sessions detected
|
||||
# SESSION_ID: WFS-first-session
|
||||
```
|
||||
|
||||
## Mode 3: Force New Mode
|
||||
|
||||
### Usage
|
||||
```bash
|
||||
/workflow:session:start --new "task description"
|
||||
```
|
||||
|
||||
### Step 1: Generate Unique Session Slug
|
||||
```bash
|
||||
# Convert to slug
|
||||
bash(echo "fix login bug" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-50)
|
||||
|
||||
# Check if exists, add counter if needed
|
||||
bash(ls .workflow/WFS-fix-login-bug 2>/dev/null && echo "WFS-fix-login-bug-2" || echo "WFS-fix-login-bug")
|
||||
```
|
||||
|
||||
### Step 2: Create Session Structure
|
||||
```bash
|
||||
bash(mkdir -p .workflow/WFS-fix-login-bug/.process)
|
||||
bash(mkdir -p .workflow/WFS-fix-login-bug/.task)
|
||||
bash(mkdir -p .workflow/WFS-fix-login-bug/.summaries)
|
||||
```
|
||||
|
||||
### Step 3: Create Metadata
|
||||
```bash
|
||||
bash(echo '{"session_id":"WFS-fix-login-bug","project":"fix login bug","status":"planning"}' > .workflow/WFS-fix-login-bug/workflow-session.json)
|
||||
```
|
||||
|
||||
### Step 4: Mark Active and Clean Old Markers
|
||||
```bash
|
||||
bash(rm .workflow/.active-* 2>/dev/null)
|
||||
bash(touch .workflow/.active-WFS-fix-login-bug)
|
||||
```
|
||||
|
||||
**Output**: `SESSION_ID: WFS-fix-login-bug`
|
||||
|
||||
## Output Format Specification
|
||||
|
||||
### Success
|
||||
```
|
||||
SESSION_ID: WFS-session-slug
|
||||
```
|
||||
|
||||
### Error
|
||||
```
|
||||
ERROR: --auto mode requires task description
|
||||
ERROR: Failed to create session directory
|
||||
```
|
||||
|
||||
### Analysis (Auto Mode)
|
||||
```
|
||||
ANALYSIS: Task relevance = high
|
||||
DECISION: Reusing existing session
|
||||
SESSION_ID: WFS-promptmaster-platform
|
||||
```
|
||||
|
||||
## Command Integration
|
||||
|
||||
### For /workflow:plan (Use Auto Mode)
|
||||
```bash
|
||||
SlashCommand(command="/workflow:session:start --auto \"implement OAuth2 authentication\"")
|
||||
|
||||
# Parse session ID from output
|
||||
grep "^SESSION_ID:" | awk '{print $2}'
|
||||
```
|
||||
|
||||
### For Interactive Workflows (Use Discovery Mode)
|
||||
```bash
|
||||
SlashCommand(command="/workflow:session:start")
|
||||
```
|
||||
|
||||
### For New Isolated Work (Use Force New Mode)
|
||||
```bash
|
||||
SlashCommand(command="/workflow:session:start --new \"experimental feature\"")
|
||||
```
|
||||
|
||||
## Simple Bash Commands
|
||||
|
||||
### Basic Operations
|
||||
- **Check sessions**: `ls .workflow/.active-*`
|
||||
- **List sessions**: `ls .workflow/WFS-*`
|
||||
- **Create directory**: `mkdir -p .workflow/WFS-session-name/.process`
|
||||
- **Create file**: `echo 'content' > .workflow/session/file.json`
|
||||
- **Mark active**: `touch .workflow/.active-WFS-session-name`
|
||||
- **Clean markers**: `rm .workflow/.active-*`
|
||||
```bash
|
||||
# Check active sessions
|
||||
bash(ls .workflow/.active-*)
|
||||
|
||||
### No Complex Logic
|
||||
- No variables or functions
|
||||
- No conditional statements
|
||||
- No loops or pipes
|
||||
- Direct bash commands only
|
||||
# List all sessions
|
||||
bash(ls .workflow/WFS-*)
|
||||
|
||||
# Read session metadata
|
||||
bash(cat .workflow/WFS-[session-id]/workflow-session.json)
|
||||
|
||||
# Create session directories
|
||||
bash(mkdir -p .workflow/WFS-[session-id]/.process)
|
||||
bash(mkdir -p .workflow/WFS-[session-id]/.task)
|
||||
bash(mkdir -p .workflow/WFS-[session-id]/.summaries)
|
||||
|
||||
# Mark session as active
|
||||
bash(touch .workflow/.active-WFS-[session-id])
|
||||
|
||||
# Clean active markers
|
||||
bash(rm .workflow/.active-*)
|
||||
```
|
||||
|
||||
### Generate Session Slug
|
||||
```bash
|
||||
bash(echo "Task Description" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-50)
|
||||
```
|
||||
|
||||
### Create Metadata JSON
|
||||
```bash
|
||||
bash(echo '{"session_id":"WFS-test","project":"test project","status":"planning"}' > .workflow/WFS-test/workflow-session.json)
|
||||
```
|
||||
|
||||
## Session ID Format
|
||||
- Pattern: `WFS-[lowercase-slug]`
|
||||
- Characters: `a-z`, `0-9`, `-` only
|
||||
- Max length: 50 characters
|
||||
- Uniqueness: Add numeric suffix if collision (`WFS-auth-2`, `WFS-auth-3`)
|
||||
|
||||
## Related Commands
|
||||
- `/workflow:plan` - Uses this for session management
|
||||
- `/workflow:execute` - Uses this for session discovery
|
||||
- `/workflow:session:status` - Shows session information
|
||||
- `/workflow:plan` - Uses `--auto` mode for session management
|
||||
- `/workflow:execute` - Uses discovery mode for session selection
|
||||
- `/workflow:session:status` - Shows detailed session information
|
||||
Reference in New Issue
Block a user