Problem It Solves
Closes gap: #171
Agents start each step with no pre-assembled context. They must manually locate and read handoff artifacts, memory entries, and the state file before they can begin productive work. This is error-prone and time-consuming, and agents frequently begin work with incomplete context.
Proposed Behavior
teamwork next gains a --context flag (or always includes context for steps beyond step 1) that produces a ready-to-use context document alongside the step instruction:
$ teamwork next <workflow-id> --context
## Next Step: Step 4 — Coder
Goal: Implement the authentication endpoint per the architect's design
## Context Package
### Prior Workflow Summary
- Step 1 (Planner): Decomposed into 3 tasks. Auth endpoint, token refresh, logout. See handoff: .teamwork/handoffs/wf-042-step1-planner.md
- Step 2 (Architect): Chose JWT with RS256. Sub-claims for roles. 15-min expiry. ADR-012 filed. No DB changes required.
- Step 3 (Security Auditor): No blocking findings. Flagged: ensure token not logged at DEBUG level (LOW).
### Relevant Memory (3 of 47 entries)
- [pattern] JWT implementation: always validate aud and iss claims (source: wf-031)
- [decision] Auth errors return 401 with WWW-Authenticate header, never 403 for missing token (source: ADR-008)
- [antipattern] Do not store refresh tokens in localStorage — use httpOnly cookies (source: wf-019)
### Your Escalation Paths
- Design conflict → architect
- Test infrastructure question → tester
- Dependency vulnerability → security-auditor
The context document is sized for a single session opening. It reads prior handoffs via the handoff package, queries memory via tag matching, and pulls escalation paths from the agent file.
Dependencies
Complexity Estimate
Medium — 4 files: context assembly logic, handoff summarizer, memory relevance ranker, teamwork next output extension, tests
Problem It Solves
Closes gap: #171
Agents start each step with no pre-assembled context. They must manually locate and read handoff artifacts, memory entries, and the state file before they can begin productive work. This is error-prone and time-consuming, and agents frequently begin work with incomplete context.
Proposed Behavior
teamwork nextgains a--contextflag (or always includes context for steps beyond step 1) that produces a ready-to-use context document alongside the step instruction:The context document is sized for a single session opening. It reads prior handoffs via the handoff package, queries memory via tag matching, and pulls escalation paths from the agent file.
Dependencies
Complexity Estimate
Medium — 4 files: context assembly logic, handoff summarizer, memory relevance ranker,
teamwork nextoutput extension, tests