mcpbeat Sign in

Comment Quality Skill for Claude

Review and fix temporal references in code comments.

20k tokens
context cost
the whole folder, loaded on every use
9
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
413
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/notque/vexjoy-agent --skill comment-quality

The instruction itself

13 sections, as written by the author

Comment Quality Skill

Review code comments for temporal references, development-activity language, and relative comparisons. Produces structured reports with actionable rewrites that explain WHAT the code does and WHY, only WHAT the code does and WHY. Supports .go, .py, .js, .ts, .md, and .txt files.

Instructions

Phase 1: SCAN

Goal: Identify all comments containing temporal, activity, or relative language.

Step 1: Determine scope

Read the repository CLAUDE.md first to pick up any project-specific comment conventions.

Scan only what was requested. If user specifies files, scan those files. If user specifies a directory, scan that directory. Honor the explicit scope -- even if you suspect other files have issues, honor the explicit scope and suggest expansion separately at the end.

If user explicitly requests auto-fix, enable it. Otherwise present findings for review. For large codebases, group findings by directory when reporting.

Step 2: Search for temporal patterns

Flag every instance of the following categories. No temporal word is "harmless" -- all temporal language ages poorly and must be rewritten regardless of how innocuous it seems:

  • Temporal words: "new", "old", "previous", "current", "now", "recently", "latest", "modern"
  • Development activity: "added", "removed", "deleted", "updated", "changed", "modified", "fixed", "improved", "enhanced", "refactored", "optimized"
  • State transitions: "replaced", "migrated", "upgraded", "deprecated", "became", "turned into", "evolved"
  • Date references: "as of", "since", "from", "after", "before"
  • Relative comparisons: "better than", "faster than", "instead of", "unlike the previous"

Step 3: Filter false positives

Exclude from findings -- these are not developer comments and must remain untouched:

  • Copyright and license headers (legal requirements, not code comments)
  • @generated markers (tooling markers)
  • @deprecated annotations (keep the tag, flag only temporal explanation text after it)
  • Variable names or string literals that happen to contain temporal words
  • TODO/FIXME items that describe future work without temporal references

When a finding appears, inspect nearby comments in the same function or block -- temporal language tends to cluster.

Gate: All files in scope scanned. Findings list populated with file path, line number, and matched text. Every finding listed, not just the first few. Proceed only when gate passes.

Phase 2: ANALYZE

Goal: Understand context for each finding to produce meaningful rewrites.

Step 1: Read surrounding code

For each finding, read the function, block, or section the comment describes. Understand what the code actually does. A rewrite without code context produces vague replacements that strip temporal words without adding substance.

Step 2: Classify the comment

| Finding | Type | Severity |
|---------|------|----------|
| "now uses JWT" | Temporal + Activity | High |
| "improved perf" | Activity | Medium |
| "Copyright 2024" | Legal (skip) | N/A |

Step 3: Determine replacement content

For each comment, identify:

  • What does the code do right now?
  • Why does it do it this way?
  • What value does the comment add for a future reader?

Gate: Every finding classified with context understood. Proceed only when gate passes.

Phase 3: REWRITE

Goal: Generate specific, valuable replacement comments.

Step 1: Draft rewrites

For each finding, produce a structured entry with file path, line number, current text, suggested replacement, and reasoning:

**File: `path/to/file.ext`**

Line X - [Comment type]:
  Current:   // Authentication now uses JWT tokens
  Suggested: // Authenticates requests using signed JWT tokens
  Reason:    "now uses" is temporal - describe current behavior only

Step 2: Validate rewrite quality

Each rewrite MUST pass these checks:

  • [ ] Would this comment make sense in 10 years?
  • [ ] Does it explain WHAT or WHY, not WHEN?
  • [ ] Is it more specific than what it replaces (not just temporal word removed)?
  • [ ] Does it add value for a future maintainer?

If a rewrite just removes the temporal word without adding substance, it fails validation. Simply deleting a word produces a useless comment -- // Updated error handling becoming // Error handling adds nothing. Rewrite with specific, descriptive content: // Handles database connection errors with exponential backoff retry.

Gate: All rewrites pass quality checks. No vague or empty replacements. Proceed only when gate passes.

Phase 4: REPORT

Goal: Deliver structured, actionable report.

Step 1: Generate report

Report facts concisely with file paths and line numbers. Every finding must include the current text, suggested replacement, and reasoning -- a diagnostic-only count without rewrites creates work without providing solutions.

## Comment Quality Review

### Summary
- Files scanned: N
- Issues found: M
- Most common pattern: [temporal word]

### Findings
[All findings with file, line, current text, suggested text, reason]

### Recommendations
1. Apply suggested changes
2. Consider adding linter rules for temporal language prevention

Step 2: Apply fixes (if auto-fix enabled)

If user requested auto-fix, apply all rewrites using Edit tool. Verify each edit succeeded. Wait for explicit user permission before auto-fixing without explicit user authorization.

Step 3: Cleanup

Remove any scan results, intermediate reports, or helper files created during execution.

Gate: Report delivered. All findings accounted for. Task complete.

Error Handling

Error: "No Temporal Language Found"

Cause: Files are clean or scope was too narrow

Solution:

  • Verify common files were scanned (README, main source files)
  • Report clean results -- this is a valid positive outcome
  • Suggest expanding scope if user suspects issues exist elsewhere

Error: "Too Many Results to Display"

Cause: Large codebase with widespread temporal language

Solution:

  • Prioritize by file importance (README first, then core modules)
  • Group findings by pattern type
  • Process files by directory with grouped reports

Error: "Comment Meaning Unclear Without History"

Cause: Comment only makes sense with development context that no longer exists

Solution:

  • Read surrounding code to infer current purpose
  • If purpose is clear from code, suggest removing the comment entirely
  • If purpose is unclear, ask user for clarification before rewriting

References

Reference Loading Table

Load on demand — only pull what the current task requires.

| Task Signal | Load |

|-------------|------|

| Go files (.go) in scope | references/go-comment-patterns.md |

| Error handling code (try/catch, if err !=, raise) | references/error-handling-patterns.md |

| Performance code (cache, pool, batch, concurrency, goroutine) | references/performance-patterns.md |

| General rewrite examples needed | references/examples.md |

| Full failure mode reference | references/preferred-patterns.md |

| Language-specific (Go, Python, JS/TS) or documentation (README, API) comments | references/preferred-patterns-language-specific.md |

Reference Files

  • ${CLAUDE_SKILL_DIR}/references/preferred-patterns.md: Core temporal failure mode catalog (language-agnostic)
  • ${CLAUDE_SKILL_DIR}/references/preferred-patterns-language-specific.md: Language-specific and documentation-targeted failure modes
  • ${CLAUDE_SKILL_DIR}/references/examples.md: Before/after examples of comment rewrites
  • ${CLAUDE_SKILL_DIR}/references/go-comment-patterns.md: Go-specific temporal patterns with grep/rg detection commands
  • ${CLAUDE_SKILL_DIR}/references/error-handling-patterns.md: Temporal patterns in error handling code with detection commands
  • ${CLAUDE_SKILL_DIR}/references/performance-patterns.md: Temporal patterns in performance-related comments with detection commands

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take notque/comment-quality from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.