refactor(rules): restructure into common + language-specific directories
* refactor(rules): restructure rules into common + language-specific directories
- Split 8 flat rule files into common/, typescript/, python/, golang/
- common/ contains language-agnostic principles (no code examples)
- typescript/ extracts TS/JS specifics (Zod, Playwright, Prettier hooks, etc.)
- python/ adds Python rules (PEP 8, pytest, black/ruff, bandit)
- golang/ adds Go rules (gofmt, table-driven tests, gosec, functional options)
- Replace deprecated ultrathink with extended thinking documentation
- Add README.md with installation guide and new-language template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix installation commands for rules
Updated installation instructions to copy all rules to a single directory.
* docs: update README.md to reflect new rules directory structure
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Hor1zonZzz <Hor1zonZzz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 21:58:06 +08:00
# Rules
## Structure
Rules are organized into a **common ** layer plus **language-specific ** directories:
```
rules/
├── common/ # Language-agnostic principles (always install)
│ ├── coding-style.md
│ ├── git-workflow.md
│ ├── testing.md
│ ├── performance.md
│ ├── patterns.md
│ ├── hooks.md
│ ├── agents.md
│ └── security.md
├── typescript/ # TypeScript/JavaScript specific
├── python/ # Python specific
└── golang/ # Go specific
```
- **common/** contains universal principles — no language-specific code examples.
- **Language directories** extend the common rules with framework-specific patterns, tools, and code examples. Each file references its common counterpart.
## Installation
2026-02-09 08:12:05 +08:00
### Option 1: Install Script (Recommended)
```bash
# Install common + one or more language-specific rule sets
./install.sh typescript
./install.sh python
./install.sh golang
# Install multiple languages at once
./install.sh typescript python
```
### Option 2: Manual Installation
> **Important:** Copy entire directories — do NOT flatten with `/*`.
> Common and language-specific directories contain files with the same names.
> Flattening them into one directory causes language-specific files to overwrite
> common rules, and breaks the relative `../common/` references used by
> language-specific files.
refactor(rules): restructure into common + language-specific directories
* refactor(rules): restructure rules into common + language-specific directories
- Split 8 flat rule files into common/, typescript/, python/, golang/
- common/ contains language-agnostic principles (no code examples)
- typescript/ extracts TS/JS specifics (Zod, Playwright, Prettier hooks, etc.)
- python/ adds Python rules (PEP 8, pytest, black/ruff, bandit)
- golang/ adds Go rules (gofmt, table-driven tests, gosec, functional options)
- Replace deprecated ultrathink with extended thinking documentation
- Add README.md with installation guide and new-language template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix installation commands for rules
Updated installation instructions to copy all rules to a single directory.
* docs: update README.md to reflect new rules directory structure
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Hor1zonZzz <Hor1zonZzz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 21:58:06 +08:00
```bash
# Install common rules (required for all projects)
2026-02-09 08:12:05 +08:00
cp -r rules/common ~/.claude/rules/common
refactor(rules): restructure into common + language-specific directories
* refactor(rules): restructure rules into common + language-specific directories
- Split 8 flat rule files into common/, typescript/, python/, golang/
- common/ contains language-agnostic principles (no code examples)
- typescript/ extracts TS/JS specifics (Zod, Playwright, Prettier hooks, etc.)
- python/ adds Python rules (PEP 8, pytest, black/ruff, bandit)
- golang/ adds Go rules (gofmt, table-driven tests, gosec, functional options)
- Replace deprecated ultrathink with extended thinking documentation
- Add README.md with installation guide and new-language template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix installation commands for rules
Updated installation instructions to copy all rules to a single directory.
* docs: update README.md to reflect new rules directory structure
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Hor1zonZzz <Hor1zonZzz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 21:58:06 +08:00
# Install language-specific rules based on your project's tech stack
2026-02-09 08:12:05 +08:00
cp -r rules/typescript ~/.claude/rules/typescript
cp -r rules/python ~/.claude/rules/python
cp -r rules/golang ~/.claude/rules/golang
refactor(rules): restructure into common + language-specific directories
* refactor(rules): restructure rules into common + language-specific directories
- Split 8 flat rule files into common/, typescript/, python/, golang/
- common/ contains language-agnostic principles (no code examples)
- typescript/ extracts TS/JS specifics (Zod, Playwright, Prettier hooks, etc.)
- python/ adds Python rules (PEP 8, pytest, black/ruff, bandit)
- golang/ adds Go rules (gofmt, table-driven tests, gosec, functional options)
- Replace deprecated ultrathink with extended thinking documentation
- Add README.md with installation guide and new-language template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix installation commands for rules
Updated installation instructions to copy all rules to a single directory.
* docs: update README.md to reflect new rules directory structure
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Hor1zonZzz <Hor1zonZzz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 21:58:06 +08:00
# Attention ! ! ! Configure according to your actual project requirements; the configuration here is for reference only.
```
## Rules vs Skills
- **Rules** define standards, conventions, and checklists that apply broadly (e.g., "80% test coverage", "no hardcoded secrets").
- **Skills** (`skills/` directory) provide deep, actionable reference material for specific tasks (e.g., `python-patterns` , `golang-testing` ).
Language-specific rule files reference relevant skills where appropriate. Rules tell you * what * to do; skills tell you * how * to do it.
## Adding a New Language
To add support for a new language (e.g., `rust/` ):
1. Create a `rules/rust/` directory
2. Add files that extend the common rules:
- `coding-style.md` — formatting tools, idioms, error handling patterns
- `testing.md` — test framework, coverage tools, test organization
- `patterns.md` — language-specific design patterns
- `hooks.md` — PostToolUse hooks for formatters, linters, type checkers
- `security.md` — secret management, security scanning tools
3. Each file should start with:
```
> This file extends [common/xxx.md](../common/xxx.md) with <Language> specific content.
```
4. Reference existing skills if available, or create new ones under `skills/` .