fix: Pass session context to agents for proper TODO_LIST and summary management

- Update workflow:execute.md to inject session context paths into agent prompts
- Modify code-developer.md to require and use session context for TODO_LIST updates
- Update task:execute.md to include session_context structure in JSON template
- Enhance action-planning-agent.md to use provided session paths for plan generation
- Fix code-review-test-agent.md to reference session context for review summaries

Resolves issue where agents couldn't locate workflow directory for TODO_LIST.md updates
and summary creation. Agents now receive explicit paths instead of assuming defaults.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-12 16:52:30 +08:00
parent 9082951519
commit 69ec163a39
5 changed files with 55 additions and 15 deletions

View File

@@ -62,14 +62,16 @@ Break work into 3-5 logical implementation stages with:
- Estimated complexity and time requirements
### 2. Implementation Plan Creation
Generate `IMPL_PLAN.md` in `.workflow/WFS-[session-id]/` directory:
Generate `IMPL_PLAN.md` using session context directory paths:
- **Session Context**: Use workflow directory path provided by workflow:execute
- **Stage-Based Format**: Simple, linear tasks
- **Hierarchical Format**: Complex tasks (>5 subtasks or >3 modules)
- **CRITICAL**: Always use session context paths, never assume default locations
### 3. Task Decomposition (Complex Projects)
For tasks requiring >5 subtasks or spanning >3 modules:
- Create detailed task breakdown and tracking
- Generate TODO_LIST.md for progress monitoring
- Generate TODO_LIST.md for progress monitoring using provided session context paths
- Use hierarchical structure (max 3 levels)
### 4. Document Generation

View File

@@ -90,13 +90,20 @@ Follow unified Gemini CLI guidelines: @~/.claude/workflows/gemini-unified.md
- Functionality works as specified
2. **Update TODO List**:
- Update TODO_LIST.md in workflow directory (.workflow/WFS-[session-id]/)
- 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
**Session Context Usage**:
- Always receive workflow directory path from agent prompt
- Use provided TODO_LIST Location for updates
- Create summaries in provided Summaries Directory
- Update task JSON in provided Task JSON Location
**Project Structure Understanding**:
```
.workflow/WFS-[session-id]/
.workflow/WFS-[session-id]/ # (Path provided in session context)
├── TODO_LIST.md # Progress tracking document
├── .task/impl-*.json # Task definitions (source of truth)
└── .summaries/IMPL-*.md # Task completion summaries
@@ -116,7 +123,12 @@ Follow unified Gemini CLI guidelines: @~/.claude/workflows/gemini-unified.md
- [ ] **IMPL-001.2**: API endpoints → [📋](./.task/impl-001.2.json)
```
3. **Generate Summary** (if .workflow directory exists):
3. **Generate Summary** (using session context paths):
- **MANDATORY**: Create summary in provided Summaries Directory
- Use exact paths from session context (e.g., `.workflow/WFS-[session-id]/.summaries/`)
- Link summary in TODO_LIST.md using relative path
**Summary Template**:
```markdown
# Task: [Task-ID] [Name]
@@ -127,6 +139,11 @@ Follow unified Gemini CLI guidelines: @~/.claude/workflows/gemini-unified.md
## Status: ✅ Complete
```
**Auto-Check Workflow Context**:
- Verify session context paths are provided in agent prompt
- If missing, request session context from workflow:execute
- Never assume default paths without explicit session context
### 5. Problem-Solving

View File

@@ -166,7 +166,7 @@ if [FAST_MODE]: apply targeted review process
**When completing code review:**
1. **Generate Review Summary Document**: Create comprehensive review summary in current workflow directory `.workflow/WFS-[session-id]/.summaries/` directory:
1. **Generate Review Summary Document**: Create comprehensive review summary using session context paths (provided summaries directory):
```markdown
# Review Summary: [Task-ID] [Review Name]
@@ -213,13 +213,13 @@ if [FAST_MODE]: apply targeted review process
- [📋 Implementation Plan](../IMPL_PLAN.md#[Task-ID])
```
2. **Update TODO_LIST.md**: After generating review summary, update the corresponding task item in current workflow directory:
2. **Update TODO_LIST.md**: After generating review summary, update the corresponding task item using session context TODO_LIST location:
- Keep the original task details link: `→ [📋 Details](./.task/[Task-ID].json)`
- Add review summary link after pipe separator: `| [✅ Review](./.summaries/[Task-ID]-review.md)`
- Mark the checkbox as completed: `- [x]`
- Update progress percentages in the progress overview section
3. **Update Session Tracker**: Update `.workflow/WFS-[session-id]/workflow-session.json` with review completion:
3. **Update Session Tracker**: Update workflow-session.json using session context workflow directory:
- Mark review task as completed in task_system section
- Update overall progress statistics in coordination section
- Update last modified timestamp
@@ -268,8 +268,8 @@ Structure your review as:
- [ ] Rejected (critical issues)
### Next Steps
1. Generate review summary document in `.workflow/WFS-[session-id]/.summaries/`
2. Update TODO_LIST.md with review completion and summary link
1. Generate review summary document using session context summaries directory
2. Update TODO_LIST.md using session context TODO_LIST location with review completion and summary link
3. Mark task as completed in progress tracking
```
@@ -321,9 +321,9 @@ When escalating, provide:
## Important Reminders
**ALWAYS:**
- Complete review summary documentation after each review
- Update TODO_LIST.md with progress and summary links
- Generate review summaries in `.workflow/WFS-[session-id]/.summaries/`
- Complete review summary documentation after each review using session context paths
- Update TODO_LIST.md using session context location with progress and summary links
- Generate review summaries in session context summaries directory
- Balance thoroughness with pragmatism
- Provide constructive, actionable feedback
- Implement or recommend tests for all code changes