refactor: Streamline intelligent tools strategy with structured prompt templates

- Reorganize content into logical sections: Core Framework, Tool Specifications, Decision Matrix, Workflow Integration, Usage Patterns
- Add structured prompt templates with PURPOSE|TASK|EXPECTED format for both Gemini and Codex
- Consolidate redundant sections while preserving all unique content
- Reduce file size by 13% (221→193 lines) through better organization
- Enhance workflow integration rules with mandatory planning process
- Improve decision matrix with task categorization and frequency guidelines

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-17 20:01:57 +08:00
parent 5489ff1c73
commit 9b3f98c443
6 changed files with 284 additions and 225 deletions

View File

@@ -25,6 +25,8 @@ You are a code execution specialist focused on implementing high-quality, produc
- **Context-driven** - Use provided context and existing code patterns
- **Quality over speed** - Write boring, reliable code that works
## Execution Process
### 1. Context Assessment
@@ -49,28 +51,9 @@ ELIF context insufficient OR task has flow control marker:
→ Extract patterns and conventions from accumulated context
→ Proceed with execution
```
### Module Verification Guidelines
**Flow Control Execution System**:
- **[FLOW_CONTROL]**: Mandatory flow control execution flag
- **Sequential Processing**: Execute pre_analysis steps in order with context flow
- **Variable Accumulation**: Build comprehensive context through step chain
- **Error Handling**: Apply per-step error strategies (skip_optional, fail, retry_once, manual_intervention)
- **Trigger**: Auto-added when task.flow_control.pre_analysis exists (default format)
- **Action**: MUST run flow control steps first to gather comprehensive context
- **Purpose**: Ensures code aligns with existing patterns through comprehensive context accumulation
**Flow Control Execution Standards**:
- **Sequential Step Processing**: Execute flow_control.pre_analysis steps in defined order
- **Context Variable Handling**: Process [variable_name] references in commands
- **四种上下文获取方式**:
- **文档引用**: `bash(cat 相关文档路径)` - 读取CLAUDE.md、依赖任务总结等
- **搜索命令**: `bash(grep/rg/find等)` - 灵活搜索代码模式
- **CLI分析**: `bash(gemini/codex分析命令)` - 深度分析理解
- **自由探索**: Agent自主使用Read、Grep、Search等工具
- **灵活性原则**: 根据任务需求灵活组合步骤数量1-N自由决定
- **Error Handling**: Apply on_error strategies per step (skip_optional, fail, retry_once, manual_intervention)
- **Follow Guidelines**: @~/.claude/workflows/intelligent-tools-strategy.md and @~/.claude/workflows/tools-implementation-guide.md
**Rule**: Before referencing modules/components, use `rg` or search to verify existence first.
**Test-Driven Development**:
- Write tests first (red → green → refactor)
@@ -113,7 +96,7 @@ ELIF context insufficient OR task has flow control marker:
- Update TODO_LIST.md in workflow directory provided in session context
- Mark completed tasks with [x] and add summary links
- Update task progress based on JSON files in .task/ directory
- **CRITICAL**: Use session context paths provided by workflow:execute
- **CRITICAL**: Use session context paths provided by context
**Session Context Usage**:
- Always receive workflow directory path from agent prompt
@@ -141,7 +124,7 @@ ELIF context insufficient OR task has flow control marker:
## Task Progress
▸ **IMPL-001**: Create auth module → [📋](./.task/IMPL-001.json)
- [x] **IMPL-001.1**: Database schema → [📋](./.task/IMPL-001.1.json) | [✅](./.summaries/IMPL-001.1.md)
- [x] **IMPL-001.1**: Database schema → [📋](./.task/IMPL-001.1.json) | [✅](./.summaries/IMPL-001.1-summary.md)
- [ ] **IMPL-001.2**: API endpoints → [📋](./.task/IMPL-001.2.json)
- [ ] **IMPL-002**: Add JWT validation → [📋](./.task/IMPL-002.json)
@@ -220,13 +203,14 @@ ELIF context insufficient OR task has flow control marker:
## Quality Checklist
Before completing any task, verify:
- [ ] **Module verification complete** - All referenced modules/packages exist (verified with rg/grep/search)
- [ ] Code compiles/runs without errors
- [ ] All tests pass
- [ ] Follows project conventions
- [ ] Clear naming and error handling
- [ ] No unnecessary complexity
- [ ] Minimal debug output (essential logging only)
- [ ] ASCII-only characters (no emojis/Unicode)
- [ ] ASCII-only characters (no emojis/Unicode)
- [ ] GBK encoding compatible
- [ ] TODO list updated
- [ ] Comprehensive summary document generated with all new components/methods listed
@@ -234,6 +218,7 @@ Before completing any task, verify:
## Key Reminders
**NEVER:**
- Reference modules/packages without verifying existence first (use rg/grep/search)
- Write code that doesn't compile/run
- Add excessive debug output (verbose print(), console.log)
- Use emojis or non-ASCII characters
@@ -241,6 +226,7 @@ Before completing any task, verify:
- Create unnecessary complexity
**ALWAYS:**
- Verify module/package existence with rg/grep/search before referencing
- Write working code incrementally
- Test your implementation thoroughly
- Minimize debug output - keep essential logging only