mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -65,6 +65,7 @@ END FUNCTION
|
||||
|
||||
- **Validation**: Checks for the task's JSON file in `.task/` and resolves its dependencies.
|
||||
- **Context Preparation**: Loads task and workflow context, preparing it for the selected agent.
|
||||
- **Session Context Injection**: Provides workflow directory paths to agents for TODO_LIST.md and summary management.
|
||||
- **TodoWrite Coordination**: Generates execution Todos and checkpoints, syncing with `TODO_LIST.md`.
|
||||
|
||||
### 🏁 **Post-Execution Protocol**
|
||||
@@ -199,7 +200,13 @@ This is the simplified data structure loaded to provide context for task executi
|
||||
},
|
||||
"workflow": {
|
||||
"session": "WFS-user-auth",
|
||||
"phase": "IMPLEMENT"
|
||||
"phase": "IMPLEMENT",
|
||||
"session_context": {
|
||||
"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_location": ".workflow/WFS-user-auth/.task/"
|
||||
}
|
||||
},
|
||||
"execution": {
|
||||
"agent": "code-developer",
|
||||
|
||||
@@ -146,6 +146,12 @@ Task(subagent_type="code-developer",
|
||||
prompt="[GEMINI_CLI_REQUIRED] Implement authentication logic based on schema
|
||||
|
||||
Task Context: impl-1.2 - Implement auth logic
|
||||
Session Context:
|
||||
- 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 Location: .workflow/WFS-user-auth/.task/impl-1.2.json
|
||||
|
||||
Implementation Details:
|
||||
- Target File: src/auth/models/User.ts
|
||||
- Function: UserSchema (lines 10-50)
|
||||
@@ -156,6 +162,7 @@ Task(subagent_type="code-developer",
|
||||
- Risks: Schema changes require database migration, Existing user data compatibility
|
||||
- Performance: Index JWT fields for faster lookups
|
||||
|
||||
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")
|
||||
```
|
||||
@@ -218,7 +225,14 @@ Task(subagent_type="code-developer",
|
||||
- Requirements: JWT authentication, OAuth2 support
|
||||
- Scope: src/auth/*, tests/auth/*
|
||||
- Dependencies: impl-1.1 (completed)
|
||||
- Workflow: WFS-user-auth authentication system",
|
||||
- Workflow: WFS-user-auth authentication system
|
||||
|
||||
Session Context:
|
||||
- Workflow Directory: .workflow/WFS-user-auth/
|
||||
- TODO_LIST Location: .workflow/WFS-user-auth/TODO_LIST.md
|
||||
- Summaries Directory: .workflow/WFS-user-auth/.summaries/
|
||||
|
||||
CRITICAL: Update TODO_LIST.md and create completion summary using provided paths.",
|
||||
|
||||
description="Agent executes with full discovered context")
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user