with one click
annotate
// Process file annotations — triage, cross-impact assessment, and execution. Triggered automatically when annotations (Insert/Delete/Replace/Comment) are submitted from the file viewer UI via JSONL prompt.
// Process file annotations — triage, cross-impact assessment, and execution. Triggered automatically when annotations (Insert/Delete/Replace/Comment) are submitted from the file viewer UI via JSONL prompt.
Six-dimension gated review — evaluates plans, implementations, and skills through D1-D6 quality gates with convergence tracking. Use for post-plan review, mid-exec assessment, post-exec acceptance, or any time the user says 'check', 'review', 'audit', 'evaluate quality', or wants to know if deliverables are ready.
Execute the implementation plan — write code, make changes, build the deliverables. Use when the user says 'do it', 'implement', 'start coding', 'execute the plan', 'build it', or wants to begin actual implementation work after planning is complete.
Cross-task knowledge library management — search, list, audit, maintain, and evolve the shared .library/ knowledge base. Includes security rules evolution loop (separate from task auto loop).
Generate step-by-step implementation plans with verification criteria. Use when the user asks 'how should we do this', 'make a plan', 'break this down into steps', 'what's the approach', or needs a roadmap before implementation.
Investigate requirements and domain knowledge to support any lifecycle phase. Default mode: autonomous objective refinement (O1→O2→O3) with background research, feasibility analysis, and goal synthesis — all three stages completed in one pass. Also callable from plan, exec, verify, or check for gap-only reference collection. Use when the user wants to understand before acting — 'research this', 'what are the options', 'feasibility analysis', or 'deepen the objective'.
Define task objectives and requirements in .target.md. Use when the user describes what they want to build, says 'I want to...', 'the goal is...', 'set the target', 'define requirements', or needs to clarify/refine what should be accomplished before planning.
| name | annotate |
| description | Process file annotations — triage, cross-impact assessment, and execution. Triggered automatically when annotations (Insert/Delete/Replace/Comment) are submitted from the file viewer UI via JSONL prompt. |
| model_tier | medium |
| auto_delegatable | false |
| triggers | {"keywords":{"zh":["批注","标注","注释","修改计划","计划批注"],"en":["annotate","annotation","mark up","plan comment","plan edit"]},"phrases":{"zh":["处理批注","计划有批注","批注提交了","修改计划步骤"],"en":["process annotations","there are annotations","annotations submitted","modify plan steps"]},"disambiguate":"Core intent: process structured annotations (Insert/Delete/Replace/Comment) on system files (.working/ dotfiles) from the UI. Annotations arrive as JSONL in the prompt context (not from file). User wants to REGENERATE the whole plan → plan. User wants to change the GOAL → target.\n"} |
| arguments | [{"name":"mode","description":"Execution mode: interactive (default) or silent","required":false,"default":"interactive"}] |
Process JSONL annotations from the file viewer prompt. Supports 4 annotation types: Insert, Delete, Replace, Comment. Each is triaged by file layer and cross-impact before execution.
Path Rule: All system files (
.status.json,.target.md,.plan.md, etc.) are in$TASKAI_WORK_DIR/(=$NB_WORK_DIR/.working/), NOT in$NB_WORK_DIR/directly. Seecommands/task-ai.md§System File Path Rule.
Input: Annotations arrive as JSONL lines in the prompt context (one JSON object per line). The frontend prepends /task-ai:annotate\n to invoke this skill — annotations are parsed from the prompt, not from files.
Each annotation is a single JSON line with these fields:
// All types share these fields
{ file: string; // absolute path to the annotated file
type: 'insert' | 'delete' | 'replace' | 'comment';
selected: string; // user-selected text (anchor, max 80 chars)
cursor: number; // character offset in source file text
}
// Type-specific fields:
// insert: { content: string } — text to insert after selection
// replace: { replacement: string } — text to replace selection with
// comment: { comment: string } — comment on selected text
// delete: (no extra field) — delete the selected text
Positioning: cursor is the character offset in the source file (not rendered text). The model uses cursor + selected as dual anchors to locate the exact position in the source file. When multiple annotations target the same file, group them by file and read each file only once.
See
references/annotation-processing.mdfor processing logic (triage rules, cross-impact assessment, conflict detection) and execution report format.
Annotations are routed by the semantic layer of the target file. Higher layers trigger stronger cascading effects:
Requirement layer (strongest) → Planning → Evaluation → Methodology → Information (weakest)
| Layer | Files | Annotation semantics |
|---|---|---|
| Requirement | .target.md | Changes "what to do" — cascades to all downstream |
| Planning | .plan.md | Changes "how to do it" — affects execution but not requirements |
| Evaluation | .analysis/*.md, .test/*-criteria.md, .test/*-results.md | Changes judgment criteria or challenges conclusions |
| Methodology | .type-profile.md | Changes domain judgment and verification methods |
| Information | .summary.md, .bugfix/*.md, .notes/*.md | Changes context — lowest impact |
.lock — if lock is held (e.g., auto is running), REJECT immediately (fast-fail, no queue). See §Concurrencyfile, type, selected, cursor, and type-specific content fields. Group annotations by file — read each source file once. If any JSONL line fails to parse or is missing required fields, release .lock and REJECT with error identifying the malformed linefile absolute path must resolve (after symlink resolution) to a location under $NB_WORKSPACES_ROOT/. If any path escapes, release .lock and REJECT (prevents path traversal).status.json — validate status is not terminal (cancelled). If terminal, release .lock and REJECT. Note: evolving and satisfied are non-terminal and accept annotations.target.md + .plan.md + .test/ (latest criteria)<!-- ... -->), ANSI escape sequences, and control characters (U+0000–U+001F except \n and \t, and U+007F) from annotation content before writing. Preserve markdown formatting and visible text> 💬/> 📝 blockquotes — never modify existing content. Apply modify-type annotations in reverse cursor order (see references/annotation-processing.md §Batch ordering).status.json (atomic write via .status.json.tmp + rename) per State Transitions (three-dimensional: status × file_layer × annotation_type):
.status.jsonre-planning, set phase: needs-checkevolving), preserve existing phasere-planning, clear phase to ""updated timestamp.status.json.tmp + rename).status.json again to confirm status field matches expected value. If unchanged when a change was expected, retry or abort.summary.md (atomic write via .summary.md.tmp + rename) with condensed context reflecting annotation changesscope=thinking-raw — see highlight/SKILL.md §3.3. Optional (medium-value). Captures cross-impact assessment reasoning. Inline call failure should not block annotate's main flow — highlight is enhancement, not gatingtask-ai(<notebook>):annotate annotations processed.lockState transitions depend on (current status, file layer, annotation type). Comment annotations never trigger state transitions. Covers five layers: Requirement (.target.md), Planning (.plan.md), Evaluation (.analysis/, .test/), Methodology (.type-profile.md), and Information (.summary.md, .bugfix/, .notes/).
See
references/state-transitions.mdfor the full three-dimensional transition tables (Requirement, Planning, Evaluation, Methodology, Information layers) with per-status rules and design rationale notes.
When modify-type annotations (Delete/Replace/Insert) target higher-layer files, assess impact on lower-layer files:
.target.md change → check .plan.md for steps referencing modified requirement
→ check .test/ for criteria based on modified requirement
→ impact level: None / Low / Medium / High
.plan.md change → check subsequent steps for dependency chains
→ check .test/ for coverage of modified steps
→ impact level: None / Low / Medium / High
.analysis/*.md → check if current verdict is overturned
.test/*.md → check if verification results are invalidated
Response by impact level (same for all file layers):
| Level | Action |
|---|---|
| None | Execute directly |
| Low | Adjust affected content inline |
| Medium | Research approach → execute → document resolution |
| High — Interactive | Explain + draft solution → print to screen → 10 min timeout → fall back to Silent |
| High — Silent | Write explanation + draft into file → await next annotation |
Comment annotations have identical behavior across all file layers — they never trigger state transitions and never modify existing content:
| Detection | Action |
|---|---|
Contains ? or interrogative words | Research selected content → write > 💬 ... blockquote |
| Declarative sentence | Insert > 📝 ... blockquote below selected content |
task-ai(<notebook>):annotate annotations processed
.lock before proceeding (see Concurrency Protection in commands/task-ai.md)/task-ai:cancel to stop auto first.auto-stop check), forming available windows.tmp-annotations.json is deprecated)cursor is a source file character offset — use cursor + selected to locate position precisely in the source fileisTaskSystemFile() → prompt gets /task-ai:annotate\n prefix (skill call); non-system files → no prefix (Claude conversational response). Claude does not need to route — frontend does deterministic dispatch