jyjeanne/ai-setup-forge/code-comments-best-practices

Claude Code and agent skill by jyjeanne/ai-setup-forge

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Guidance and best practices for code comments best practices.

Install

npx vskill@latest install jyjeanne/ai-setup-forge/code-comments-best-practices

SKILL.md

The same SKILL.md was published earlier as jyjeanne/ai-setup-forge/code-comments-best-practices.

Code Comments Best Practices

Procedure

1. Self-Documenting Code

Prioritize clean code over comments.

typescript
// BAD: Comment explaining a cryptic name
const d = 86400; // seconds in a day
// GOOD: Name explains itself
const SECONDS_IN_A_DAY = 86400;
2. Using JSDoc/TSDoc

Use structured comments for public APIs, functions, and classes to enable IDE intellisense.

typescript
/**
* Calculates the discounted price of a product.
* @param price - The original price in cents.
* @param discount - The discount percentage (0-100).
* @returns The final price in cents.
* @throws {Error} If discount is outside the valid range.
*/
function calculateDiscount(price: number, discount: number): number {
if (discount < 0 || discount > 100) throw new Error('Invalid discount');
return price * (1 - discount / 100);
}
3. Explaining the "Why"

Use comments to explain complex logic, hacks, or business requirements that aren't obvious.

typescript
// We use a retry limit of 3 because the external API
// occasionally fails with a 503 error due to rate limiting.
const RETRY_LIMIT = 3;
// HACK: This timeout is necessary to wait for the legacy
// animation library to finish its internal state update.
setTimeout(() => {
renderUI();
}, 100);
4. TODOs and FIXMEs

Mark incomplete or problematic areas clearly.

typescript
// TODO: Refactor this to use the new PricingService once it's ready.
// FIXME: This logic fails when the user has multiple active subscriptions.

Constraints

  • No Redundancy: Avoid // This is a user class above class User.
  • Delete Dead Code: Don't comment out code; let Git handle the history.
  • Stay Up to Date: A misleading comment is worse than no comment. Update comments when the code changes.

Expected Output

A codebase where comments provide valuable context and intent, rather than cluttering the logic.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jyjeanne/ai-setup-forge/code-comments-best-practices/badge)](https://verified-skill.com/skills/jyjeanne/ai-setup-forge/code-comments-best-practices)

Something wrong with this skill or its page? Tell us.