Skip to content

Commit 36b5efd

Browse files
committed
feat(roadmap): Revise async task context delivery architecture and introduce tiered integration framework for remote agents
1 parent a79d66a commit 36b5efd

1 file changed

Lines changed: 174 additions & 19 deletions

File tree

roadmap.md

Lines changed: 174 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -299,20 +299,172 @@ Architecture support is now available in all workflow modes as optional commands
299299
-**Fix Build Mode Checking in Analyze and Clarify**: Ensure analyze and clarify commands properly check build mode before execution
300300
-**Test Build Mode Workflow**: Verify specify → implement works in build mode without tasks.md
301301

302-
#### **Async Task Context Delivery Architecture** *(0% Complete)* - **CRITICAL PRIORITY** - Makes async functionality non-functional
302+
#### **Tier 1 (CRITICAL): Async Task Context Delivery & Remote Agent Integration** *(0% Complete)* - **CRITICAL PRIORITY** - Unblocks full async workflow
303+
304+
Consolidates: Former "Async Task Context Delivery Architecture" + "Multi-Tracker Task-to-Issues Extension" + context purity enforcement from Claude Code article insights
305+
306+
**Purpose**: Enable remote async agents (async-copilot, async-codex, jules) to receive complete spec contexts and support multi-tracker issue creation for enhanced traceability.
307+
308+
**Tier 1.1 - Artifact Context Packaging**
309+
-**Spec Context Bundling**: Create `scripts/bash/package-spec-context.sh` to bundle spec.md + plan.md + research.md + context.md as unified delivery unit
310+
-**Payload Strategy Selection**: Support embedded payload for specs < 150K tokens; URL references for larger repos
311+
-**Git Metadata Inclusion**: Include repo URL, branch, commit SHA in package for remote context
312+
-**PowerShell Equivalent**: Implement `scripts/powershell/Package-SpecContext.ps1` with cross-platform parity
313+
314+
**Tier 1.2 - Remote MCP Task Submission Protocol**
315+
-**Standard MCP Tools**: Define `submit_async_task`, `check_task_status`, `get_task_result` tools in MCP schema
316+
-**Agent Type Support**: Implement endpoints for async-copilot, async-codex, jules, and custom agents
317+
-**Endpoint Registration**: Extend `.mcp.json` configuration to register remote agent endpoints per type
318+
-**Model Parameter Passthrough**: Allow `--model` parameter to flow through to remote agent execution (e.g., `--model opus` on `/implement` passes to async agent)
319+
-**Agent Selection Logic**: Route tasks to appropriate agent based on `/tasks` metadata (ASYNC tag + agent type)
320+
321+
**Tier 1.3 - Repository Context Provision**
322+
-**Git Credential Handling**: Support SSH keys, personal tokens, git-credential-helper for remote auth
323+
-**Branch Context**: Pass feature branch reference so remote agents work with correct isolated specs
324+
-**Commit History**: Include recent commit history and related issue references in context metadata
325+
-**Authentication Testing**: Validate credentials before submitting tasks to prevent failures
326+
327+
**Tier 1.4 - Webhook/Callback Integration**
328+
-**Webhook Listener**: Implement listener for async agent completion events (status, output, error info)
329+
-**Result Storage**: Store completion status + output path in `tasks_meta.json` (keyed by job_id from remote agent)
330+
-**Integration Checking**: During `/implement` execution, check for completed async tasks and retrieve results
331+
-**Error Handling**: Detect failures and escalate ASYNC tasks to SYNC with user notification
332+
333+
**Tier 1.5 - Multi-Tracker Issue Creation** *(Consolidated from Multi-Tracker Task-to-Issues)*
334+
-**Extended `/taskstoissues`**: Update command to support GitHub, Jira, Linear, GitLab (not just GitHub)
335+
-**Dynamic Tracker Detection**: Auto-detect configured issue tracker from `.mcp.json` configuration
336+
-**Tracker-Specific MCP Tools**: Invoke correct platform-specific MCP tool per tracker type
337+
-**URL Validation**: Handle different URL formats (GitHub SSH/HTTPS, Jira REST, Linear API, GitLab REST)
338+
-**Task-to-Issue Linking**: Establish bidirectional links between tasks.md and created issues for traceability
339+
340+
**Tier 1.6 - Context Purity Enforcement** *(From Claude Code article insights)*
341+
-**Full Artifact Delivery**: Remote agents receive complete spec.md/plan.md/research.md (not summaries)
342+
-**Compression Thresholds**: Only compress when artifacts exceed 150K tokens (configurable in config.json)
343+
-**Attention Mechanism Preservation**: Ensure agents can perform pair-wise reasoning across context via full document loading
344+
-**Token Cost Visibility**: Log context size and token costs in delegation prompts for transparency
303345

304-
-**MCP Task Submission Protocol**: Define standard MCP tools for async task submission (submit_task, check_status, get_result)
305-
-**Remote Context Delivery Mechanism**: Implement file upload, URL references, or embedded payload for spec content delivery to remote MCP servers
306-
-**Repository Context Provision**: Provide repository URL, branch, and authentication for remote agents to access committed specs
307-
-**Webhook/Callback Integration**: Establish completion notification and result retrieval from remote async agents
308-
-**Agent-Specific MCP Tool Implementation**: Custom MCP tool implementations for jules, async-copilot, async-codex
346+
---
347+
348+
#### **Tier 2 (HIGH): Sub-Agent Coordination Framework** *(0% Complete)* - **HIGH PRIORITY** - Intelligent local & remote task orchestration
349+
350+
Consolidates: Sub-agent spawning logic from dual execution loop + background observability + failure escalation + agent type selection guidance
351+
352+
**Purpose**: Unified framework for spawning, coordinating, and monitoring local sub-agents (Explore, Plan, general-purpose) and remote async agents with context-aware selection.
353+
354+
**Tier 2.1 - Sub-Agent Type Selection Matrix**
355+
-**Explore Agent Documentation**: Create decision guidance for read-only codebase search (Glob, Grep, Read, bash read-only only)
356+
- ✓ When: Finding files, searching keywords, understanding architecture
357+
- ✗ Don't: Use for modification tasks, complex reasoning
358+
- Context: Fresh slate (no conversation history) - faster + focused
359+
- Model override: Support `--model sonnet` for deeper analysis
360+
-**Plan Agent Documentation**: Design/implementation planning with full tools
361+
- ✓ When: Complex multi-file implementations, architecture decisions
362+
- ✗ Don't: Simple CRUD operations, straightforward fixes
363+
- Context: Full inheritance (pair-wise reasoning enabled)
364+
- Model override: Support `--model opus` for critical planning
365+
-**General-Purpose Agent Documentation**: Complex multi-step task execution
366+
- ✓ When: Tasks requiring tool sequencing, decision-making
367+
- ✗ Don't: Single-tool operations, trivial tasks
368+
- Context: Full inheritance
369+
- Model override: User-configurable per task
370+
-**Integration with Task Tool**: Embed selection guidance in Task tool schema (system prompt injection)
371+
-**Model Parameter Support**: Document model override capability for each agent type
372+
373+
**Tier 2.2 - Context Inheritance Rules**
374+
-**Context Inheritance Matrix**: Document which agents inherit vs start fresh
375+
- Explore: Fresh slate (enables fast codebase search without prior context bloat)
376+
- Plan/General-purpose: Full context inheritance (enables pair-wise attention relationships)
377+
-**Main Agent Reading Pattern**: Document guidance that main agent should read relevant files itself (not rely on agent summaries) for better reasoning (from Claude Code article)
378+
-**Team Directive Integration**: Store preferred context inheritance per organization in `team-ai-directives`
379+
-**Configuration Option**: Allow per-project override of inheritance rules
380+
381+
**Tier 2.3 - "When NOT to Spawn" Guidelines** *(Reduces context bloat)*
382+
-**Anti-Pattern Documentation**:
383+
- ❌ Don't spawn Explore if file paths already known → use Read tool directly
384+
- ❌ Don't spawn if task < 3 steps → execute directly with tools
385+
- ❌ Don't spawn for simple CRUD → handle inline
386+
- ❌ Don't spawn multiple agents serially → coordinate with parallel spawning
387+
-**Negative Guidance in Task Tool**: Inject anti-patterns into system prompt to prevent unnecessary spawns
388+
-**Token Cost Awareness**: Log when direct execution used instead of spawn (context saved)
389+
390+
**Tier 2.4 - Background Agent Observability**
391+
-**Background Task Spawning**: Support `run_in_background: true` in Task tool for long-running processes
392+
-**Monitoring Hooks**: Log output from background tasks (process execution, test runs, compilations)
393+
-**Result Retrieval**: Implement `TaskOutput` tool for retrieving background task results
394+
-**Error Tracking**: Surface background task failures with clear error context
395+
-**Use Case Documentation**: Guide when background spawning is appropriate (e.g., watching test output)
396+
397+
**Tier 2.5 - Parallel Sub-Agent Coordination** *(Enhances existing [P] markers)*
398+
-**[P] Marker Enhancement**: Ensure [P] markers in tasks.md are recognized for parallel spawning
399+
-**File-Based Sequencing**: Maintain rule that tasks touching same files run sequentially despite [P]
400+
-**Phase-Based Execution**: Ensure phases (setup → tests → core → integration → polish) complete in order
401+
-**Parallel Spawn Coordination**: Manage multiple simultaneous sub-agents without context window flooding
402+
-**Integration Testing**: Verify [P] parallelization works with both Tier 1 remote tasks and local Explore agents
403+
404+
**Tier 2.6 - Sub-Agent Failure Escalation**
405+
-**Async Escalation Logic**: When remote ASYNC sub-agent fails, promote parent task to SYNC with user notification
406+
-**Model Retry Strategy**: Support escalation with model upgrade (Haiku → Sonnet → Opus) for failed tasks
407+
-**Rollback Mechanism**: Option to rollback failed agent's changes and retry with different approach
408+
-**Escalation Logging**: Detailed logging of why escalation occurred (timeout, tool failure, reasoning error)
409+
-**User Control**: Allow user to choose: retry, escalate, skip, or restart phase
309410

310-
#### **Multi-Tracker Task-to-Issues Extension** *(0% Complete)* - **MEDIUM PRIORITY** - Enhanced traceability
411+
---
311412

312-
-**Extend taskstoissues Command**: Update `/taskstoissues` command to support Jira/Linear/GitLab in addition to GitHub
313-
-**Dynamic Tracker Detection**: Add logic to detect configured issue tracker from `.mcp.json`
314-
-**Tracker-Specific MCP Tools**: Implement tracker-specific issue creation logic for each platform
315-
-**URL Validation Updates**: Update remote URL validation for different tracker types (Git-based vs non-Git-based)
413+
#### **Tier 3 (MEDIUM): Model Selection Strategy per Command** *(0% Complete)* - **MEDIUM PRIORITY** - Optimize cost & performance
414+
415+
Consolidates: Command-level model selection + context budgeting + two-model review pattern + cost optimization guidance
416+
417+
**Purpose**: Systematic approach to model selection per core command, enabling cost optimization while maintaining quality gates.
418+
419+
**Tier 3.1 - Core & Admin Command Model Selection Matrix**
420+
-**Core Workflow Commands**:
421+
- `/specify`: Default Opus → Options: Sonnet (faster but less conversational quality)
422+
- `/clarify`: Default Opus → Options: Sonnet (validation still works well)
423+
- `/plan`: Default Sonnet → Options: Opus (complexity), Haiku (exploration)
424+
- `/implement`: Default Sonnet → Options: Opus (analysis), Haiku (lightweight)
425+
- `/analyze`: Default Opus → Options: Sonnet (time-constrained)
426+
- `/trace`: Default Haiku → Options: Sonnet (richer traces)
427+
- `/levelup`: Default Sonnet → Options: Opus (comprehensive packets)
428+
-**Admin Commands**:
429+
- `/architect`: Default Sonnet → Options: Opus (critical systems), Haiku (exploration)
430+
- `/constitution`: Default Sonnet → Options: Opus (complex governance)
431+
- `/mode`: Haiku (config is lightweight)
432+
- `/checklist`: Haiku (validation is formulaic)
433+
-**Integration**: Add `--model [opus|sonnet|haiku|gpt-5-codex]` parameter to all commands above
434+
435+
**Tier 3.2 - Model-Aware Context Budgeting** *(Inform users of token costs)*
436+
-**Context Window Limits**: Document effective context windows per model (Opus: ~120K effective of 200K, Sonnet: ~100K of 200K, Haiku: ~80K of 200K)
437+
-**Token Cost Calculator**: Implement utility to estimate tokens for spec.md + plan.md + tasks.md
438+
-**Recommendation Engine**: Show "context utilization: 58% - OK" or "context: 72% - consider compaction" during execution
439+
-**Model Downgrade Suggestions**: Auto-suggest Haiku when context > 70% for non-critical tasks
440+
-**Transparency in Prompts**: Log context size in delegation prompts (e.g., "using Sonnet to preserve 22K tokens")
441+
442+
**Tier 3.3 - Two-Model Review Strategy** *(From Claude Code article)*
443+
-**Review Model Configuration**: Store preferred review model in config.json (configurable: gpt-5-codex, Sonnet, etc.)
444+
-**Quality Gate Integration**: Invoke review model for ASYNC task validation (bug-finding, style checking)
445+
-**SYNC vs ASYNC Review**: Apply two-model review only to critical SYNC tasks (cost optimization)
446+
-**User Override**: Support `--review-model` parameter to force specific reviewer (cross-vendor validation)
447+
-**Review Quality Thresholds**: Document when review model is invoked (P1/P2 risk level, SYNC tasks, security code)
448+
449+
**Tier 3.4 - Cost Optimization Guidance**
450+
-**Usage Documentation**: Create guide on when to use each tier:
451+
- Haiku: Trace generation, exploration, formatting, config updates
452+
- Sonnet: Execution, general-purpose tasks, balanced cost/quality
453+
- Opus: Complex reasoning, architecture decisions, critical paths
454+
-**Cost Calculator**: Implement simple calculator (Opus costs ~3x Sonnet, 5x Haiku) with examples
455+
-**Budget Tracking**: Optional logging of model usage per project/team
456+
-**Org Policy Templates**: Provide templates for enforcing model choices per team
457+
458+
**Tier 3.5 - Model Preference in Team Directives**
459+
-**Directive Format**: Define structure in `team-ai-directives` for model preferences per command
460+
-**Fallback Hierarchy**: Implement precedence: user CLI override → project config → team directive → hardcoded default
461+
-**Org-Wide Defaults**: Enable shared model policies across projects via team directives
462+
463+
**Tier 3.6 - Command-Level --model Parameter Implementation**
464+
-**CLI Parameter Addition**: Add `--model` to all command templates (specify.md, clarify.md, plan.md, implement.md, analyze.md, architect.md, constitution.md, trace.md, levelup.md)
465+
-**Config Validation**: Validate model choice against available models
466+
-**Preference Persistence**: Store user's recent model choice per command for convenience
467+
-**Documentation**: Update quickstart and command help text with model selection guidance
316468

317469
#### **Unified Spec Template Implementation** *(100% Complete)* - **MEDIUM PRIORITY** - Template maintenance reduction
318470

@@ -605,15 +757,16 @@ Architecture support is now available in all workflow modes as optional commands
605757
|**Enhanced Traceability**|60%|⚠️ Partially Complete|
606758
|**Strategic Tooling**|70%|⚠️ Partially Complete|
607759
|**Session Trace Command**|100%|✅ Complete|
608-
|**Async Context Delivery**|0%|🔄 Current Phase (CRITICAL)|
760+
|**Tier 1: Async Context Delivery & Remote Integration**|0%|🔄 Current Phase (CRITICAL)|
761+
|**Tier 2: Sub-Agent Coordination Framework**|0%|🔄 Current Phase (HIGH)|
762+
|**Tier 3: Model Selection Strategy**|0%|🔄 Current Phase (MEDIUM)|
609763
|**Build Mode Bug Fix**|100%|✅ Complete|
610764
|**Levelup Build Mode**|100%|✅ Complete|
611765
|**Persistent Issue ID**|0%|🔄 Current Phase|
612766
|**Build Mode "GSD" Upgrade**|100%|✅ Complete|
613767
|**Architecture Support + Mermaid Diagrams**|100%|✅ Complete|
614768
|**Three-Pillar Validation**|100%|✅ Complete|
615769
|**Context Intelligence & Optimization**|0%|🔄 Current Phase|
616-
|**Multi-Tracker Task-to-Issues**|0%|🔄 Current Phase|
617770
|**Spec Management**|0%|🔄 Current Phase|
618771
|**Workflow Utilities**|0%|🔄 Current Phase|
619772
|**Command Prefix Migration**|0%|🚀 Next Phase (Deferred)|
@@ -635,7 +788,7 @@ Architecture support is now available in all workflow modes as optional commands
635788
- **MCP Infrastructure**: 100% Complete (issue tracker, async agent, and git platform integrations)
636789
- **SDD Optimization**: 100% Complete (workflow flexibility with comprehensive iterative development, enhanced UX, completed mode switching with auto-detection, and mode-aware checklist validation)
637790
- **Complexity Solutions**: ~90% Complete (completed workflow modes with auto-detecting post-implementation analysis, iterative development, enhanced rollback, configurable options - HIGH PRIORITY response to user feedback; some automation features still need implementation)
638-
- **Current Phase Priorities**: 1 CRITICAL (async context delivery) + 5 HIGH (workflow blockers) + 4 MEDIUM features - **PRIMARY FOCUS**
791+
- **Current Phase Priorities**: 3 TIERED INITIATIVES (Tier 1: CRITICAL async delivery, Tier 2: HIGH sub-agent coordination, Tier 3: MEDIUM model selection) + 1 HIGH (persistent issue ID) + 3 MEDIUM features - **PRIMARY FOCUS with parallel development**
639792
- **Next Phase Priorities**: Command prefix migration (deferred to reduce churn while fixing blockers)
640793
- **Future Enhancements**: 0% Complete (minimal enterprise features only)
641794
- **Deferred Features**: IDE Integration & overkill enhancements (removed to maintain focus)
@@ -648,12 +801,14 @@ Architecture support is now available in all workflow modes as optional commands
648801

649802
**🔄 CURRENT PHASE (Primary Focus):**
650803

651-
1. **CRITICAL**: Async task context delivery architecture (0% → 100%) - Makes async functionality completely non-functional
652-
2. **✅ COMPLETED**: Build mode workflow bug fix (100%) - Fixed --require-tasks conditional logic
653-
3. **✅ COMPLETED**: Levelup command build mode compatibility (100%) - Mode-aware file requirements implemented
804+
1. **CRITICAL**: Tier 1 - Async Context Delivery & Remote Agent Integration (0% → 100%) - Unblocks full async workflow with remote agents + multi-tracker issue creation
805+
2. **HIGH**: Tier 2 - Sub-Agent Coordination Framework (0% → 100%) - Intelligent local & remote task orchestration with context-aware selection
806+
3. **MEDIUM**: Tier 3 - Model Selection Strategy per Command (0% → 100%) - Cost optimization & performance tuning across all workflow commands
654807
4. **HIGH**: Persistent issue ID storage enhancement (0% → 100%) - Issue-tracker-first workflow improvement
655-
5. **✅ COMPLETED**: Build Mode "GSD" Upgrade (100%) - All functionality complete including template refactoring
656-
6. **COMPLETED**: Optional Architecture Support (100%) - Architecture commands now available in all modes
808+
5. **✅ COMPLETED**: Build mode workflow bug fix (100%) - Fixed --require-tasks conditional logic
809+
6. **✅ COMPLETED**: Levelup command build mode compatibility (100%) - Mode-aware file requirements implemented
810+
7. **✅ COMPLETED**: Build Mode "GSD" Upgrade (100%) - All functionality complete including template refactoring
811+
8. **✅ COMPLETED**: Optional Architecture Support (100%) - Architecture commands now available in all modes
657812
- ✅ Mode detection utilities implemented (get_current_mode functions)
658813
- ✅ Architecture loading matches constitution pattern
659814
- ✅ Silent operation - no warnings when files missing

0 commit comments

Comments
 (0)