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.
npx skills add skyf0xx/hedgehog --skill code-comment-disciplinegit clone --depth 1 https://github.com/skyf0xx/hedgehogWrote 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.
[](https://agentmods.dev/skills/skyf0xx/hedgehog/code-comment-discipline)<a href="https://agentmods.dev/skills/skyf0xx/hedgehog/code-comment-discipline"><img src="https://agentmods.dev/badge/skills/skyf0xx/hedgehog/code-comment-discipline/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.
<a href="https://agentmods.dev/skills/skyf0xx/hedgehog/code-comment-discipline"><img src="https://agentmods.dev/badge/skills/skyf0xx/hedgehog/code-comment-discipline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00079 | $0.00486 |
| Opus 5.5 | $0.00032 | $0.00194 |
| Sonnet 5.5 | $0.00016 | $0.00097 |
| Haiku 4.5 | $0.00008 | $0.00049 |
Grade A, and why
code-comment-discipline 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 1mo 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.
What it actually says
Code Comment Discipline
Well-named identifiers and clear structure explain what code does. A comment earns its place only when it explains something the code cannot: a hidden constraint, a non-obvious invariant, a workaround for a specific external bug, or behavior that would surprise a reader.
Default: no comment
Most lines, functions, and blocks need zero comments. Before writing one, check whether the same clarity is reachable by renaming a variable or function instead — prefer that over a comment every time.
When a comment is allowed
Only for the non-obvious:
- A constraint imposed from outside the code (an API's undocumented limit, a browser quirk, a platform requirement) that isn't visible at the call site.
- An invariant the code relies on that isn't implied by types or names (e.g. "callers must hold the lock before this runs").
- A deliberate workaround for a specific bug in a dependency, with enough detail to know when it's safe to remove.
- Behavior that looks like a mistake but is intentional.
What a comment must never say
- What the code does — that's the identifier's job, not the comment's.
- Why this task needed the change, who asked for it, or which ticket, issue, or conversation prompted it.
- History: "used to be X," "changed from Y," "removed Z," "previously," "now we," or any other before/after narration. A comment states the current state and its non-obvious reason only, never how it got there.
- A restatement of the function/variable name in prose ("increments the
counter" above
counter++).
Applying to existing comments
When editing a file that already has comments violating these rules, remove or rewrite them as part of the same change rather than leaving them in place — don't let a nearby edit normalize the pattern.
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.
- 1mo ago First seen · 48 lines · 79 tokens per session scan A 23aebafc13e7
code-comment-discipline is a skill published in the GitHub repository skyf0xx/hedgehog (46 stars, last pushed yesterday), licensed MIT. It adds 79 tokens to every session and 486 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-09-16.
Other skills, from other repositories
codex-cross-review
Use when the user wants Codex to review Claude's work, cross-validate PRs, or run high-volume PR review with dual-model verification using the codex-plugin-cc plugin.
confidence-based-strictness
Use when the complexity or unfamiliarity of a task should increase guardrail enforcement. Scales verification depth based on how confident the system is in the correctness of the generated code.
code-complexity
Enforce cyclomatic complexity limits, function/file length limits, nesting depth, parameter counts, and duplication detection. Keeps code readable and maintainable.
requesting-code-review
Invoke the code-reviewer agent with git-based commit ranges to get structured feedback on code quality, architecture compliance, and correctness.
receiving-code-review
Process code review feedback with technical verification — not performative agreement. Fix real issues, push back on incorrect feedback with evidence.
architecture-check
Validate module boundaries, check for architectural drift, and suggest fitness function tests. Compares actual code structure against ARCHITECTURE.md.