スキル一覧に戻る
dewittn

code-styling

by dewittn

0🍴 0📅 2026年1月25日
GitHubで見るManusで実行

SKILL.md


name: code-styling description: Apply consistent coding style patterns when writing or reviewing code. Use when generating new code that should follow your established preferences. Works with any language. Complements linters (which handle formatting) with higher-level style decisions.

Code Styling Profile

Apply these coding style preferences when writing new code or suggesting improvements. This skill captures style decisions that linters don't enforce.

How to Use This Skill

This skill is a template. To make it useful:

  1. Create a separate project for style assessment
  2. Have Claude analyze your existing code to identify patterns
  3. Review and refine the extracted patterns
  4. Replace the placeholders below with your actual preferences

Core Principles (All Languages)

Control Flow

  • Prefer early returns over nested if/else
  • Use guard clauses at function top
  • Flat over nested (max nesting depth: ___)

Functions

  • Small focused functions over large multi-purpose ones
  • Maximum function length: ___ lines
  • Prefer pure functions where practical

Naming

  • Explicit over implicit
  • Abbreviations: (never / common only / freely)
  • Boolean prefix: (is/has/should / none / varies)

Error Handling

  • Fail fast with clear errors
  • Return errors vs throw exceptions: ___
  • Error message style: ___

Comments

  • Explain why, not what
  • Comment density: (minimal / moderate / thorough)
  • TODO format: ___

Language-Specific Patterns

Shell/Bash

# Function style preference:
# [ ] function name() { }
# [ ] name() { }

# Variable style:
# [ ] ${var} always
# [ ] $var when simple

# Error handling:
# [ ] set -euo pipefail
# [ ] explicit checks

# Example pattern (replace with your own):

Lua (Neovim)

-- Module style:
-- [ ] local M = {} ... return M
-- [ ] return { ... }

-- Require style:
-- [ ] local mod = require("mod")
-- [ ] Top of file / lazy as needed

-- Example pattern (replace with your own):

TypeScript/JavaScript

// Import organization:
// 1. ___
// 2. ___
// 3. ___

// Async preference:
// [ ] async/await
// [ ] .then() chains
// [ ] mixed based on context

// Type definitions:
// [ ] interface (default)
// [ ] type (default)
// [ ] depends on ___

// Example pattern (replace with your own):

Python

# Import organization:
# 1. ___
# 2. ___
# 3. ___

# Type hints:
# [ ] Always
# [ ] Public APIs only
# [ ] Minimal

# String formatting:
# [ ] f-strings
# [ ] .format()
# [ ] % formatting

# Example pattern (replace with your own):

Go

// Error handling:
// [ ] if err != nil { return err }
// [ ] wrapped errors with context
// [ ] sentinel errors

// Struct initialization:
// [ ] Named fields always
// [ ] Positional for small structs

// Example pattern (replace with your own):

Anti-Patterns (Code Smells You Dislike)

List patterns you want Claude to avoid:





Assessment Process

To populate this file with your actual preferences:

Step 1: Gather Examples

Collect 5-10 files that represent your best code across languages you use.

Step 2: Run Assessment

In a new Claude conversation:

I want to document my coding style preferences. Please analyze these files
and identify patterns in:
- Control flow (early returns, nesting, guard clauses)
- Function structure (size, naming, purity)
- Error handling
- Comments and documentation
- Language-specific idioms

[paste or attach files]

Step 3: Refine

Review Claude's analysis. Correct anything that doesn't match your intent. Add patterns Claude missed.

Step 4: Update This File

Replace the placeholders above with your documented preferences.

Step 5: Test

Try using the skill on a new coding task. Refine based on results.


Integration Notes

This skill complements:

  • pre-commit-reviewer - Catches violations of these patterns
  • code-simplifier - Uses these patterns when refactoring
  • Linters - Handle formatting; this handles style

When conflicts occur, explicit project standards (CLAUDE.md, linter configs) take precedence over this skill.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です