xiaohongshu
xiaohongshu
effective-commenting-strategies
Use this skill when writing, reviewing, or maintaining code comments. Apply these strategies to ensure comments explain intent rather than repeat code, use maintainable styles, and follow density guidelines. This skill covers comment types, style best practices, and performance considerations.
Full skill instructions
Good comments explain the "why" behind code, not the "what." Use these strategies to write comments that enhance code maintainability without creating maintenance burden.
Good comments should:
Rule: If the code already explains everything, a comment that repeats it provides no value.
Purpose: Remind developers of incomplete work (not intended for production)
Requirements:
***, TBD, TODO)Action: Search for all markers before release to ensure no incomplete code ships.
Purpose: Explain complex, tricky, or sensitive code
Strategy:
Purpose: Condense several lines of code into one or two sentences
Value: More valuable than code-repeating comments because readers can scan them faster than reading code
When to use: Particularly helpful when non-original authors need to modify code
Purpose: Explain the purpose of a code section at the intent/problem level
Level: Operates more at the problem level than the solution level
Example:
Purpose: Record information that cannot be expressed in code
Includes:
Do not use styles that require manual alignment:
...) connecting variables and descriptions*) surrounding paragraphs—requires adjusting both sides+---+)—requires precise positioning when text length changesPrinciple: Prefer accurate comments over pretty comments. If maintaining aesthetics requires tedious work, abandon that style.
For Java and C++:
// syntax, keep comments short/* ... */ syntax—easier to maintain than manually wrapped // linesFor emphasis: Use standard-length lines (via editor macros), not lines that vary with comment length
IBM Research Finding: Approximately 1 comment per 10 statements maximizes code clarity
Do not enforce rigid standards like "at least 1 comment per 5 lines"
Reason: This addresses the symptom (lack of comments) without solving the root cause (unclear code)
Principle: Do not avoid comments due to performance concerns (e.g., interpreted environments, network transmission overhead)
Solution: Create a separate release build
Implementation: Run a tool during the build process to automatically strip comments from the production version
When using the Pseudocode Programming Process:
Conclusion: If comments explain "why" and meet quality standards, the quantity is adequate—don't worry about the number.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience