ns-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-autonomous../../ns-harness/references/code-skill-routing.md作为处理临时代码差异的核心执行工作者(在下也承担角色)。并非入口技能——宿主需根据选择入口。
ns-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-reviewer/references/review-gate-workflow.mdreviewer-agentns-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 桥接器(依据使用 / )。不得使用平台任务角色或临时评审流程。
../../ns-harness/references/subagent-dispatch.mdcoder-agentreviewer-agent标准评审关卡:——仅步骤7–9适用于临时任务 / C2模式。评审必须通过再交由(若可用必须桥接;否则直接调用技能);最多3轮评审;关键修复必须重新评审;未通过评审或处于阻塞状态则视为未完成。评审通过后:若符合条件则执行活规格更新(步骤8),然后生成最终报告(步骤9)。
../ns-reviewer/references/review-gate-workflow.mdreviewer-agentns-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范围的任务 | |
| 模糊bug、根因不明 | |
| 临时代码差异已准备就绪 | 先调用 |
入口优先级为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修复/热修复
- 独立的组件、钩子、服务或工具类
- 小型重构(≤1个文件或紧密关联的文件组)
- 版本生命周期外的脚本、迁移、种子数据
- 无的“直接实现这个需求”场景
execution-handoff.md
When invoked as C2 (engine mode)
作为C2调用时(引擎模式)
ns-autonomousns-execution-gitlab-issueISSUE_URLAns-autonomousISSUE_URLns-execution-gitlab-issueAWhen invoked under execution-handoff (SDD task mode)
在执行交接场景下被调用时(SDD任务模式)
Parent (classic SDD) or dispatch SDD handoff / execution-handoff:
run-implementation- Scope: classic = one batch (same-layer consecutive , prefer 4–7, hard max 7; size 1 = single task) per
pending. Partitioned slice = that slice's tasks. Parent owns handoff file updates.references/run-implementation.md - Read each task card (header through Validation criteria); open on demand (ambiguity or
Detailed description) —blocked.../ns-spec-driven/references/task-schema.md - Implement + unit/integration only. No E2E.
- Forbidden: /
reviewer-agent, living-spec consolidator,ns-reviewerverdict line.Code Review: - Report to parent per task: files changed, tests run, blockers, tokens (split or ). Parent marks rows and runs Step 5 review once all tasks done.
~N - Session boot: cold start this agent = full boot per ; same agent continuing = no full re-read unless
session-boot.md/ harness rules changed.agents.local.md
父级调用(经典SDD)或调度指示为SDD交接 / execution-handoff:
run-implementation- 范围:经典模式 = 一个批次(同层连续的任务,建议4–7个,硬上限7个;数量1则为单个任务),依据
pending。分片任务 = 对应分片的任务。父级负责更新交接文件。references/run-implementation.md - 阅读每个任务卡片(从标题到验证标准);若存在歧义或处于状态,按需查看
blocked——参考Detailed description。../ns-spec-driven/references/task-schema.md - 仅实现 + 单元/集成测试。无需E2E测试。
- **禁止:**调用/
reviewer-agent、活规格整合器、添加ns-reviewerverdict行。Code Review: - 按任务向父级汇报:修改的文件、运行的测试、阻塞点、token(拆分或)。父级标记任务行,待所有任务完成后执行步骤5的评审。
~N - 会话启动:冷启动此Agent = 按完成完整启动;同一Agent持续运行 = 除非
session-boot.md/ harness规则变更,否则无需重新读取全部规则。agents.local.md
Session boot
会话启动
See . Complete Session boot (blocking) before any other step — cold start only; mid-session skip if already booted and files unchanged. Never tool-Read .
../../ns-harness/references/session-boot.mdAGENTS.md详见。**完成会话启动(阻塞式)**后再执行其他步骤——仅冷启动时需执行;会话中途若已启动且文件未变更则跳过。不得读取文件。
../../ns-harness/references/session-boot.mdAGENTS.mdSession inputs
会话输入
| Variable | Required |
|---|---|
| Yes |
| Infer when possible: frontend, backend, infra, tests, fullstack |
| 变量 | 是否必填 |
|---|---|
| 是 |
| 尽可能推断:frontend、backend、infra、tests、fullstack |
Scope isolation
范围隔离
Operate only inside the repo + harness docs.
仅在仓库 + harness文档内操作。
Boot (mandatory)
启动(强制要求)
Session boot () — one rule for ad-hoc, C2, SDD handoff:
../../ns-harness/references/session-boot.md| Agent state | Action |
|---|---|
| Cold start (this agent/subagent just started) | Full Session boot (steps 1–6). Bridge may have done local + architecture/project rules — finish layer rules + context |
| Same agent continuing; steps 1–6 done; files unchanged | Do not re-read rule corpus |
| Re-boot |
Then:
- Obey orders (already in context) — no invented paths
AGENTS.md - and
git statusgit diff - Read target files before writing
Success: orders + project rules + task scope. Invented paths or SDD artifacts (except handoff updates when parent owns them) = failure.
AGENTS.md会话启动()——临时任务、C2、SDD交接场景均需遵循同一规则:
../../ns-harness/references/session-boot.md| Agent状态 | 操作 |
|---|---|
| 冷启动(此Agent/子Agent刚启动) | 完成完整会话启动(步骤1–6)。桥接器可能已读取本地 + 架构/项目规则——需完成层规则 + 上下文读取 |
| 同一Agent持续运行;步骤1–6已完成;文件未变更 | 不得重新读取规则库 |
自上次启动后 | 重新启动 |
然后:
- 遵守中的指令(已加载至上下文)——不得自行创建流程
AGENTS.md - 执行和
git statusgit diff - 编写前先读取目标文件
**成功标准:**遵循指令 + 项目规则 + 任务范围。自行创建流程或生成SDD工件(除非父级负责的交接文件更新)均视为失败。
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-living-spec - 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版本工件——不得创建、
task-NNN.md、requirements.md或写入execution-handoff.md目录。允许通过docs/versions/在ns-living-spec下进行条件性活规格更新(见活规格部分)。docs/specs/ - 不得添加无意义注释除非被要求
- 依据中的Docker + 测试规则执行测试;容器/命令参考
AGENTS.mdarchitecture-rules.md - 在/
execution-handoff.md场景下:仅执行单元/集成测试——无需E2E测试(由人类在版本收尾时执行);无需评审关卡(父级执行步骤5)run-implementation
Complement delegation
互补技能委托
spec-drivengitlabdepends.agents/skills/| Signal | Skill | When |
|---|---|---|
| | Before large UI diff (step 4–5) or when task is primarily visual |
| Security headers, CSP/CORS, dep CVE sweep, a11y/Web Interface Guidelines audit | | On explicit request, or after frontend work before review when hygiene was in scope |
README / | | On explicit request or version/doc closure — not every ad-hoc fix |
MR/SOLID review stays only. Missing complement: continue with harness rules; recommend install once per session ().
ns-reviewer../ns-spec-driven/references/skill-integrations.mdspec-drivengitlabdepends.agents/skills/| 信号 | 技能 | 时机 |
|---|---|---|
| | 大型UI差异前(步骤4–5)或任务以视觉为主时 |
| 安全头、CSP/CORS、依赖CVE扫描、a11y/Web界面指南审计 | | 明确要求时,或前端工作完成后、评审前且卫生检查在范围内时 |
README / | | 明确要求时或版本/文档收尾时——并非每次临时修复都需执行 |
MR/SOLID评审仅由****负责。若缺失互补技能:继续遵循harness规则;每会话建议安装一次(参考)。
ns-reviewer../ns-spec-driven/references/skill-integrations.mdPer-task cycle
单任务循环
SDD handoff mode: one dispatch may cover a batch; still stop after step 6; report per task 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-reviewer../ns-reviewer/references/review-gate-workflow.md - Living specs (conditional) — see below
- Final report — mandatory fields; never skip verdict or round count
SDD交接模式:一次调度可能覆盖一个批次;仍需在步骤6后停止;按任务向父级汇报;跳过步骤7–9。
- 理解任务
- 加载规则——已启动的Agent需遵守;仅当冷启动此Agent或文件变更时才重新执行会话启动
AGENTS.md - 探索(grep/head大型测试数据——不得导出完整测试内容)
- 确定最小差异范围
- 实施(或若触发大变更关卡则提交计划)
- 若在范围内则运行测试(见评审前准备)
- 评审循环——若可用必须调用(否则调用
reviewer-agent);参考ns-reviewer../ns-reviewer/references/review-gate-workflow.md - 活规格(条件性)——见下文
- 最终报告——必填字段;不得跳过结论或轮次计数
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-reviewer/references/review-gate-workflow.md- MUST invoke when available (else
reviewer-agent) on working-tree diff (ns-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-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-reviewer(MUST when available; elsereviewer-agent).ns-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-reviewer/references/review-gate-workflow.md- 必须在工作树差异()上调用**
git diff(若可用,否则调用reviewer-agent**)——评审桥接器/技能在冷启动时执行会话启动,然后执行评审工作流;无需ns-reviewer,无需版本收尾路径。仅处理临时代码差异。ISSUE_URL - 最多3轮评审。的评分关卡:通过≥9/10,理想为10/10。
ns-reviewer- **通过:**无关键问题 且 总分≥9/10:进入步骤8。
- 失败(存在关键问题 或 总分≤8)且仍有剩余轮次:应用最小差异修复关键问题并将质量提升至≥9分(/
reviewer-agent仅读取——此技能负责修复),若在范围内则重新运行测试,然后必须重新评审(优先使用ns-reviewer;否则用reviewer-agent)。ns-reviewer - 轮次耗尽仍未通过关卡:停止,报告阻塞。列出未解决的关键问题和/或最终评分。视为未成功。跳过步骤8(活规格)。
- 修复需在原任务范围内。关键问题(或影响评分的警告)需要超出范围的变更(公共契约、跨产品、多日工作):停止,按停止条件升级。
- 仅存在建议(P2)且总分已≥9时不阻塞:在最终报告中列为后续事项。
Living specs (step 8, conditional)
活规格(步骤8,条件性)
Only after (not as C2). Invoke in ad-hoc mode when all true:
Code Review: Approvedns-living-spec- exists
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-living-spec- 目录存在
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交接模式:**向父级报告实施状态;无需行——版本收尾负责结论。
review-gate-workflow.mdCode Review:每个临时任务/C2模式的收尾响应必须包含:
| 字段 | 值 |
|---|---|
| 当前技能 | |
| 评审技能 | |
| 评审轮次 | 最后执行的轮次: |
| 评分 | 评审给出的最终总分 |
| 结论 | 精确行: |
| 活规格 | |
然后列出:变更内容、后续事项、若阻塞则列出未解决的关键问题。
Stop conditions
停止条件
| Condition | Action |
|---|---|
| Large change gate | Plan + wait |
| Public contract change | Stop, explain, ask |
| Task needs multi-day SDD planning | Redirect to |
| 条件 | 操作 |
|---|---|
| 触发大变更关卡 | 提交计划 + 等待批准 |
| 变更公共契约 | 停止,说明原因,请求确认 |
| 任务需要多日SDD规划 | 重定向至 |
Related skills
相关技能
- — mandatory review loop after implementation (Review loop)
ns-reviewer - — conditional ad-hoc living-spec update after Approved (Living specs)
ns-living-spec - — blocked by unclear bug
ns-investigator - — autonomous multi-agent execution (GitLab issue or local plan); GitLab issue use
ns-autonomousinsteadns-execution-gitlab-issue - — UI/design work (Complement delegation)
ns-frontend-design - — security/CSP/a11y hygiene pass (Complement delegation)
ns-best-practices - — README /
ns-docs-writerguides on request (Complement delegation)docs/
- ——实施后必须执行的评审循环(评审循环)
ns-reviewer - ——通过评审后条件性临时活规格更新(活规格)
ns-living-spec - ——因bug不明而阻塞时调用
ns-investigator - ——自主多Agent执行(GitLab issue或本地计划);GitLab issue场景请使用
ns-autonomousns-execution-gitlab-issue - ——UI/设计工作(互补技能委托)
ns-frontend-design - ——安全/CSP/a11y卫生检查(互补技能委托)
ns-best-practices - ——按需编写README /
ns-docs-writer指南(互补技能委托)docs/
Forbidden
禁止事项
- SDD version artifact generation (, handoff, requirements/tasks)
docs/versions/ - Living-spec consolidator before , or when
Code Review: Approvedmissingdocs/specs/ - Out-of-repo 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-reviewer. HarnessSKILL.mdallowed.reviewer-agent - Skipping re-review — success after fix when previous verdict was
ns-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 / mid-batch review under handoff — /
reviewer-agentduringns-reviewertask or batch (parent owns Step 5)run-implementation
- 生成SDD 版本工件(、交接文档、需求/任务)
docs/versions/ - 在之前调用活规格整合器,或
Code Review: Approved目录缺失时调用docs/specs/ - 无范围限制的仓库外访问
- 无明确要求的代码提交
- 超出任务范围的重构
- 替代评审流程——Cursor Task子Agent(、
senior-tech-lead-reviewer、bugbot)或任何未通过security-review/reviewer-agentns-reviewer的评审。Harness的SKILL.md允许使用。reviewer-agent - 跳过重新评审——修复后若之前结论为
ns-reviewer或评分<9,未进行新的通过轮次则视为成功(临时任务/C2模式)Rejected - 无结论的成功——临时任务/C2模式收尾时缺少必填的最终报告字段和可解析的行
Code Review: - 交接场景下的单任务/批中评审——在任务或批次期间调用
run-implementation/reviewer-agent(父级负责步骤5)ns-reviewer