Repository Guidelines
Project Rules
- Respond in Japanese.
Project Structure & Module Organization
- Root:
README.md,LICENSE,mise.toml(tool versions),.devcontainer/(container setup). - Create
src/for application code andtests/for automated tests when adding functionality. - Keep non-code assets in
assets/and docs indocs/(create as needed). Co-locate small module-specific fixtures undertests/fixtures/<module>/.
Build, Test, and Development Commands
- Dev container (recommended): open in VS Code and run “Reopen in Container”. Ownership and
mise install -yrun automatically. - Tooling:
mise install -yinstalls versions frommise.toml(currently Node). Example:node --versionto verify. - Node projects: use
npm cifor clean installs,npm testto run tests,npm run buildfor builds (add scripts inpackage.json).
Coding Style & Naming Conventions
- Indentation: 2 spaces for JS/TS/JSON/YAML; 4 spaces for shell scripts.
- Naming:
camelCasefor variables/functions,PascalCasefor classes,kebab-casefor filenames and CLI commands. - Formatting: prefer Prettier and ESLint if present; otherwise run
npx prettier -w .before PRs. - Imports: use relative paths within a package; avoid deep imports across modules without an index barrel.
Testing Guidelines
- Framework: Jest or Vitest for Node projects (recommended). Keep unit tests close to code in
tests/and mirror directory names. - Naming: test files as
<name>.test.ts|js. Aim for clear, isolated tests with minimal mocks. - Running:
npm test -- --watchlocally; add coverage withnpm test -- --coverageand keep deltas green.
Commit & Pull Request Guidelines
- Commits: follow Conventional Commits, e.g.,
feat: add user session store,fix: handle empty input. - Scope small and focused. Reference issues with
Closes #123when applicable. - PRs: include summary, rationale, screenshots (if UI), and testing notes. Link related issues/discussions. Keep PRs under ~300 lines of diff when possible.
Security & Configuration Tips
- Do not commit secrets. Use
.env.localand provide.env.examplewhen config is needed. - Devcontainer: environment sets
XDG_STATE_HOMEand fixes permissions somisecan write state. If tools change, updatemise.tomland runmise install -y.
プロジェクト構成とモジュール
.devcontainer/: 開発コンテナ設定一式。devcontainer.json(Dev Containers 設定)、Dockerfile(Ubuntu ベース、TZ/locale/ユーザー設定)。mise.toml: プロジェクト固有のツール管理(例: Node のバージョン指定)。.devcontainer/mise/config.toml: ユーザー向けのグローバル設定(XDG)。コンテナ内~/.config/mise/config.tomlに bind。- ルートには
README.md,LICENSE。現時点でアプリ用のsrc/やtest/は未配置(必要に応じて追加)。
ビルド・実行・開発コマンド
- Dev Containers(推奨)
devcontainer build --workspace-folder .: 開発コンテナのイメージをビルド。devcontainer up --workspace-folder .: 開発コンテナを起動(VS Code からも同等操作可)。
- Docker 直接利用(参考)
docker run --rm -it -v "$PWD":/workspaces -w /workspaces mcr.microsoft.com/devcontainers/base:ubuntu zsh
- mise(ツール管理)
mise install:mise.tomlに基づきツールを取得。- コンテナ内
PATHは/mnt/mise-data/shimsを含むため追加設定は不要。
コーディングスタイルと命名
- JSON: 2 スペースインデント、末尾カンマなし、キーはローワーケース。
- Dockerfile: 1 命令 1 目的、キャッシュを意識して順序最適化、不要なレイヤーを避ける。
- ファイル/ディレクトリ命名: ローワーケース + ハイフン(例:
sample-script.sh)。 - ブランチ命名:
feat/...,fix/...,docs/...。
テスト方針
- 本リポジトリは開発環境(Dev Container)提供が主目的のためテストは未提供。
- 将来的にテンプレートやスクリプトを追加する場合は
test/を作成し、スモークテスト +make testなどで統一実行を推奨。
コミットとプルリクエスト
- コミット: Conventional Commits を推奨(例:
docs: add README)。種別:feat,fix,docs,chore,refactor,ci。短く現在形で要点を記述。 - PR: 目的/背景/変更点/動作確認手順を明記。必要に応じスクリーンショットやログを添付。関連 Issue をリンク。小さく分割し、Rebase で履歴を整える。
セキュリティと設定のヒント
- 機密情報はコミットしない(環境変数やトークンはローカル/CI の安全な保管に)。
devcontainer.jsonのボリューム/mnt/mise-dataはツール用。権限はpostCreateCommandで設定されるため手動変更不要。