code-writing-guide

code-writing-guide is a skill for Claude Code from nowsprinting/unity-coding-skills. It costs 72 tokens per session (610 once invoked), scanned A, original, Unlicense.

Coding rules for Unity, a game-development platform, that guide how code files are changed. They cover editor state, safe refactoring, and Unity-specific files and objects.

In plain words
What is it for?
Use it when adding features, fixing bugs, refactoring, or testing Unity code. It also guides edits to scenes, prefabs, and repeated prefab instances.
Why use it?
It helps avoid stale code, broken references, and Unity project files that the editor should create or manage itself.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the unity-coding-skills plugin — 12 skills shipped together

Good fit Use it when adding features, fixing bugs, refactoring, or testing Unity code. It also guides edits to scenes, prefabs, and repeated prefab instances.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nowsprinting/unity-coding-skills/code-writing-guide
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.

Any agent
npx skills add nowsprinting/unity-coding-skills --skill code-writing-guide
Clone the repo
git clone --depth 1 https://github.com/nowsprinting/unity-coding-skills

Made for: Claude Code.

Or install unity-coding-skills, the plugin that ships this one along with the rest of its 12 skills.

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 code-writing-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/nowsprinting/unity-coding-skills/code-writing-guide/github.svg)](https://agentmods.dev/skills/nowsprinting/unity-coding-skills/code-writing-guide)
Your own site
<a href="https://agentmods.dev/skills/nowsprinting/unity-coding-skills/code-writing-guide"><img src="https://agentmods.dev/badge/skills/nowsprinting/unity-coding-skills/code-writing-guide/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-writing-guide

Your own site · 80×15
<a href="https://agentmods.dev/skills/nowsprinting/unity-coding-skills/code-writing-guide"><img src="https://agentmods.dev/badge/skills/nowsprinting/unity-coding-skills/code-writing-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 610 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00072 $0.00610
Opus 5.5 $0.00029 $0.00244
Sonnet 5.5 $0.00014 $0.00122
Haiku 4.5 $0.00007 $0.00061

Measured yesterday against content hash 680fe745276c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-writing-guide 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.

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/code-writing-guide/SKILL.md · 37 lines

How it starts

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

Guide for writing code in Unity projects.

Rules

  • Before modifying any code file, check if the editor is in Play Mode. If it is, stop it using the unity_play_control tool first — Play Mode may skip recompilation, leaving stale code active.
  • When a change is a structural refactoring — renaming a symbol, extracting a method/interface/base class, changing a method signature, moving a type to another namespace, or deleting a symbol — use the Rider MCP refactoring tools (rename_refactoring, extract_method, extract_interface, extract_base_class, change_api_signature, move_type_to_namespace, reorganize_namespaces, safe_delete) instead of text edits. They update all references and call sites across the solution.
  • Never create .meta files. Unity editor creates them automatically.
  • When editing (creating or modifying) scene (.unity) or prefab (.prefab) files, use the edit-scene skill.
  • When instantiating a prefab multiple times, give each instance a unique GameObject.name; otherwise, automated tests cannot identify a specific instance. Use a concrete name (e.g., "<PrefabName> (Hero)") or append an index (e.g., "<PrefabName> (0)").

Resources

Read the appropriate resource file based on the situation:

  • Before writing or modifying any code file: Read ${CLAUDE_SKILL_DIR}/resources/coding-guideline.md
  • Before writing or modifying any code file: Read ${CLAUDE_SKILL_DIR}/resources/unity-modern-guidelines.md
  • Before writing or modifying MonoBehaviour lifecycle or event-handling methods (Awake, Start, OnEnable, OnDisable, OnDestroy, Update, FixedUpdate, LateUpdate, OnCollision*, OnTrigger*, OnGUI, OnMouse*, OnBecame*, OnPreCull, OnPreRender, OnPostRender, OnRenderImage, OnRenderObject, OnWillRenderObject, OnAnimatorMove, OnAnimatorIK, OnDrawGizmos): Read ${CLAUDE_SKILL_DIR}/resources/unity-event-functions.md
  • Before referencing an API, verifying a package behavior, or looking up documentation: Read ${CLAUDE_SKILL_DIR}/resources/unity-references.md
  • When resolving diagnostics or handling code review feedback: Read ${CLAUDE_SKILL_DIR}/resources/diagnostics-review-feedback.md

Read the full file on GitHub · 37 lines

Files

What ships with it

5 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 Changed · +4 lines 680fe745276c
  2. 3mo ago First seen · 33 lines · 72 tokens per session scan A b49ed8f92756

Subscribe to this mod's changes

code-writing-guide is a skill published in the GitHub repository nowsprinting/unity-coding-skills (20 stars, last pushed 2d ago), licensed Unlicense. It adds 72 tokens to every session and 610 once invoked, about $0.0003 per session on Opus 5.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-08-30.

Related

code-writing-guide compared with skills from other repositories

code-writing-guide next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-writing-guidenowsprinting/unity-coding-skillsSkill202d agoUnlicenseA72Claude Code
aspid-visual-element-fluentVPDPersonal/Aspid.FastToolsSkill27yesterdayMITA109Claude Code, Codex
aspid-serializable-typeVPDPersonal/Aspid.FastToolsSkill27yesterdayMITA136Claude Code, Codex
aspid-profiler-markerVPDPersonal/Aspid.FastToolsSkill27yesterdayMITA82Claude Code, Codex
aspid-enum-valuesVPDPersonal/Aspid.FastToolsSkill27yesterdayMITA87Claude Code, Codex
asp-ft-player-buildsVPDPersonal/Aspid.FastToolsSkill27yesterdayMITA99Claude Code
asp-ft-editor-componentVPDPersonal/Aspid.FastToolsSkill27yesterdayMITA77Claude Code