comment-code
Use whenever you write or edit comments or doc comments in code (Dart especially): inline comments on executing code and documentation on declarations…
Skill by FMorschel
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/fmorschel-comment-code
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
Use cases: documents, writing
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. 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/comment-code
What's inside
- Skill name
comment-code- Description
- Use whenever you write or edit comments or doc comments in code (Dart especially): inline comments on executing code and documentation on declarations (functions, methods, constructors, fields, getters, setters). Inline comments explain why, never what; declaration docs follow a fixed shape and prefer comment references.
- License
- MIT
- Instructions
- 81 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
## Commenting code
Two kinds of comments, two different jobs. Decide which one you are writing first.
### Inline comments (on executing code)
Explain **why** the code is there: the constraint, the surprising behavior, the bug it works around, the reason this approach was chosen over the obvious one. The code already says *what* it does; a comment that restates it is noise and gets stale.
Never write:
```dart
// Prints foo
print(foo);
```
Write a comment only when a reader would otherwise ask "why?":
```dart
// The server rejects empty batches, so skip the call instead of sending one.
if (items.isEmpty) return;
```
If you can't state a *why*, don't comment. Prefer renaming or extracting code over explaining unclear code with a comment.
### Declaration comments (doc comments)
Use `///` doc comments.
**Functions, methods, constructors**
- The first paragraph is a **single phrase/sentence** saying what it does.
- Following paragraphs add context: when to use it, edge cases, side effects, throws, examples.
- Explain complex parameters (and only those) by referencing them with `[param]`.
- Add a short example when usage isn't obvious.
```dart
/// Splits [text] into chunks that fit within [maxLength].
///
/// Breaks happen at whitespace when possible; a word longer than
/// [maxLength] is split mid-word rather than dropped. If [keepDelimiters]
/// is `true`, the whitespace stays attached to the end of each chunk.
List<String> chunk(String text, {required int maxLength, bool keepDelimiters = false})
```
**Getters, fields, setters**
- Explain what the value **means for the class**, not its type or how it is stored.
- For a setter, mention any separate side effects (notifies listeners, invalidates a cache, triggers a rebuild) when they're worth knowing. Skip this if there are none.
```dart
/// Whether the user has confirmed the order and it can no longer be edited.
bool get isLocked => _lockedAt != null;
```
### Always prefer comment references
Use `[name]` references instead of plain-text or backticked names whenever the target is a symbol that resolves in scope: parameters, other members, classes, enum values, top-level functions. Use `[Class.member]` or `[Class.new]` for constructors when needed. References make the docs navigable and let the analyzer flag them when the symbol is renamed or removed. Backticks are for code that isn't a resolvable symbol (literals like `null`, `true`, snippets).
### Multi-line TODOs
When a TODO spans more than one line, every line after the first must start with **two spaces** between `//` and the text. This is how the analyzer knows the continuation belongs to the TODO.
```dart
// TODO(FMorschel): bla bla
// bla bla.
```
Without the extra space, the second line is treated as an ordinary comment and is dropped from the TODO.
### Don't
- Don't restate the signature, the name, or the types in prose.
- Don't add section-divider or banner comments.
- Don't leave commented-out code.
- Don't write TODOs without something actionable, or continuation lines without the two-space indent.
### After editing
For Dart, follow the post-edit workflow from the global instructions: `dart fix --apply`, `dart analyze` (unresolved comment references show up here, fix them), then `dart format` on each edited file.From FMorschel/agents, MIT.
More from FMorschel/agents
- 0.570score
layered-architecture
FMorschel
Use when designing, placing, implementing, or reviewing Dart/Flutter code against the default layered architecture (View → Controller → Service → Repository →…
SkillAFreshness: AClaude Code +9 - 0.565score
dart-edit-protocol
FMorschel
Use after editing any `.dart` file, before reporting the edit as done: the fix → format → analyze → test loop, MCP-first tool preference, Dart MCP…
SkillAFreshness: AClaude Code +9 - 0.565score
edit-dart-class
FMorschel
Use whenever you add, move, or edit members of a Dart class (constructors, fields, methods, getters/setters, operators, toString) or change constructor/method…
SkillAFreshness: AClaude Code +9 - 0.565score
compose-commits
FMorschel
Use when splitting a completed piece of work into commits for a human reviewer: grouping by logical concern (pipeline stages by default), hunk-level splitting…
SkillAFreshness: AClaude Code +9 - 0.565score
design-dart-class
FMorschel
Use when creating a Dart class or deciding how to shape it: primary constructors (Dart 3.13+), field vs.
SkillAFreshness: AClaude Code +9 - 0.565score
flutter-conventions
FMorschel
Use whenever you write, edit or review Flutter widget code: `State` classes (caching `.of(context)` lookups in didChangeDependencies, fixed lifecycle override…
SkillAFreshness: AClaude Code +9 - 0.565score
hunt-bug
FMorschel
Use when the user reports something broken, a failing case, a crash, a stack trace or unexpected behavior and wants the cause found or fixed ("why does X…
SkillAFreshness: AClaude Code +9 - 0.565score
place-project-knowledge
FMorschel
Use whenever you are about to write knowledge down — a rule or preference for agents, a procedure, a fact about a project, a requirement or plan — and must…
SkillAFreshness: AClaude Code +9 - 0.565score
pr-review
FMorschel
Reviews GitHub Pull Requests or local Git branch diffs for defects, removed behavior, and specification drift using a 13-angle rubric and adversarial noise…
SkillAFreshness: AClaude Code +9 - 0.565score
minimum-viable-change
FMorschel
Use whenever you define, plan, implement, test or review a change in this pipeline: the Minimum Viable Change (MVC) is the smallest diff that makes the…
SkillAFreshness: AClaude Code +9 - 0.561score
new-dart-project
FMorschel
Use whenever the user asks to create, scaffold, or set up a new Dart or Flutter project (e.g.
SkillAFreshness: AClaude Code +9 - 0.561score
find-dtd-uri
FMorschel
Use whenever you need a Dart Tooling Daemon (DTD) URI, e.g.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 25, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/FMorschel/agents
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from FMorschel
- 0.570score
layered-architecture
FMorschel
Use when designing, placing, implementing, or reviewing Dart/Flutter code against the default layered architecture (View → Controller → Service → Repository →…
SkillAFreshness: AClaude Code +9 - 0.565score
edit-dart-class
FMorschel
Use whenever you add, move, or edit members of a Dart class (constructors, fields, methods, getters/setters, operators, toString) or change constructor/method…
SkillAFreshness: AClaude Code +9 - 0.565score
design-dart-class
FMorschel
Use when creating a Dart class or deciding how to shape it: primary constructors (Dart 3.13+), field vs.
SkillAFreshness: AClaude Code +9 - 0.565score
compose-commits
FMorschel
Use when splitting a completed piece of work into commits for a human reviewer: grouping by logical concern (pipeline stages by default), hunk-level splitting…
SkillAFreshness: AClaude Code +9 - 0.565score
flutter-conventions
FMorschel
Use whenever you write, edit or review Flutter widget code: `State` classes (caching `.of(context)` lookups in didChangeDependencies, fixed lifecycle override…
SkillAFreshness: AClaude Code +9 - 0.565score
hunt-bug
FMorschel
Use when the user reports something broken, a failing case, a crash, a stack trace or unexpected behavior and wants the cause found or fixed ("why does X…
SkillAFreshness: AClaude Code +9
Cite this page
comment-code skill. Agent Mart. https://agentmart.dev/skills/fmorschel-comment-code (last updated 2026-10-24)