mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
refactor(commands/agents): replace bash/jq with ccw session commands
Replace legacy bash/jq operations with ccw session commands for better consistency and maintainability across workflow commands and agents. Changes: - commands/memory/docs.md: Use ccw session update/read for session ops - commands/workflow/review.md: Replace cat/jq with ccw session read - commands/workflow/tdd-verify.md: Replace find/jq with ccw session read - agents/conceptual-planning-agent.md: Use ccw session read for metadata - agents/test-fix-agent.md: Use ccw session read for context package - skills/command-guide/reference/*: Mirror changes to skill docs - ccw/src/commands/session.js: Fix EPIPE error when piping to jq/head 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -74,7 +74,7 @@ SlashCommand(command="/workflow:session:start --type docs --new \"{project_name}
|
||||
|
||||
```bash
|
||||
# Update workflow-session.json with docs-specific fields
|
||||
bash(jq '. + {"target_path":"{target_path}","project_root":"{project_root}","project_name":"{project_name}","mode":"full","tool":"gemini","cli_execute":false}' .workflow/active/{sessionId}/workflow-session.json > tmp.json && mv tmp.json .workflow/active/{sessionId}/workflow-session.json)
|
||||
ccw session update {sessionId} --type session --content '{"target_path":"{target_path}","project_root":"{project_root}","project_name":"{project_name}","mode":"full","tool":"gemini","cli_execute":false}'
|
||||
```
|
||||
|
||||
### Phase 2: Analyze Structure
|
||||
@@ -136,7 +136,8 @@ bash(if [ -d .workflow/docs/\${project_name} ]; then find .workflow/docs/\${proj
|
||||
|
||||
```bash
|
||||
# Count existing docs from doc-planning-data.json
|
||||
bash(cat .workflow/active/WFS-docs-{timestamp}/.process/doc-planning-data.json | jq '.existing_docs.file_list | length')
|
||||
ccw session read WFS-docs-{timestamp} --type process --filename doc-planning-data.json --raw | jq '.existing_docs.file_list | length'
|
||||
# Or read entire process file and parse
|
||||
```
|
||||
|
||||
**Data Processing**: Use count result, then use **Edit tool** to update `workflow-session.json`:
|
||||
|
||||
@@ -115,7 +115,7 @@ List sessions with metadata and prompt user selection:
|
||||
```bash
|
||||
bash(for dir in .workflow/active/WFS-*/; do
|
||||
session=$(basename "$dir")
|
||||
project=$(jq -r '.project // "Unknown"' "$dir/workflow-session.json" 2>/dev/null)
|
||||
project=$(ccw session read "$session" --type session --raw 2>/dev/null | jq -r '.project // "Unknown"')
|
||||
total=$(grep -c "^- \[" "$dir/TODO_LIST.md" 2>/dev/null || echo "0")
|
||||
completed=$(grep -c "^- \[x\]" "$dir/TODO_LIST.md" 2>/dev/null || echo "0")
|
||||
[ "$total" -gt 0 ] && progress=$((completed * 100 / total)) || progress=0
|
||||
@@ -152,7 +152,7 @@ Parse user input (supports: number "1", full ID "WFS-auth-system", or partial "a
|
||||
|
||||
#### Step 1.3: Load Session Metadata
|
||||
```bash
|
||||
bash(cat .workflow/active/${sessionId}/workflow-session.json)
|
||||
ccw session read ${sessionId} --type session
|
||||
```
|
||||
|
||||
**Output**: Store session metadata in memory
|
||||
|
||||
@@ -113,13 +113,14 @@ After bash validation, the model takes control to:
|
||||
1. **Load Context**: Read completed task summaries and changed files
|
||||
```bash
|
||||
# Load implementation summaries
|
||||
cat .workflow/active/${sessionId}/.summaries/IMPL-*.md
|
||||
ccw session read ${sessionId} --type summary --raw
|
||||
|
||||
# Load test results (if available)
|
||||
cat .workflow/active/${sessionId}/.summaries/TEST-FIX-*.md 2>/dev/null
|
||||
ccw session read ${sessionId} --type summary --filename "TEST-FIX-*.md" --raw 2>/dev/null
|
||||
|
||||
# Get changed files
|
||||
git log --since="$(cat .workflow/active/${sessionId}/workflow-session.json | jq -r .created_at)" --name-only --pretty=format: | sort -u
|
||||
# Get session created_at for git log filter
|
||||
created_at=$(ccw session read ${sessionId} --type session --raw | jq -r .created_at)
|
||||
git log --since="$created_at" --name-only --pretty=format: | sort -u
|
||||
```
|
||||
|
||||
2. **Perform Specialized Review**: Based on `review_type`
|
||||
@@ -169,11 +170,11 @@ After bash validation, the model takes control to:
|
||||
- Verify all requirements and acceptance criteria met:
|
||||
```bash
|
||||
# Load task requirements and acceptance criteria
|
||||
find .workflow/active/${sessionId}/.task -name "IMPL-*.json" -exec jq -r '
|
||||
ccw session read ${sessionId} --type task --raw | jq -r '
|
||||
"Task: " + .id + "\n" +
|
||||
"Requirements: " + (.context.requirements | join(", ")) + "\n" +
|
||||
"Acceptance: " + (.context.acceptance | join(", "))
|
||||
' {} \;
|
||||
'
|
||||
|
||||
# Check implementation summaries against requirements
|
||||
cd .workflow/active/${sessionId} && gemini -p "
|
||||
|
||||
@@ -77,18 +77,18 @@ find .workflow/active/ -name "WFS-*" -type d | head -1 | sed 's/.*\///'
|
||||
|
||||
```bash
|
||||
# Load all task JSONs
|
||||
find .workflow/active/{sessionId}/.task/ -name '*.json'
|
||||
ccw session read {sessionId} --type task
|
||||
|
||||
# Extract task IDs
|
||||
find .workflow/active/{sessionId}/.task/ -name '*.json' -exec jq -r '.id' {} \;
|
||||
ccw session read {sessionId} --type task --raw | jq -r '.id'
|
||||
|
||||
# Check dependencies
|
||||
find .workflow/active/{sessionId}/.task/ -name 'IMPL-*.json' -exec jq -r '.context.depends_on[]?' {} \;
|
||||
find .workflow/active/{sessionId}/.task/ -name 'REFACTOR-*.json' -exec jq -r '.context.depends_on[]?' {} \;
|
||||
# Check dependencies - read tasks and filter for IMPL/REFACTOR
|
||||
ccw session read {sessionId} --type task --task-id "IMPL-*" --raw | jq -r '.context.depends_on[]?'
|
||||
ccw session read {sessionId} --type task --task-id "REFACTOR-*" --raw | jq -r '.context.depends_on[]?'
|
||||
|
||||
# Check meta fields
|
||||
find .workflow/active/{sessionId}/.task/ -name '*.json' -exec jq -r '.meta.tdd_phase' {} \;
|
||||
find .workflow/active/{sessionId}/.task/ -name '*.json' -exec jq -r '.meta.agent' {} \;
|
||||
ccw session read {sessionId} --type task --raw | jq -r '.meta.tdd_phase'
|
||||
ccw session read {sessionId} --type task --raw | jq -r '.meta.agent'
|
||||
```
|
||||
|
||||
**Validation**:
|
||||
|
||||
Reference in New Issue
Block a user