mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
feat(docs): update Bash tool usage to enforce foreground execution for CLI calls
This commit is contained in:
@@ -22,11 +22,11 @@ Available CLI endpoints are dynamically defined by the config file:
|
|||||||
- **TaskOutput usage**: Only use `TaskOutput({ task_id: "xxx", block: false })` + sleep loop to poll completion status. NEVER read intermediate output during agent/CLI execution - wait for final result only
|
- **TaskOutput usage**: Only use `TaskOutput({ task_id: "xxx", block: false })` + sleep loop to poll completion status. NEVER read intermediate output during agent/CLI execution - wait for final result only
|
||||||
|
|
||||||
### CLI Tool Calls (ccw cli)
|
### CLI Tool Calls (ccw cli)
|
||||||
- **Always use `run_in_background: true`** for Bash tool when calling ccw cli:
|
- **Default: `run_in_background: true`** - Unless otherwise specified, always use background execution for CLI calls:
|
||||||
```
|
```
|
||||||
Bash({ command: "ccw cli -p '...' --tool gemini", run_in_background: true })
|
Bash({ command: "ccw cli -p '...' --tool gemini", run_in_background: true })
|
||||||
```
|
```
|
||||||
- **After CLI call**: If no other tasks, stop immediately - let CLI execute in background, do NOT poll with TaskOutput
|
- **After CLI call**: Stop immediately - let CLI execute in background, do NOT poll with TaskOutput
|
||||||
|
|
||||||
## Code Diagnostics
|
## Code Diagnostics
|
||||||
|
|
||||||
|
|||||||
@@ -847,6 +847,9 @@ Use `analysis_results.complexity` or task count to determine structure:
|
|||||||
- Apply 举一反三 principle: Adapt pre-analysis patterns to task-specific needs dynamically
|
- Apply 举一反三 principle: Adapt pre-analysis patterns to task-specific needs dynamically
|
||||||
- Follow template validation: Complete IMPL_PLAN.md template validation checklist before finalization
|
- Follow template validation: Complete IMPL_PLAN.md template validation checklist before finalization
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**NEVER:**
|
**NEVER:**
|
||||||
- Load files directly (use provided context package instead)
|
- Load files directly (use provided context package instead)
|
||||||
- Assume default locations (always use session_id in paths)
|
- Assume default locations (always use session_id in paths)
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ ccw cli -p "CONTEXT: @**/* @../shared/**/*" --tool gemini --mode analysis --cd s
|
|||||||
|
|
||||||
**Timeout**: Simple 20min | Medium 40min | Complex 60min (Codex ×1.5)
|
**Timeout**: Simple 20min | Medium 40min | Complex 60min (Codex ×1.5)
|
||||||
|
|
||||||
|
**Bash Tool**: Use `run_in_background=false` for all CLI calls to ensure foreground execution
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Phase 5: Output Routing
|
## Phase 5: Output Routing
|
||||||
|
|||||||
@@ -174,6 +174,9 @@ Brief summary:
|
|||||||
7. Include file:line references in findings
|
7. Include file:line references in findings
|
||||||
8. Attribute discovery source (bash/gemini)
|
8. Attribute discovery source (bash/gemini)
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**NEVER**:
|
**NEVER**:
|
||||||
1. Modify any files (read-only agent)
|
1. Modify any files (read-only agent)
|
||||||
2. Skip schema reading step when schema is specified
|
2. Skip schema reading step when schema is specified
|
||||||
|
|||||||
@@ -437,6 +437,9 @@ function validateTask(task) {
|
|||||||
- Generate flow_control from dependencies
|
- Generate flow_control from dependencies
|
||||||
- Handle CLI errors with fallback chain
|
- Handle CLI errors with fallback chain
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**NEVER**:
|
**NEVER**:
|
||||||
- Execute implementation (return plan only)
|
- Execute implementation (return plan only)
|
||||||
- Use vague acceptance criteria
|
- Use vague acceptance criteria
|
||||||
|
|||||||
@@ -446,6 +446,9 @@ See: `.process/iteration-{iteration}-cli-output.txt`
|
|||||||
- **Generate measurable acceptance criteria**: Include verification commands
|
- **Generate measurable acceptance criteria**: Include verification commands
|
||||||
- **Apply layer-specific guidance**: Use test_type to customize analysis approach
|
- **Apply layer-specific guidance**: Use test_type to customize analysis approach
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**NEVER:**
|
**NEVER:**
|
||||||
- Execute tests directly (orchestrator manages test execution)
|
- Execute tests directly (orchestrator manages test execution)
|
||||||
- Skip CLI analysis (always run CLI even for simple failures)
|
- Skip CLI analysis (always run CLI even for simple failures)
|
||||||
|
|||||||
@@ -296,6 +296,9 @@ Before completing any task, verify:
|
|||||||
- Make assumptions - verify with existing code
|
- Make assumptions - verify with existing code
|
||||||
- Create unnecessary complexity
|
- Create unnecessary complexity
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**ALWAYS:**
|
**ALWAYS:**
|
||||||
- Verify module/package existence with rg/grep/search before referencing
|
- Verify module/package existence with rg/grep/search before referencing
|
||||||
- Write working code incrementally
|
- Write working code incrementally
|
||||||
|
|||||||
@@ -561,6 +561,9 @@ Output: .workflow/session/{session}/.process/context-package.json
|
|||||||
- Include binaries/generated files
|
- Include binaries/generated files
|
||||||
- Use ripgrep if CodexLens available
|
- Use ripgrep if CodexLens available
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**ALWAYS**:
|
**ALWAYS**:
|
||||||
- Initialize CodexLens in Phase 0
|
- Initialize CodexLens in Phase 0
|
||||||
- Execute get_modules_by_depth.sh
|
- Execute get_modules_by_depth.sh
|
||||||
|
|||||||
@@ -322,6 +322,9 @@ Before completing the task, you must verify the following:
|
|||||||
- **Update Progress**: Use `TodoWrite` to track each step of the execution.
|
- **Update Progress**: Use `TodoWrite` to track each step of the execution.
|
||||||
- **Generate a Summary**: Create a detailed summary upon task completion.
|
- **Generate a Summary**: Create a detailed summary upon task completion.
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**NEVER**:
|
**NEVER**:
|
||||||
- **Make Planning Decisions**: Do not deviate from the instructions in the task JSON.
|
- **Make Planning Decisions**: Do not deviate from the instructions in the task JSON.
|
||||||
- **Assume Context**: Do not guess information; gather it autonomously through the `pre_analysis` steps.
|
- **Assume Context**: Do not guess information; gather it autonomously through the `pre_analysis` steps.
|
||||||
|
|||||||
@@ -271,6 +271,9 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
|
|||||||
|
|
||||||
### 3.3 Guidelines
|
### 3.3 Guidelines
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**ALWAYS**:
|
**ALWAYS**:
|
||||||
1. Read schema first: `cat .claude/workflows/cli-templates/schemas/solution-schema.json`
|
1. Read schema first: `cat .claude/workflows/cli-templates/schemas/solution-schema.json`
|
||||||
2. Use ACE semantic search as PRIMARY exploration tool
|
2. Use ACE semantic search as PRIMARY exploration tool
|
||||||
|
|||||||
@@ -271,6 +271,9 @@ Return brief summaries; full conflict details in separate files:
|
|||||||
|
|
||||||
### 4.3 Guidelines
|
### 4.3 Guidelines
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**ALWAYS**:
|
**ALWAYS**:
|
||||||
1. Build dependency graph before ordering
|
1. Build dependency graph before ordering
|
||||||
2. Detect file overlaps between solutions
|
2. Detect file overlaps between solutions
|
||||||
|
|||||||
@@ -120,6 +120,9 @@ Before completing any task, verify:
|
|||||||
- Make assumptions - verify with existing materials
|
- Make assumptions - verify with existing materials
|
||||||
- Skip quality verification steps
|
- Skip quality verification steps
|
||||||
|
|
||||||
|
**Bash Tool**:
|
||||||
|
- Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
|
||||||
|
|
||||||
**ALWAYS:**
|
**ALWAYS:**
|
||||||
- Verify resource/dependency existence before referencing
|
- Verify resource/dependency existence before referencing
|
||||||
- Execute tasks systematically and incrementally
|
- Execute tasks systematically and incrementally
|
||||||
|
|||||||
Reference in New Issue
Block a user