ln-402-task-reviewer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Task Reviewer

任务评审者

MANDATORY after every task execution. Reviews a single task in To Review and decides Done vs To Rework with immediate fixes or clear rework notes.
This skill is NOT optional. Every task executed by ln-401/ln-403/ln-404 MUST be reviewed by ln-402 immediately. No exceptions, no batching, no skipping.
每次任务执行后必须执行。评审处于待评审状态的单个任务,决定将其标记为完成还是需要返工,并提供即时修复或明确的返工说明。
此技能为必选项。ln-401/ln-403/ln-404执行的每一项任务都必须立即由ln-402进行评审。无例外、无批量处理、无跳过。

Purpose & Scope

目的与范围

  • Independent context loading: Receive only task ID from orchestrator; load full task and parent Story independently (Linear: get_issue; File: Read task file). This isolation ensures unbiased review without executor's assumptions (fresh eyes pattern).
  • Check architecture, correctness, configuration hygiene, docs, and tests.
  • For test tasks, verify risk-based limits and priority (≤15) per planner template.
  • Update only this task: accept (Done) or send back (To Rework) with explicit reasons and fix suggestions tied to best practices.
  • 独立上下文加载:仅从编排器接收任务ID;独立加载完整任务及父级Story(Linear:调用
    get_issue
    ;文件:读取任务文件)。这种隔离确保评审不受执行者假设的影响(新视角模式)。
  • 检查架构、正确性、配置规范性、文档及测试。
  • 对于测试任务,根据规划模板验证基于风险的限制和优先级(≤15)。
  • 仅更新当前任务:接受(完成)或退回(需要返工),并附上基于最佳实践的明确理由和修复建议。

Task Storage Mode

任务存储模式

AspectLinear ModeFile Mode
Load task
get_issue(task_id)
Read("docs/tasks/epics/.../tasks/T{NNN}-*.md")
Load Story
get_issue(parent_id)
Read("docs/tasks/epics/.../story.md")
Update status
update_issue(id, state: "Done"/"To Rework")
Edit
the
**Status:**
line in file
Add commentLinear comment APIAppend to task file or kanban
File Mode status values: Done, To Rework (only these two outcomes from review)
维度Linear 模式文件模式
加载任务
get_issue(task_id)
Read("docs/tasks/epics/.../tasks/T{NNN}-*.md")
加载Story
get_issue(parent_id)
Read("docs/tasks/epics/.../story.md")
更新状态
update_issue(id, state: "Done"/"To Rework")
编辑文件中的
**Status:**
添加评论Linear 评论API追加到任务文件或看板
文件模式状态值:Done、To Rework(评审仅产生这两种结果)

Workflow (concise)

工作流程(精简版)

  1. Receive task (isolated context): Get task ID from orchestrator (ln-400)—NO other context passed. Load all information independently from Linear. Detect type (label "tests" -> test task, else implementation/refactor).
  2. Read context: Full task + parent Story; load affected components/docs; review diffs if available.
  3. Review checks:
    • Approach: diff aligned with Technical Approach in Story. If different → rationale documented in code comments.
    • No hardcoded creds/URLs/magic numbers; config in env/config.
    • Error handling: all external calls (API, DB, file I/O) wrapped in try/catch or equivalent. No swallowed exceptions. Layering respected; reuse existing components.
    • Logging: errors at ERROR; auth/payment events at INFO; debug data at DEBUG. No sensitive data in logs.
    • Comments: explain WHY not WHAT; no commented-out code; docstrings on public methods; Task ID present in new code blocks (
      // See PROJ-123
      ).
    • Naming: follows project's existing convention (check 3+ similar files). No abbreviations except domain terms. No single-letter variables (except loops).
    • Docs: if public API changed → API docs updated. If new env var → .env.example updated. If new concept → README/architecture doc updated.
    • Tests updated/run: for impl/refactor ensure affected tests adjusted; for test tasks verify risk-based limits and priority (≤15) per planner template.
  4. AC Validation (MANDATORY for implementation tasks): Load parent Story AC and verify implementation against 4 criteria (see
    references/ac_validation_checklist.md
    ):
    • AC Completeness: All AC scenarios covered (happy path + errors + edge cases).
    • AC Specificity: Exact requirements met (HTTP codes 200/401/403, timing <200ms, exact messages).
    • Task Dependencies: Task N uses ONLY Tasks 1 to N-1 (no forward dependencies on N+1, N+2).
    • Database Creation: Task creates ONLY tables in Story scope (no big-bang schema). If ANY criterion fails → To Rework with specific guidance from checklist.
  5. Side-Effect Bug Detection (MANDATORY): While reviewing affected code, actively scan for bugs/issues NOT related to current task:
    • Pre-existing bugs in touched files
    • Broken patterns in adjacent code
    • Security issues in related components
    • Deprecated APIs, outdated dependencies
    • Missing error handling in caller/callee functions
    For each side-effect bug found:
    • Create new task in same Story (Linear: create_issue with parentId=Story.id; File: create task file)
    • Title:
      [BUG] {Short description}
    • Description: Location, issue, suggested fix
    • Label:
      bug
      ,
      discovered-in-review
    • Priority: based on severity (security → 1 Urgent, logic → 2 High, style → 4 Low)
    • Do NOT defer — create task immediately, reviewer catches what executor missed
  6. Agent Review: Per
    shared/references/agent_delegation_pattern.md
    §Parallel Aggregation.
    • Template:
      code_review.md
      with
      {task_content}
      +
      {story_content}
      from Step 2.
    • Verdict escalation: Agent findings with area=security|correctness can escalate Done → To Rework.
    • Display:
      "Agent Review: codex ({duration}s, {N}), gemini ({duration}s, {N}). Validated: {accepted}/{total}"
  7. Decision (for current task only):
    • If only nits and no critical agent findings: apply minor fixes and set Done.
    • If issues remain (own review OR accepted agent suggestions with security/correctness area): set To Rework with comment explaining why (best-practice ref) and how to fix.
    • Side-effect bugs do NOT block current task's Done status (they are separate tasks).
    • If Done: commit all uncommitted changes with message referencing task ID:
      git add -A && git commit -m "Implement {task_id}: {task_title}"
  8. Update: Set task status in Linear; update kanban: if Done → remove task from kanban (Done section tracks Stories only, not individual Tasks); if To Rework → move task to To Rework section; add review comment with findings/actions. If side-effect bugs created, mention them in comment. Include agent review summary in comment.
  1. 接收任务(隔离上下文):从编排器(ln-400)获取任务ID——不传递其他上下文。从Linear独立加载所有信息。检测任务类型(标签为"tests"则为测试任务,否则为实现/重构任务)。
  2. 读取上下文:完整任务 + 父级Story;加载受影响的组件/文档;若有差异则评审差异内容。
  3. 评审检查项
    • 实现方式:差异内容与Story中的技术方案一致。若不一致→在代码注释中记录理由。
    • 无硬编码凭证/URL/魔法数值;配置存储在环境变量/配置文件中。
    • 错误处理:所有外部调用(API、数据库、文件I/O)都包裹在try/catch或等效逻辑中。禁止吞噬异常。遵循分层原则;复用现有组件。
    • 日志:错误信息标记为ERROR;认证/支付事件标记为INFO;调试数据标记为DEBUG。日志中不得包含敏感数据。
    • 注释:解释原因而非内容;无注释掉的代码;公共方法需有文档字符串;新代码块中需包含任务ID(如
      // See PROJ-123
      )。
    • 命名:遵循项目现有约定(参考3个以上同类文件)。除领域术语外不得使用缩写。禁止使用单字母变量(循环变量除外)。
    • 文档:若公共API变更→更新API文档。若新增环境变量→更新.env.example。若引入新概念→更新README/架构文档。
    • 测试更新/运行:对于实现/重构任务,确保调整受影响的测试;对于测试任务,根据规划模板验证基于风险的限制和优先级(≤15)。
  4. 验收标准(AC)验证(实现任务必须执行): 加载父级Story的验收标准,对照4项标准验证实现(参考
    references/ac_validation_checklist.md
    ):
    • AC完整性:覆盖所有AC场景(正常流程+错误场景+边缘案例)。
    • AC准确性:满足精确要求(HTTP状态码200/401/403、响应时间<200ms、精确消息内容)。
    • 任务依赖:任务N仅依赖任务1至N-1(不得依赖后续任务N+1、N+2)。
    • 数据库创建:任务仅在Story范围内创建表(禁止大爆炸式 schema 变更)。 若任何一项标准不满足→标记为需要返工,并附上检查清单中的具体指导。
  5. 副作用BUG检测(必须执行): 评审受影响代码时,主动扫描与当前任务无关的BUG/问题:
    • 被修改文件中已存在的BUG
    • 相邻代码中的破窗模式
    • 相关组件中的安全问题
    • 已废弃的API、过时的依赖
    • 调用方/被调用方函数中缺失的错误处理
    对于发现的每个副作用BUG
    • 在同一Story中创建新任务(Linear:调用create_issue,parentId=Story.id;文件:创建任务文件)
    • 标题:
      [BUG] {简短描述}
    • 描述:位置、问题、建议修复方案
    • 标签:
      bug
      ,
      discovered-in-review
    • 优先级:基于严重程度(安全问题→1 紧急,逻辑问题→2 高,风格问题→4 低)
    • 不得延迟——立即创建任务,评审者需发现执行者遗漏的问题
  6. Agent评审:遵循
    shared/references/agent_delegation_pattern.md
    §并行聚合。
    • 模板
      code_review.md
      ,包含步骤2中的
      {task_content}
      +
      {story_content}
    • 结论升级:Agent发现的安全/正确性相关问题可将状态从完成升级为需要返工。
    • 展示格式
      "Agent Review: codex ({duration}s, {N}), gemini ({duration}s, {N}). Validated: {accepted}/{total}"
  7. 决策(仅针对当前任务)
    • 若仅存在小问题且Agent未发现关键问题:应用微小修复并设置为完成。
    • 若仍有问题(自身评审OR Agent提出的安全/正确性相关建议被采纳):设置为需要返工,并附上注释说明原因(参考最佳实践)和修复方法。
    • 副作用BUG不影响当前任务的完成状态(它们是独立任务)。
    • 若标记为完成:提交所有未提交的变更,提交信息需引用任务ID:
      git add -A && git commit -m "Implement {task_id}: {task_title}"
  8. 更新状态:在Linear中设置任务状态;更新看板:若为完成→从看板中移除任务(完成区域仅跟踪Story,不跟踪单个任务);若为需要返工→将任务移至需要返工区域;添加评审注释,说明发现的问题和执行的操作。若创建了副作用BUG任务,需在注释中提及。注释中需包含Agent评审摘要。

Critical Rules

关键规则

  • One task at a time; side-effect bugs → separate [BUG] tasks (not scope creep).
  • Zero tolerance: fix now or send back with guidance. Never mark Done with unresolved in-scope issues.
  • Test-task violations (limits/priority ≤15) → To Rework.
  • Keep task language (EN/RU) in edits/comments.
  • 一次处理一个任务;副作用BUG→创建独立的[BUG]任务(不得扩大当前任务范围)。
  • 零容忍:立即修复或退回并提供指导。不得在存在未解决的范围内问题时标记为完成。
  • 测试任务违反限制/优先级(≤15)→标记为需要返工。
  • 编辑/注释时保持任务语言(英文/俄文)不变。

Definition of Done

完成定义

  • Steps 1-8 completed: context loaded, review checks passed, AC validated, side-effect bugs created, agent review done, decision applied.
  • If Done: changes committed with task ID; task removed from kanban. If To Rework: task moved with fix guidance.
  • Review comment posted (findings + agent summary + [BUG] list if any).
  • 完成步骤1-8:加载上下文、通过评审检查、验证AC、创建副作用BUG任务、完成Agent评审、应用决策。
  • 若标记为完成:变更已提交并包含任务ID;任务已从看板移除。若标记为需要返工:任务已移至需要返工区域并附有修复指导。
  • 已发布评审注释(包含发现的问题 + Agent评审摘要 + 若有则列出[BUG]任务)。

Reference Files

参考文件

  • [MANDATORY] Problem-solving approach:
    shared/references/problem_solving.md
  • AC validation rules:
    shared/references/ac_validation_rules.md
  • AC Validation Checklist:
    references/ac_validation_checklist.md
    (4 criteria: Completeness, Specificity, Dependencies, DB Creation)
  • Agent review prompt:
    shared/agents/prompt_templates/code_review.md
  • Agent review schema:
    shared/agents/schemas/code_review_schema.json
  • Agent delegation:
    shared/references/agent_delegation_pattern.md
  • Kanban format:
    docs/tasks/kanban_board.md

Version: 5.0.0 (BREAKING: Added Agent Review step 6 with parallel codex+gemini aggregation. Commit on Done. AC Validation step 4.) Last Updated: 2026-02-07
  • [必须参考] 问题解决方法
    shared/references/problem_solving.md
  • AC验证规则
    shared/references/ac_validation_rules.md
  • AC验证检查清单:
    references/ac_validation_checklist.md
    (4项标准:完整性、准确性、依赖、数据库创建)
  • Agent评审提示词:
    shared/agents/prompt_templates/code_review.md
  • Agent评审 schema:
    shared/agents/schemas/code_review_schema.json
  • Agent委托模式:
    shared/references/agent_delegation_pattern.md
  • 看板格式:
    docs/tasks/kanban_board.md

版本:5.0.0(重大变更:新增步骤6 Agent评审,采用并行codex+gemini聚合。完成时需提交变更。新增步骤4 AC验证。) 最后更新:2026-02-07