CLAUDE.md スターター
CLAUDE.md は、Claude Code に与えられる最も効果の高いものです。これはセッションのたびに読み込まれる永続的な指示です。これらのいずれかをリポジトリのルートに置き(あるいは /init を実行して出発点を生成し)、自分に合うように削ぎ落としてください。各ブロックのコピーボタンを使ってください。
:::tip 短く、そして真実に 長く、理想論的で、最新でない CLAUDE.md は害になります — Claude はそれを文字どおりに従います。プロジェクトが実際にどう動いているかを記述し、容赦なく刈り込んでください。詳しくは CLAUDE.md のページを参照してください。 :::
汎用スターター
# Project: <name>
## What this is
<One or two sentences: what the project does and who uses it.>
## Tech stack
- Language/runtime: <e.g. TypeScript, Node 20>
- Framework: <e.g. Next.js 14 App Router>
- Key libraries: <e.g. Prisma, tRPC, Tailwind>
## How to run
- Install: `<cmd>`
- Dev server: `<cmd>`
- Tests: `<cmd>`
- Lint/format: `<cmd>`
## Conventions
- <e.g. Use functional components; no class components.>
- <e.g. Co-locate tests as *.test.ts next to source.>
- <e.g. Conventional Commits for messages.>
## Guardrails
- Run the tests before saying a task is done.
- Don't edit files under `/generated` or `/vendor`.
- Never commit secrets or .env files.
## Good to know
- <Gotchas, non-obvious decisions, links to deeper docs.>
Node / TypeScript Web アプリ
# Project: <name> (Next.js + TypeScript)
## How to run
- Dev: `npm run dev`
- Build: `npm run build`
- Test: `npm test`
- Lint: `npm run lint` (must pass before commit)
## Conventions
- TypeScript strict; no `any` without a comment justifying it.
- Components in `src/components`, one folder per component.
- Data fetching via tRPC; never call the DB from a client component.
- Styling: Tailwind utility classes; no inline styles.
## Guardrails
- After any change, run `npm run lint && npm test`.
- Keep files under ~300 lines; split when larger.
- Do not modify `prisma/migrations` by hand.
Python サービス
# Project: <name> (FastAPI)
## How to run
- Install: `uv sync` (or `pip install -e .`)
- Dev: `uvicorn app.main:app --reload`
- Test: `pytest`
- Lint/format: `ruff check . && ruff format .`
## Conventions
- Type hints everywhere; prefer `pathlib` over `os.path`.
- Pydantic models for all request/response bodies.
- f-strings, not %-formatting.
## Guardrails
- Run `pytest` and `ruff check` before completing a task.
- Fail fast with descriptive errors; no silent excepts.
どれにも当てはまるヒント
- 階層化する。 プロジェクト全体には、リポジトリのルートに
CLAUDE.mdを置きます。領域固有のルールには、サブフォルダにネストしたCLAUDE.mdファイルを置きます。 @importsを使うことで、既存のドキュメントを複製せずに取り込めます(CLAUDE.md リファレンスを参照)。- 毎月見直す。 古くなった指示は、何もないよりも悪いものです。
関連
- 詳しい手順 → CLAUDE.md とメモリファイル
- さらなるスターター → SKILL.md テンプレート、フックと設定のレシピ
- これらの改善 → コントリビュート