ns-code-coder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode Coder
Code Coder
Central execution worker for ad-hoc diffs (and under ). Not front door — host picks entry per .
C2ns-code-autonomous../ns-harness/references/code-skill-routing.md用于临时代码差异(以及下的模式)的核心执行工作者。非入口技能——宿主需根据选择入口技能。
ns-code-autonomousC2../ns-harness/references/code-skill-routing.mdWorkflow mode (mandatory)
工作流模式(强制要求)
Fixed workflow, not loose checklist. Steps in order; handoffs = named skills or harness bridges ( / per ). No platform Task personas or improvised review.
coder-agentreviewer-agent../ns-harness/references/subagent-dispatch.mdCanonical review gate: — steps 7–9 ad-hoc / C2 only. Review only via then (MUST bridge when available; else skill direct); max 3 rounds; Critical fix requires re-review mandatory; no success without pass or blocked. After Approved: Living specs (8) if match, then Final report (9).
../ns-harness/references/review-gate-workflow.mdreviewer-agentns-code-reviewerException — SDD handoff mode: caller / (or dispatch says SDD task mode): skip review gate + living specs. Parent owns review at version closure. See When invoked under execution-handoff.
run-implementationexecution-handoff.md固定工作流,非松散检查清单。步骤按顺序执行;交接对象为指定技能或 harness 桥接器( / ,详见)。禁止使用平台任务角色或临时评审流程。
coder-agentreviewer-agent../ns-harness/references/subagent-dispatch.md标准评审关卡:——仅步骤7–9适用于临时任务 / C2模式。评审必须通过再转(优先使用桥接器;无桥接器时直接调用技能);最多3轮评审;关键修复需强制重新评审;未通过评审或处于阻塞状态则任务未完成。评审通过后:若符合条件则执行活规格更新(步骤8),然后提交最终报告(步骤9)。
../ns-harness/references/review-gate-workflow.mdreviewer-agentns-code-reviewer例外——SDD交接模式:调用者为 / (或调度指令指定SDD任务模式):跳过评审关卡 + 活规格更新。父代理在版本收尾时负责评审。详见在执行交接场景下被调用时。
run-implementationexecution-handoff.mdRouting (read first)
路由规则(必读)
| Signal | Redirect |
|---|---|
GitLab | Stop — |
| Multi-day / version / SDD scope | |
| Obscure bug, root cause unclear | |
| Ad-hoc diff ready | |
Entry priority 5 (default). Harness table: . Trigger phrases: .
../ns-harness/references/code-skill-routing.mdreferences/entry-triggers.md| 信号 | 重定向目标 |
|---|---|
检测到GitLab | 终止——使用 |
| 多日/版本/SDD范围任务 | |
| 问题模糊、根因不明 | |
| 临时代码差异已就绪 | |
入口优先级5(默认)。Harness路由表:。触发短语:。
../ns-harness/references/code-skill-routing.mdreferences/entry-triggers.mdWhen to use (entry)
适用场景(入口调用)
- Bug fixes / hotfixes outside planned version
- Isolated component, hook, service, or utility
- Small refactors (≤ 1 file or tight group)
- Scripts, migrations, seeds outside version lifecycle
- "Just implement this" without
execution-handoff.md
- 计划版本外的bug修复/热修复
- 独立组件、Hook、服务或工具类
- 小型重构(≤1个文件或紧密关联的文件组)
- 版本生命周期外的脚本、迁移、种子数据任务
- 无的“直接实现此需求”任务
execution-handoff.md
When invoked as C2 (engine mode)
作为C2模式调用(引擎模式)
ns-code-autonomousns-execution-gitlab-issueISSUE_URLAns-code-autonomousISSUE_URLns-execution-gitlab-issueAWhen invoked under execution-handoff (SDD task mode)
在执行交接场景下被调用时(SDD任务模式)
Parent (classic SDD) or dispatch SDD handoff / execution-handoff task:
run-implementation- Task scope: ; handoff updates:
../ns-sdd-execution-handoff-generator/references/run-implementation.md.../ns-sdd-execution-handoff-generator/SKILL.md - Implement + unit/integration only. No E2E.
- Forbidden: /
reviewer-agent, living-spec consolidator,ns-code-reviewerverdict line.Code Review: - Report to parent: files changed, tests run, blockers. Parent Step 5 review once all tasks done.
- Session boot: cold start this agent = full boot; same agent continuing = no full re-read unless /
AGENTS.md/ harness rules changed.agents.local.md
父代理为(经典SDD)或调度指令为SDD交接 / execution-handoff任务:
run-implementation- 任务范围:;交接更新规则:
../ns-sdd-execution-handoff-generator/references/run-implementation.md。../ns-sdd-execution-handoff-generator/SKILL.md - 仅实现功能 + 单元/集成测试。禁止执行E2E测试。
- 禁止:调用/
reviewer-agent、活规格合并工具、添加ns-code-reviewerverdict行。Code Review: - 向父代理报告:变更文件列表、已执行测试、阻塞问题。父代理在所有任务完成后执行步骤5评审。
- 会话启动:冷启动此代理需完整启动流程;同一代理持续执行时,除非/
AGENTS.md/ harness规则变更,否则无需重新读取全部规则。agents.local.md
Harness discovery
Harness发现流程
See . Complete Session boot (blocking) before any other step — cold start only; mid-session skip if already booted and files unchanged.
../ns-harness/references/harness-discovery.md详见。在执行任何其他步骤前,必须完成会话启动(阻塞式)——仅冷启动时需执行;会话中若已完成启动且文件未变更则跳过。
../ns-harness/references/harness-discovery.mdSession inputs
会话输入
| Variable | Required |
|---|---|
| Yes (or infer if single obvious product) |
| Yes |
| Infer when possible: frontend, backend, infra, tests, fullstack |
| 变量 | 是否必填 |
|---|---|
| 是(若仅有一个明确产品可自动推断) |
| 是 |
| 尽可能自动推断:frontend、backend、infra、tests、fullstack |
Scope isolation
范围隔离
Only + harness docs. No other monorepo products unless asked.
{product_root}/**仅访问 + harness文档。除非明确要求,否则不得访问其他单仓产品。
{product_root}/**Boot (mandatory)
启动流程(强制要求)
Session boot () — one rule for ad-hoc, C2, SDD handoff:
../ns-harness/references/harness-discovery.md| Agent state | Action |
|---|---|
| Cold start (this agent/subagent just started) | Full Session boot (steps 1–7). Bridge may have done harness 1–4 (AGENTS through project-rules) — finish 5–7 |
| Same agent continuing; steps 1–7 done; files unchanged | Do not full re-read |
| Re-boot |
Then:
- Obey orders — no invented paths or cross-product changes
AGENTS.md - and
git statusgit diff - Read target files before writing
Success: orders + project rules + task scope. Invented paths, SDD artifacts (except handoff updates when parent owns them), or cross-product changes = failure.
AGENTS.md会话启动()——临时任务、C2模式、SDD交接场景均遵循同一规则:
../ns-harness/references/harness-discovery.md| 代理状态 | 操作 |
|---|---|
| 冷启动(此代理/子代理刚启动) | 完整会话启动(步骤1–7)。桥接器可能已完成harness步骤1–4(从AGENTS到project-rules)——需完成剩余步骤5–7 |
| 同一代理持续执行;步骤1–7已完成;文件未变更 | 请勿重新读取 |
自上次启动后 | 重新启动 |
然后:
- 遵守中的指令——不得自行创建路径或跨产品变更
AGENTS.md - 执行和
git statusgit diff - 编写前先读取目标文件
成功标准:遵循指令 + 项目规则 + 任务范围。自行创建路径、生成SDD版本 artifacts(父代理负责的交接更新除外)或跨产品变更均视为失败。
AGENTS.mdImplementation rules
实现规则
- Diff-first — only required lines; no unrelated formatting
- Prefer editing existing files over new files
- Large change gate: >1 file simultaneously, >20 lines in one file, or public contract change: one-line plan, wait for approval
- No commits unless human explicitly asks — when committing, see
../ns-harness/references/agent-git-identity.md - No SDD version artifacts — no ,
task-NNN.md,requirements.md, orexecution-handoff.mdwrites. Conditional living-spec updates underdocs/versions/viadocs/specs/allowed (see Living specs).ns-sdd-living-spec-consolidator - No gratuitous comments unless requested
- Tests per Docker + testing; container/commands in
AGENTS.mdarchitecture-rules.md - Under /
execution-handoff.md: unit/integration only — no E2E (human at version end); no review gate (parent Step 5)run-implementation
- 优先生成差异——仅变更必要代码行;禁止无关格式调整
- 优先编辑现有文件,而非创建新文件
- 大变更关卡:同时修改>1个文件、单个文件变更>20行或修改公共契约:需提交一行计划,等待批准
- 禁止提交代码,除非人类明确要求——提交时需遵循
../ns-harness/references/agent-git-identity.md - 禁止生成SDD版本 artifacts——不得创建、
task-NNN.md、requirements.md或向execution-handoff.md写入内容。符合条件时可通过docs/versions/向ns-sdd-living-spec-consolidator更新活规格(详见活规格更新)。docs/specs/ - 禁止无意义注释,除非明确要求
- 根据中的Docker + 测试规则执行测试;容器/命令规则详见
AGENTS.mdarchitecture-rules.md - 在/
execution-handoff.md场景下:仅执行单元/集成测试——禁止E2E测试(由人类在版本收尾时执行);跳过评审关卡(父代理负责步骤5评审)run-implementation
Per-task cycle
单任务循环
SDD handoff mode: stop after step 6; report to parent; skip 7–9.
- Understand task
- Load rules — obey already booted; Session boot again only if cold start this agent or files changed
AGENTS.md - Explore (grep/head large fixtures — no full test dumps)
- Identify minimal diff
- Apply (or plan if large-change gate)
- Run tests if in scope (see Pre-review)
- Review loop — MUST when available (else
reviewer-agent);ns-code-reviewer../ns-harness/references/review-gate-workflow.md - Living specs (conditional) — see below
- Final report — mandatory fields; never skip verdict or round count
SDD交接模式:完成步骤6后停止;向父代理报告;跳过步骤7–9。
- 理解任务需求
- 加载规则——若已启动则遵守指令;仅冷启动此代理或文件变更时需重新执行会话启动
AGENTS.md - 探索代码(对大型 fixture 使用grep/head——禁止完整导出测试内容)
- 确定最小变更范围
- 应用变更(或触发大变更关卡时提交计划)
- 若在任务范围内则执行测试(详见评审前准备)
- 评审循环——必须在可用时调用(否则调用
reviewer-agent);遵循ns-code-reviewer../ns-harness/references/review-gate-workflow.md - 活规格更新(条件触发)——详见下方
- 最终报告——必填字段;不得跳过 verdict 或评审轮次统计
Pre-review (before step 7)
评审前准备(步骤7前)
- Tests covering changed files per and
AGENTS.md.../ns-harness/references/docker-and-testing.md - Diff removes exports/constants/env flags/public symbols: search remaining call sites; resolve before review.
- 根据和
AGENTS.md执行覆盖变更文件的测试。../ns-harness/references/docker-and-testing.md - 若差异移除了导出/常量/环境变量/公共符号:搜索剩余调用位置;在评审前解决问题。
Review loop (mandatory ad-hoc / C2; skip SDD handoff)
评审循环(临时任务/C2模式强制执行;SDD交接模式跳过)
After step 6, run before done — except SDD handoff (return to parent; no review).
../ns-harness/references/review-gate-workflow.md- MUST invoke when available (else
reviewer-agent) on working-tree diff (ns-code-reviewer) — reviewer bridge/skill begins Session boot at cold start then reviewer workflow; nogit diff, no version-closure path. Ad-hoc diff only.ISSUE_URL - Max 3 rounds. Score gate from : pass ≥9/10, ideal 10/10.
ns-code-reviewer- Pass: zero Critical Issues and overall score ≥ 9/10: proceed step 8.
- Fail (Criticals or score ≤ 8) with rounds left: apply minimal diff that clears Criticals and lifts quality to ≥9 (/
reviewer-agentread-only — this skill applies fixes), re-run tests if in scope, then mandatory re-review vians-code-reviewer(MUST when available; elsereviewer-agent).ns-code-reviewer - Rounds exhausted still failing gate: stop, report blocked. List unresolved Criticals and/or last score. No success. Skip step 8 (living specs).
- Fixes within original task scope. Critical (or score-blocking Warning) needs changes outside scope (public contract, cross-product, multi-day): stop, escalate per Stop conditions.
- Suggestions (P2) alone do not block when score already ≥9: carry into final report as follow-ups.
完成步骤6后,在任务结束前需执行——SDD交接模式除外(返回父代理;无需评审)。
../ns-harness/references/review-gate-workflow.md- 必须在可用时调用**(否则调用
reviewer-agent**)对工作目录差异(ns-code-reviewer)进行评审——评审桥接器/技能在冷启动时先执行会话启动,再进入评审工作流;不得使用git diff,不得走版本收尾路径。仅处理临时代码差异。ISSUE_URL - 最多3轮评审。的评分关卡:通过≥9/10,理想为10/10。
ns-code-reviewer- 通过:无关键问题 且 总分≥9/10:进入步骤8。
- 失败(存在关键问题 或 总分≤8/10)且仍有剩余轮次:应用最小差异修复关键问题并将质量提升至≥9/10(/
reviewer-agent仅读取——此技能负责修复),若在范围内则重新执行测试,然后必须通过ns-code-reviewer(可用时优先)重新评审(否则调用reviewer-agent)。ns-code-reviewer - 轮次耗尽仍未通过关卡:停止任务,报告阻塞状态。列出未解决的关键问题和/或最终评分。任务未成功。跳过步骤8(活规格更新)。
- 修复需在原任务范围内。关键问题(或影响评分的警告)需要超出范围的变更(公共契约、跨产品、多日任务):停止任务,根据终止条件升级反馈。
- 仅存在建议(P2)且总分已≥9/10时,不阻塞任务:将建议作为后续事项纳入最终报告。
Living specs (step 8, conditional)
活规格更新(步骤8,条件触发)
Only after (not as C2). Invoke in ad-hoc mode when all true:
Code Review: Approvedns-sdd-living-spec-consolidator- exists
{product_root}/docs/specs/ - Diff behavioral (API, schema, UX, or domain behavior) — skip cosmetic / rename-only / pure refactor
- Skill available (installed via )
depends
Pass: mode , , approved . Read consolidator , follow it. No invent or write under .
ad-hoc{task_description}git diffSKILL.md{version_san}docs/versions/Skip (note reason in final report) when any condition fails, review not Approved, or consolidator reports skipped.
仅在后执行(C2模式除外)。当所有以下条件满足时,以临时任务模式调用****:
Code Review: Approvedns-sdd-living-spec-consolidator- 存在
{product_root}/docs/specs/ - 差异为行为性变更(API、 schema、UX或领域行为)——跳过 cosmetic/重命名/纯重构变更
- 该技能可用(已通过安装)
depends
传入参数:模式、、已通过评审的。阅读合并工具的并遵循其规则。不得自行生成或向写入内容。
ad-hoc{task_description}git diffSKILL.md{version_san}docs/versions/跳过(在最终报告中注明原因)的情况:任一条件不满足、评审未通过、或合并工具报告跳过。
Final report (step 9)
最终报告(步骤9)
No success language until gate passes or blocked (). SDD handoff: report implement status to parent; no line — version closure owns verdict.
review-gate-workflow.mdCode Review:Every ad-hoc / C2 closure response must include:
| Field | Value |
|---|---|
| Active skill | |
| Reviewer skill | |
| Review round | Last round executed: |
| Score | Last overall score from reviewer |
| Verdict | Exact line: |
| Living specs | |
Then: what changed, follow-ups, blocked Criticals if applicable.
在关卡通过或处于阻塞状态前,不得使用成功类表述(遵循)。SDD交接模式:向父代理报告实现状态;不得添加行——版本收尾时由父代理给出 verdict。
review-gate-workflow.mdCode Review:所有临时任务/C2模式的收尾响应必须包含以下字段:
| 字段 | 值 |
|---|---|
| 当前技能 | |
| 评审技能 | |
| 评审轮次 | 最后执行的轮次: |
| 评分 | 评审给出的最终总分 |
| Verdict | 固定格式行: |
| 活规格更新 | |
然后说明:变更内容、后续事项、阻塞状态下的未解决关键问题(若有)。
Stop conditions
终止条件
| Condition | Action |
|---|---|
| Ask once |
| Large change gate | Plan + wait |
| Public contract or cross-product boundary | Stop, explain, ask |
| Task needs multi-day SDD planning | Redirect to |
| 条件 | 操作 |
|---|---|
| 询问一次 |
| 触发大变更关卡 | 提交计划 + 等待批准 |
| 涉及公共契约或跨产品边界 | 停止任务,说明原因,请求指示 |
| 任务需要多日SDD规划 | 重定向到 |
Related skills
相关技能
- — mandatory review loop after implementation (Review loop)
ns-code-reviewer - — conditional ad-hoc living-spec update after Approved (Living specs)
ns-sdd-living-spec-consolidator - — blocked by unclear bug
ns-code-investigator - — autonomous multi-agent execution (GitLab issue or local plan); GitLab issue use
ns-code-autonomousinsteadns-execution-gitlab-issue
- ——实现完成后的强制评审循环(评审循环)
ns-code-reviewer - ——评审通过后的条件性临时活规格更新(活规格更新)
ns-sdd-living-spec-consolidator - ——问题模糊时的重定向目标
ns-code-investigator - ——自主多代理执行(GitLab issue或本地计划);GitLab issue场景应使用
ns-code-autonomous替代ns-execution-gitlab-issue
Forbidden
禁止操作
- SDD version artifact generation (, handoff, requirements/tasks)
docs/versions/ - Living-spec consolidator before , or when
Code Review: Approvedmissing{specs_root}/ - Cross-product access without scope
- Commits without explicit request
- Refactors outside task scope
- Review substitutes — Cursor Task subagents (,
senior-tech-lead-reviewer,bugbot) or any review not viasecurity-review/reviewer-agentns-code-reviewer. HarnessSKILL.mdallowed.reviewer-agent - Skipping re-review — success after fix when previous verdict was
ns-code-revieweror score < 9 without new passing round (ad-hoc / C2)Rejected - Success without verdict — ad-hoc / C2 closure without mandatory Final report fields and parseable line
Code Review: - Per-task review under handoff — /
reviewer-agentduringns-code-reviewertask (parent owns Step 5)run-implementation
- 生成SDD 版本 artifacts(、交接文档、需求/任务文档)
docs/versions/ - 在前调用活规格合并工具,或
Code Review: Approved不存在时调用{specs_root}/ - 无范围授权时跨产品访问
- 无明确请求时提交代码
- 超出任务范围的重构
- 替代评审流程——使用Cursor Task子代理(、
senior-tech-lead-reviewer、bugbot)或任何未通过security-review/reviewer-agentns-code-reviewer的评审流程。允许使用HarnessSKILL.md。reviewer-agent - 跳过重新评审——修复后未通过新的评审轮次(临时任务/C2模式),但之前的verdict为
ns-code-reviewer或评分<9时,不得标记任务成功Rejected - 无verdict时标记成功——临时任务/C2模式收尾时,缺少必填的最终报告字段和可解析的行
Code Review: - 交接场景下的单任务评审——在任务中调用
run-implementation/reviewer-agent(父代理负责步骤5评审)ns-code-reviewer