Skip to content
Back to skills

Init Rules

ASecurity

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", "初始化规范", "生成 CLAUDE.md", or wants to set up coding standards.

  • 666 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 2, 2026
developmentjavascripttypescriptpythonrustgojavaswiftkotlinreactvue

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add majiayu000/claude-skill-registry --skill init-rules --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Init Rules?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Init Rules
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-init-rules-claude-skill-registry/badge)](https://www.skillsdirectory.com/skills/majiayu000-init-rules-claude-skill-registry)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: init-rules
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", "初始化规范", "生成 CLAUDE.md", or wants to set up coding standards.
---

# Init Claude Rules

IMPORTANT: You MUST read rule files from this skill's bundled files. Do NOT generate rules from your own knowledge.

Rule files are bundled in this skill's directory. Use `${CLAUDE_SKILL_DIR}` to reference them.

## Workflow

### Step 1: Detect Tech Stack

Scan the current working directory to identify languages and frameworks:

| Signal | Rule File |
|--------|-----------|
| `tsconfig.json` or `*.ts` files | `languages/typescript.md` |
| `package.json` with `"vue"` dependency | `frameworks/vue.md` |
| `package.json` with `"react"` dependency | `frameworks/react.md` |
| `src-tauri/` directory | `frameworks/tauri.md` |
| `*.js` files without `tsconfig.json` | `languages/javascript.md` |
| `*.java` files or `pom.xml` | `languages/java.md` |
| `build.gradle.kts` or `*.kt` files | `languages/kotlin.md` |
| `pom.xml`/`build.gradle` with `spring-boot` | `frameworks/springboot.md` |
| `Package.swift` or `*.swift` files | `languages/swift.md` |
| Swift files with `import SwiftUI` | `frameworks/swiftui.md` |
| `pyproject.toml` or `requirements.txt` | `languages/python.md` |
| `*.html` files | `languages/html.md` |
| `*.css`/`*.scss` files | `languages/css.md` |
| `go.mod` or `*.go` files | `languages/go.md` |
| `Cargo.toml` or `*.rs` files | `languages/rust.md` |

Present detection results and ask user to confirm or adjust before proceeding.

### Step 2: Read Rule Files

Read files from this skill's bundled directory using the Read tool.

Always read:
1. `${CLAUDE_SKILL_DIR}/base/core.md`
2. `${CLAUDE_SKILL_DIR}/base/git.md`

Then read each detected language and framework file, e.g.:
- `${CLAUDE_SKILL_DIR}/languages/typescript.md`
- `${CLAUDE_SKILL_DIR}/frameworks/vue.md`

### Step 3: Assemble & Write CLAUDE.md

Concatenate ALL fetched content in this exact order:

1. `<!-- Generated by init-claude-rules | https://github.com/lifedever/claude-rules -->`
2. Empty line
3. Content of `base/core.md`
4. Content of `base/git.md`
5. Each detected language file
6. Each detected framework file

Write to `CLAUDE.md` in the current working directory.

If CLAUDE.md already exists, warn user and ask before overwriting.

### Step 4: Report

- List included rule files
- Total line count
- Remind user to run `claude plugin marketplace update claude-rules` to get latest rules

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.