Skip to content
Back to search

claude-rules

SkillWorks with Claude CodeGitHub

Coding standards for AI coding assistants. Auto-detect tech stack, generate project rules. Works with Claude Code, Cursor, Antigravity, GitHub Copilot.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/lifedever--claude-rules/badge.svg)](/listings/lifedever--claude-rules)

HTML

<a href="/listings/lifedever--claude-rules"><img src="/api/listings/lifedever--claude-rules/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

# Step 1: Add the marketplace
claude plugin marketplace add lifedever/claude-rules

# Step 2: Install the plugin
claude plugin install init-claude-rules@claude-rules

# Step 3: Restart Claude Code

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 23 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "claude-rules",
  3. "owner": {
  4. "name": "lifedever"
  5. },
  6. "metadata": {
  7. "description": "Coding standards template library for AI coding assistants. Auto-detect tech stack and generate project-specific rules.",
  8. "version": "1.0.0"
  9. },
  10. "plugins": [
  11. {
  12. "name": "init-claude-rules",
  13. "source": "./",
  14. "description": "Initialize or update CLAUDE.md coding standards for any project by auto-detecting tech stack and assembling rules from the claude-rules template library. Use when user says 'init rules', 'generate CLAUDE.md', or wants to set up coding standards.",
  15. "version": "1.0.0",
  16. "author": {
  17. "name": "lifedever"
  18. },
  19. "category": "development",
  20. "strict": false
  21. }
  22. ]
  23. }
README.md · README · 159 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Claude Rules
  2. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
  3. [![GitHub stars](https://img.shields.io/github/stars/lifedever/claude-rules)](https://github.com/lifedever/claude-rules/stargazers)
  4. [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/lifedever/claude-rules/pulls)
  5. [![Website](https://img.shields.io/badge/Website-claude--rules-orange)](https://lifedever.github.io/claude-rules/)
  6. English | [中文](README_CN.md)
  7. 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.
  8. ## The Problem
  9. AI coding assistants tend to mimic existing code style in legacy projects — including bad habits. The core principle of this library:
  10. > **Don't imitate legacy code. Refactor according to the standards.**
  11. Every rule is a concrete, actionable directive (not vague "use proper XX"), with "Bad / Good" code comparison examples.
  12. ## Directory Structure
  13. ```
  14. claude-rules/
  15. ├── base/ # Universal (required)
  16. │ ├── core.md # Core principles: legacy code attitude, quality metrics, naming, architecture
  17. │ └── git.md # Git commit message conventions
  18. │
  19. ├── languages/ # Pick by language
  20. │ ├── typescript.md # No any/enum/barrel exports, as const, import type
  21. │ ├── javascript.md # ES2022+, JSDoc type annotations, ESM only
  22. │ ├── java.md # Java 17+ record/sealed/pattern matching, Optional
  23. │ ├── kotlin.md # Null safety, structured concurrency, sealed class
  24. │ ├── swift.md # guard let, async/await, actor, Protocol
  25. │ ├── python.md # ruff, type annotations, Protocol, uv/poetry
  26. │ ├── html.md # Semantic tags, accessibility, no div soup
  27. │ ├── css.md # Custom properties, Flexbox/Grid, BEM, modern features
  28. │ ├── go.md # Error wrapping, small interfaces, structured concurrency
  29. │ └── rust.md # Ownership/borrowing, thiserror/anyhow, iterators, Clippy
  30. │
  31. └── frameworks/ # Pick by framework
  32. ├── vue.md # script setup, ref vs reactive, composable patterns
  33. ├── react.md # Hooks rules, correct useEffect, state layering
  34. ├── swiftui.md # @Observable (not legacy ObservableObject), SwiftData
  35. ├── springboot.md # Layered architecture, DTO, global exception handling
  36. └── tauri.md # Command design, service encapsulation, security config
  37. ```
  38. ## Three-Layer Architecture
  39. ```
  40. ┌─────────────────────────────────────────────┐
  41. │ base (required) │ core.md + git.md
  42. │ Legacy code attitude / Quality metrics / │ Applies to all projects
  43. │ Naming / Architecture │
  44. ├─────────────────────────────────────────────┤
  45. │ language (pick) │ typescript.md / java.md / ...
  46. │ Type system / Naming conventions / │ Based on project language
  47. │ Language-specific features │
  48. ├─────────────────────────────────────────────┤
  49. │ framework (pick) │ vue.md / react.md / ...
  50. │ Component standards / State management / │ Based on project framework
  51. │ Architecture patterns │
  52. └─────────────────────────────────────────────┘
  53. ```
  54. **Rule priority**: framework > language > base (specific rules override general rules)
  55. ## Usage
  56. ### Claude Code Plugin (Recommended)
  57. #### Install
  58. ```bash
  59. # Step 1: Add the marketplace
  60. claude plugin marketplace add lifedever/claude-rules
  61. # Step 2: Install the plugin
  62. claude plugin install init-claude-rules@claude-rules
  63. # Step 3: Restart Claude Code
  64. ```
  65. #### Use
  66. Open any project in Claude Code and run:
  67. ```
  68. /init-rules
  69. ```
  70. The plugin will:
  71. 1. Auto-detect your project's tech stack (TypeScript, Vue, React, etc.)
  72. 2. Ask you to confirm the detected stack
  73. 3. Read the matching rule files from the plugin
  74. 4. Generate `CLAUDE.md` in your project root
  75. #### Update
  76. When new rules are added upstream, update the local cache:
  77. ```bash
  78. claude plugin marketplace update claude-rules
  79. ```
  80. Then restart Claude Code. To apply updated rules to a project that already has `CLAUDE.md`, run `/init-rules` again — the plugin will ask before overwriting.
  81. #### Uninstall
  82. ```bash
  83. claude plugin uninstall init-claude-rules@claude-rules
  84. claude plugin marketplace remove claude-rules
  85. ```
  86. ### Manual Usage
  87. Clone this repo and concatenate the rule files you need:
  88. ```bash
  89. git clone https://github.com/lifedever/claude-rules.git
  90. cd claude-rules
  91. # Example: Vue 3 + TypeScript project
  92. cat base/core.md base/git.md languages/typescript.md frameworks/vue.md > /path/to/project/CLAUDE.md
  93. ```
  94. The rules are plain Markdown and work with any AI coding tool. Just place the output where your tool expects:
  95. | Tool | Target File |
  96. |------|-------------|
  97. | Claude Code | `CLAUDE.md` |
  98. | Cursor | `.cursorrules` or `.cursor/rules/*.mdc` |
  99. | Antigravity | `.antigravity/rules.md` |
  100. | GitHub Copilot | `.github/copilot-instructions.md` |
  101. ## Design Principles
  102. 1. **Actionable** — Every rule is directly executable by AI, no vague wording
  103. 2. **Exemplified** — Key rules include "Bad" and "Good" code comparisons
  104. 3. **Quantified** — Functions ≤30 lines, files ≤300 lines, nesting ≤3 levels, parameters ≤4
  105. 4. **Up-to-date** — Uses modern APIs for each language/framework (@Observable, record, as const, etc.)
  106. 5. **Not hollow** — Instead of "handle errors properly", specifies exactly how to handle them
  107. ## Contributing
  108. PRs for new languages or frameworks are welcome. Please follow these guidelines:
  109. - Rules must be concrete and actionable — no "use appropriate/proper" phrasing
  110. - Key rules should include code examples (bad practice + good practice)
  111. - Recommend modern idioms — don't document outdated APIs
  112. - Write in English
  113. ## References
  114. - [flyeric0212/cursor-rules](https://github.com/flyeric0212/cursor-rules) — Cursor IDE rules template library
  115. ## License
  116. [MIT](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.