mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-29 20:11:04 +08:00
feat: 增加文件模式参考和复杂模式发现的示例,增强 CLI 命令的文档
This commit is contained in:
@@ -100,6 +100,39 @@ RULES: $(cat ~/.claude/prompt-templates/bug-fix.md) | Focus on session managemen
|
||||
- **Targeted Solutions**: Minimal, specific fixes
|
||||
- **Impact Assessment**: Side effect evaluation
|
||||
|
||||
## File Pattern Reference
|
||||
|
||||
### Common Patterns
|
||||
- All files: `@{**/*}`
|
||||
- Source files: `@{src/**/*}`
|
||||
- TypeScript: `@{*.ts,*.tsx}`
|
||||
- JavaScript: `@{*.js,*.jsx}`
|
||||
- Python: `@{*.py}`
|
||||
- With docs: `@{CLAUDE.md,**/*CLAUDE.md}`
|
||||
- Tests: `@{**/*.test.*,**/*.spec.*}`
|
||||
|
||||
### Complex Pattern Discovery
|
||||
For bug investigation, use semantic discovery to find relevant code:
|
||||
|
||||
```bash
|
||||
# Step 1: Find bug-related files
|
||||
rg "error_keyword|exception_pattern" --files-with-matches
|
||||
mcp__code-index__search_code_advanced(pattern="throw|catch|error", file_pattern="*.ts")
|
||||
|
||||
# Step 2: Trace error propagation path
|
||||
# Identify: origin → propagation → handler
|
||||
|
||||
# Step 3: Execute bug analysis with focused context
|
||||
cd src && ~/.claude/scripts/gemini-wrapper --all-files -p "
|
||||
PURPOSE: Debug null pointer error in authentication
|
||||
TASK: Identify root cause and provide fix
|
||||
MODE: analysis
|
||||
CONTEXT: @{CLAUDE.md,auth/service.ts,middleware/auth.ts}
|
||||
EXPECTED: Root cause, execution trace, minimal fix
|
||||
RULES: $(cat ~/.claude/prompt-templates/bug-fix.md) | Bug: null pointer in token validation
|
||||
"
|
||||
```
|
||||
|
||||
## Session Output
|
||||
|
||||
**Location**: `.workflow/WFS-[topic]/.chat/bug-index-[timestamp].md`
|
||||
|
||||
@@ -46,6 +46,39 @@ The code-analysis template provides:
|
||||
- **Logical Reasoning**: Explain "why" behind code behavior
|
||||
- **Debugging Insights**: Identify potential bugs or inefficiencies
|
||||
|
||||
## File Pattern Reference
|
||||
|
||||
### Common Patterns
|
||||
- All files: `@{**/*}`
|
||||
- Source files: `@{src/**/*}`
|
||||
- TypeScript: `@{*.ts,*.tsx}`
|
||||
- JavaScript: `@{*.js,*.jsx}`
|
||||
- Python: `@{*.py}`
|
||||
- With docs: `@{CLAUDE.md,**/*CLAUDE.md}`
|
||||
- Tests: `@{**/*.test.*,**/*.spec.*}`
|
||||
|
||||
### Complex Pattern Discovery
|
||||
For deep code analysis, use semantic discovery to trace execution paths:
|
||||
|
||||
```bash
|
||||
# Step 1: Find entry points and related files
|
||||
rg "function.*authenticate|class.*AuthService" --files-with-matches
|
||||
mcp__code-index__search_code_advanced(pattern="authenticate|login", file_pattern="*.ts")
|
||||
|
||||
# Step 2: Trace execution flow through discovered files
|
||||
# Build call graph: entry → middleware → service → repository
|
||||
|
||||
# Step 3: Execute analysis with focused context
|
||||
cd src && ~/.claude/scripts/gemini-wrapper --all-files -p "
|
||||
PURPOSE: Trace authentication execution flow
|
||||
TASK: Analyze complete auth flow from request to response
|
||||
MODE: analysis
|
||||
CONTEXT: @{CLAUDE.md,api/auth.ts,middleware/auth.ts,services/auth.ts}
|
||||
EXPECTED: Step-by-step execution trace with call diagram
|
||||
RULES: $(cat ~/.claude/prompt-templates/code-analysis.md) | Focus on control flow
|
||||
"
|
||||
```
|
||||
|
||||
## Command Templates
|
||||
|
||||
### Gemini (Default)
|
||||
|
||||
@@ -47,6 +47,38 @@ RULES: $(cat ~/.claude/prompt-templates/plan.md) | Focus on [topic area]
|
||||
"
|
||||
```
|
||||
|
||||
## File Pattern Reference
|
||||
|
||||
### Common Patterns
|
||||
- All files: `@{**/*}`
|
||||
- Source files: `@{src/**/*}`
|
||||
- TypeScript: `@{*.ts,*.tsx}`
|
||||
- JavaScript: `@{*.js,*.jsx}`
|
||||
- With docs: `@{CLAUDE.md,**/*CLAUDE.md}`
|
||||
- Tests: `@{**/*.test.*,**/*.spec.*}`
|
||||
- Config files: `@{*.config.*,**/config/**/*}`
|
||||
|
||||
### Complex Pattern Discovery
|
||||
For comprehensive planning, use semantic discovery to understand project scope:
|
||||
|
||||
```bash
|
||||
# Step 1: Discover project structure
|
||||
~/.claude/scripts/get_modules_by_depth.sh
|
||||
mcp__code-index__find_files(pattern="*.ts")
|
||||
|
||||
# Step 2: Identify key architectural files
|
||||
rg "export.*class|export.*interface" --files-with-matches
|
||||
mcp__code-index__search_code_advanced(pattern="class.*Service|interface.*Config")
|
||||
|
||||
# Step 3: Execute planning with full context
|
||||
cd . && ~/.claude/scripts/gemini-wrapper --all-files -p "
|
||||
PURPOSE: Plan feature implementation
|
||||
CONTEXT: @{CLAUDE.md,**/*CLAUDE.md} Full project context
|
||||
EXPECTED: Architecture design and implementation roadmap
|
||||
RULES: $(cat ~/.claude/prompt-templates/plan.md) | Focus on scalability
|
||||
"
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
**Basic Planning**:
|
||||
|
||||
Reference in New Issue
Block a user