Language Guides¶
Language-specific rules and best practices that auto-load based on the files you're working with.
Overview¶
When you work on a file, AI automatically loads the appropriate language guide:
Core Languages¶
| Language | Extensions | Guide |
|---|---|---|
| TypeScript | .ts, .tsx, .js, .jsx | typescript.md |
| Python | .py | python.md |
| Go | .go | go.md |
| Rust | .rs | rust.md |
| Kotlin | .kt, .kts | kotlin.md |
Enterprise Languages¶
| Language | Extensions | Guide |
|---|---|---|
| Java | .java | java.md |
| C# | .cs | csharp.md |
| PHP | .php | php.md |
| Swift | .swift | swift.md |
| C/C++ | .c, .cpp, .h, .hpp | cpp.md |
| Ruby | .rb | ruby.md |
Specialized Domains¶
| Language | Extensions | Guide |
|---|---|---|
| SQL | .sql | sql.md |
| Shell/Bash | .sh, .bash | shell.md |
| R | .r, .R | r.md |
| Dart | .dart | dart.md |
| HTML/CSS | .html, .css, .scss | html-css.md |
| Lua | .lua | lua.md |
| Assembly | .asm, .s | assembly.md |
| CUDA | .cu, .cuh | cuda.md |
| Solidity | .sol | solidity.md |
| Zig | .zig | zig.md |
No manual selection needed - it just works!
What's in a Language Guide?¶
Each guide contains:
- Core Principles - Language philosophy
- Language-Specific Guardrails - Rules beyond the universal ones
- Validation & Input Handling - Recommended libraries
- Testing - Frameworks and patterns
- Tooling - Linters, formatters, configs
- Common Pitfalls - What to avoid
- Framework Patterns - React, Django, Rails, Spring, etc.
- Performance Considerations - Language-specific optimizations
- Security Best Practices - Language-specific security
Quick Comparison¶
Type Safety¶
| Language | Approach |
|---|---|
| TypeScript | Strict mode, no any, explicit types |
| Python | Type hints + mypy strict mode |
| Go | Built-in static types |
| Rust | Built-in static types, ownership |
| Kotlin | Null safety, smart casts |
| Java | Strong static typing, Optional |
| C# | Nullable reference types, strong typing |
| Swift | Optionals, strong static typing |
| C/C++ | Static types, no null safety (use smart pointers) |
Validation Libraries¶
| Language | Recommended |
|---|---|
| TypeScript | Zod |
| Python | Pydantic |
| Go | go-playground/validator |
| Rust | serde + custom validators |
| Kotlin | kotlinx.serialization + init blocks |
| Java | Bean Validation (JSR-380) |
| C# | FluentValidation |
| PHP | Laravel Validation, Symfony Validator |
| Ruby | ActiveModel::Validations |
Testing Frameworks¶
| Language | Recommended |
|---|---|
| TypeScript | Vitest or Jest |
| Python | pytest |
| Go | built-in testing |
| Rust | built-in testing |
| Kotlin | Kotest + MockK |
| Java | JUnit 5 + Mockito |
| C# | xUnit + Moq |
| PHP | PHPUnit or Pest |
| Ruby | RSpec |
| Swift | XCTest |
| C/C++ | GoogleTest |
Linting/Formatting¶
| Language | Format | Lint |
|---|---|---|
| TypeScript | Prettier | ESLint |
| Python | Black | Ruff |
| Go | gofmt | golangci-lint |
| Rust | rustfmt | Clippy |
| Kotlin | ktlint | detekt |
| Java | google-java-format | Checkstyle, SpotBugs |
| C# | dotnet format | Roslyn Analyzers |
| PHP | PHP-CS-Fixer | PHPStan |
| Ruby | RuboCop | RuboCop |
| Swift | SwiftFormat | SwiftLint |
| C/C++ | clang-format | clang-tidy |
Universal vs Language-Specific¶
Universal (from CLAUDE.md)¶
These apply to ALL languages:
✓ Functions ≤50 lines
✓ Files ≤300 lines
✓ All inputs validated
✓ Tests >80% for business logic
✓ Conventional commits
Language-Specific (from guides)¶
These are language-specific additions:
All Language Guides¶
Core Languages¶
-
TypeScript
TypeScript, JavaScript, React, Node.js, Next.js, Vue, Angular.
-
Python
Python 3.9+, Django, FastAPI, Flask, Data Science.
-
Go
Go 1.20+, Microservices, APIs, CLIs.
-
Rust
Rust 1.70+, Systems Programming, WebAssembly, CLIs.
-
Kotlin
Kotlin 1.9+, Android, Spring Boot, Ktor, Multiplatform.
Enterprise Languages¶
-
Java
Java 17+, Spring Boot, Jakarta EE, Microservices.
-
:simple-csharp:{ .lg .middle } C#
C# 11+, .NET 7+, ASP.NET Core, Unity, MAUI.
-
PHP
PHP 8.1+, Laravel, Symfony, WordPress.
-
Swift
Swift 5.9+, iOS, macOS, SwiftUI, Server-Side Swift.
-
C/C++
C17/C23, C++17/20/23, Systems Programming, Embedded.
-
Ruby
Ruby 3.0+, Rails 7+, Sinatra, RSpec.
Specialized Domains¶
-
SQL
PostgreSQL, MySQL, SQLite, SQL Server, Query Optimization.
-
Shell/Bash
Bash 4+, POSIX sh, Zsh, CI/CD Pipelines, Automation.
-
R
R 4.0+, Tidyverse, Shiny, Statistical Computing.
-
Dart
Dart 3.0+, Flutter, Mobile Development.
-
HTML/CSS
HTML5, CSS3, Sass/SCSS, Accessibility, Responsive Design.
-
Lua
Lua 5.4+, Love2D, Neovim, Game Development.
-
Assembly
x86-64, ARM64, RISC-V, OS Development.
-
CUDA
CUDA 11+, GPU Computing, Deep Learning, Scientific Computing.
-
Solidity
Solidity 0.8+, Ethereum, Smart Contracts, DeFi.
-
Zig
Zig 0.11+, Systems Programming, C Interop, Game Development.
Contributing a Language Guide¶
Want to contribute a guide for a language not yet covered?
- Copy an existing guide as a template
- Adapt the sections for your language
- Add to
.claude/skills/<language>-guide/ANDdocs/languages/ - Update
mkdocs.ymlnavigation - Update this index
- Submit a pull request
Template structure:
# [Language] Guide
> **Applies to**: [Language version]+, [frameworks]
## Core Principles
## Language-Specific Guardrails
## Validation & Input Handling
## Testing
## Tooling
## Common Pitfalls
## Framework-Specific Patterns
## Performance Considerations
## Security Best Practices
## References
My Language Isn't Listed¶
The core guardrails in CLAUDE.md are language-agnostic. 90% of the rules still apply:
- Functions ≤50 lines ✓
- Files ≤300 lines ✓
- Input validation ✓
- Parameterized queries ✓
- Test coverage >80% ✓
- Conventional commits ✓
You can still use the system effectively without a language-specific guide!
Consider contributing a guide for your language to help others.