melech-smart-comments
Preserve code intent with selective comments and protect meaningful existing comments.
Skill by AdirD
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/adird-melech-smart-comments
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/melech-smart-comments
What's inside
- Skill name
melech-smart-comments- Description
- Preserve code intent with selective comments and protect meaningful existing comments.
- License
- MIT
- Instructions
- 103 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Smart Comments
You are often the first reader of this code. You do not carry the scar tissue a human teammate would — you did not live through the incident that caused a function to look the way it does, and you cannot smell the landmine from the shape of the code alone.
Comments are the spec layer closest to the code. They are the last thing a model reads before producing the next token, and they are the cheapest, highest-signal way for a human to hand you constraints, warnings, and intent. Treat them accordingly.
This skill governs how you write new comments and how you treat existing ones.
## When to Write a Comment
Write an inline comment when one of these is true. Otherwise do not.
1. **Landmines.** Code that looks wrong, redundant, or removable but is not. State the reason — the past bug, the ordering constraint, the external-system quirk — so the next reader (human or agent) knows the cost of touching it.
2. **Non-obvious WHY.** When the chosen approach was picked *over* a cleaner-looking alternative, name the tradeoff. "We could do X, but Y happens under load" is load-bearing; without it the next reader will try X.
3. **Hidden invariants and contracts.** Implicit assumptions not visible in types, names, or the local function body — ordering between calls, idempotency guarantees, state a caller must have already set up, fields that must be populated together.
4. **Workarounds.** Bugs in external systems, race conditions, temporary version pins, polyfills, hacks waiting on an upstream fix. Link or name the issue if one exists.
## When NOT to Write a Comment
Do not write a comment when:
- It narrates WHAT the code does and the identifiers already say it. `// increment counter` above `counter++` is noise.
- It refers to the current task, ticket, PR, author, or review round. Those belong in the commit message or PR description. They rot in the code.
- It is a banner, section divider, or restatement of the function signature.
- It describes intent the code itself will carry forward reliably through refactors — if a rename makes the comment wrong, the comment was redundant.
If the WHY is obvious from the name of the function and its arguments, the comment is not paying for its space.
## How to Write Them
- **Inline.** Directly above or beside the line they protect. Not at the top of the file, not in external docs, not in a commit message.
- **Short.** Lead with the constraint or the warning. No wind-up.
- **Imperative where it matters.** Prefer "Do not reorder — must run before X" over "This runs before X."
- **Name the cost.** "Removing this early-return reopens the N+1 we fixed" beats "important early return."
- **Close the reasoning gap.** Give enough of the causal chain for an unfamiliar reader to answer: what change would violate this, and what would break? Labels such as "race," "security issue," or "data leak" are not explanations by themselves.
- **Stay near three lines, not at their expense.** Use the shortest comment that preserves the reason. If that takes substantially more, make the code express more of the constraint.
## Respecting Existing Comments
This section is the reason this skill exists.
- **Treat every existing comment as load-bearing until proven otherwise.** Someone — human or past agent — paid a cost to leave it there. Assume that cost was real.
- **Do not delete a comment during a refactor** unless the code the comment describes is also being removed. Moving code does not justify dropping its comment.
- **"Looks redundant" is not sufficient justification** for removal. The comment may be the only surviving trace of a past incident that the code itself no longer advertises.
- **If a comment looks stale or wrong**, flag it in your response to the user. Do not silently fix or remove it. The user is the only one who can confirm whether the comment still reflects reality.
- **Never rewrite a comment just to change voice or tone.** If it reads as a warning, keep it as a warning.
## Calibration Examples
Bad — narrates what the code already says:
```python
# Increment the retry counter
retries += 1
```
Good — names the landmine:
```python
# Do not switch to exponential backoff here; upstream rate-limits on burst, not on average.
retries += 1
```
Bad — rots on the next refactor:
```ts
// Added in PR #4821 by @alice to handle the new billing webhook
if (event.type === "invoice.paid") { ... }
```
Good — preserves the WHY:
```ts
// Stripe fires invoice.paid before invoice.finalized for auto-advancing subs; handle both orderings.
if (event.type === "invoice.paid") { ... }
```
Bad — decorative, adds no signal:
```go
// ---------- Helpers ----------
```
Good — encodes a hidden contract:
```go
// Caller must hold s.mu. Returns the unwrapped value; safe only until the next Set().
func (s *state) peek() T { ... }
```
Bad — labels the failure without explaining it:
```ts
// Keep this order to avoid a race.
await save(job);
await publish(job);
```
Good — gives the minimum reason needed to preserve the order:
```ts
// Persist before publishing: a worker may consume immediately and must find the job.
await save(job);
await publish(job);
```
## Summary
Code shows movement. Comments preserve memory. You are the reader that will most often decide whether that memory survives the next edit. When in doubt, leave the comment, and ask the human whether it should go.From AdirD/agent-shell-hamelech, MIT.
More from AdirD/agent-shell-hamelech
- 0.662score
melech-handoff
AdirD
List and continue coding-agent transcripts across Cursor, Claude Code, Codex, Gemini, and other local agents.
SkillAFreshness: A★ 45Claude Code +9 - 0.662score
melech-cost
AdirD
Show what coding-agent sessions cost for every worktree of the current repo — Cursor, Claude Code, and Codex — as handoff-style cards with dollars and tokens.
SkillAFreshness: A★ 45Claude Code +9 - 0.662score
melech-plan-review
AdirD
Review a solution before approving it, like a GitHub changes tab: a file tree of red and green pseudo-code the user can comment on inline, then answer…
SkillAFreshness: A★ 45Claude Code +9 - 0.662score
melech-live-browser
AdirD
Operate the user's already-open, logged-in Chrome tabs through Chrome DevTools MCP.
SkillAFreshness: A★ 45Claude Code +9 - 0.659score
melech-debug-mode
AdirD
Debug or verify a local UI end to end in the user's existing Chrome tab, with temporary runtime probes and a manual browser fallback.
SkillAFreshness: A★ 45Claude Code +9 - 0.659score
melech-tidy
AdirD
Adaptive diff reduction — prune dead code residue, shake prompt bloat, remove cosmetic diff noise, and propose edge-case trades that drop rare-case handling…
SkillAFreshness: A★ 45Claude Code +9 - 0.656score
melech-pr-gardener
AdirD
Tend one explicit GitHub author's open PRs and keep them green — one stateless pass per scheduled run.
SkillAFreshness: A★ 45Claude Code +9 - 0.651score
melech-8020
AdirD
Find the smallest useful path to a product or engineering outcome.
SkillAFreshness: A★ 45Claude Code +9 - 0.622score
melech-roi
AdirD
Grade whether a change's complexity and blast radius are actually worth the benefit it delivers, using an itemized ROI receipt and rankings among solutions…
SkillBFreshness: B★ 45Claude Code +9 - 0.619score
melech-make-it-click
AdirD
Recover when the agent's explanation did not land by finding the smallest thing blocking understanding and replacing the failed mental model with a concrete…
SkillBFreshness: B★ 45Claude Code +9 - 0.617score
melech-consult
AdirD
Get an independent verdict on an AI-proposed plan, fix, architecture, or claim by verifying its premises against the real artifact, then dispatching a panel…
SkillBFreshness: B★ 45Claude Code +9 - 0.616score
melech-buy-vs-build
AdirD
Decide whether to adopt an existing tool or build a capability yourself, grounded in verified research.
SkillBFreshness: B★ 45Claude Code +9
Signals
- Stars
- 45
- Forks
- 5
- Open issues
- 0
- Last commit (this folder)
- Sep 28, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/AdirD/agent-shell-hamelech
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from AdirD
- 0.662score
melech-cost
AdirD
Show what coding-agent sessions cost for every worktree of the current repo — Cursor, Claude Code, and Codex — as handoff-style cards with dollars and tokens.
SkillAFreshness: A★ 45Claude Code +9 - 0.662score
melech-handoff
AdirD
List and continue coding-agent transcripts across Cursor, Claude Code, Codex, Gemini, and other local agents.
SkillAFreshness: A★ 45Claude Code +9 - 0.662score
melech-live-browser
AdirD
Operate the user's already-open, logged-in Chrome tabs through Chrome DevTools MCP.
SkillAFreshness: A★ 45Claude Code +9 - 0.662score
melech-plan-review
AdirD
Review a solution before approving it, like a GitHub changes tab: a file tree of red and green pseudo-code the user can comment on inline, then answer…
SkillAFreshness: A★ 45Claude Code +9 - 0.659score
melech-debug-mode
AdirD
Debug or verify a local UI end to end in the user's existing Chrome tab, with temporary runtime probes and a manual browser fallback.
SkillAFreshness: A★ 45Claude Code +9 - 0.659score
melech-tidy
AdirD
Adaptive diff reduction — prune dead code residue, shake prompt bloat, remove cosmetic diff noise, and propose edge-case trades that drop rare-case handling…
SkillAFreshness: A★ 45Claude Code +9
Cite this page
melech-smart-comments skill. Agent Mart. https://agentmart.dev/skills/adird-melech-smart-comments (last updated 2026-10-24)