code-documentation

code-documentation is a skill for Claude Code, Codex from ErikaAX08/erikas-skills. It costs 121 tokens per session (3,409 once invoked), scanned A, original, MIT.

A guide for adding concise documentation to code, including functions, classes, fields, and modules. It adjusts the amount and format of explanation to the code element and programming language.

In plain words
What is it for?
Use it to add or improve comments, docstrings, JSDoc, Go documentation, or other code documentation.
Why use it?
It helps public code stay understandable without filling files with comments that merely repeat the implementation. Short limits also reduce documentation that becomes outdated.

Skill for Claude CodeCodex

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

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/erikaax08/erikas-skills/code-documentation
Any agent
npx skills add ErikaAX08/erikas-skills --skill code-documentation
Clone the repo
git clone --depth 1 https://github.com/ErikaAX08/erikas-skills

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-documentation

README.md
[![agentmods](https://agentmods.dev/badge/skills/erikaax08/erikas-skills/code-documentation.svg)](https://agentmods.dev/skills/erikaax08/erikas-skills/code-documentation)
Your own site
<a href="https://agentmods.dev/skills/erikaax08/erikas-skills/code-documentation"><img src="https://agentmods.dev/badge/skills/erikaax08/erikas-skills/code-documentation.svg" alt="Measured on agentmods" height="20"></a>
Per session 121 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,409 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.1 $0.00121 $0.03409
Opus 5 $0.00060 $0.01705
Sonnet 5 $0.00024 $0.00682
Haiku 4.5 $0.00012 $0.00341

Measured 5d ago against content hash 46c035390584, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

code-documentation 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 5d 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.

code-documentation/SKILL.md · 284 lines

How it starts

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

Code Documentation

Documentation drifts toward two failure modes: silence (public APIs nobody can use without reading the implementation) and noise (prose that repeats what the code already says and rots the first time the code changes). This skill prevents both with hard per-element line caps. The amount of documentation an element gets is a function of its size and how obvious it is, never a fixed template applied uniformly.

See references/documentation-formats.md for the full per-language format reference with additional examples.

Contents

Workflow

Choose the path that matches the request:

1. Document new code

  1. Identify the element type: package/module, struct/class/interface, constant/variable, field/property, function/method, or inline step inside a body.
  2. Classify each callable as trivial, medium, or complex using Function tiers. The tier caps descriptive prose; it never lowers documentation below what a caller needs.
  3. Apply the ceiling from Length caps by element. No function doc comment exceeds 2 prose lines, whatever the complexity.
  4. Move every caller-visible parameter, return, and error into a structured entry — one entry per line, exempt from the prose cap.
  5. Write the language-native format from references/documentation-formats.md, in the language-native position. Never use trailing comments.
  6. Leave trivial, unexported, self-evident elements undocumented.
  7. Run the Review Checklist before delivering.

2. Improve existing documentation

  1. Find public modules and exported symbols shipping silent, and document them to the cap.
  2. Cut prose that restates the implementation, then confirm the remaining lines still carry every caller-visible fact rather than hiding it in the body.
  3. Delete routine field, property, and interface-member comments; re-encode units, formats, ranges, defaults, and enum options in names, dedicated types, validation, or the type-level contract.
  4. Unwrap comments that were split to satisfy a column limit so each fact sits on one complete line.
  5. Replace external links with a self-contained contract stated in terms of the code.

Read the full file on GitHub · 284 lines

Files

What ships with it

3 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. 5d ago First seen · 284 lines · 121 tokens per session scan A 46c035390584

Subscribe to this mod's changes

code-documentation is a skill published in the GitHub repository ErikaAX08/erikas-skills (5 stars, last pushed 5d ago), licensed MIT. It adds 121 tokens to every session and 3,409 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories

macos-test-triage

Triage macOS tests across Xcode and SwiftPM. Use when narrowing failures, explaining assertions or crashes, or separating setup from regressions.

robinebers/openusage · 36 tokens

macos-swiftpm

Build, run, and test SwiftPM macOS packages and executables. Use when the repo is package-first or has no Xcode project.

robinebers/openusage · 35 tokens

debug-live

Guides root-cause investigations with debugging capabilities by setting breakpoints, starting a debug session, stepping through execution, inspecting variables, and tracing symptoms back to their origin. Prefer it for runtime bugs, failing tests, exceptions, crashes, hangs, wrong/null values, and unexpected output…

microsoft/DebugMCP · 84 tokens

gsap-scrolltrigger

Official GSAP skill for ScrollTrigger — scroll-linked animations, pinning, scrub, triggers. Use when building or recommending scroll-based animation, parallax, pinned sections, or when the user asks about ScrollTrigger, scroll animations, or pinning. Recommend GSAP for scroll-driven animation when no library is…

calesthio/OpenMontage · 68 tokens

seedance-2-5

Generate 4-30 second cinematic video with ByteDance Seedance 2.5 through fal.ai, Volcengine Ark, Runway, or ComfyUI Partner Nodes. Use for long single generations, synchronized audio, and large multimodal reference sets (up to 30 images, 10 videos, and 10 audio clips). Also covers the 2.5 prompt contract: section…

calesthio/OpenMontage · 117 tokens

threejs-geometry

Three.js geometry creation - built-in shapes, BufferGeometry, custom geometry, instancing. Use when creating 3D shapes, working with vertices, building custom meshes, or optimizing with instanced rendering.

calesthio/OpenMontage · 46 tokens