comment-generator
Skill3 starsChanged 11 months agoApache-2.0View on GitHub
Generate meaningful code comments. Use when the user needs to add comments explaining complex logic, document intent, or improve code readability.
In this repository100 other files it gives its agents.
- accessibility-checkerSkill
- analytics-trackerSkill
- api-contract-testerSkill
- api-documentation-generatorSkill
- api-rate-limiterSkill
- appstore-screenshot-resizerSkill
- architecture-documenterSkill
- authentication-implementerSkill
- aws-resource-provisionerSkill
- browser-extension-builderSkill
- caching-implementerSkill
- changelog-generatorSkill
- chart-generatorSkill
- ci-pipeline-debuggerSkill
- cli-tool-builderSkill
- code-documenterSkill
- code-explainerSkill
- code-migration-helperSkill
- code-refactorerSkill
- code-reviewerSkill
- color-palette-generatorSkill
- contributing-guide-writerSkill
- cron-job-schedulerSkill
- css-animatorSkill
- csv-processorSkill
- data-aggregatorSkill
- database-backup-restoreSkill
- database-migration-generatorSkill
- database-query-optimizerSkill
- data-transformerSkill
- data-validatorSkill
- date-time-helperSkill
- debug-helperSkill
- dependency-updaterSkill
- dependency-vulnerability-checkerSkill
- discord-bot-builderSkill
- docker-compose-builderSkill
- dockerfile-generatorSkill
- e2e-test-builderSkill
- email-template-builderSkill
- env-setupSkill
- error-handlerSkill
- error-message-writerSkill
- error-response-handlerSkill
- etl-pipeline-builderSkill
- file-organizerSkill
- form-builderSkill
- git-commit-messageSkill
- github-actions-builderSkill
- gitignore-generatorSkill
- graphql-schema-builderSkill
- icon-system-builderSkill
- input-validatorSkill
- integration-test-builderSkill
- jsdoc-generatorSkill
- json-schema-generatorSkill
- kubernetes-manifest-generatorSkill
- license-chooserSkill
- linter-fixerSkill
- load-testerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Write meaningful, maintainable code comments.
- Distinctive: line 97
Keep comments updated with code
- Distinctive: line 98
Use descriptive variable names instead of comments
- Distinctive: line 99
Document edge cases and assumptions
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Comment Generator
Write meaningful, maintainable code comments.
Comment Types
File Header
/**
* @fileoverview User authentication service handling login, logout,
* and session management.
*
* @module services/auth
* @requires jsonwebtoken
* @requires bcrypt
*
* @author Development Team
* @since 1.0.0
*/Function Comment
/**
* Validate user credentials and return authentication tokens.
*
* This function checks the provided credentials against the database,
* generates JWT tokens if valid, and records the login attempt.
*
* @param {string} email - User's email address
* @param {string} password - Plain text password to verify
* @returns {Promise<{accessToken: string, refreshToken: string}>}
* @throws {AuthenticationError} If credentials are invalid
*/
async function login(email, password) {}Inline Comments (When Needed)
function calculateDiscount(price, user) {
// Apply loyalty discount for users with 5+ years membership
const loyaltyYears = calculateMembershipYears(user.joinDate);
const loyaltyDiscount = loyaltyYears >= 5 ? 0.1 : 0;
// Stack promotions but cap at 30% max discount
const totalDiscount = Math.min(
loyaltyDiscount + user.promoDiscount,
0.3 // Business rule: max 30% discount
);
return price * (1 - totalDiscount);
}TODO Comments
// TODO: Implement rate limiting before production release
// TODO(john): Refactor this to use the new authentication service
// FIXME: Memory leak when processing large files - see issue #123
// HACK: Temporary workaround for API bug, remove after v2.0 release
// NOTE: This algorithm assumes sorted inputWhen to Comment
| Situation | Comment? | Example |
| Complex algorithm | Yes | Explain the approach |
| Business rules | Yes | Document the "why" |
| Workarounds | Yes | Explain the reason |
| Self-evident code | No | i++; // increment i |
| Public API | Yes | Document usage |
When NOT to Comment
// Bad: States the obvious
// Set user name to the name parameter
user.name = name;
// Bad: Outdated comment
// Calculate tax at 5%
const tax = amount * 0.1; // Actually 10%!
// Good: Let code speak for itself
const isEligibleForDiscount = user.purchaseCount > 10 && user.isActive;Best Practices
- Explain why, not what
- Keep comments updated with code
- Use descriptive variable names instead of comments
- Document edge cases and assumptions
- Link to external resources (specs, tickets) when relevant
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

