xiaohongshu
xiaohongshu
cleanup
This skill should be used when the user asks to "clean up the code", "remove unnecessary comments", "simplify docstrings", "parameterize tests", or wants to review and clean up code.
Full skill instructions
Review and clean up code, removing unwanted patterns and improving test structure.
Remove explanatory comments that state the obvious or describe what code does line-by-line. Remove comments that:
Keep comments that:
Example - Before:
# Get the user from the database
user = db.get_user(user_id)
# Check if user exists
if user is None:
# Raise an error if user not found
raise UserNotFoundError(user_id)
# Return the user's email address
return user.email
Example - After:
user = db.get_user(user_id)
if user is None:
raise UserNotFoundError(user_id)
return user.email
Remove verbose docstrings that repeat parameter names and types already visible in type annotations, or describe obvious behavior. Clean up docstrings by:
Example - Before:
def get_user_email(user_id: int) -> str:
"""
Get the email address for a user.
This function retrieves the email address associated with the given user ID
from the database.
Args:
user_id: The unique identifier of the user whose email should be retrieved.
Returns:
The email address of the user as a string.
Raises:
UserNotFoundError: If no user exists with the given ID.
"""
user = db.get_user(user_id)
if user is None:
raise UserNotFoundError(user_id)
return user.email
Example - After:
def get_user_email(user_id: int) -> str:
"""Raises UserNotFoundError if user doesn't exist."""
user = db.get_user(user_id)
if user is None:
raise UserNotFoundError(user_id)
return user.email
Or if the function name and signature are completely self-explanatory:
def get_user_email(user_id: int) -> str:
user = db.get_user(user_id)
if user is None:
raise UserNotFoundError(user_id)
return user.email
Consolidate separate test functions that should be parameterized. Look for:
Consolidate using @pytest.mark.parametrize:
Example - Before:
def test_validate_email_valid():
assert validate_email("[email protected]") is True
def test_validate_email_valid_with_subdomain():
assert validate_email("[email protected]") is True
def test_validate_email_invalid_no_at():
assert validate_email("userexample.com") is False
def test_validate_email_invalid_no_domain():
assert validate_email("user@") is False
def test_validate_email_invalid_empty():
assert validate_email("") is False
Example - After:
@pytest.mark.parametrize(
("email", "expected"),
[
("[email protected]", True),
("[email protected]", True),
("userexample.com", False),
("user@", False),
("", False),
],
)
def test_validate_email(email: str, expected: bool):
assert validate_email(email) is expected
When NOT to parameterize:
.get() calls with defaults that hide bugsxiaohongshu
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