Agent skill
code-conventions
코드 컨벤션, 코딩 스타일, 코드 스타일, 네이밍, 컨벤션, 타입스크립트, 파이썬, 자바, 함수 크기, 파일 크기 - Code style reference for TypeScript, Python, and Java. Provides naming rules, function/file size limits, and formatting conventions. Use when writing or reviewing code style. Do NOT use as primary skill for code reviews (use code-reviewer) or refactoring (use refactor-cleaner).
Install this agent skill to your Project
npx add-skill https://github.com/aimskr/aims-claude-toolkit/tree/main/skills/code-conventions
Metadata
Additional technical details for this skill
- author
- jaehashin
- version
- 1.2.0
SKILL.md
Code Conventions - Code Style Persona
Role
Guide how to write code:
- Maintain consistent code style
- Write readable code
- Create maintainable structure
General Principles
Early Return Pattern
Prefer early returns over nested conditions for better readability.
Size Limits
| Target | Limit | When Exceeded |
|---|---|---|
| Function/Method | 50 lines | Split |
| File/Class | 200 lines | Split into modules |
| Nesting depth | 3 levels | Apply early return |
TypeScript Conventions
Naming
| Type | Pattern | Example |
|---|---|---|
| Class/Interface/Type | PascalCase | OrderService, UserEntity |
| Function/Variable | camelCase | calculateTotal, userName |
| Constant | SCREAMING_SNAKE | MAX_RETRY_COUNT |
| File | kebab-case or camelCase | order-service.ts |
| Boolean | is/has/can prefix | isActive, hasPermission |
Best Practices
- Use arrow functions when possible
- Prefer
constoverlet, avoidvar - Always declare explicit types
- Use
interfacefor object shapes,typefor unions/intersections - Prefer
unknownoverany
Avoid
❌ utils.ts, helpers.ts, common.ts, shared.ts
Python Conventions (PEP-8)
Naming
| Type | Pattern | Example |
|---|---|---|
| Class | PascalCase | OrderService, UserEntity |
| Function/Variable | snake_case | calculate_total, user_name |
| Constant | SCREAMING_SNAKE | MAX_RETRY_COUNT |
| Module/File | snake_case | order_service.py |
| Private | leading underscore | _internal_method |
Best Practices
- Maximum line length: 79 characters (code), 72 (docstrings)
- Use 4 spaces for indentation (no tabs)
- Two blank lines between top-level definitions
- One blank line between method definitions
- Use type hints (PEP 484)
- Use docstrings for public modules, functions, classes, methods
Import Order (PEP-8)
# 1. Standard library
import os
import sys
# 2. Third-party
import requests
import numpy as np
# 3. Local application
from myapp import utils
Avoid
❌ utils.py, helpers.py, common.py, shared.py
Java Conventions
Naming
| Type | Pattern | Example |
|---|---|---|
| Class/Interface | PascalCase | OrderService, UserEntity |
| Method/Variable | camelCase | calculateTotal, userName |
| Constant | SCREAMING_SNAKE | MAX_RETRY_COUNT |
| Package | lowercase | com.example.order |
| File | Same as class name | OrderService.java |
Best Practices
- One public class per file
- Use
finalfor immutable variables - Prefer composition over inheritance
- Use interfaces for abstraction
- Follow JavaDoc conventions for documentation
- Use Optional instead of null for return values
Avoid
❌ Utils.java, Helpers.java, Common.java, Shared.java
Checklist
When Writing Code
- Is function/method under 50 lines?
- Is file/class under 200 lines?
- Is nesting under 3 levels?
- Is early return applied?
- Is naming following language conventions?
- Are types/type hints declared?
Before PR
- Consistent code style maintained
- Unnecessary comments removed
- Error handling appropriate
- Linter/formatter passed
Anti-Patterns
- Magic Numbers: Using meaningless numbers directly
- God Function/Class: Giant function/class that does everything
- Callback Hell / Nested Conditionals: Deep nesting
- Copy-Paste Code: Duplicated code
- Generic Naming: utils, helpers, common, shared, misc
Completion
레퍼런스 Skill이므로 독립적 완료 조건 없음. 다른 Skill(code-reviewer, refactor-cleaner)이 참조하여 사용.
Troubleshooting
Project uses conventions different from this skill: Project-level CLAUDE.md or .editorconfig takes precedence. This skill provides defaults when no project convention exists. Naming conflict between languages: Each language section is independent. Python uses snake_case, TypeScript uses camelCase — don't mix across language boundaries. Linter rules conflict with these conventions: Linter config is authoritative. Update this skill’s guidance in project CLAUDE.md if persistent conflicts arise.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
build-error-resolver
빌드 에러, 빌드 오류, 컴파일 에러, 빌드 실패 해결, 의존성 에러 - Specialized in resolving build errors, compilation failures, and dependency issues. Use when build fails, compilation errors occur, or dependency conflicts arise. Do NOT use for runtime bugs or logic errors (use debug-specialist instead).
brainstorming
브레인스토밍, 아이디어, 기획, 구상, 아이디어회의, 설계, 요구사항 분석, 접근법 탐색 - Use before creating new features or significant changes to explore user intent, requirements, and design options. Collaborative brainstorming through step-by-step questioning. Do NOT use for simple bug fixes, config changes, or tasks with clear requirements already defined.
doc-coauthoring
문서 작성, 문서화, 문서, 스펙 작성, 기술 문서, 제안서, RFC, 설계 문서, 의사결정 문서 - Collaborative document co-authoring through 3 stages: context gathering, iterative refinement, and reader testing. Use when writing docs, proposals, tech specs, decision docs, or RFCs. Do NOT use for PRD/product requirements (use prd-strategist) or implementation plans (use writing-plans).
testing-strategy
테스트 전략, 테스팅 계획, QA 전략, 품질 보증, 테스트 피라미드, 테스트 시나리오, 커버리지 목표 - Designs test strategies including test pyramid ratios, scenario categories, and coverage targets. Use when planning how to test a feature, designing QA approach, or creating test plans. Do NOT use for TDD implementation (use tdd-workflow) or E2E test execution (use e2e-runner).
learning-research
학습 리서치, 학습 자료, 공부 자료, 학습, 공부, 스터디, 개념 정리, 이해 - 특정 주제를 깊이 이해하기 위한 학습 자료를 수집·정리한다. 병렬 전문가 서브에이전트로 개념, 원리, 실습, 심화 자료를 수집하고 이해도별로 체계화된 학습 노트를 생성한다. Obsidian vault에 자동 저장. 의사결정용 자료 조사는 research 스킬을, 시장조사는 market-research 스킬을 사용할 것.
devil-advocate
Didn't find tool you were looking for?