Teamwork Spec Refactor
Use this skill to continue the teamwork refactor without drifting from the contract.
Resume Protocol
Start here before changing code:
- Read the session plan snapshot in
~/.copilot/session-state/.../plan.mdif available. - Read
references/contract.md. - Read
references/implementation-map.md. - Inspect the current code surface you are about to change.
- Only then edit code.
If a proposed change conflicts with the contract, follow the contract instead of improvising.
Non-Negotiable Contract
- Team Workspace is the durable collaboration substrate
- teamwork base information, including the original user request, belongs in workspace scaffolding
- SSOT, progress, and handoff memory live in scaffolded files and workspace instructions
teamworkis a meta-meta-skill- decide whether a team is needed
- choose the execution pattern
- scaffold the workspace
- generate
agents.md - instantiate the teamwork constitution
- Static code enforces runtime guarantees
- safety policy
- validation
- refresh semantics
- provenance
- observability
orgis explicit lineage-based teamwork- org view must show only lineages created through explicit org creation
- do not infer org membership from generic
lineageId/parentSessionIdalone - do not reuse org identity for scheduled collaboration
- Scheduled collaboration uses scheduled task groups
- separate from org
- governed by Settings-backed backend-enforced limits
- Scheduled wake-up may trigger a master agent
- this is an operational pattern, not a reason to merge org and scheduled models
- Keep org tooling minimal
- prefer 2-3 agent tools total
- recommended minimum set:
createOrgspawnOrgAgent- optional
getOrg
Primary Workstreams
Choose the workstream that matches the requested change.
Workstream A: Workspace constitution and scaffolding
Use when changing:
teamwork- scaffold generation
agents.md- teamwork base information
- coordination file contracts
Do this:
- Preserve workspace files as the canonical teamwork state.
- Write the original user request and teamwork base information into the scaffold.
- Generate
agents.mdwith explicit read/write rules. - Keep backend models out of the canonical teamwork constitution.
Workstream B: Scheduled task groups and policy
Use when changing:
- scheduled task data model
- scheduled task UI
- governance settings
- scheduler-side validation
Do this:
- Treat scheduled collaboration as grouped automation, not org lineage.
- Add group metadata, not org identity.
- Put user-configurable policy in Settings.
- Enforce the policy in backend so agents cannot bypass it.
Workstream C: Org lineage and org view
Use when changing:
- lineage metadata
- org-focused UX
- sub-agent organization behavior
Do this:
- Keep org tied to lineage-based teamwork only.
- Preserve separation from scheduled task groups.
- Treat org membership as explicit metadata, not lineage inference.
- Build org-focused UX as a dedicated surface, not a small tweak to generic lineage history.
- Resume the org root session from org view, not arbitrary child sessions.
Decision Rules
When uncertain, apply these rules in order:
- Prefer workspace scaffolding over backend canonical state.
- Prefer explicit contract files over hidden conventions.
- Prefer separate models for org and scheduled groups.
- Prefer explicit org metadata over lineage-only inference when org semantics matter.
- Prefer Settings UX plus backend enforcement for governance.
- Prefer dedicated org/group surfaces over overloaded generic views.
Current Likely Next Changes
- Upgrade
teamworkand its scaffold script to generate:agents.md- teamwork base information including the original user request
- coordination scaffold
- optional machine-readable teamwork manifest
- Redesign Scheduled Tasks UX around:
- personal tasks
- governance settings
- Replace the provisional lineage-filtered Org view with:
- explicit org metadata
- minimal org tool group
- org-card / org-chart UX
- root-session resume behavior
References
- Read
references/contract.mdfor the binding architecture contract. - Read
references/implementation-map.mdfor the current code surfaces and where changes should land.