pegregenerate417/claude-rules
Build project-specific coding rules for AI assistants with base, language, and framework layers to keep generated code clean and consistent
Platform-specific configuration:
{
"mcpServers": {
"claude-rules": {
"command": "npx",
"args": [
"-y",
"claude-rules"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
[](LICENSE) [](https://github.com/lifedever/claude-rules/stargazers) [](https://github.com/lifedever/claude-rules/pulls) [](https://lifedever.github.io/claude-rules/)
English | 中文
Coding standards template library for AI coding assistants. Combine base + language + framework layers to generate a project-specific rules file that keeps AI-generated code clean and consistent.
AI coding assistants tend to mimic existing code style in legacy projects — including bad habits. The core principle of this library:
> Don't imitate legacy code. Refactor according to the standards.
Every rule is a concrete, actionable directive (not vague "use proper XX"), with "Bad / Good" code comparison examples.
claude-rules/
├── base/ # Universal (required)
│ ├── core.md # Core principles: legacy code attitude, quality metrics, naming, architecture
│ └── git.md # Git commit message conventions
│
├── languages/ # Pick by language
│ ├── typescript.md # No any/enum/barrel exports, as const, import type
│ ├── javascript.md # ES2022+, JSDoc type annotations, ESM only
│ ├── java.md # Java 17+ record/sealed/pattern matching, Optional
│ ├── kotlin.md # Null safety, structured concurrency, sealed class
│ ├── swift.md # guard let, async/await, actor, Protocol
│ ├── python.md # ruff, type annotations, Protocol, uv/poetry
│ ├── html.md # Semantic tags, accessibility, no div soup
│ ├── css.md # Custom properties, Flexbox/Grid, BEM, modern features
│ ├── go.md # Error Loading reviews...