sun-lab-style

Apply Sun Lab Python coding conventions when writing, reviewing, or refactoring code. Covers docstrings, type annotations, naming conventions, error handling, Numba functions, and formatting standards.

⭐2stars🔀1forks📁View on GitHub🕐Updated Jan 10, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill automates the enforcement of the Sun Lab Style Guide across the entire development lifecycle. It ensures high-quality, consistent output by applying specific conventions to Python source code, documentation, git commit messages, and AI skill configurations, focusing on readability, type safety, and professional standards.

Use Cases

  • Code Refactoring: Automatically updating legacy Python scripts to include Google-style docstrings, mandatory type annotations, and compliant naming conventions.
  • Automated Code Review: Auditing pull requests or existing files to ensure they meet the 120-character line limit and specific error-handling patterns using ataraxis_base_utilities.
  • Documentation Standardization: Creating or rewriting README.md files and Claude skill metadata to maintain a consistent third-person professional voice and specific formatting structures.
  • Git Workflow Compliance: Formatting git commit messages to start with past-tense verbs and adhere to strict character limits for better version control history.
  • Numba Optimization: Ensuring Numba-decorated functions follow specific formatting and documentation standards for high-performance computing tasks.
nameapplying-sun-lab-style
description>-

Sun Lab Style Guide

Applies Sun Lab coding and documentation conventions.

You MUST read the appropriate style guide and apply its conventions when writing or modifying any code, documentation, commits, or skills. You MUST verify your changes against the style guide's checklist before submitting.


Workflow Selection

Determine what you're modifying and read the appropriate guide:

Task Action
Writing Python code? Read PYTHON_STYLE.md
Writing README? Read README_STYLE.md
Writing commit message? Read COMMIT_STYLE.md
Writing skill file? Read SKILL_STYLE.md

After reading the appropriate guide:

  1. Apply all conventions from that guide
  2. Verify against the guide's checklist before submitting

Style Guides

Guide Use When
PYTHON_STYLE.md Writing Python code (docstrings, type annotations, naming, error handling)
README_STYLE.md Creating or updating README files
COMMIT_STYLE.md Writing git commit messages
SKILL_STYLE.md Creating Claude skills or YAML configuration files

Quick Reference

Python Code (includes docstrings and inline comments)

  • Docstrings: Google-style with Args, Returns, Raises, Notes, Attributes sections
  • Prose Over Lists: Use prose in all documentation; bullet lists are forbidden in docstrings
  • Inline Comments: Third person imperative, above the code, explain non-obvious logic
  • Naming: Full words (position not pos), private members _underscore
  • Type Annotations: All parameters and returns; always specify dtype for arrays
  • Error Handling: Use console.error() from ataraxis_base_utilities
  • Line Length: Maximum 120 characters

Commit Messages

  • Start with past tense verb: Added, Fixed, Updated, Refactored, Removed
  • Header line ≤ 72 characters
  • End with a period

README Files

  • Third-person voice throughout
  • Present tense as default

Skills & Templates

  • SKILL.md frontmatter: name (gerund form), description (third person)
  • Line length ≤ 120 characters