Use when writing code - follow Google style guides where available, otherwise follow established best practices for the language
When writing code, follow Google style guides for the language when available, otherwise follow established best practices. Use project-specific guides if they exist.
/plugin marketplace add troykelly/claude-skills/plugin install issue-driven-development@troykelly-skillsThis skill cannot use any tools. It operates in read-only mode without the ability to modify files or execute commands.
Follow established style guides. Consistency over personal preference.
Core principle: Code is read more than written. Consistent style aids reading.
Priority order:
| Principle | Description |
|---|---|
| Consistency | Match surrounding code style |
| Clarity | Prefer readable over clever |
| Simplicity | Simplest solution that works |
| Documentation | Document the why, not the what |
// Classes: PascalCase
class UserService { }
// Interfaces: PascalCase (no I prefix)
interface User { } // NOT IUser
// Functions/methods: camelCase
function fetchUserData() { }
// Variables/parameters: camelCase
const userName = 'Alice';
// Constants: UPPER_SNAKE_CASE
const MAX_RETRIES = 3;
// Private members: no underscore prefix
class Service {
private cache: Map<string, Data>; // NOT _cache
}
// Files: kebab-case
// user-service.ts, not userService.ts or UserService.ts
// Indent: 2 spaces
// Line length: 80 characters (100 max)
// Semicolons: required
// Quotes: single for strings
// Trailing commas: yes in multiline
const config = {
name: 'app',
version: '1.0.0',
features: [
'auth',
'logging',
],
};
// Order: external, then internal, then relative
// Alphabetize within groups
import { something } from 'external-lib';
import { other } from 'another-external';
import { internal } from '@/lib/internal';
import { local } from './local';
import { nearby } from '../nearby';
# Classes: PascalCase
class UserService:
pass
# Functions/variables: snake_case
def fetch_user_data():
pass
user_name = 'Alice'
# Constants: UPPER_SNAKE_CASE
MAX_RETRIES = 3
# Private: single underscore prefix
class Service:
def __init__(self):
self._cache = {} # internal use
def __private_method(self): # name mangling
pass
# Files: snake_case
# user_service.py
# Indent: 4 spaces
# Line length: 80 characters
# Use Black formatter for consistency
# Imports order (use isort):
# 1. Standard library
# 2. Third-party
# 3. Local
import os
import sys
import requests
from flask import Flask
from myapp.utils import helper
def calculate_total(items: list[Item], tax_rate: float) -> float:
"""Calculate the total price including tax.
Args:
items: List of items to sum.
tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).
Returns:
Total price including tax.
Raises:
ValueError: If tax_rate is negative.
"""
if tax_rate < 0:
raise ValueError("Tax rate cannot be negative")
subtotal = sum(item.price for item in items)
return subtotal * (1 + tax_rate)
// Exported: PascalCase
type UserService struct { }
func FetchUser() { }
// Unexported: camelCase
type internalCache struct { }
func fetchFromDB() { }
// Acronyms: consistent case
type HTTPClient struct { } // or httpClient for unexported
var userID string // NOT userId
// Files: snake_case
// user_service.go
Use gofmt - no options, no debate.
# Format all files
gofmt -w .
# Or use goimports for imports too
goimports -w .
| Language | Formatter | Linter |
|---|---|---|
| TypeScript | Prettier | ESLint |
| Python | Black | Pylint, Ruff |
| Go | gofmt | golangci-lint |
| Rust | rustfmt | clippy |
Ensure these exist in the project:
TypeScript/JavaScript:
.eslintrc.js or eslint.config.js.prettierrcPython:
pyproject.toml (Black, isort, mypy).pylintrc or ruff.tomlGo:
.golangci.yml# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: format
name: Format code
entry: pnpm format
language: system
- id: lint
name: Lint code
entry: pnpm lint
language: system
If project has established style that differs from Google:
<!-- CONTRIBUTING.md -->
## Code Style
This project uses [specific style] which differs from Google style:
- We use tabs instead of spaces
- Line length is 120 characters
- [Other differences]
Before committing:
# Run formatter
pnpm format # or black, gofmt, etc.
# Run linter
pnpm lint # or pylint, golangci-lint, etc.
# Fix auto-fixable issues
pnpm lint:fix
Before committing:
| Mistake | Correction |
|---|---|
| Inconsistent naming | Follow project conventions |
| Long lines | Break at logical points |
| Mixed quote styles | Use project standard |
| Unorganized imports | Use import sorter |
| Manual formatting | Use automated formatter |
This skill is applied by:
issue-driven-development - Step 7comprehensive-review - Style criterionThis skill ensures:
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.