agentleFS
goonobu-dotgoonobu-dot/dev-skills-library/skills/project-conventions/SKILL.md

project-conventions

Skill0 starsChanged 4 months agoMITView on GitHub

Project scaffolding conventions from elsewhencode/project-guidelines: directory layout, env var and config management, README/CONTRIBUTING essentials, Git branch and commit conventions. Use when starting a new project/repository, restructuring project layout, setting up .env/.gitignore, or when the user says プロジェクト構成, 雛形, 新規リポジトリ, ディレクトリ構成. Not for writing the commit message itself (use commit-and-pr) or for CI/CD workflow design (use ci-cd-hardening).

  • Reads credentials

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use e2e-template-testing, notification-routing and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GitHubSkill

    e2e-template-testing

    End-to-end validation of coordinator and agent template changes

    Also in 3 projects that use this

  • GitHubSkill

    notification-routing

    Route agent notifications to specific channels by type — prevent alert fatigue from single-channel flooding

    Also in 3 projects that use this

  • Microsoft AzureSkill

    coordinator-source-of-truth

    The complete file-by-file source-of-truth hierarchy for Squad: which files are authoritative, which are derived/append-only, who may write each one, who may read each one, and the precedence rules when they conflict. Squad coordinator loads this on demand when it needs to resolve a write conflict, decide where a piece of state belongs, or answer a 'who owns this file' question.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    cross-squad-communication

    Protocol for sending queries, delegating tasks, and sharing context between independent Squad instances across different repositories

    Also in 3 projects that use this

  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 3 projects that use this

  • +4 more from github
  • +2 more from Azure

The file

Files
SKILL.md

Project Conventions

新規プロジェクトの雛形作成・既存プロジェクトの構造整理のためのスキル。ディレクトリ構成、環境変数管理、README/CONTRIBUTING、Gitブランチ規約を扱う。コミットメッセージそのものの書き方は commit-and-pr、CI/CDワークフローの設計は ci-cd-hardening を使う。

使うタイミング

  • 新規プロジェクト・新規リポジトリを立ち上げるとき
  • 既存プロジェクトのディレクトリ構造が乱雑で整理するとき
  • .env / 設定管理の仕組みを導入するとき
  • README・CONTRIBUTINGの雛形を作るとき
  • Gitのブランチ運用ルールを決めるとき

手順

ステップ1:ディレクトリ構成を機能単位で分ける

  1. ページ・機能単位(例:product/, user/, order/)でディレクトリを分け、実装ファイルとテストファイルを同階層に併置する(src/とtest/を完全分離しない方が、関連ファイルを見失いにくい)。
  2. 設定ファイルは ./config に集約する(環境ごとの設定を1箇所にまとめ、散在させない)。
  3. 補助スクリプト(マイグレーション、シード投入、ビルド補助)は ./scripts に集約する。
  4. ビルド成果物は ./build(または./dist)に出力し、必ず .gitignore へ登録する。
  5. 巨大な1ファイル(数千行のutils.js等)を作らない。責務ごとにファイルを分割する。

ステップ2:環境変数・設定管理を安全にする

  1. 機密情報(APIキー、接続文字列、トークン)は .env に記載し、.gitignore へ登録する。絶対にコミットしない。
  2. .env.example にキー名のみのテンプレート(値は空またはダミー)を用意し、これはリポジトリにコミットする。新規参加者が何を設定すべきか一目でわかるようにする。
  3. アプリ起動時に環境変数のスキーマバリデーション(例:joi, zod, pydantic-settings等プロジェクトの言語に合うもの)を行い、必須変数の欠落を起動直後に検知する。実行中に初めて気づく設計にしない。
  4. 環境ごと(development/staging/production)で異なる値は環境変数側で切り替え、コード側にif分岐で環境名を埋め込まない。

ステップ3:README / CONTRIBUTINGの必須要素

README.mdに最低限含める項目:

  • プロジェクトの目的(1〜2文)
  • セットアップ手順(依存関係インストール〜起動まで、コピペで動く形)
  • 必要な環境変数一覧(.env.exampleへのリンクでも可)
  • テスト実行コマンド
  • ディレクトリ構成の簡単な説明

CONTRIBUTING.mdに最低限含める項目:

  • ブランチ運用ルール
  • コミットメッセージ規約(詳細はcommit-and-pr参照でよい)
  • PR作成前に実行すべきチェック(lint、テスト)
  • コードスタイル・レビュー基準へのリンク

ステップ4:Gitブランチ運用規約を決める

  1. main(またはdevelop)から feature ブランチを切る。main/developへの直接pushは禁止し、PR必須にする。
  2. マージ前に対話的リベース等でコミット履歴を整理する(無意味な"wip"コミットの羅列を残さない)。
  3. マージ後はローカル・リモート双方のfeatureブランチを削除する(ブランチが溜まり続けるのを防ぐ)。
  4. ブランチ命名規則を統一する(例:feature/xxx, fix/xxx, chore/xxx)。

チェックリスト(新規プロジェクト立ち上げ時)

  • 機能単位のディレクトリ構成になっているか(技術レイヤー単位だけで分割していないか)
  • .gitignore に .env・ビルド成果物・依存関係ディレクトリが含まれているか
  • .env.example が用意されているか
  • 起動時の環境変数バリデーションが入っているか
  • README単体でセットアップが完結するか(口頭説明が前提になっていないか)
  • ブランチ運用ルールがCONTRIBUTINGに明文化されているか

アンチパターン集

アンチパターン現実
.envを誤ってコミットする秘密情報が履歴に残り続け、削除してもgit historyから完全除去は困難。最初から.gitignoreに入れる
環境変数の必須チェックをしない本番デプロイ後、特定の機能を使った瞬間に初めて「変数が未設定」と気づく。起動時バリデーションで早期検知する
README に「詳しくは担当者に聞いてください」と書く新規参加者・将来の自分・AIエージェントがセットアップできない。手順は自己完結させる
技術レイヤー単位(controllers/, models/, views/)だけでディレクトリを切る1機能の変更が複数ディレクトリに分散し、関連ファイルを探すコストが増える。機能単位との併用を検討する
ブランチを削除せず放置するリポジトリが肥大化し、どのブランチが生きているか判別できなくなる。マージ後は必ず削除する
環境ごとの分岐をコード内にif (env === "production")で書き散らす環境差分がコードとconfigの両方に散らばり、変更時に見落としが発生する。configに集約する

出典

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.