بنقرة واحدة
write-code
Edit source code for the current task. Delegates editing and lint/typecheck/self-repair to a subagent.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Edit source code for the current task. Delegates editing and lint/typecheck/self-repair to a subagent.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Conduct a decision-tree interview with the user to lock in requirements, motivation, scope, and non-goals before planning.
Stage 3 of three-stage planning pipeline. Produce a file-level implementation plan via detail-planner/detail-reviewer loop, then get user approval. Inputs are confirmed intent (<session-id>-intent.md) and outline (<session-id>-outline.md) from prior stages.
Plan and write test cases with high reasoning effort. Test iteration runs in a subagent to minimize confirmations.
Explore the codebase to understand existing patterns, constraints, and relevant files before planning.
Investigate git history, docs/history.md, and GitHub issue/PR timeline since the relevant issue opened, to surface changes that may invalidate the issue's premises.
Orchestrate session close — Phase 2 issue close + Final Report. Replaces CLAUDE.md WF-CODE-12. Handles both ENFORCE_WORKTREE on (worktree path) and off (branch/main path).
| name | write-code |
| description | Edit source code for the current task. Delegates editing and lint/typecheck/self-repair to a subagent. |
| model | sonnet |
| user-invocable | false |
Edit source code for the current task.
When a hook blocks a sanctioned command, a fallback path is taken, or any unexpected outcome occurs, report via supervisor-report — see rules/supervisor-reporting.md.
WCD-1. Read rules/core-principles.md 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'
OFF: proceed to step WCD-3.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"'. If output is not NONE, use the stored verdict and signals directly (parse verdict=<v> and signals=<csv>).
If NONE (fail-open): read skills/_shared/judge-task-complexity.md and evaluate directly. Emit in Claude text output (NOT Bash echo):
Model selected: [opus|sonnet] (signals: [comma-separated triggered signal IDs, or "none"])
WCD-4. Launch subagent (Agent tool, mode: "default", model = verdict from step WCD-3) with a prompt containing:
rules/coding/<lang>.md before the first Edit for each language present."<tool> not found — check skipped in the final summary. Never omit this notice.WCD-5. Parse the subagent summary. Surface tool output on failure. Collect all check skipped notes and scope-expansion notes.
WCD-6. Present the final edited file list + skipped-check notes + scope-expansion notes to the user — gated by CONFIRM_CODE gate (post-action review):
bash -c 'cd "$AGENTS_CONFIG_DIR" && bash "$AGENTS_CONFIG_DIR/bin/confirm-off" CONFIRM_CODE on'
OFF: skip this step; proceed (no user wait).ON or ERROR: present the file list and notes.rules/coding/*.md)rules/coding/python.md before the first Python Edit. All Python invariants (including modern type syntax) are owned by the B-layer.rules/coding/nodejs.md before the first JS Edit. All Node invariants (including module-system guidance) are owned by the B-layer.rules/coding/nodejs.md; items below are writing-moment additions not in B-layer): discriminated union over loose interface; explicit return types on exported functions.$ErrorActionPreference = 'Stop'; Set-StrictMode -Version Latest; full cmdlet names; $env:VAR for env vars.set -euo pipefail; [[ ]] over [ ]; quote variable expansions; $(...) over backticks; ${var:?error} for required vars.When a new standalone B-layer file is added for a language that currently has only A-layer content (PowerShell, Bash, JSON, YAML), that language's entry collapses to a bare read-directive. Test p in tests/feature-write-code-skill-static.sh enforces SSOT non-duplication for module-system guidance tokens at CI.
| Language | Command |
|---|---|
| Python | uv run ruff check <file> |
| JavaScript | npx eslint <file> |
| TypeScript | npx eslint <file> + npx tsc --noEmit |
| PowerShell | pwsh -NoProfile -Command Invoke-ScriptAnalyzer -Path <file> |
| Bash | shellcheck <file> |
| JSON | node -e "JSON.parse(require('fs').readFileSync('<file>','utf8'))" |
| YAML | uv run python -c "import yaml,sys;yaml.safe_load(open(sys.argv[1]))" <file> |
Each is best-effort: if the tool or config is absent, skip AND emit <tool> not found — check skipped.
/write-tests owns them.None.