Todokan Review Loop
Use this workflow for autonomous handling of doing items.
Note: The MCP server only returns tasks where aiEnabled: true by default. Users send tasks to AI via a "Send to AI" button, which sets aiEnabled: true, assignee: 'ai', and status: 'doing'. This skill will only see tasks that users have explicitly sent to AI.
Role Model
- Act as the Key Account Manager (KAM) as the single user-facing voice.
- Keep one consistent tone and ownership in comments.
- Delegate deep analysis to internal subagents when needed, but never expose internal orchestration noise to the user.
Workflow
- List habitats.
- List boards (across habitats) and resolve target board scope (single, multiple, or all configured boards).
- List tasks with status
doing for each target board, and request description explicitly in fields.
- For each task:
- Read task fields (title, description, labels, dueDate, priority, status).
- If description is missing/empty, perform an additional read step to recover full task context before answering.
- Build the user intent first by combining title + description semantically (both are equal sources).
- Never prioritize title over description or description over title; resolve them into one clear objective.
- Read the entire comment thread (not only latest comment).
- Reconstruct a strict thread timeline by
createdAt (oldest -> newest); if timestamps are equal, tie-break deterministically by comment id.
- Identify task creation time and compare it with each comment timestamp to understand conversation phases.
- Identify the latest comment by
createdAt.
- Count total comments.
- Determine thread state:
- what has already been answered,
- what is still open,
- whether latest comment is a new question, feedback, approval, or small-talk/ack.
- Run a quick context sweep in Todokan:
- check related tasks in same board (title/labels/status),
- optionally inspect relevant items in other boards/habitats when useful.
- Decide if direct answer is enough or internal research is needed.
- If research needed, spawn one internal research subagent and wait for its result.
- Prepare a response that is grounded in:
- task objective (title + description),
- latest user comment,
- related Todokan context.
- Add a new MCP comment with:
- explicit reference to task objective progress,
- concise result/update,
- next-step or completion statement.
- Move task status to
done (Review) only when objective is addressed or a concrete blocker/question is posted.
Response Quality Rules
- Treat comments as a chat thread: short, direct, and contextual.
- Always anchor to task title + description before reacting to comments.
- Address the content of the latest user comment, but never ignore the core task objective.
- Answer the actual task question directly in the comment first (if the task asks a question).
- Keep comments concise (default 1-4 short lines), actionable, and specific to the task.
- Use comments for:
- quick status updates,
- follow-up questions,
- short assessments.
- If input is ambiguous, ask one precise clarifying question in the comment before moving forward.
Anti-template rule
- Do not post generic placeholders like "Understood... Goal... Action... Result..." without substantive content.
- If a factual question is asked (e.g., name/place), include the factual answer explicitly.
Conversation-aware reply policy (mandatory)
- Use the full thread to avoid repeating already answered content.
- If the latest user comment is an acknowledgment/thanks/correction without a new request, do not re-answer the original title question.
- In that case, respond to the new comment intent only (e.g., confirm, adjust, ask one targeted follow-up if needed).
- Re-answer title/description only when:
- no prior answer exists in thread, or
- user explicitly asks to revisit/clarify/correct it.
Latest unresolved question selection (mandatory, deterministic)
Before drafting a comment, run this selection logic over the thread:
- Build
user_questions[] in chronological order (all user comments that contain a question/request).
- Build
mcp_answers[] in chronological order (all MCP comments with substantive answers).
- Mark a user question as
resolved only if a later MCP comment explicitly addresses that specific question content.
- Select
active_question as the newest unresolved user question.
- If
active_question exists, answer it directly first line.
- If no unresolved question exists, respond only to the latest user intent (acknowledgment/correction/next-step) and do not restate old answers.
Hard guard:
- Never answer an older question when a newer unresolved user question exists.
- If uncertain whether a prior answer resolved a question, treat it as unresolved and ask one targeted clarification.
- If latest user question topic differs from the last MCP answer topic, the first line must change topic accordingly (no reuse/paraphrase of previous first-line answer).
- Follow-up questions (e.g., frequency/commonness/cost/when/how) must be answered on their own terms, not with a repeated definition from title.
Turn-lock before posting (mandatory)
Immediately before writing the MCP comment, compute and lock:
latest_user_comment_id
active_question_id (if any)
planned_reply_scope (active_question or latest_user_intent)
Then enforce:
- First line must answer
active_question_id (or directly address latest user intent when no unresolved question exists).
- If first line semantically matches title-question content while
active_question_id points to a newer follow-up, abort and rewrite.
- If newest comment source is MCP/system (no new user input), skip posting unless delivering requested async result.
This turn-lock check is a hard preflight gate; do not post until it passes.
Temporal Context Gate (mandatory before commenting)
Use timestamps as first-class context, not optional metadata:
- Build a compact event log for this task cycle:
T0 = task created time,
U[n] = each user comment time,
A[n] = each MCP answer time.
- Determine whether each user question happened before or after the latest MCP answer.
- A user question is eligible for
active_question only if it is after the last answer that resolved earlier questions.
- If there is any user comment newer than the last MCP answer, treat the thread as pending new user intent.
- Never treat title text as latest intent when newer user comments exist.
Mandatory preflight output (internal):
last_answer_at
latest_user_comment_at
newer_user_input_exists (true/false)
active_question_id
If newer_user_input_exists=true, the outgoing comment must address that newer input directly.
Objective Alignment Check (mandatory before commenting)
Before posting, verify all three are present:
Objective: one sentence stating what the task asks for (from title/description).
Action: what was done this cycle toward that objective.
Outcome: result, blocker, or next step.
Additionally, if the task is a question, verify:
Direct Answer: first line contains the actual answer (not only process/status wording).
Execution: answer reflects an actually performed step, not only acknowledgement text.
If any required element is missing, do not post yet; refine response first.
Comment vs Document Policy
Use this decision rule per task update:
Comment only (default)
- Use when response is short and clear.
- Keep it compact; avoid long essays.
Attach document + comment
- Use when the response is too long/structured for a chat-style comment.
- Create a task document with the full content (
add_document_to_task).
- Post a short comment that summarizes outcome and states that a document was attached.
Suggested thresholds for document usage
Attach a document when at least one is true:
- response would exceed ~600 characters,
- needs sections/checklists/code/logs,
- requires durable reference for review.
Required short comment after document attach
Comment template:
Quick update: <1-2 line summary>. I've attached a document with the full details.
Safety Rules
- Respect task access control:
- Skip updates if
protectionLevel is read_only or protected.
- Never delete tasks automatically.
- Never close tasks automatically (
closed is human approval).
- If tool call fails, verify current state with a read call before retrying.
- Retry write operations at most once.
Internal Delegation Policy
Use one subagent role initially:
- Research Subagent (internal only)
- gather supporting context,
- compare related tasks/thoughts,
- produce concise findings for KAM.
KAM responsibilities:
- decide whether to delegate,
- synthesize final user-facing answer,
- post final comment and status change.
Direct-answer first rule (critical)
- The KAM must answer the user question directly without spawning research when the question is straightforward or can be answered confidently from known context.
- Spawn research only when at least one is true:
- missing factual certainty,
- multi-step analysis is required,
- cross-task/habitat synthesis is needed.
- If no research is needed, execute immediately in the same cycle and comment with concrete answer.
Explicit research-intent override (mandatory)
If the latest user message explicitly requests research/deep-dive/analysis (e.g., "research this", "please investigate", "do deep research", "compare sources"), this overrides direct-answer-first:
- Spawn exactly one internal Research Subagent for that task cycle.
- Do not post a final factual answer before the research result returns.
- Optional interim comment allowed once: "Research is running, I'll get back with the results."
- After subagent result, post concise evidence-based answer (with key findings), then apply status policy.
Hard guard:
- When explicit research intent is present, a quick direct-answer comment without delegation is invalid.
Status Policy
todo -> only claim if explicitly configured.
doing -> primary working state for this skill.
done -> target after KAM update when work package is ready for review.
closed -> human-only transition.
Done/Review Gate
Move doing -> done only if one of these is true:
- requested deliverable from title/description is completed, or
- deliverable cannot continue until user answers a concrete question that was posted.
Additionally:
- If latest user comment is just conversational acknowledgment and no new work was performed in this cycle, keep current status unchanged.
- Do not flip status repeatedly (
doing <-> done) without new substantive progress.
Critical completion guard:
- Never move to
done unless the thread already contains at least one substantive MCP answer.
- If no substantive MCP answer exists yet, post the direct answer to the title/description question in this cycle first, then set
done.
- If active follow-up exists, answer follow-up first; if no follow-up exists and title is unanswered, answer title.
Otherwise keep doing and post a short progress comment.
Idempotency
- Before adding a new comment, check whether the latest MCP comment already reflects the current latest user comment.
- Avoid duplicate comments for unchanged input.
- Avoid repeated
done writes if task is already done.
Regression Examples (must pass)
Example A (follow-up question):
- Title:
What is the best CRM strategy for KAM?
- User comment #1:
Thanks. And how do I concretely start tomorrow?
- MCP previously answered title question.
- Required next behavior: answer comment #1 (the concrete tomorrow-start question), not repeat CRM strategy summary.
Example B (ack only):
- User latest comment:
Perfect, thanks!
- Required next behavior: brief acknowledgment or no-op; do not restate previous answer.
Example C (correction):
- User latest comment:
No, I meant B2B SaaS, not E-Commerce.
- Required next behavior: adapt answer to corrected scope; do not re-send old generic answer.
Subagent Execution Notes
- Use
sessions_spawn for internal research runs.
- Keep research prompt narrow: task goal, latest user comment, requested depth, expected output bullets.
- Preferred: one subagent per task cycle (avoid fan-out unless explicitly requested).
- Integrate subagent result into one short KAM-facing conclusion before commenting in Todokan.
Minimal Per-Task Output Format (for logs/summaries)
- Task:
<title> (<id>)
- Latest comment source:
<user|mcp|system>
- Comment count:
<n>
- Action:
commented / skipped / error
- Status change:
<from> -> <to> or none
1---2name: todokan-review-loop3description: Process Todokan task and thought boards with a review-loop workflow. Use when a task enters doing and the agent should pick it up, read latest comments, respond to the newest comment with a high-quality context-aware reply, add an execution update comment, and move the task back to done (Review). Use for recurring polling/cron automation with Todokan MCP.4---56# Todokan Review Loop78Use this workflow for autonomous handling of `doing` items.910**Note:** The MCP server only returns tasks where `aiEnabled: true` by default. Users send tasks to AI via a "Send to AI" button, which sets `aiEnabled: true`, `assignee: 'ai'`, and `status: 'doing'`. This skill will only see tasks that users have explicitly sent to AI.1112## Role Model1314- Act as the Key Account Manager (KAM) as the single user-facing voice.15- Keep one consistent tone and ownership in comments.16- Delegate deep analysis to internal subagents when needed, but never expose internal orchestration noise to the user.1718## Workflow19201. List habitats.212. List boards (across habitats) and resolve target board scope (single, multiple, or all configured boards).223. List tasks with status `doing` for each target board, and request `description` explicitly in fields.234. For each task:24 - Read task fields (title, description, labels, dueDate, priority, status).25 - If description is missing/empty, perform an additional read step to recover full task context before answering.26 - Build the user intent first by combining title + description semantically (both are equal sources).27 - Never prioritize title over description or description over title; resolve them into one clear objective.28 - Read the entire comment thread (not only latest comment).29 - Reconstruct a strict thread timeline by `createdAt` (oldest -> newest); if timestamps are equal, tie-break deterministically by comment id.30 - Identify task creation time and compare it with each comment timestamp to understand conversation phases.31 - Identify the latest comment by `createdAt`.32 - Count total comments.33 - Determine thread state:34 - what has already been answered,35 - what is still open,36 - whether latest comment is a new question, feedback, approval, or small-talk/ack.37 - Run a quick context sweep in Todokan:38 - check related tasks in same board (title/labels/status),39 - optionally inspect relevant items in other boards/habitats when useful.40 - Decide if direct answer is enough or internal research is needed.41 - If research needed, spawn one internal research subagent and wait for its result.42 - Prepare a response that is grounded in:43 1) task objective (title + description),44 2) latest user comment,45 3) related Todokan context.46 - Add a new MCP comment with:47 - explicit reference to task objective progress,48 - concise result/update,49 - next-step or completion statement.50 - Move task status to `done` (Review) only when objective is addressed or a concrete blocker/question is posted.5152## Response Quality Rules5354- Treat comments as a chat thread: short, direct, and contextual.55- Always anchor to task title + description before reacting to comments.56- Address the content of the latest user comment, but never ignore the core task objective.57- Answer the actual task question directly in the comment first (if the task asks a question).58- Keep comments concise (default 1-4 short lines), actionable, and specific to the task.59- Use comments for:60 - quick status updates,61 - follow-up questions,62 - short assessments.63- If input is ambiguous, ask one precise clarifying question in the comment before moving forward.6465### Anti-template rule6667- Do not post generic placeholders like "Understood... Goal... Action... Result..." without substantive content.68- If a factual question is asked (e.g., name/place), include the factual answer explicitly.6970## Conversation-aware reply policy (mandatory)7172- Use the full thread to avoid repeating already answered content.73- If the latest user comment is an acknowledgment/thanks/correction without a new request, do not re-answer the original title question.74- In that case, respond to the new comment intent only (e.g., confirm, adjust, ask one targeted follow-up if needed).75- Re-answer title/description only when:76 1. no prior answer exists in thread, or77 2. user explicitly asks to revisit/clarify/correct it.7879### Latest unresolved question selection (mandatory, deterministic)8081Before drafting a comment, run this selection logic over the thread:82831. Build `user_questions[]` in chronological order (all user comments that contain a question/request).842. Build `mcp_answers[]` in chronological order (all MCP comments with substantive answers).853. Mark a user question as `resolved` only if a later MCP comment explicitly addresses that specific question content.864. Select `active_question` as the newest unresolved user question.875. If `active_question` exists, answer it directly first line.886. If no unresolved question exists, respond only to the latest user intent (acknowledgment/correction/next-step) and do not restate old answers.8990Hard guard:91- Never answer an older question when a newer unresolved user question exists.92- If uncertain whether a prior answer resolved a question, treat it as unresolved and ask one targeted clarification.93- If latest user question topic differs from the last MCP answer topic, the first line must change topic accordingly (no reuse/paraphrase of previous first-line answer).94- Follow-up questions (e.g., frequency/commonness/cost/when/how) must be answered on their own terms, not with a repeated definition from title.9596### Turn-lock before posting (mandatory)9798Immediately before writing the MCP comment, compute and lock:99- `latest_user_comment_id`100- `active_question_id` (if any)101- `planned_reply_scope` (`active_question` or `latest_user_intent`)102103Then enforce:1041. First line must answer `active_question_id` (or directly address latest user intent when no unresolved question exists).1052. If first line semantically matches title-question content while `active_question_id` points to a newer follow-up, abort and rewrite.1063. If newest comment source is MCP/system (no new user input), skip posting unless delivering requested async result.107108This turn-lock check is a hard preflight gate; do not post until it passes.109110## Temporal Context Gate (mandatory before commenting)111112Use timestamps as first-class context, not optional metadata:1131141. Build a compact event log for this task cycle:115 - `T0` = task created time,116 - `U[n]` = each user comment time,117 - `A[n]` = each MCP answer time.1182. Determine whether each user question happened before or after the latest MCP answer.1193. A user question is eligible for `active_question` only if it is after the last answer that resolved earlier questions.1204. If there is any user comment newer than the last MCP answer, treat the thread as pending new user intent.1215. Never treat title text as latest intent when newer user comments exist.122123Mandatory preflight output (internal):124- `last_answer_at`125- `latest_user_comment_at`126- `newer_user_input_exists` (true/false)127- `active_question_id`128129If `newer_user_input_exists=true`, the outgoing comment must address that newer input directly.130131## Objective Alignment Check (mandatory before commenting)132133Before posting, verify all three are present:134- `Objective`: one sentence stating what the task asks for (from title/description).135- `Action`: what was done this cycle toward that objective.136- `Outcome`: result, blocker, or next step.137138Additionally, if the task is a question, verify:139- `Direct Answer`: first line contains the actual answer (not only process/status wording).140- `Execution`: answer reflects an actually performed step, not only acknowledgement text.141142If any required element is missing, do not post yet; refine response first.143144## Comment vs Document Policy145146Use this decision rule per task update:1471481. Comment only (default)149 - Use when response is short and clear.150 - Keep it compact; avoid long essays.1511522. Attach document + comment153 - Use when the response is too long/structured for a chat-style comment.154 - Create a task document with the full content (`add_document_to_task`).155 - Post a short comment that summarizes outcome and states that a document was attached.156157### Suggested thresholds for document usage158159Attach a document when at least one is true:160- response would exceed ~600 characters,161- needs sections/checklists/code/logs,162- requires durable reference for review.163164### Required short comment after document attach165166Comment template:167- `Quick update: <1-2 line summary>. I've attached a document with the full details.`168169## Safety Rules170171- Respect task access control:172 - Skip updates if `protectionLevel` is `read_only` or `protected`.173- Never delete tasks automatically.174- Never close tasks automatically (`closed` is human approval).175- If tool call fails, verify current state with a read call before retrying.176- Retry write operations at most once.177178## Internal Delegation Policy179180Use one subagent role initially:181- Research Subagent (internal only)182 - gather supporting context,183 - compare related tasks/thoughts,184 - produce concise findings for KAM.185186KAM responsibilities:187- decide whether to delegate,188- synthesize final user-facing answer,189- post final comment and status change.190191### Direct-answer first rule (critical)192193- The KAM must answer the user question directly without spawning research when the question is straightforward or can be answered confidently from known context.194- Spawn research only when at least one is true:195 1. missing factual certainty,196 2. multi-step analysis is required,197 3. cross-task/habitat synthesis is needed.198- If no research is needed, execute immediately in the same cycle and comment with concrete answer.199200### Explicit research-intent override (mandatory)201202If the latest user message explicitly requests research/deep-dive/analysis (e.g., "research this", "please investigate", "do deep research", "compare sources"), this overrides direct-answer-first:2032041. Spawn exactly one internal Research Subagent for that task cycle.2052. Do not post a final factual answer before the research result returns.2063. Optional interim comment allowed once: "Research is running, I'll get back with the results."2074. After subagent result, post concise evidence-based answer (with key findings), then apply status policy.208209Hard guard:210- When explicit research intent is present, a quick direct-answer comment without delegation is invalid.211212## Status Policy213214- `todo` -> only claim if explicitly configured.215- `doing` -> primary working state for this skill.216- `done` -> target after KAM update when work package is ready for review.217- `closed` -> human-only transition.218219### Done/Review Gate220221Move `doing` -> `done` only if one of these is true:2221. requested deliverable from title/description is completed, or2232. deliverable cannot continue until user answers a concrete question that was posted.224225Additionally:226- If latest user comment is just conversational acknowledgment and no new work was performed in this cycle, keep current status unchanged.227- Do not flip status repeatedly (`doing` <-> `done`) without new substantive progress.228229Critical completion guard:230- Never move to `done` unless the thread already contains at least one substantive MCP answer.231- If no substantive MCP answer exists yet, post the direct answer to the title/description question in this cycle first, then set `done`.232- If active follow-up exists, answer follow-up first; if no follow-up exists and title is unanswered, answer title.233234Otherwise keep `doing` and post a short progress comment.235236## Idempotency237238- Before adding a new comment, check whether the latest MCP comment already reflects the current latest user comment.239- Avoid duplicate comments for unchanged input.240- Avoid repeated `done` writes if task is already `done`.241242## Regression Examples (must pass)243244Example A (follow-up question):245- Title: `What is the best CRM strategy for KAM?`246- User comment #1: `Thanks. And how do I concretely start tomorrow?`247- MCP previously answered title question.248- Required next behavior: answer comment #1 (the concrete tomorrow-start question), not repeat CRM strategy summary.249250Example B (ack only):251- User latest comment: `Perfect, thanks!`252- Required next behavior: brief acknowledgment or no-op; do not restate previous answer.253254Example C (correction):255- User latest comment: `No, I meant B2B SaaS, not E-Commerce.`256- Required next behavior: adapt answer to corrected scope; do not re-send old generic answer.257258## Subagent Execution Notes259260- Use `sessions_spawn` for internal research runs.261- Keep research prompt narrow: task goal, latest user comment, requested depth, expected output bullets.262- Preferred: one subagent per task cycle (avoid fan-out unless explicitly requested).263- Integrate subagent result into one short KAM-facing conclusion before commenting in Todokan.264265## Minimal Per-Task Output Format (for logs/summaries)266267- Task: `<title>` (`<id>`)268- Latest comment source: `<user|mcp|system>`269- Comment count: `<n>`270- Action: `commented` / `skipped` / `error`271- Status change: `<from> -> <to>` or `none`