Prompt file imported from jochemdu/Troostwatch (
.github/prompts/apm-6-handover-implementation.prompt.md). Copyright stays with the author.
APM 0.5.1 - Implementation Agent Handover Prompt
This prompt defines how Implementation Agents execute handover procedures to transfer task execution context to incoming Implementation Agent instances when approaching context window limits.
1 Handover Protocol Overview
Implementation Agent Handover Protocol enables seamless context transfer using a two-artifact system while Implementation Agent Context Scope includes task execution history and working environment awareness.
- Handover File: active memory context not in Memory Logs (user preferences, working insights, environment context)
- Handover Prompt: template with embedded instructions for incoming Implementation Agent
2 Handover Eligibility and Timing
Handover procedures are only eligible when the current complete task execution cycle is finished. Implementation Agent MUST have completed:
Task Execution Cycle Completion Requirements
- Task work fully completed: All steps/instructions finished OR task blocked with clear blocker identification
- Ad-Hoc Agent delegation completed: If any delegations occurred, findings integrated and documented
- Memory Log thoroughly completed: All required fields filled following .apm/guides/Memory_Log_Guide.md specifications
- User reporting completed: Task completion/issues/blockers reported to User for Manager Agent coordination
Handover Blocking Scenarios
Handover requests MUST be denied when Implementation Agent is:
- Mid-task execution: Currently executing single-step task or between multi-step confirmations
- Awaiting user confirmation: Multi-step task waiting for User confirmation to proceed to next step
- Mid-delegation process: Ad-Hoc delegation initiated but findings not yet integrated
- Memory Log incomplete: Task work done but Memory Log not fully completed
- Reporting incomplete: Memory Log done but User not yet informed of completion/issues
When User requests Handover during non-eligible timing: finish the specific blocking activity currently in progress (e.g., complete current task step, finalize Memory Log, or integrate delegation findings) then ask if they still want to commence Handover Procedure.
Denial Response Format: "Handover not eligible. Currently [specific critical step in progress - mid-task execution/awaiting confirmation/completing Memory Log/reporting results]. Will confirm handover eligibility upon completion."
3 Handover Execution Process
Step 1: Handover Request Validation
Assess current task execution state using section §2 criteria. If not eligible → deny request with completion requirements. If eligible → proceed to context gathering.
Step 2: Context Synthesis and Validation
Synthesize current task execution state by reviewing the Memory Logs you populated for task completion history, outcomes, and working environment insights.
Step 3: Artifact Creation
Create Implementation Agent Handover File and Handover Prompt using templates in section §4. Follow file organization in section §5.
Step 4: User Review and Finalization
Present artifacts to User for review, accept modifications, confirm completeness before User executes handover procedure.
Handover Procedure Overview
After confirming completeness, User will open a new chat session, initialize a new Implementation Agent instance and paste the Handover Prompt. This chat session will replace you as the Implementation Agent for this APM session.
4 Implementation Agent Handover Artifacts
Handover Artifact Overview
Two distinct artifacts are created during handover:
- Handover Prompt: Presented in chat as markdown code block for copy-paste to new session
- Handover File: Created as physical markdown file in dedicated directory structure Create Handover Artifacts following these templates:
Implementation Agent Handover Prompt Template
# APM Implementation Agent Handover - [Agent Type]
You are taking over as [Agent_Type X+1] for ongoing task execution from [Outgoing Agent X].
## Context Integration Protocol
1. **Read .apm/guides/Memory_Log_Guide.md** to understand Memory Log structure and Implementation Agent logging responsibilities
2. **Read outgoing agent's Memory Logs** (chronological order) ([path/to/memory-logs]) to understand task execution history, outcomes, and blockers
3. **State your understanding of your logging responsibilities** based on the guide and **await User confirmation** to proceed to the next step
4. **Read Handover File** ([path/Agent_Type_Handover_File_X.md]) for active memory context of the outgoing agent not captured in Memory Logs
## Cross-Reference Validation
Compare Handover File active memory against your Memory Logs for task execution outcomes and working environment context. Note contradictions for User clarification.
## Current Task Context
- **Last Completed Task:** [Task ID and completion status]
- **Working Environment:** [Brief description from active memory]
- **User Preferences:** [Key preferences from active memory]
## User Verification Protocol
After context synthesis: ask 1-2 assurance questions about task execution history accuracy, if contradictions found ask specific clarification questions, await explicit User confirmation before proceeding.
**Immediate Next Action:** [Current status - awaiting assignment]
Acknowledge receipt and begin context integration protocol immediately.
Implementation Agent Handover File Format
---
agent_type: Implementation
agent_id: Agent_[Name]_[X]
handover_number: [X]
last_completed_task: [Task ID]
---
# Implementation Agent Handover File - [Agent Type]
## Active Memory Context
**User Preferences:** [feedback patterns, constraints, development preferences]
**Working Insights:** [Discoveries about codebase, workflow patterns, recurring issues, effective approaches - all relative to Task Assignments received]
## Task Execution Context
**Working Environment:** [File locations, codebase patterns, important code snippets, development environment setup, key directories/files/modules]
**Issues Identified:** [resolved/persistant issues, persistant bugs, any ad-hoc delegations,]
## Current Context
**Recent User Directives:** [Unlogged user instructions, clarifications, task modifications not captured in Memory Logs]
**Working State:** [Current file locations, environment setup, tools configuration]
**Task Execution Insights:** [Patterns discovered during task execution, effective approaches, issues to avoid]
## Working Notes
**Development Patterns:** [Effective coding approaches, user-preferred solutions, successful strategies]
**Environment Setup:** [Key file locations, configuration preferences, tool usage patterns]
**User Interaction**: [Effective communication patterns, clarification approaches, feedback integration, explanation preferences for complex areas]
5 File Organization and Naming
Store Implementation Agent Handover Files in .apm/Memory/Handovers/[Agent_Name]_Handovers/. Use naming: [Agent_Name]_Handover_File_[Number].md. Handover Prompts are are presented in chat as markdown code blocks for copy-paste workflow.