About ns-code-coder
ns-code-coder is an execution skill for implementing bounded, ad hoc code changes and work units dispatched by ns-code-autonomous. It defines routing, project-rule discovery, testing, and a review-gated workflow, with a separate handoff mode for SDD tasks.
Key features
- 01Routes tasks by scope and context
- 02Requires project and harness rule discovery
- 03Implements minimal, task-scoped diffs
- 04Runs scoped unit and integration tests
- 05Uses a defined review loop and final report
Use cases
- 01Fixing an isolated bug or hotfix
- 02Updating a small component or utility
- 03Implementing a dispatched work unit
- 04Carrying out an SDD task handoff
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ nextstage-brasil/ skills --skill ns-code-coderAfter installing, type/ns-code-coderin Claude Code to confirm it loaded.
Bundled filesevals/evals.jsonreferences/entry-triggers.md
Details
From the project READMECode Coder
Central execution worker for ad-hoc diffs (and C2 under ns-code-autonomous). Not front door — host picks entry per ../ns-harness/references/code-skill-routing.md.
Workflow mode (mandatory)
Fixed workflow, not loose checklist. Steps in order; handoffs = named skills or harness bridges (coder-agent / reviewer-agent per ../ns-harness/references/subagent-dispatch.md). No platform Task personas or improvised review.
Canonical review gate: ../ns-harness/references/review-gate-workflow.md — steps 7–9 ad-hoc / C2 only. Review only via reviewer-agent then ns-code-reviewer (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).
Exception — SDD handoff mode: caller run-implementation / execution-handoff.md (or dispatch says SDD task mode): skip review gate + living specs. Parent owns review at version closure. See When invoked under execution-handoff.
Routing (read first)
| Signal | Redirect |
|---|---|
GitLab ISSUE_URL detected | Stop — ns-execution-gitlab-issue |
| Multi-day / version / SDD scope | ns-spec-driven |
| Obscure bug, root cause unclear | ns-code-investigator |
| Ad-hoc diff ready | reviewer-agent then ns-code-reviewer (review loop below) |
Entry priority 5 (default). Harness table: ../ns-harness/references/code-skill-routing.md. Trigger phrases: references/entry-triggers.md.
When 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
When invoked as C2 (engine mode)
ns-code-autonomous dispatches as work-unit subagent in existing worktree: unit scope only. Do not re-route to ns-execution-gitlab-issue on ISSUE_URL in code/comments — context, not routing. Escalate destructive doubts to caller (A), not GitLab skills. No living-spec consolidator as C2 — version closure/caller owns. Complete ad-hoc Review loop unless caller says SDD handoff / defer review.
When invoked under execution-handoff (SDD task mode)
Parent run-implementation (classic SDD) or dispatch SDD handoff / execution-handoff task:
- Task scope:
../ns-sdd-execution-handoff-generator/references/run-implementation.md; handoff updates:../ns-sdd-execution-handoff-generator/SKILL.md. - Implement + unit/integration only. No E2E.
- Forbidden:
reviewer-agent/ns-code-reviewer, living-spec consolidator,Code Review:verdict line. - 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/agents.local.md/ harness rules changed.
Harness discovery
See ../ns-harness/references/harness-discovery.md. Complete Session boot (blocking) before any other step — cold start only; mid-session skip if already booted and files unchanged.
Session inputs
| Variable | Required |
|---|---|
{product_root} | Yes (or infer if single obvious product) |
{task_description} | Yes |
{target_layer} | Infer when possible: frontend, backend, infra, tests, fullstack |
Scope isolation
Only {product_root}/** + harness docs. No other monorepo products unless asked.
Boot (mandatory)
Session boot (../ns-harness/references/harness-discovery.md) — one rule for ad-hoc, C2, SDD handoff:
| 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 AGENTS.md / rule corpus |
AGENTS.md, agents.local.md, or harness rules changed since last boot | Re-boot |
Then:
- Obey
AGENTS.mdorders — no invented paths or cross-product changes git statusandgit diff- Read target files before writing
Success: AGENTS.md orders + project rules + task scope. Invented paths, SDD artifacts (except handoff updates when parent owns them), or cross-product changes = failure.
Implementation 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,execution-handoff.md, ordocs/versions/writes. Conditional living-spec updates underdocs/specs/vians-sdd-living-spec-consolidatorallowed (see Living specs). - No gratuitous comments unless requested
- Tests per
AGENTS.mdDocker + testing; container/commands inarchitecture-rules.md - Under
execution-handoff.md/run-implementation: unit/integration only — no E2E (human at version end); no review gate (parent Step 5)
Per-task cycle
SDD handoff mode: stop after step 6; report to parent; skip 7–9.
- Understand task
- Load rules — obey
AGENTS.mdalready booted; Session boot again only if cold start this agent or files changed - 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
reviewer-agentwhen available (elsens-code-reviewer);../ns-harness/references/review-gate-workflow.md - Living specs (conditional) — see below
- Final report — mandatory fields; never skip verdict or round count
Pre-review (before step 7)
- Tests covering changed files per
AGENTS.mdand../ns-harness/references/docker-and-testing.md. - Diff removes exports/constants/env flags/public symbols: search remaining call sites; resolve before review.
Review loop (mandatory ad-hoc / C2; skip SDD handoff)
After step 6, run ../ns-harness/references/review-gate-workflow.md before done — except SDD handoff (return to parent; no review).
- MUST invoke
reviewer-agentwhen available (elsens-code-reviewer) on working-tree diff (git diff) — reviewer bridge/skill begins Session boot at cold start then reviewer workflow; noISSUE_URL, no version-closure path. Ad-hoc diff only. - Max 3 rounds. Score gate from
ns-code-reviewer: pass ≥9/10, ideal 10/10.- 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-agent/ns-code-reviewerread-only — this skill applies fixes), re-run tests if in scope, then mandatory re-review viareviewer-agent(MUST when available; elsens-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.
Living specs (step 8, conditional)
Only after Code Review: Approved (not as C2). Invoke ns-sdd-living-spec-consolidator in ad-hoc mode when all true:
{product_root}/docs/specs/exists- Diff behavioral (API, schema, UX, or domain behavior) — skip cosmetic / rename-only / pure refactor
- Skill available (installed via
depends)
Pass: mode ad-hoc, {task_description}, approved git diff. Read consolidator SKILL.md, follow it. No invent {version_san} or write under docs/versions/.
Skip (note reason in final report) when any condition fails, review not Approved, or consolidator reports skipped.
Final report (step 9)
No success language until gate passes or blocked (review-gate-workflow.md). SDD handoff: report implement status to parent; no Code Review: line — version closure owns verdict.
Every ad-hoc / C2 closure response must include:
| Field | Value |
|---|---|
| Active skill | ns-code-coder |
| Reviewer skill | ns-code-reviewer (via reviewer-agent when dispatched) |
| Review round | Last round executed: 1, 2, or 3 |
| Score | Last overall score from reviewer |
| Verdict | Exact line: Code Review: {Approved|Rejected|Blocked} |
| Living specs | updated | skipped: {reason} | n/a (blocked/rejected) |
Then: what changed, follow-ups, blocked Criticals if applicable.
Stop conditions
| Condition | Action |
|---|---|
{product_root} unclear with multiple products | Ask once |
| Large change gate | Plan + wait |
| Public contract or cross-product boundary | Stop, explain, ask |
| Task needs multi-day SDD planning | Redirect to ns-spec-driven |
Related skills
ns-code-reviewer— mandatory review loop after implementation (Review loop)ns-sdd-living-spec-consolidator— conditional ad-hoc living-spec update after Approved (Living specs)ns-code-investigator— blocked by unclear bugns-code-autonomous— autonomous multi-agent execution (GitLab issue or local plan); GitLab issue usens-execution-gitlab-issueinstead
Forbidden
- SDD version artifact generation (
docs/versions/, handoff, requirements/tasks) - Living-spec consolidator before
Code Review: Approved, or when{specs_root}/missing - Cross-product access without scope
- Commits without explicit request
- Refactors outside task scope
- Review substitutes — Cursor Task subagents (
senior-tech-lead-reviewer,bugbot,security-review) or any review not viareviewer-agent/ns-code-reviewerSKILL.md. Harnessreviewer-agentallowed. - Skipping re-review — success after fix when previous
ns-code-reviewerverdict wasRejectedor score < 9 without new passing round (ad-hoc / C2) - Success without verdict — ad-hoc / C2 closure without mandatory Final report fields and parseable
Code Review:line - Per-task review under handoff —
reviewer-agent/ns-code-reviewerduringrun-implementationtask (parent owns Step 5)