Init rules
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.From its SKILL.md
npx -y skills add lifedever/claude-rules --skill init-rulesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- runs commandsInstructs the agent to run 1 command, including `claude plugin marketplace update claude-rules`.
SKILL.md
2.6 KB, 637 tokens by cl100k_base, as published. Nobody here has run it
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:
${CLAUDE_SKILL_DIR}/base/core.md${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:
<!-- Generated by init-claude-rules | https://github.com/lifedever/claude-rules -->- Empty line
- Content of
base/core.md - Content of
base/git.md - Each detected language file
- 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-rulesto get latest rules
What ships with it: 17 files
55.4 KB alongside SKILL.md
frameworks/
- react.md3.1 KB
- springboot.md3.0 KB
- swiftui.md3.7 KB
- tauri.md1.9 KB
- vue.md3.7 KB
languages/
- css.md2.8 KB
- go.md6.5 KB
- html.md1.9 KB
- java.md3.7 KB
- javascript.md2.1 KB
- kotlin.md3.4 KB
- python.md2.1 KB
- rust.md7.8 KB
- swift.md3.0 KB
- typescript.md2.6 KB
Gives 0 of the 12 instructions most project setup skills give in 637 tokens
Counted across 1,553 of the 3,091 authors here whose files we hold, read 2026-09-06
- Write the configuration filein 36 of 1553
- Create the directory structurein 35 of 1553, across 33 files
- Verify the setupin 31 of 1553, across 28 files
- Run the setup scriptin 30 of 1553, across 29 files
- Pre-determine the required sample sizein 29 of 1553, across 12 files
- Check if the configuration already existsin 29 of 1553
- Document every testin 26 of 1553, across 10 files
- Start with a hypothesisin 26 of 1553, across 11 files
- Ask one question at a timein 22 of 1553
- Test a single variable per testin 21 of 1553, across 9 files
- Read product marketing context before asking questionsin 19 of 1553, across 8 files
- Do not peek and stop earlyin 18 of 1553, across 7 files
Said here and by no other author read
- Scan the working directory for tech stack signals
- Ask user to confirm or adjust detection results
- Read rule files from the bundled directory
- Concatenate fetched content in the exact order
- Write assembled rules to CLAUDE.md
- List included rule files and total line count
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.