Skip to content
Apothem
Contoh

Rule kustom

Menulis sebuah rule selalu-aktif kustom untuk proyek Anda.

Contoh ini menambahkan rule selalu-aktif khusus proyek yang menegakkan konvensi penamaan di seluruh berkas.

Berkas rule

---
name: "kebab-filenames"
description: "Enforce kebab-case filenames in the src/ tree"
pathFilter: ""
alwaysApply: true
---

# Kebab-case filenames

All new files created under `src/` MUST use kebab-case naming
(lowercase letters, digits, and hyphens only — no underscores,
no camelCase, no PascalCase).

**Correct:** `src/styles/button-group.css`, `src/components/nav-bar.css`
**Incorrect:** `src/styles/buttonGroup.css`, `src/components/NavBar.css`

When in doubt, err on the side of more hyphens.

Simpan ini ke rules/kebab-filenames.md di dalam akar instalasi harness Anda (~/.claude/ untuk adapter Claude Code; ganti dengan jalur native harness jika tidak).

Verifikasi bahwa rule valid

Jalankan validator frontmatter terhadap berkas rule yang baru saja Anda tulis. Gunakan perintah pertama dari checkout Apothem, tempat PYTHONPATH=src membuat paket dapat diimpor. Gunakan perintah kedua setelah pemasangan skrip, saat sumbernya berada di bawah $HOME/.apothem/src:

# From an Apothem checkout
PYTHONPATH=src python -m apothem.conformity.gate --check frontmatter-grep ~/.claude/rules/kebab-filenames.md

# After a script install
PYTHONPATH="$HOME/.apothem/src" python -m apothem.conformity.gate --check frontmatter-grep ~/.claude/rules/kebab-filenames.md

Rule yang valid melaporkan lolos bersih:

{
  "orchestrator": "conformity-gate",
  "passed": true,
  "grep_count": 1
}

Propagasikan ke harness

Jalankan perintah update sekali untuk setiap harness yang terpasang:

apothem update --harness claude-code
apothem update --harness cursor --project /path/to/project

On this page