feat: Add task-specific path management system for precise CLI analysis

- Add 'paths' field to task JSON schema with semicolon-separated concrete paths
- Create read-task-paths.sh script to convert paths to Gemini @ format
- Update all agents to use task-specific paths instead of --all-files
- Integrate get_modules_by_depth.sh for project structure discovery
- Update workflow planning to populate paths field automatically
- Enhance execute command to pass task-specific paths to agents
- Update documentation for new path management system

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-13 11:28:16 +08:00
parent e8de626387
commit 9a4003deda
10 changed files with 146 additions and 7 deletions

View File

@@ -168,6 +168,9 @@ Task(subagent_type="code-developer",
- Risks: Schema changes require database migration, Existing user data compatibility
- Performance: Index JWT fields for faster lookups
Focus Paths (from task JSON): $(.claude/scripts/read-task-paths.sh .workflow/WFS-user-auth/.task/impl-1.2.json)
Gemini Command: gemini -p "$(.claude/scripts/read-task-paths.sh .workflow/WFS-user-auth/.task/impl-1.2.json) @{CLAUDE.md}"
IMPORTANT: Update TODO_LIST.md and create summary in provided directories upon completion.
Use implementation details above for precise, targeted development.",
description="Execute impl-1.2 with full workflow context and implementation details")
@@ -237,10 +240,14 @@ Task(subagent_type="code-developer",
- Workflow Directory: .workflow/WFS-user-auth/
- TODO_LIST Location: .workflow/WFS-user-auth/TODO_LIST.md
- Summaries Directory: .workflow/WFS-user-auth/.summaries/
- Task JSON: .workflow/WFS-user-auth/.task/impl-1.2.json
CRITICAL: Update TODO_LIST.md and create completion summary using provided paths.",
Focus Paths: $(.claude/scripts/read-task-paths.sh .workflow/WFS-user-auth/.task/impl-1.2.json)
Analysis Command: Use gemini -p \"$(.claude/scripts/read-task-paths.sh .workflow/WFS-user-auth/.task/impl-1.2.json) @{CLAUDE.md}\"
description="Agent executes with full discovered context")
CRITICAL: Use task-specific paths for focused analysis. Update TODO_LIST.md and create completion summary using provided paths.",
description="Agent executes with task-specific paths and full discovered context")
```
### Status Tracking Integration

View File

@@ -91,6 +91,7 @@ The command automatically detects input type:
- Automatically creates .task/ files when complexity warrants
- Generates hierarchical task structure (max 3 levels)
- Updates session state with task references
- Runs project structure analysis to populate paths field
### Implementation Field Requirements
⚠️ **CRITICAL**: All generated tasks must include detailed implementation guidance
@@ -132,6 +133,31 @@ The command automatically detects input type:
- **context_notes**: Dependencies, risks, performance considerations
- **analysis_source**: manual|gemini|codex|auto-detected
**Paths Field Population Process**:
1. **Project Structure Analysis**: Run `get_modules_by_depth.sh` to discover project structure
2. **Relevance Filtering**: Match discovered modules to task requirements
3. **Path Selection**: Choose concrete directories/files (avoid wildcards)
4. **Format**: Semicolon-separated list (e.g., `"src/auth;tests/auth;config/auth.json"`)
**Path Selection Strategy**:
```pseudo
# Step 1: Analyze project structure
modules = Bash(.claude/scripts/get_modules_by_depth.sh list)
# Step 2: Extract relevant modules based on task scope
relevant_paths = []
for module in modules:
if matches_task_scope(module.path, task_requirements):
relevant_paths.append(module.path)
# Step 3: Add specific files mentioned in requirements
specific_files = extract_file_mentions(task_requirements)
relevant_paths.extend(specific_files)
# Step 4: Format as semicolon-separated string
task.paths = join(relevant_paths, ";")
```
**Quality Standards**:
- logic_flow must use specified symbols (───►, ◊───, ◄───)
- Each file must have specific location (function name or line range)