lean-comments
यह क्या करती है
यह टूल प्रोग्राम के कोड को साफ और आसानी से समझने लायक रखने में मदद करता है। यह जांचता है कि कोड में लिखी कमेंट सच में ज़रूरी हैं या नहीं, और क्या वे 'क्यों' को समझाती हैं, न कि सिर्फ़ वही बताती हैं जो कोड पहले से कह रहा है।
कब इस्तेमाल करें
- ✓कोड में नई कमेंट जोड़ते समय।
- ✓मौजूदा कमेंट की समीक्षा करते समय, ताकि पक्का हो कि वे उपयोगी हैं।
- ✓जब कोड उलझा हुआ हो और उसे साफ समझाने की ज़रूरत हो।
Skill का लिंक
https://github.com/github/awesome-copilot/blob/main/skills/lean-comments/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस कोड स्निपेट की कमेंट देखो और पक्का करो कि वे ज़रूरी हैं और 'क्यों' समझाती हैं।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
टूल यह सोचकर काम करता है कि अगर कमेंट न हो तो क्या एक अनुभवी प्रोग्रामर को कोई ज़रूरी जानकारी खो देगी। यह उन कमेंट को हटाने को प्राथमिकता देता है जो सिर्फ़ कोड को दोहराती हैं या जो साफ तौर पर बेमतलब हैं।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Lean Comments
Goal
Keep the smallest amount of high-value commentary necessary to make a codebase easier and safer to understand and maintain.
The default is no comment.
A comment must preserve meaningful information that a competent maintainer cannot reasonably recover from the code, names, types, signatures, structure, tests, configuration, or nearby context.
Comments are not labels, narration, decoration, declaration summaries, change logs, or substitutes for clear code.
Reader model
Write for a competent maintainer reading the repository at HEAD months later, without access to the current conversation, prompt, diff, pull request, issue discussion, review discussion, or implementation process.
Document the durable state, contract, constraint, or rationale of the code as it exists. Do not assume the reader knows what changed, what came before, or what was discussed unless that context is deliberately preserved in a reliable project source.
Authority and evidence
Use this skill as the comment-policy authority when it is active.
Use language, framework, library, or infrastructure skills to determine whether a non-obvious constraint is real, not to override this skill's necessity test.
Honor explicit current repository requirements, public API documentation requirements, tooling contracts, and generated-source rules. Do not infer a documentation requirement merely from existing comment density or precedent.
Base retained or newly written rationale on evidence from the repository, tests, configuration, official API behavior, project documentation, issue tracker, ADRs, specifications, or another reliable source.
Never invent a security reason, performance reason, business rule, compatibility requirement, API constraint, historical reason, architectural rationale, or external limitation to justify commentary.
If no supported non-obvious reason exists, remove or omit it.
Core decision rule
Before retaining or adding ordinary commentary, mentally remove it and ask:
Would a competent maintainer lose meaningful, non-obvious information if this comment did not exist?
If no, remove or omit it.
If uncertain, prefer no comment unless repository evidence demonstrates that the information matters.
If yes, retain only the minimum information necessary.
Never preserve a comment merely because it is correct, harmless, already present, grammatically polished, written as a warning, related to security or validation, related to internal or public state, or attached to an exported declaration.
The information itself must justify the comment.
Decision order
Evaluate existing and proposed commentary in this order:
- Delete or omit if the information is already clear without it
- Express through code if a tiny behavior-preserving readability improvement removes the need for it
- Shorten if it is necessary but contains unnecessary information or words
- Rewrite if it is necessary but unclear, inaccurate, stale, awkward, or inconsistent
- Use declaration documentation if the information belongs to the declaration's contract, semantics, or intended usage
- Keep unchanged only if it is already necessary, minimal, accurate, durable, and correctly styled
Always decide necessity before wording.
Do not polish an unnecessary comment or convert one into documentation.
What deserves an implementation comment
Use an implementation comment when it preserves non-obvious information such as:
- Why intentionally surprising code exists
- An external constraint or compatibility requirement
- An important invariant or subtle edge case
- A meaningful tradeoff or required workaround
- Non-obvious coupling
- An ordering, timing, lifecycle, concurrency, performance, or security constraint
- A reason an apparently simpler implementation would be incorrect
Prefer comments that explain why something matters.
Comments that merely explain what the code does should normally be removed.
Remove low-value commentary
Remove comments that merely:
- Restate or translate the code into prose
- Narrate the next statement or obvious control flow
- Explain an obvious guard clause, return, assignment, or branch
- Describe an obvious fetch, validation, transformation, mapping, filtering, creation, update, or deletion
- Repeat a declaration name, property name, type, signature, parameter, or return type
- Label or summarize a declaration
…
अक्सर पूछे जाने वाले सवाल
'सोर्स कोड' क्या है?
यह वह टेक्स्ट है जो प्रोग्रामर लिखते हैं और जो कंप्यूटर को बताता है कि उसे क्या करना है। इसे आप एक केक की रेसिपी जैसा समझ सकते हैं।
कोड में 'कमेंट' क्या होते हैं?
ये कोड के अंदर लिखे नोट्स हैं जिनसे प्रोग्रामर मुश्किल हिस्से या किसी फैसले की वजह समझाते हैं। कंप्यूटर इन्हें अनदेखा कर देता है।
अच्छी कमेंट क्यों ज़रूरी हैं?
अच्छी कमेंट दूसरे प्रोग्रामर्स (या भविष्य में खुद आपको) को कोड जल्दी समझने में मदद करती हैं, जिससे उसे संभालना और गलतियां ठीक करना आसान होता है।
जानकारी
लेखक का मूल विवरण
Audits, writes, and refines maintained first-party source-code comments and declaration-level documentation across languages. Use when adding, editing, reviewing, cleaning up, or auditing comments, doc comments, docstrings, TODO, FIXME, NOTE, suppressions, or other source commentary, including while modifying code and deciding whether a comment is warranted at all. Defaults to no comment unless it
repo: github/awesome-copilot
लोकप्रियता
- GitHub स्टार
- 40k
- रैंकिंग में स्थान
- #7268
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
acquire-codebase-knowledge
40kआपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।
acreadiness-assess
40kआपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।
acreadiness-generate-instructions
40kआपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।
acreadiness-policy
40kआपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।
मिलती-जुलती skills
technical-documentation
394kयह आपके एजेंट को साफ़ तकनीकी डॉक्स और एजेंट निर्देश फ़ाइलें लिखने और जांचने में मदद करती है, ताकि लोग और AI टूल उन्हें आसानी से समझ सकें।
architecture-decision-records
280kयह आपके एजेंट को project structure से जुड़े ज़रूरी फैसलों को दर्ज करने देता है। इससे पता चलता है कि कोई चुनाव क्यों किया गया, और बदलावों का साफ़ इतिहास बना रहता है।
code-tour
280kआपके एजेंट को exact file और line references के साथ step-by-step code walkthrough बनाने देता है। intro, explanations और reviews के लिए उपयोगी है।