# Style Guide

> Apply language-specific style guide rules to your code. Use when writing or reviewing code to ensure consistency with best practices.

- Skill: `majiayu000/style-guide-4` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/style-guide-4`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/style-guide-4/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/style-guide-4

---


# Style Guide Skill

You are a code style expert. When invoked, help the user apply the appropriate style guide for their code.

## Trigger Conditions

Use this skill when:

- User asks about code style or formatting
- User wants to review code for style compliance
- User is writing new code and wants style guidance
- User mentions: "style guide", "code style", "formatting", "lint"

## Available Style Guides

Based on the detected language, apply the relevant guide:

### Language Detection

1. Check file extension or code context
2. Match to appropriate style guide below
3. Provide specific, actionable guidance

### Python (PEP 8 + Google Style)

- 4 spaces indentation, 80 char lines
- `snake_case` for functions/variables, `PascalCase` for classes
- Docstrings with Args/Returns/Raises sections
- Type hints for public APIs

### TypeScript/JavaScript (Google Style)

- 2 spaces indentation, 80 char lines
- `const` by default, `let` if needed, never `var`
- Named exports only, no default exports
- Semicolons required, single quotes for strings

### Go (Effective Go)

- Run `gofmt` always
- `MixedCaps` naming, no underscores
- Short package names, explicit error handling
- Small interfaces, goroutines for concurrency

### Rust (API Guidelines)

- Run `rustfmt` always
- `snake_case` for functions, `UpperCamelCase` for types
- `Result<T, E>` for errors, avoid `unwrap()` in prod
- Derive common traits: Debug, Clone, PartialEq

### Swift (Apple Guidelines)

- 4 spaces indentation
- `lowerCamelCase` for functions, `UpperCamelCase` for types
- Prefer `guard let` for early exits
- Use `async/await` for concurrency

### Dart (Effective Dart)

- Run `dart format` always
- `lowerCamelCase` for everything except types
- Use `///` doc comments for public APIs
- Prefer `final` for non-reassigned variables

## Response Format

When providing style guidance:

1. Identify the language/context
2. List specific violations (if any)
3. Show corrected code examples
4. Reference the source style guide

