kernel は、繰り返しの業務オペレーションを TypeScript で定義し、GitHub App と Discord bot から駆動するための一元 hub。
「人間が毎週繰り返している作業」を TypeScript の workflow として定義し、GitHub Actions・Railway・Discord・GitHub App から呼び出す。Python は使わず、Claude Code (Max OAuth) を実行エンジンに据える。
実行ロジックを全部 kernel に置き、対象レポは外から checkout して書き換える。各レポに workflow を撒き散らさない。
workflow 実装言語は TS に統一。型で repo / cloud / SaaS の対応関係を表現する。
AI を使う step は Claude Code を OAuth で呼び、API 課金を介さず Max 枠で回す。
┌──────────────────────────┐
│ kernel repo │
│ workflows · knowledge │
└──────────────────────────┘
│ │
checkout / commit deploy
▼ ▼
┌─────────────────────┐ ┌────────────────────────┐ ┌──────────────────┐
│ target repos │ │ github actions │ │ railway │
│ (any org) │ │ sentry-autofix · … │ │ gateway+worker │
└─────────────────────┘ └────────────────────────┘ └──────────────────┘
▲ │ │
│ │ │
│ app token (kernel-bot) │
│ ▼ ▼
│ ┌───────────────────────────────────────────┐
└───────────│ claude code (headless) │
│ + MCP (sentry · esa · backlog · …) │
└───────────────────────────────────────────┘
▲
│
┌────────────┴────────────┐
│ discord │
│ slash · @mention · cron│
└─────────────────────────┘
kernel-bot は kernel が他レポへ PR / Issue / Review コメントを書き込むための GitHub App。InterfaceX 以外の org にもインストールできる。target repo 側にコードは一切要らない。
target repo オーナーが行う作業。
kernel-bot App の install ページから対象 organization / repository を選ぶ。「All repositories」か「Only select」を選択。kernel-bot は read/write が必要な repo にだけ入れる。
App が PR を作れるよう、org または target repo の Settings → Actions → General で「Allow GitHub Actions to create and approve pull requests」を ON。
Sentry の autofix を回すなら Sentry token、社内 wiki を引かせるなら esa token、といった具合に MCP 越しに繋ぐ外部サービスを選定。kernel 側 secret に追加する。
Discord から /sentry-fix-issue 等のスラッシュコマンドを発行、または kernel リポ側の workflow_dispatch を叩いて end-to-end を疎通。target repo 側に PR が立つ。
kernel-bot-gateway が Discord に常駐し、スラッシュコマンド・メンション・cron で workflow を起動する。重い実行は worker service へ BullMQ で逃がす。
workflow ごとに SDK を抱え込まず、Model Context Protocol の server を起動して Claude Code に渡す。各 integration は kernel/integrations/ 配下に config 生成 shell を持ち、複数 workflow で使い回す。
unresolved issue 検索、event / breadcrumbs 取得。autofix の入り口。read scope のみ。
社内ナレッジ (記事 / カテゴリ / タグ) の read。Personal Access Token v2 を read scope で発行。
issue / wiki / PR / document の read。write 系は allowedTools 側で外して安全側に倒す。
ライブラリ / フレームワーク / CLI の最新ドキュメントを fetch。training cutoff のズレ対策。
service / deployment / volume / variable の管理。kernel 自身の deploy 操作にも使う。
browser automation。UI 変更の動作確認、回帰スクリーンショット取得。
kernel 上の Claude Code には description trigger で on-demand load される skill が並ぶ。スラッシュ起動できるものと、文脈マッチで自動 load されるものが混在する。
kernel は credential 管理を「git に乗せない」「scope は最小」「破壊操作は ask」の 3 原則で運用する。token 名や vault パスはここでは伏せ、運用方針だけ書く。
ローカル実行時は op run 経由で env を注入し、.env 平文ファイルを作らない。
repo に置くのは .env.1password (vault item へのリファレンスのみ) で、実値は git に乗らない。
workflow が使う token は GitHub Actions の org / repo secret に置き、code には文字列を埋め込まない。
workflow からは secrets.* でしか参照されないため、log にも echo されない。
esa / Backlog / Sentry など、read で済む token は read scope のみで発行。書き込みが要る workflow が出てから別 token を分離発行する。
シェル全体に AWS_PROFILE を export せず、コマンドごとに inline 指定。本番 profile での破壊操作は permission を ask に倒し、claude harness 側で都度確認する。
App は target repo に install されている範囲でしか書けない。install されていない repo へのアクセスは 404 で弾かれる。
外部 webhook (Messenger / GitHub) は受信時に署名検証してから処理。検証失敗は即棄却。