mcpField
E
engram-branch-pr

engram-branch-pr

github.com/gentleman-programming開発7.7k92 回インストール今日更新
リポジトリ

engram-branch-pr について

engram-branch-pr は Engram プロジェクトのコントリビューター向けに、ブランチとプルリクエストの準備を案内するスキルです。課題・ラベル要件、命名規則、PR の内容、必須チェックを説明します。

主な機能

  1. 01承認済み課題へのリンク要件
  2. 02ブランチ命名規則
  3. 03PR テンプレートの必須項目
  4. 04type ラベルを厳密に1つ指定
  5. 05コミット規約とチェックリスト

活用シーン

  1. 01提出用ブランチの準備
  2. 02要件を満たすプルリクエストの作成
  3. 03必須ラベルと課題ステータスの確認
  4. 04テストと CI 結果の報告

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/gentleman-programming/engram --skill engram-branch-pr

インストール後、Claude Code で/engram-branch-prを入力して読み込まれたか確認します。

詳細

使用するタイミング

次の場合に、このスキルを使用します:

  • 変更を加えるプルリクエストを作成するとき
  • 提出するブランチを準備するとき
  • コントリビューターが PR を作成するのを支援するとき

重要なルール

  1. すべての PR で、承認済みの issue へのリンクが必須です — 例外はありません
  2. すべての PR に、type:* ラベルを必ず 1 つだけ付けてください
  3. マージを可能にするには、必須の自動チェックにすべて合格する必要があります
  4. issue にリンクしていない空の PR は、GitHub Actions によってブロックされます

ワークフロー

1. Verify issue has `status:approved` label
2. Create branch: feat/*, fix/*, docs/*, refactor/*, chore/*
3. Implement changes
4. For behavior changes, run a focused regression test and affected package tests locally; record commands and outcomes. For docs-only changes, record N/A for Go tests and verify the documentation.
5. Check every changed path against the [Transient Artifact Policy](../../CONTRIBUTING.md#transient-artifact-policy)
6. Open PR using the template
7. Add exactly one type:* label
8. After pushing/opening the PR, wait for GitHub CI's full unit/E2E/lint and applicable platform checks; report results only after they run

ブランチの命名(GitHub ルールセットによる強制)

ブランチ名は GitHub ルールセットによって検証されます。一致しないプッシュは拒否されます。

パターン: ^(feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)\/[a-z0-9._-]+$

種類ブランチのパターン例
機能feat/<description>feat/json-export-command
バグ修正fix/<description>fix/duplicate-observation-insert
雑務chore/<description>chore/bump-bubbletea-v0.26
ドキュメントdocs/<description>docs/api-reference-update
スタイルstyle/<description>style/fix-tui-alignment
リファクタリングrefactor/<description>refactor/extract-query-sanitizer
パフォーマンスperf/<description>perf/optimize-fts5-queries
テストtest/<description>test/add-sync-coverage
ビルドbuild/<description>build/update-go-toolchain
CIci/<description>ci/split-e2e-job
リバートrevert/<description>revert/broken-migration

ルール:

  • 説明はすべて小文字にする必要があります
  • 説明には a-z、0-9、.、_、- のみ使用できます
  • 大文字、スペース、特殊文字は使用できません

PR 本文の形式

PR テンプレートは .github/PULL_REQUEST_TEMPLATE.md にあります。すべての PR 本文に、以下を含める必要があります:

1. リンクされた issue(必須)
Closes #<issue-number>

有効なキーワード:Closes #N、Fixes #N、Resolves #N(大文字と小文字は区別されません)。 リンク先の issue には status:approved ラベルが付いている必要があります。

2. PR の種類(必須)

テンプレートで該当する項目を 1 つだけ選択し、対応するラベルを追加します:

チェックボックス追加するラベル
バグ修正type:bug
新機能type:feature
ドキュメントのみtype:docs
コードのリファクタリングtype:refactor
メンテナンス/ツールtype:chore
破壊的変更type:breaking-change
3. 概要

PR の内容を 1~3 個の箇条書きで説明します。

4. 変更点の表
| File | Change |
|------|--------|
| `path/to/file` | What changed |
5. テスト計画
- [ ] Focused regression (behavior change): `<actual command>` — `<actual outcome or N/A: documentation-only>`
- [ ] Affected package (behavior change): `<actual command>` — `<actual outcome or N/A: documentation-only>`
- [ ] GitHub CI full unit/E2E/lint and applicable platform checks — pending until they run

サンプルのコマンドと結果は、実際の証拠に置き換えてください。ドキュメントのみの変更の場合、ローカルの Go テストには N/A — documentation-only; no Go behavior changed と記録し、実際に実行したドキュメントのチェックを列挙してください。対象を絞ったカバレッジは、見落とした分岐の発見に役立ちます。モジュール全体のカバレッジや PR ごとの数値ゲートは適用されません。PR を作成していない場合(またはプッシュ前)、およびリスクの高い変更の場合は、該当する追加のローカルチェックを実行し、CI の証拠に不足があれば明記してください。

6. コントリビューターチェックリスト

すべての項目にチェックを付ける必要があります:

  • 承認済みの issue にリンクした
  • type:* ラベルをちょうど 1 つ追加した
  • 動作に関わる変更では、実際に実行した対象を絞った回帰テストおよび影響を受けるパッケージのテストコマンドと結果を記録した。ドキュメントのみの変更では N/A とした
  • PR を作成せずに、またはリスクの高い変更に対して、該当する追加のローカルチェックを実行し、不足している CI の証拠を明記した
  • 動作を変更した場合、ドキュメントを更新した
  • Conventional Commits の形式に従った
  • Co-Authored-By トレーラーを含めていない
  • 変更したすべてのパスが一時成果物ポリシーに準拠している

自動チェック

必須コンテキストの6項目はCONTRIBUTING.mdに記載されています。マージ前に6項目すべてに合格する必要があります。Lint、一時生成物チェック、Windows Setup Test、Cloud Sync Wrapper Tests (Windows)はPRでは実行されますが、マージグループでは実行されず、必須コンテキストの6項目には含まれません。保留中のチェックを合格扱いせず、実際の結果を報告してください。

チェックジョブ名検証内容
PR 検証Check Issue Reference本文に Closes/Fixes/Resolves #N が含まれている
PR 検証Check Issue Has status:approvedリンクされたIssueに status:approved が付いている
PR ラベルポリシーCheck PR Has type:* LabelPRに type:* ラベルが1つだけ付いている
一時生成物チェックCheck PR Has No Transient ArtifactsPRのファイルが一時生成物ポリシーに準拠している
CIUnit Testsgo test ./... が合格する
CIE2E Testsgo test -tags e2e ./internal/server/... が合格する
CIPlugin Testsplugin/piで npm test が合格する
CILintgolangci-lintがGoの変更に新たな指摘がないと報告する
CIWindows Setup TestWindowsのセットアップで絶対パスが保持され、MCPのジョブオブジェクトに関する親プロセスの有効期間テストが合格する
CICloud Sync Wrapper Tests (Windows)Windowsでクラウド同期ラッパーとPowerShellが見つからない場合のEngramテストが合格する

Conventional Commits(GitHubルールセットで強制)

コミットメッセージはGitHubルールセットによって検証されます。パターンに一致しないコミットは拒否されます。

パターン: ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z0-9\._-]+\))?!?: .+

形式:

<type>(<optional-scope>): <description>
<type>(<optional-scope>)!: <description>   ← breaking change
許可されるタイプ
タイプ用途PRラベル
feat新機能type:feature
fixバグ修正type:bug
docsドキュメントのみtype:docs
refactorコードのリファクタリングtype:refactor
choreメンテナンス、依存関係type:chore
style書式、空白type:chore
perfパフォーマンスの改善type:refactor
testテストの追加・修正type:chore
buildビルドシステムの変更type:chore
ciCI/CDの変更type:chore
revert以前のコミットの取り消し(元のタイプに合わせる)
feat! / fix!破壊的変更type:breaking-change
ルール
  • タイプは、記載されている値のいずれかでなければなりません
  • スコープは省略可能で、小文字を使用し、a-z、0-9、.、_、-を使用できます
  • :の前にある!は、破壊的変更を示します
  • 説明は : (コロンとスペース)の後に始めなければなりません
例
feat(cli): add --json flag to session list command
fix(store): prevent duplicate observation insert on retry
docs(contributing): update workflow documentation
refactor(internal): extract search query sanitizer
chore(deps): bump github.com/charmbracelet/bubbletea to v0.26
style(tui): fix alignment in session detail view
perf(store): optimize FTS5 query for large datasets
test(sync): add coverage for conflict resolution
ci(workflows): split e2e into separate job
fix!: change session ID format
無効な例(拒否されます)
Fix bug                          ← no type prefix
feat: Add login                  ← description should be lowercase
FEAT(cli): add flag              ← type must be lowercase
feat (cli): add flag             ← no space before scope
feat(CLI): add flag              ← scope must be lowercase
update docs                      ← no conventional commit format

コマンド

# Create branch
git checkout -b feat/my-feature main

# For behavior changes, run actual focused regression and affected package commands:
# go test ./internal/store -run '<actual regression test name>'
# go test ./internal/store
# Record actual commands and outcomes in the PR test plan.
# For docs-only changes, record N/A for Go tests and the documentation checks run.
# Without a PR or for high-risk changes, run additional applicable local checks.
# After pushing, GitHub CI runs broad unit/E2E/lint and applicable platform checks;
# do not claim their results until the checks actually pass.

# Push and create PR
git push -u origin feat/my-feature
gh pr create --title "feat(scope): description" --body "Closes #N"

# Add type label to PR
gh pr edit <pr-number> --add-label "type:feature"

コメント