refactor(commands): replace bash/jq operations with ccw session commands

- session/start.md: Replace find/mkdir/echo with ccw session list/init
- session/list.md: Replace find/jq with ccw session list/stats/read
- session/resume.md: Replace jq status updates with ccw session status
- session/complete.md: Replace jq/mv with ccw session archive
- execute.md: Replace session discovery with ccw session list/status
- code-developer.md: Replace jq context-package read with ccw session read

Benefits:
- Atomic operations (no temp files)
- Auto workspace detection (works from subdirectories)
- Auto session location detection (active/archived/lite)
- Status history auto-tracking for tasks
- Consistent error handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-10 23:31:51 +08:00
parent 598bea9b21
commit a667b7548c
6 changed files with 79 additions and 122 deletions

View File

@@ -17,39 +17,35 @@ Resume the most recently paused workflow session, restoring all context and stat
### Step 1: Find Paused Sessions
```bash
ls .workflow/active/WFS-* 2>/dev/null
ccw session list --location active
# Filter for sessions with status="paused"
```
### Step 2: Check Session Status
```bash
jq -r '.status' .workflow/active/WFS-session/workflow-session.json
ccw session read WFS-session --type session
# Check .status field in response
```
### Step 3: Find Most Recent Paused
```bash
ls -t .workflow/active/WFS-*/workflow-session.json | head -1
ccw session list --location active
# Sort by created_at, filter for paused status
```
### Step 4: Update Session Status
### Step 4: Update Session Status to Active
```bash
jq '.status = "active"' .workflow/active/WFS-session/workflow-session.json > temp.json
mv temp.json .workflow/active/WFS-session/workflow-session.json
ccw session status WFS-session active
# Or with full update:
ccw session update WFS-session --type session --content '{"status":"active","resumed_at":"2025-12-10T08:00:00Z"}'
```
### Step 5: Add Resume Timestamp
```bash
jq '.resumed_at = "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"' .workflow/active/WFS-session/workflow-session.json > temp.json
mv temp.json .workflow/active/WFS-session/workflow-session.json
```
## Simple Bash Commands
## Simple Commands
### Basic Operations
- **List sessions**: `ls .workflow/active/WFS-*`
- **Check status**: `jq -r '.status' session.json`
- **Find recent**: `ls -t .workflow/active/*/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)'"'`
- **List sessions**: `ccw session list --location active`
- **Check status**: `ccw session read WFS-xxx --type session`
- **Update status**: `ccw session status WFS-xxx active`
### Resume Result
```