init-rules

A setup tool for creating or updating a CLAUDE.md file, which records coding standards for an AI coding agent. It detects the project's languages and frameworks and selects matching rules from a bundled library.

In plain words
What is it for?
Use it to initialize coding standards for projects using technologies such as TypeScript, React, Vue, Python, Java, Kotlin, Swift, HTML, or CSS.
Why use it?
It gives the agent project-specific instructions without requiring you to write every rule by hand.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lifedever/claude-rules/init-rules
Any agent
npx skills add lifedever/claude-rules --skill init-rules
Clone the repo
git clone --depth 1 https://github.com/lifedever/claude-rules

Made for: Claude Code, Codex.

Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 707 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00062 $0.00707
Opus 5 $0.00031 $0.00353
Sonnet 5 $0.00012 $0.00141
Haiku 4.5 $0.00006 $0.00071

Measured 2d ago against content hash 864781fe0c6a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

init-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/init-rules/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 73 lines · 62 tokens per session scan A 864781fe0c6a

Subscribe to this mod's changes

init-rules is a skill published in the GitHub repository lifedever/claude-rules (189 stars, last pushed 5mo ago), licensed MIT. It adds 62 tokens to every session and 707 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories