Skip to content

feat(instructions): Subagent handoff workflow specification #592

@WilliamBerryiii

Description

@WilliamBerryiii

Overview

Create the subagent handoff workflow specification — an instruction file defining how the DT coach dispatches subagents for handoff-related activities: readiness assessment before space exit, artifact compilation for handoff prompts, and handoff validation after artifact generation.

This specification supports the handoff contract (#583) by defining the operational mechanics of subagent dispatch during handoff transitions.

Directory context: The .copilot-tracking/dt/ path in applyTo is created per-project by the coach agent (#579 from Phase 2). See #583 for the complete directory and handoff contract specification.

Target File

.github/instructions/dt-subagent-handoff.instructions.md

Frontmatter

---
description: 'DT subagent handoff workflow — readiness assessment, artifact compilation, and handoff validation via subagent dispatch'
applyTo: '**/.copilot-tracking/dt/**'
---

Required Content

Subagent Dispatch Context

The DT coach dispatches subagents in two contexts:

  1. Mid-session research: Quick, focused queries during active coaching (industry data, competitive analysis, technical constraints) — addressed in the coach agent definition (feat(agents): Create dt-coach.agent.md #579)
  2. Handoff workflow: Multi-step assessment and compilation before DT→RPI handoff — specified in this file

This instruction file governs context 2.

Readiness Assessment Workflow

When the coach triggers graduation awareness at a space boundary:

  1. Coach dispatches assessment subagent with:
    • Current DT space (problem/solution/implementation)
    • List of expected artifacts per the exit schema
    • Project directory path for artifact scanning
  2. Subagent scans artifacts against the exit-point schema:
    • File existence check for each expected artifact
    • Content completeness assessment (non-empty, has key sections)
    • Quality marker inventory (count of validated vs. assumed vs. unknown items)
  3. Subagent returns assessment to coach:
    • Readiness status: Ready, Partially Ready, Not Ready
    • Missing artifacts list
    • Quality summary (e.g., "3 validated insights, 2 unknown assumptions, 1 conflicting data point")
    • Recommended actions if not fully ready

Artifact Compilation Workflow

When the user confirms handoff and readiness is acceptable:

  1. Coach dispatches compilation subagent with:
    • Exit-point schema template from handoff contract
    • Project artifact directory paths
    • Quality marker definitions
  2. Subagent reads and compiles all method artifacts into the exit schema:
    • Extracts key content from each method's output files
    • Applies quality markers based on artifact content and coaching history
    • Generates the structured exit-point artifact
  3. Subagent returns compiled artifact to coach
  4. Coach reviews and adjusts before passing to the handoff prompt

Handoff Validation Workflow

After the handoff prompt generates the RPI entry artifact:

  1. Coach dispatches validation subagent with:
    • Generated RPI entry artifact
    • RPI input contract for the target agent
    • Content sanitization rules
  2. Subagent validates:
    • All required RPI input fields are populated
    • No .copilot-tracking/ paths leaked into the artifact
    • No planning reference IDs in the artifact
    • Quality markers are present and consistent
  3. Subagent returns validation result: Pass/Fail with specific issues

Session Continuity

During all subagent dispatch:

  • Coaching state is not modified by subagents (read-only access)
  • Coach identity and hint calibration persist
  • If subagent dispatch fails, coach presents the assessment/compilation manually with reduced detail
  • User is informed that background work is happening ("Let me check our readiness for handoff...")

Token Budget

Target: ~800-1,200 tokens (ambient tier)

RPI Pipeline Workflow

  1. task-researcher: Gather DT4HVE subagent dispatch patterns, existing runSubagent usage in HVE Core (from task-researcher and other agents), and handoff readiness assessment approaches.
  2. task-planner: Plan the file — three workflows (readiness, compilation, validation), subagent dispatch format, session continuity rules.
  3. task-implementor: Author following prompt-builder standards. Workflows should be clear enough for the coach agent to implement dispatch correctly.
  4. task-reviewer: Validate workflow completeness, subagent dispatch format consistency with HVE Core patterns, session continuity guarantees, prompt-builder compliance.

Success Criteria

  • Instruction file created at .github/instructions/dt-subagent-handoff.instructions.md
  • Frontmatter has applyTo: '**/.copilot-tracking/dt/**' glob
  • Readiness assessment workflow with artifact scanning and quality inventory
  • Artifact compilation workflow with schema-based extraction and quality marking
  • Handoff validation workflow with content sanitization checks
  • Session continuity guarantees (read-only state, identity persistence, failure fallback)
  • Token count within ~800-1,200 target
  • Passes task-reviewer validation against prompt-builder standards
  • Each prompt, instructions, or agent file registered in collections/design-thinking.collection.yml with path and kind fields
  • Each prompt, instructions, or agent file registered in collections/hve-core-all.collection.yml with path and kind fields
  • npm run plugin:generate succeeds after collection manifest updates

Metadata

Metadata

Assignees

Labels

featureNew feature triggering minor version bumpinstructionsCopilot instruction files (.instructions.md)

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions