engine-comments

A guide for deciding where explanations belong in an engine's codebase: beside code as invariants, in commit messages as transitions, or in decision records as design choices.

In plain words
What is it for?
Writing or editing comments and file headers in hooks, scripts, commands, or agents, and deciding when lengthy headers should be moved.
Why use it?
It prevents comments from becoming overloaded while keeping important reasoning available where future maintainers need it.

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/ignaciomarin402/spec-flow-plugin/engine-comments
Any agent
npx skills add IgnacioMarin402/spec-flow-plugin --skill engine-comments
Clone the repo
git clone --depth 1 https://github.com/IgnacioMarin402/spec-flow-plugin

Made for: Claude Code, Codex.

Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,422 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.00074 $0.01422
Opus 5 $0.00037 $0.00711
Sonnet 5 $0.00015 $0.00284
Haiku 4.5 $0.00007 $0.00142

Measured 2d ago against content hash 779defbf39ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

engine-comments 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 2d 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.

.claude/skills/engine-comments/SKILL.md · 140 lines

How it starts

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

Where reasoning goes in this engine

This engine's comments are unusually dense, and that density was earned: the defects this project exists to close are the ones where a check looks armed and is not, and the only thing standing between a future edit and that failure is an explanation sitting where the edit happens.

It also went too far. At the time this was written the engine's files ran around 50% comment, and spec-trace.mjs had 61 lines before its first import. The cause was not "too many comments" — it was three different kinds of reasoning all defaulting to the same place.

Before writing a comment, decide which of the three you are writing.


1. Invariant — why this line must be this way

Read exactly when someone is about to undo it. This is the kind that earns co-location: whoever changes the line has already opened the file, and no separate document reaches them at that moment.

Write it when the code would look arbitrary — or look improvable — to a competent reader who does not know what it is defending against.

// AFTER the phase guard: this hook fires on every subagent spawn in every
// repository the user opens, so a check ahead of the guard would deny agents
// that have nothing to do with this engine.

Keep it to what the reader needs to not break it. An invariant does not need the story of how it was discovered.

Stays in the code. Always.


2. Transition — what the code used to be, and why it changed

// This used to match `it(...)` call shapes, which meant a pytest proof read
// as absent...

This is a commit message that leaked into the source. Git already holds it, with the diff attached, and unlike a comment it cannot drift from what actually happened.

Goes in the commit message. See CLAUDE.md for the three commands that recover it — git log -S, git log -L, git blame -L.

The test: would this sentence read as history to someone who never saw the old version? If yes, it belongs in the commit.

Read the full file on GitHub · 140 lines

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. 2d ago First seen · 140 lines · 74 tokens per session scan A 779defbf39ab

Subscribe to this mod's changes

engine-comments is a skill published in the GitHub repository IgnacioMarin402/spec-flow-plugin (2 stars, last pushed 2d ago), licensed MIT. It adds 74 tokens to every session and 1,422 once invoked, about $0.0004 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

lat-dispatch

You MUST use this when the user mentions lat, loop, loopagentteams, dispatch, or when brainstorming skill is loaded. Also use for multi-agent spec/plan/test workflows.

ouob-tw/LoopAgentTeams · 40 tokens

lat-code

Execute one approved code-phase task from .lat/workspace/ /tasks.yaml as the codeexecutor, persist its result and lifecycle status without deleting history, then exit. Use when the prompt contains lat-code or names a LAT TASKID ledger with a codeexecutor agentid. Typically launched by lat-dispatch.

ouob-tw/LoopAgentTeams · 66 tokens

three-tier-testing

Use when setting up test infrastructure, adding tests, reorganizing test directories, or reviewing test structure. Triggers include creating test files, discussing test strategy, separating unit from integration tests, or when tests need external services like databases or Docker.

ouob-tw/LoopAgentTeams · 52 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

gsd-audit-milestone

Audit milestone completion against original intent before archiving.

open-gsd/gsd-core · 17 tokens

spec-kitty-charter-doctrine

Run charter interview, generation, context, and sync workflows for project governance in Spec Kitty 3.x. Access doctrine artifacts programmatically via DoctrineService. Resolve agent profiles. Load action-scoped governance context iteratively, not all at once. Triggers: "interview for charter", "generate charter"…

Priivacy-ai/spec-kitty · 135 tokens