code-writing

code-writing is a skill for Claude Code, Codex from byronxlg/skillfold. It costs 12 tokens per session (332 once invoked), scanned A, original, MIT.

A guide for writing readable, correct code that fits the project's existing style and is easier to test and change.

In plain words
What is it for?
Use it to implement features, validate inputs, handle failures, structure functions, and improve code quality during development.
Why use it?
It helps prevent unclear implementations, hidden edge cases, weak error messages, and code that conflicts with the surrounding system.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to implement features, validate inputs, handle failures, structure functions, and improve code quality during development.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/byronxlg/skillfold/code-writing
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 byronxlg/skillfold --skill code-writing
Clone the repo
git clone --depth 1 https://github.com/byronxlg/skillfold

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/byronxlg/skillfold/code-writing/github.svg)](https://agentmods.dev/skills/byronxlg/skillfold/code-writing)
Your own site
<a href="https://agentmods.dev/skills/byronxlg/skillfold/code-writing"><img src="https://agentmods.dev/badge/skills/byronxlg/skillfold/code-writing/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/byronxlg/skillfold/code-writing"><img src="https://agentmods.dev/badge/skills/byronxlg/skillfold/code-writing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 332 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.00012 $0.00332
Opus 5.5 $0.00005 $0.00133
Sonnet 5.5 $0.00002 $0.00066
Haiku 4.5 $0.00001 $0.00033

Measured 2mo ago against content hash e449e61e1e3f, 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 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 2mo ago.

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.

library/skills/code-writing/SKILL.md · 41 lines

What it actually says

Code Writing

You write clean, correct, production-quality code. You follow the conventions of the project you are working in and prioritize readability and maintainability.

Principles

  • Correctness first, then clarity, then performance
  • Follow existing project patterns and conventions - consistency matters more than personal preference
  • Write code that is easy to read, test, and change
  • Handle errors explicitly with useful messages
  • Keep functions small and focused on a single responsibility
  • Name things descriptively - the reader should not need to look elsewhere to understand what something does

Approach

When writing code:

  1. Understand the requirement fully before writing. Clarify ambiguity before implementing
  2. Read the surrounding code to understand patterns, naming conventions, and architecture
  3. Write the simplest correct implementation first
  4. Handle edge cases and error conditions explicitly
  5. Add comments only where the "why" is not obvious from the code itself
  6. Validate inputs at boundaries - functions that accept external input should fail fast on bad data

Code Quality

  • Prefer pure functions where practical - they are easier to test and reason about
  • Avoid deep nesting - extract helper functions or use early returns
  • Group related logic together; separate unrelated concerns
  • Use the type system to prevent invalid states when the language supports it
  • Delete dead code rather than commenting it out

Output

Produce working code that fits naturally into the existing codebase. Include any necessary imports, error handling, and type annotations. If the change touches tests, update them to match.

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. 2mo ago First seen · 41 lines · 12 tokens per session scan A e449e61e1e3f

Subscribe to this mod's changes

code-writing is a skill published in the GitHub repository byronxlg/skillfold (15 stars, last pushed 6d ago), licensed MIT. It adds 12 tokens to every session and 332 once invoked, about $0.0000 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.