Melech Smart Comments logo

Melech Smart Comments

Community
AdirD
melech-smart-comments

Preserve code intent with selective comments and protect meaningful existing comments.

Overview

PublisherAdirD
Repositoryagent-shell-hamelech
Skill namemelech-smart-comments
Stars
46
Forks
5
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by AdirD on GitHub. Read the source before you install it.

Installation

Install the Melech Smart Comments AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/AdirD/agent-shell-hamelech/tree/main/skills/melech-smart-comments
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AdirD/agent-shell-hamelech.git /tmp/agent-shell-hamelech
mkdir -p .claude/skills
cp -r /tmp/agent-shell-hamelech/skills/melech-smart-comments .claude/skills/melech-smart-comments
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Melech Smart Comments in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Melech Smart Comments on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Melech Smart Comments is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Frequently asked questions

What does the Melech Smart Comments AI skill do?

Preserve code intent with selective comments and protect meaningful existing comments.

Why use Melech Smart Comments on TypingMind?

Because you install it once and use it with any model. Melech Smart Comments is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Melech Smart Comments in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/AdirD/agent-shell-hamelech/tree/main/skills/melech-smart-comments. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Melech Smart Comments?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Melech Smart Comments?

As many as you like. As long as a model supports skills, you can use Melech Smart Comments with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Melech Smart Comments AI skill free?

Yes. It is published on GitHub by AdirD under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇