write-code

write-code is a skill for Claude Code, Codex from nirecom/agents. It costs 26 tokens per session (1,950 once invoked), scanned A, original, MIT.

A coding workflow for editing source files for the current task. It also covers code checks and delegated repair work.

In plain words
What is it for?
Changing source code, running checks, and repairing problems found during those checks.
Why use it?
It organizes the editing process and catches issues such as lint or type-check failures.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nirecom/agents/write-code
Any agent
npx skills add nirecom/agents --skill write-code
Clone the repo
git clone --depth 1 https://github.com/nirecom/agents

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for write-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/nirecom/agents/write-code.svg)](https://agentmods.dev/skills/nirecom/agents/write-code)
Your own site
<a href="https://agentmods.dev/skills/nirecom/agents/write-code"><img src="https://agentmods.dev/badge/skills/nirecom/agents/write-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,950 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00026 $0.01950
Opus 5 $0.00013 $0.00975
Sonnet 5 $0.00005 $0.00390
Haiku 4.5 $0.00003 $0.00195

Measured yesterday against content hash 4be80868013c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

write-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/detect-contract-pins.sh, scripts/self-check-siblings.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/write-code/SKILL.md · 91 lines

How it starts

The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Edit source code for the current task.

Procedure

Apply skills/_shared/resolve-plans-dir.md once; substitute the resolved absolute path for every <PLANS_DIR> below.

When a hook blocks a sanctioned command, a fallback path is taken, or any unexpected outcome occurs, report via /supervisor-report (trigger conditions: rules/supervisor-reporting.md). Read rules/ops.md before any destructive or system-state-changing command (including inside WCD-4 self-repair) — on-demand-only, never auto-injected; it owns the recovery-options-first decision path.

WCD-1. Read rules/core-principles.md, rules/coding.md (on-demand-only: not auto-injected, so this Read is the only way it arrives), and the target files identified from the plan.

WCD-2. CONFIRM_CODE gate — enumerate planned edits (one line per file: path + change intent). Then check via Bash: bash -c 'cd "$AGENTS_CONFIG_DIR" && bash "$AGENTS_CONFIG_DIR/bin/confirm-off" CONFIRM_CODE on'

  • stdout OFF: proceed to step WCD-3.
  • stdout ON or ERROR: present the planned edits via AskUserQuestion and wait for approval before continuing.

WCD-3. Run bash -c 'node "$AGENTS_CONFIG_DIR/bin/workflow/read-complexity-evaluation" --session "$SESSION_ID" --stage write_code'. If line 1 is not NONE, use the stored level and signals directly (parse level=<v> and signals=<csv-or-none>), then derive the model: level === "high" ? "opus" : "sonnet".

  • If NONE (fail-open):
    • Read skills/_shared/judge-task-complexity.md and evaluate the signals.
    • Use the Write tool (never Bash) to write the resulting CSV, alone and unquoted, to <PLANS_DIR>/<session-id>-write-code-signals.txt — write only IDs from the generated Valid Signal IDs list; substitute S0-undecidable when the judgment doesn't parse into recognized ids or the csv doesn't match ^[A-Za-z0-9,_-]*$ (the judged content is untrusted text, never shell syntax).
    • Run bash -c 'node "$AGENTS_CONFIG_DIR/bin/workflow/derive-complexity-level" --stage write_code --signals-file "<PLANS_DIR>/<session-id>-write-code-signals.txt"' and use its level=<v> — never judge the level inline. Map to model: high→opus, low→sonnet. Emit in Claude text output (NOT Bash echo): > Model selected: **[opus|sonnet]** (signals: [comma-separated triggered signal IDs, or "none"]) WCD-3a. Emit echo "<<WORKFLOW_MARK_STEP_write_code_in_progress>>" via Bash immediately before the WCD-4 subagent launch.

WCD-4. Launch subagent (Agent tool, mode: "default", model: <model derived from level in step WCD-3> — the model parameter receives "opus" or "sonnet", never "high" or "low") with a prompt containing:

  • Target files and planned edit summary from step WCD-2.
  • A-layer language essence block (see below).
  • Directive: "Read rules/coding.md (the hub — on-demand-only, so it does not reach you otherwise) and rules/coding/<lang>.md for each language present, before the first Edit."
  • Directive: "Read rules/shell-commands.md before the first Bash command, or before writing a file — general-purpose dispatch does not inherit auto-injected rules."
  • Directive: "Read rules/user-escalation.md before any system-state-changing command — general-purpose dispatch does not inherit auto-injected rules."
  • Directive: "Read rules/ops.md before any destructive or system-state-changing command inside self-repair — general-purpose dispatch does not inherit auto-injected rules; on-demand-only, so it does not reach you otherwise."
  • Lint/typecheck recipe table (see below).
  • Self-repair cap: 3 iterations; if still failing after 3, surface tool output verbatim.
  • Lint-tool absence policy: when a tool is unavailable, skip that check AND emit <tool> not found — check skipped in the final summary. Never omit this notice.
  • Scope-expansion policy: if editing reveals additional files not in the original list need changes, include them in the final summary with a reason. Do NOT prompt mid-edit; do NOT silently expand scope.
  • Prohibitions: no diffs shown in the conversation; no mid-edit confirmation prompts.

Read the full file on GitHub · 91 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 91 lines · 26 tokens per session scan A 4be80868013c

Subscribe to this mod's changes

write-code is a skill published in the GitHub repository nirecom/agents (3 stars, last pushed today), licensed MIT. It adds 26 tokens to every session and 1,950 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.