| name | teammate-flow |
| description | This skill should be used when orchestrating the full kon teammate flow โ Azusa explores, Mugi plans, Yui implements, Sawako cleans, Mio reviews. Applies to /kon:team. |
Teammate Flow
Consumers: /kon:team.
Teammate-flow defines the shared workflow skeleton for the kon team โ
from exploration to implementation to review.
Each agent owns their segment; the orchestrator strings them together.
Orchestrator context: follow skills/orchestrator-context โ artifacts hold full output; orchestrator routes by file pointer only.
Core principles (always): follow skills/core-principles โ first principles (don't hide the issue); simplest, most concise correct solution.
When anything is unclear: ask the user โ do not guess or hallucinate. Follow skills/ask-dont-guess. Orchestrator must not advance to the next stage until material uncertainty is resolved.
Shared flow (Full pipeline)
These steps are required in order for /kon:team:
- Plan reuse check โ if
.kon/plan-<SESSION_ID>.md exists (or the most recent .kon/plan-*.md
for cross-session reuse after /kon:design), read it and ask the user once: reuse or re-plan?
Skip Azusa, pre-plan gate, and Mugi on reuse (unless user chooses re-plan).
See commands/team.md.
- ๐ธ Azusa + optional ๐ Jun (parallel when task needs external docs) โ see
skills/external-research. Jun writes .kon/research.md.
- Pre-plan gate (MANDATORY) โ orchestrator runs
skills/pre-plan-gate:
ask high-level + implementation questions; write sessions/<SID>/understanding.md;
do not spawn Mugi until understanding is sufficient and user has answered.
- ๐ฐ Mugi โ structure the work into
.kon/plan-<SESSION_ID>.md (read understanding.md, .kon/research.md, explore.md).
- User confirms plan (MANDATORY) โ After Mugi finishes:
- Orchestrator presents the plan summary to the user
- If
## Decisions needed section exists, present each decision with its default
- STOP and wait for explicit user approval โ do NOT spawn Yui automatically
- Only proceed to step 5 after user says "go", "approved", "proceed", or similar confirmation
- This applies even in
--yolo mode โ plan approval is always required
- Update session (required โ dashboard shows โธ waiting):
python3 $KON_ROOT/scripts/kon_session.py wait-for-user --id "$SID" \
--after plan --summary "Plan ready โ approve to start milestone 1?"
- After user confirms:
python3 $KON_ROOT/scripts/kon_session.py user-continued --id "$SID" \
--summary "Approved plan"
- Milestone loop โ For each milestone in the plan (or all steps if no milestones):
- ๐ถ Yui โ implement this milestone only. "Working on Milestone X..."
- Execute steps for current milestone
- Stop after completing milestone (don't continue to next milestone)
- ๐งน Sawako โ garbage collect the implementation (runs immediately after Yui โ no user gate here)
- Remove dead code: unused functions, variables, imports
- Remove redundant comments that just restate what code does
- Simplify over-complex logic, remove duplicate logic
- Verify before removing โ use grep to confirm nothing is referenced
- No behavior changes โ tests should still pass
- ๐ Mio โ review changes for this milestone only
- Follow
skills/strict-review on the diff from this milestone
- If BLOCKED/NEEDS_CHANGES โ Yui fixes โ Sawako cleans โ Mio re-reviews (repeat until approved)
- If APPROVED โ keep Task ids across milestones (do not clear here). User gate (MANDATORY) before the next milestone or summarize:
- Repeat until all milestones complete (each followed by user gate)
- Manual testing โ After the last milestone gate, user runs tests themselves.
- User verifies the implementation works in their environment
After review passes, always call ๐ Nodoka as the final step to write the session summary.
Follow /kon:summarize.
Quality checks
Implementation loop โ Task resume (token savings)
Within each milestone (or the single pass for /kon:quick / /kon:debug), ๐ถ Yui โ ๐งน Sawako โ ๐ Mio form one loop until Mio approves. Do not re-pass agent files or skills on every iteration โ spawn once, then resume the same Task subagent.
No build/compile during the loop
During the implementation loop, do not run project compile or build steps โ no npm run build, cargo build, go build, tsc, bundlers, or equivalent full source builds.
| Agent | During loop |
|---|
| ๐ถ Yui | Edit code only. May run targeted pytest for tests added/changed this turn (pytest path::test -xvs). No full test suite, no compile/build. |
| ๐งน Sawako | Cleanup only โ no build/compile. |
| ๐ Mio | Review via diff + static analysis. Do not require or block on missing build output. Accept targeted test output when Yui added tests. |
User validates manually after all milestones are approved (existing policy). /kon:debug is the exception: Yui runs repro commands from debug.md (not a full project build).
Scope
Default scope: impl-loop. One set of Task ids shared across all milestones in a /kon:team run until context is full or resume fails.
After Mio approves a milestone: do not call clear-task-agents โ ids stay warm for the next milestone.
Before starting the next milestone (after user-continued):
python3 $KON_ROOT/scripts/kon_session.py maybe-clear-task-agents --id "$SID"
Or check first:
python3 $KON_ROOT/scripts/kon_session.py should-refresh-task-agents --id "$SID"
Refresh when any impl-loop agent's latest transcript estimate is โฅ 80% of the observed context window. Window size comes from Cursor's preCompact hook (context_window_size, stored in ~/.kon/context_profile.json and on the active session) โ not a hardcoded default. Until Cursor reports a window (or you set an override), should-refresh-task-agents prints keep.
| Override | Meaning |
|---|
KON_TASK_CONTEXT_BUDGET | Force assumed window size (tokens) |
~/.kon/config.json โ task_context_budget | Same, persistent |
--budget on CLI | One-off override |
KON_TASK_CONTEXT_THRESHOLD | Default 0.8 โ refresh when usage โฅ window ร threshold |
Estimates come from subagentStop transcript token counts in the session log โ approximate, not Cursor's exact fill meter. Re-run scripts/install_cursor_hooks.sh after upgrade so preCompact is wired.
Still clear (or rely on maybe-clear-task-agents โ cleared) when:
- Resume fails / Task id expired
- Same must-fix blocked twice (optional fresh Mio โ see failure-handling)
- User runs
clear-task-agents manually
First pass in the loop (new Task)
| Agent | First spawn prompt includes | After Task returns |
|---|
| ๐ถ Yui | agents/Yui.md + PLAN_FILE + milestone steps | set-task-agent --agent Yui --task-id <id> |
| ๐งน Sawako | agents/Sawako.md + files Yui touched (paths only) | set-task-agent --agent Sawako --task-id <id> |
| ๐ Mio | agents/Mio.md + skills/strict-review/SKILL.md + scoped diff pointer + plan excerpt path | set-task-agent --agent Mio --task-id <id> |
Store ids:
python3 $KON_ROOT/scripts/kon_session.py set-task-agent --id "$SID" --agent Yui --task-id "<task-id>"
python3 $KON_ROOT/scripts/kon_session.py set-task-agent --id "$SID" --agent Mio --task-id "<task-id>"
Fix / re-review passes (resume only)
Look up id; if present, Task resume=<id> with a short delta prompt only โ do not re-attach agents/*.md or skills/*.md.
YUI_ID=$(python3 $KON_ROOT/scripts/kon_session.py get-task-agent --id "$SID" --agent Yui)
MIO_ID=$(python3 $KON_ROOT/scripts/kon_session.py get-task-agent --id "$SID" --agent Mio)
Yui resume (after Mio must-fix):
Resume. You already have agents/Yui.md and the plan.
Fix must-fix items from sessions/<SID>/review.md โ reference each by number.
PLAN_FILE: โฆ Milestone: N. Report files changed.
Mio resume (re-review same milestone):
Resume. You already have agents/Mio.md and strict-review.
Re-review milestone N. Prior must-fix: sessions/<SID>/review.md.
Verify each item with git diff evidence. Full hook-compliant output.
Sawako resume (after Yui fix): same pattern โ delta only, no agent file re-pass.
If get-task-agent prints nothing, or resume fails โ fresh Task spawn (full agent + skill once), then set-task-agent again.
When to fresh-spawn (not resume)
- First iteration of the loop for that milestone
- After
clear-task-agents (context refresh) or when get-task-agent is empty
- Resume error / expired Task id
- Same must-fix blocked 2 consecutive times (see failure-handling) โ optional fresh Mio
Explore/plan/design agents (Azusa, Mugi, Jun, Nodoka) stay one-shot spawns โ not part of impl-loop.
Orchestrator rules
Follow skills/orchestrator-context for artifact pointers and anti-bloat rules.
Narration
When the orchestrator speaks to the user, use ๐ธ Ui's narrator voice โ
opening, closing, and stuck-point beats.
Follow skills/narration.
Execution rules
- The orchestrator does not implement. Every agent is launched via the Task tool.
- Model inheritance: Pass
model on every Task spawn/resume (same slug as orchestrator). See skills/model-inheritance.
- CRITICAL: Never auto-proceed from Mugi to Yui โ after Mugi finishes, the orchestrator MUST:
- Present the plan to the user
- Run
wait-for-user --after plan (see step 3 above)
- STOP and wait for explicit user confirmation (even in
--yolo mode)
- Run
user-continued, then spawn Yui
- CRITICAL: Never auto-proceed after Mio approves a milestone โ after each milestone is Mio-approved:
- Present milestone summary
- Run
wait-for-user --after milestone --milestone N
- STOP until user confirms, then
user-continued, then next milestone or Nodoka/summarize (last milestone)
- Milestone-based review loop:
- If plan has milestones: implement and review ONE milestone at a time
- Yui implements milestone โ Sawako cleans up โ Mio reviews โ if blocked, Yui fixes (then Sawako cleans again) โ repeat until Mio approves
- After Mio approves: user gate (keep Task ids unless context budget exceeded โ see Scope below), then next milestone or Nodoka/summarize (last milestone)
- Do NOT implement all milestones then review โ review incrementally
- Context contract: never paste or restate subagent Task output in assistant messages or in spawn/resume prompts โ use artifact paths (see orchestrator-context).
- After each agent finishes, give the user one line (verdict + artifact path if any) โ not a full paste.
- No skipping steps. Even for small tasks, every step runs.
- At the end, give a final summary: which files changed, any unresolved issues.
- Pass
PLAN_FILE to every agent that reads or writes the plan (Mugi, Yui, Nodoka,
Azusa-challenge). Include this line in the task prompt:
PLAN_FILE: .kon/plan-<SESSION_ID>.md
where SESSION_ID is the same ID used for session tracking.
Commit message draft
After all milestones are approved, if there are uncommitted
changes from this session, draft a commit message from the diff following
skills/commit-message.
Do not run git commit automatically โ provide the text only, user decides.
Failure handling
See skills/failure-handling.
Session tracking
At the start of every run and after every agent step, write a session state file.
Follow skills/session-tracking.
This feeds the live dashboard (python3 scripts/dashboard.py).
YOLO mode (--yolo flag)
When the user appends --yolo to any command, activate autonomous mode.
Follow skills/yolo-mode.
Session close (default)
After all milestones approved and summarized:
- ๐ Nodoka โ
/kon:summarize (if not already run)
- Retro โ
skills/session-retro
- User
/kon:finish or dashboard โ
User may say skip retro. Read-only commands skip this block.
Memory propose confirm flow
Detection (including fence tracking) and the 6-step confirm flow follow
skills/memory-propose-confirm.
Confirm flow completes, then the main flow continues โ the command step structure does not change.
Hard rules
- Never skip ๐ Mio โ code review is mandatory for every milestone
- Ask, don't guess โ if any stage is unclear, stop and ask the user; follow
skills/ask-dont-guess
- Review per milestone, not all at once โ Mio reviews after each milestone implementation
- Mio blocking is final โ if Mio blocks, send back to Yui for fixes
- Standards don't relax on round 3 โ the checklist is the same from round 1 to round N
- No automated testing โ user runs tests manually after all milestones are approved