From a7c6ab400bcce8f5cec421408fe2ed264155c380 Mon Sep 17 00:00:00 2001 From: kimukei Date: Sat, 21 Feb 2026 00:09:14 +0900 Subject: [PATCH 1/3] Add CLAUDE.md with project conventions and context Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4435c85 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,45 @@ +# CLAUDE.md + +## Project Overview + +GitHub Actions のワークフロー一覧サイドバーで、`/` を含むワークフロー名を折りたたみ可能なフォルダにグループ化する Chrome 拡張。 +ビルドツール不要。プレーン JS + CSS のみ。 + +## File Structure + +- `manifest.json` - Chrome Manifest V3 +- `content.js` - メインロジック(DOM 操作 + MutationObserver + fetch) +- `content.css` - フォルダ UI スタイル(GitHub Primer CSS 変数使用) +- `icons/` - 拡張アイコン (16/48/128px) +- `eslint.config.js` - ESLint flat config(browser globals を手動定義) +- `.stylelintrc.json` - Stylelint 設定 +- `tests/` - vitest ユニットテスト + manifest バリデーション + +## Development Commands + +- `npm run lint` - ESLint + Stylelint +- `npm run lint:js` - ESLint のみ +- `npm run lint:css` - Stylelint のみ +- `npm test` - vitest 実行 +- `npm run validate:manifest` - manifest.json の構造チェック + +## Key Conventions + +- **No build step**: `content.js` はブラウザで直接実行される。ES Modules (`import`/`export`) は使えない +- **ESLint globals**: `content.js` で使うブラウザ API は `eslint.config.js` の `globals` に手動追加が必要 +- **CSS**: GitHub Primer の CSS 変数(`--fgColor-default`, `--bgColor-neutral-muted` 等)を使い、全テーマ対応 +- **CSS notation**: Stylelint が modern notation を要求する。`rgb(R G B / A%)` 形式を使うこと(`rgba()` は不可) +- **GitHub Actions の uses**: コミットハッシュに pin する(バックドア防止)。タグコメントを付記(例: `actions/checkout@ # v4`) +- **テスト**: `content.js` は DOM 依存のため直接 import できない。テストではロジックを再実装してテストする + +## Testing + +動作確認は https://github.com/bm-sms/xuan/actions で行う。 +`chrome://extensions` → デベロッパーモード → 「パッケージ化されていない拡張機能を読み込む」でこのフォルダを指定。 + +## GitHub Internal Endpoints + +ワークフロー全件取得に使用している非公開エンドポイント: +- `GET /{owner}/{repo}/actions/workflows_partial?query=&page=N` - ワークフロー一覧の HTML パーシャル + - "Show more" 要素の `src` 属性にベース URL、`data-total-pages` に総ページ数がある + - `credentials: "include"` でセッション Cookie を使用(トークン不要) From 61544c2320b2f9e33021e64a0927f8f5dc6394c3 Mon Sep 17 00:00:00 2001 From: kimukei Date: Sat, 21 Feb 2026 00:10:38 +0900 Subject: [PATCH 2/3] Add pull request template Co-Authored-By: Claude Opus 4.6 --- .github/pull_request_template.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..fa0976b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ +## Summary + + + +- + +## Test plan + + + +- [ ] From 4b3816b990e399129cdcdfb1423037a1879ae0ad Mon Sep 17 00:00:00 2001 From: kimukei Date: Sat, 21 Feb 2026 00:11:36 +0900 Subject: [PATCH 3/3] Add /create-draft-pr slash command Co-Authored-By: Claude Opus 4.6 --- .claude/commands/create-draft-pr.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .claude/commands/create-draft-pr.md diff --git a/.claude/commands/create-draft-pr.md b/.claude/commands/create-draft-pr.md new file mode 100644 index 0000000..b6eaa3d --- /dev/null +++ b/.claude/commands/create-draft-pr.md @@ -0,0 +1,11 @@ +現在のブランチから draft PR を作成してください。 + +手順: +1. `git status` と `git diff main...HEAD`(または適切なベースブランチ)で変更内容を確認 +2. 変更内容を分析して PR タイトルと本文を作成 +3. `gh pr create --draft` で draft PR を作成 +4. 作成した PR の URL を表示 + +PR 本文はリポジトリの pull_request_template.md に従ってください。 + +引数 $ARGUMENTS が指定されていればベースブランチとして使用し、なければ main をベースにしてください。