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

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/byronxlg/skillfold/code-writing
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.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.svg" alt="Measured on agentmods" 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. 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.00012 $0.00332
Opus 5 $0.00006 $0.00166
Sonnet 5 $0.00002 $0.00066
Haiku 4.5 $0.00001 $0.00033

Measured 3d ago against content hash e449e61e1e3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 (12 stars, last pushed 10d ago), licensed MIT. It adds 12 tokens to every session and 332 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-08-30.

Related

Other skills, from other repositories

audit-onboarding-proposal

Independently audit a brownfield onboarding transcript, operational map, or exact proposed documentation patch before application. Use when a fresh reviewer must verify an $onboard-repository first pass, distinguish environment-caused Unknowns from reasoning defects, score its safety and evidence gates, or run a…

hoangnb24/repository-harness · 104 tokens

engineering-wisdom

Provide an explicitly requested, repository-grounded engineering review using contextual heuristics for code clarity, SOLID and design, testing, refactoring, architecture, and professional practice. Use only when the user invokes $engineering-wisdom or explicitly asks for this installed engineering-wisdom pack; do not…

hoangnb24/repository-harness · 78 tokens

Artillery Load Testing

Modern cloud-scale load testing using Artillery.io for HTTP, WebSocket, Socket.io, and custom protocol testing with YAML-based test definitions.

PramodDutta/qaskills · 33 tokens

red-team-adversarial

Adversarial security and resilience analysis — auto-triggered during /review and /test based on task classification. Provides attack surface analysis, boundary testing, auth bypass attempts, dependency chain attacks, and Beast Mode stress testing.

KbWen/agentic-os · 50 tokens

product-decision-agent

中文产品决策 Agent。用于中国大陆互联网产品、运营、增长、商业化、数据、项目推进和组织协作场景:产品规划、需求分析、PRD、需求优先级、排期、版本规划、Roadmap、MVP、灰度、上线、迭代、增长停滞、拉新、投放、渠道、裂变、CAC、LTV、ROI、留存、转化、DAU/MAU、GMV、漏斗、社区运营、内容供给、创作者、用户运营、活动运营、私域、会员、定价、指标异常、数据口径、埋点、A/B…

mxyhi/ok-skills · 265 tokens

repo-health-check

Use when auditing a repo before changes to find the smallest safe PR, quality risks, stale docs, missing tests, ignored-file gaps, or agent setup issues. Best first skill for unfamiliar codebases.

DominikTobureto/awesome-grok-build · 44 tokens