Skip to content
Back to skills

File Naming

ASecurity

File and directory naming conventions for TypeScript/JavaScript projects. Use when creating new files or directories.

  • 3 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 27, 2026
developmentjavascripttypescriptjavareactapi

Works with

  • api

Security analysis

A100/100

Scanned November 28, 2026

npx -y skills add ncaq/konoka --skill file-naming --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of File Naming?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for File Naming
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ncaq-file-naming/badge)](https://www.skillsdirectory.com/skills/ncaq-file-naming)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: file-naming
description: File and directory naming conventions for TypeScript/JavaScript projects. Use when creating new files or directories.
user-invocable: false
---

# ファイル名とディレクトリ名の規約

ファイル名とディレクトリ名にはkebab-caseを使います。

URLやnpmのパッケージ名などWebのエコシステムではkebab-caseが一般的で、
TypeScript/JavaScriptのプロジェクトでも広く採用されているためです。
またmacOSやWindowsのファイルシステムはデフォルトで大文字と小文字を区別しないので、
`UserList.tsx`と`userList.tsx`を区別できませんが、kebab-caseならこの問題が起きません。

## エクスポートと同じ名前にしてよいファイル

以下のファイルは、エクスポートするものと同じ名前にしても構いません。
ファイル名とエクスポートの名前が一致して、対応関係が分かりやすくなるためです。
React公式のチュートリアルにも、このような名前を使っている例があります。

- Reactコンポーネントをエクスポートするファイルは、コンポーネントと同じ名前のPascalCaseにできます。
- 単一のReactのカスタムHooksをエクスポートするファイルは、関数と同じ名前のcamelCaseにできます。
  eslint-plugin-react-hooksはファイル名ではなく関数名の`use`プレフィックスでHooksを検出するので、
  ファイル名はHooksの検出に影響しません。

これらのファイルも含めて、全てをkebab-caseに統一しても構いません。

```text
src/
  api/
    customer-query.ts
  components/
    SearchDialog.tsx    # SearchDialogコンポーネントをエクスポート
  hooks/
    useAuth.ts          # useAuth関数をエクスポート
```

それ以外のモジュールは、エクスポートが1つだけでも、その名前に合わせずkebab-caseを推奨します。
後からエクスポートが増える可能性が割とあるためです。

## 既存の規約との関係

プロジェクトで既に採用されている規約がある場合は、そちらに従います。
規約が混在している場合は、新しく作るファイルでは一貫した命名規則を使い、
既存のファイルは変更のついでに統一していきます。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.