beeops 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja.md +156 -0
  3. package/README.md +80 -0
  4. package/bin/beeops.js +502 -0
  5. package/command/bo.md +120 -0
  6. package/contexts/agent-modes.json +100 -0
  7. package/contexts/code-reviewer.md +118 -0
  8. package/contexts/coder.md +247 -0
  9. package/contexts/default.md +1 -0
  10. package/contexts/en/agent-modes.json +100 -0
  11. package/contexts/en/code-reviewer.md +129 -0
  12. package/contexts/en/coder.md +247 -0
  13. package/contexts/en/default.md +1 -0
  14. package/contexts/en/fb.md +15 -0
  15. package/contexts/en/leader.md +158 -0
  16. package/contexts/en/log.md +16 -0
  17. package/contexts/en/queen.md +240 -0
  18. package/contexts/en/review-leader.md +190 -0
  19. package/contexts/en/reviewer-base.md +27 -0
  20. package/contexts/en/security-reviewer.md +200 -0
  21. package/contexts/en/test-auditor.md +146 -0
  22. package/contexts/en/tester.md +135 -0
  23. package/contexts/en/worker-base.md +69 -0
  24. package/contexts/fb.md +15 -0
  25. package/contexts/ja/agent-modes.json +100 -0
  26. package/contexts/ja/code-reviewer.md +129 -0
  27. package/contexts/ja/coder.md +247 -0
  28. package/contexts/ja/default.md +1 -0
  29. package/contexts/ja/fb.md +15 -0
  30. package/contexts/ja/leader.md +158 -0
  31. package/contexts/ja/log.md +17 -0
  32. package/contexts/ja/queen.md +240 -0
  33. package/contexts/ja/review-leader.md +190 -0
  34. package/contexts/ja/reviewer-base.md +27 -0
  35. package/contexts/ja/security-reviewer.md +200 -0
  36. package/contexts/ja/test-auditor.md +146 -0
  37. package/contexts/ja/tester.md +135 -0
  38. package/contexts/ja/worker-base.md +68 -0
  39. package/contexts/leader.md +158 -0
  40. package/contexts/log.md +16 -0
  41. package/contexts/queen.md +240 -0
  42. package/contexts/review-leader.md +190 -0
  43. package/contexts/reviewer-base.md +27 -0
  44. package/contexts/security-reviewer.md +200 -0
  45. package/contexts/test-auditor.md +146 -0
  46. package/contexts/tester.md +135 -0
  47. package/contexts/worker-base.md +69 -0
  48. package/hooks/checkpoint.py +89 -0
  49. package/hooks/prompt-context.py +139 -0
  50. package/hooks/resolve-log-path.py +93 -0
  51. package/hooks/run-log.py +429 -0
  52. package/package.json +42 -0
  53. package/scripts/launch-leader.sh +282 -0
  54. package/scripts/launch-worker.sh +184 -0
  55. package/skills/bo-dispatch/SKILL.md +299 -0
  56. package/skills/bo-issue-sync/SKILL.md +103 -0
  57. package/skills/bo-leader-dispatch/SKILL.md +211 -0
  58. package/skills/bo-log-writer/SKILL.md +101 -0
  59. package/skills/bo-review-backend/SKILL.md +234 -0
  60. package/skills/bo-review-database/SKILL.md +243 -0
  61. package/skills/bo-review-frontend/SKILL.md +236 -0
  62. package/skills/bo-review-operations/SKILL.md +268 -0
  63. package/skills/bo-review-process/SKILL.md +181 -0
  64. package/skills/bo-review-security/SKILL.md +214 -0
  65. package/skills/bo-review-security/references/finance-security.md +351 -0
  66. package/skills/bo-self-improver/SKILL.md +145 -0
  67. package/skills/bo-self-improver/refs/agent-manager.md +61 -0
  68. package/skills/bo-self-improver/refs/command-manager.md +46 -0
  69. package/skills/bo-self-improver/refs/skill-manager.md +59 -0
  70. package/skills/bo-self-improver/scripts/analyze.py +359 -0
  71. package/skills/bo-task-decomposer/SKILL.md +130 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 YuugouOhno
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ja.md ADDED
@@ -0,0 +1,156 @@
1
+ # beeops
2
+
3
+ [English README](README.md)
4
+
5
+ [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 向け 3層マルチエージェント・オーケストレーションシステム。
6
+
7
+ **Queen → Leader → Worker** — GitHub Issue を自動的にサブタスクに分解し、git worktree で隔離された環境で並列実装を行い、コードレビューを実施し、CI をチェックします。すべて tmux 上でオーケストレーションされます。
8
+
9
+ ## 仕組み
10
+
11
+ ```
12
+ Queen (L1) – GitHub Issue を読み込み、queue.yaml を構築、Leader をディスパッチ
13
+ ├─ Leader (L2) – Issue をサブタスクに分解、Worker をディスパッチ、PR を作成
14
+ │ ├─ Worker (coder) – 単一サブタスクの実装
15
+ │ └─ Worker (tester) – サブタスクのテスト作成
16
+ └─ Review Leader (L2) – レビュー Worker をディスパッチ、結果を集約
17
+ ├─ Worker (code-reviewer) – コード品質レビュー
18
+ ├─ Worker (security) – セキュリティ脆弱性レビュー
19
+ └─ Worker (test-auditor) – テストカバレッジ監査
20
+ ```
21
+
22
+ 各レイヤーは tmux 内で個別の Claude Code インスタンスとして動作します。通信は YAML レポートと `tmux wait-for` シグナルで行われます。GitHub 以外の外部サーバー・データベース・API は不要です。
23
+
24
+ Worker は**多層コンテキスト注入**(ベース+専門特化)を受け取ります:
25
+
26
+ | Worker ロール | ベースコンテキスト | 専門特化 |
27
+ |-------------|-------------|----------------|
28
+ | `worker-coder` | `worker-base.md` | `coder.md` |
29
+ | `worker-tester` | `worker-base.md` | `tester.md` |
30
+ | `worker-code-reviewer` | `reviewer-base.md` | `code-reviewer.md` |
31
+ | `worker-security` | `reviewer-base.md` | `security-reviewer.md` |
32
+ | `worker-test-auditor` | `reviewer-base.md` | `test-auditor.md` |
33
+
34
+ ## 前提条件
35
+
36
+ - **Node.js** >= 18
37
+ - **git**
38
+ - **tmux**
39
+ - **python3**
40
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI (`claude`)
41
+ - [GitHub CLI](https://cli.github.com/) (`gh`) — Issue 同期と PR 操作に使用
42
+
43
+ ## クイックスタート
44
+
45
+ ```bash
46
+ # インストール
47
+ npm install beeops
48
+
49
+ # プロジェクトで初期化
50
+ cd your-project
51
+ npx beeops init
52
+
53
+ # Claude Code から起動
54
+ # Claude Code で /bo と入力
55
+ ```
56
+
57
+ 以下がインストールされます:
58
+ - `/bo` スラッシュコマンド
59
+ - 4つのスキル(dispatch, leader-dispatch, task-decomposer, issue-sync)
60
+ - コンテキスト注入用の UserPromptSubmit フック
61
+
62
+ ## init オプション
63
+
64
+ ```bash
65
+ npx beeops init # .claude/settings.local.json にフック登録(デフォルト)
66
+ npx beeops init --shared # .claude/settings.json にフック登録(チーム共有)
67
+ npx beeops init --global # ~/.claude/settings.json にフック登録(全プロジェクト)
68
+ npx beeops init --with-contexts # カスタマイズ用にコンテキストファイルをコピー
69
+ npx beeops init --locale ja # ロケールを日本語に設定
70
+ ```
71
+
72
+ ## 多言語サポート
73
+
74
+ beeops はエージェントプロンプトの多言語ロケールに対応しています。現在利用可能:**en**(英語、デフォルト)、**ja**(日本語)。
75
+
76
+ ```bash
77
+ # init 時に設定
78
+ npx beeops init --locale ja
79
+
80
+ # 実行時にオーバーライド
81
+ BO_LOCALE=ja /bo
82
+ ```
83
+
84
+ コンテキストファイルは 4段階のフォールバックで解決されます:
85
+ 1. プロジェクトローカル+ロケール (`<project>/.claude/beeops/contexts/<locale>/<file>`)
86
+ 2. プロジェクトローカル・ルート (`<project>/.claude/beeops/contexts/<file>`)
87
+ 3. パッケージ+ロケール (`<pkg>/contexts/<locale>/<file>`)
88
+ 4. パッケージ・ルート (`<pkg>/contexts/<file>`)
89
+
90
+ ## エージェント動作のカスタマイズ
91
+
92
+ ```bash
93
+ # デフォルトコンテキストを編集用にコピー
94
+ npx beeops init --with-contexts
95
+ ```
96
+
97
+ プロジェクト内に `.claude/beeops/contexts/` が作成されます。任意のファイルを編集してエージェントの動作をカスタマイズできます。ファイルを削除するとパッケージのデフォルトにフォールバックします。
98
+
99
+ 主要ファイル:
100
+ - `queen.md` — Queen オーケストレータープロンプト
101
+ - `leader.md` — 実装 Leader プロンプト
102
+ - `review-leader.md` — レビュー Leader プロンプト
103
+ - `worker-base.md` — Worker ベース(自律ルール、レポート形式)
104
+ - `coder.md` — コーダー特化(コーディング規約、Fail Fast、禁止パターン)
105
+ - `tester.md` — テスター特化(テスト計画、境界値、Given-When-Then)
106
+ - `reviewer-base.md` — レビュアーベース(レビュー手順、判定ルール)
107
+ - `code-reviewer.md` — コードレビュー特化(設計、品質、API、パフォーマンス)
108
+ - `security-reviewer.md` — セキュリティ特化(OWASP Top 10、インジェクション、認証)
109
+ - `test-auditor.md` — テスト監査特化(カバレッジ、エッジケース、リグレッション)
110
+ - `agent-modes.json` — 環境変数からコンテキストファイルへのマッピング
111
+
112
+ ## アーキテクチャ
113
+
114
+ ### ワークフロー
115
+
116
+ 1. **Issue 同期**: Queen が GitHub Issue を取得 → `queue.yaml` を構築
117
+ 2. **ディスパッチ**: Queen が git worktree 付きの新しい tmux ウィンドウで Leader を起動
118
+ 3. **実装**: Leader が Issue を分解 → tmux ペインで Worker を起動
119
+ 4. **PR 作成**: 最終 Worker がプルリクエストを作成
120
+ 5. **レビュー**: Queen が Review Leader をディスパッチ → レビュー Worker を起動
121
+ 6. **CI チェック**: 承認後、Queen が CI ステータスを監視
122
+ 7. **修正ループ**: レビュー/CI 失敗時、Queen が修正モードで Leader を再起動(最大3回)
123
+
124
+ ### tmux レイアウト
125
+
126
+ ```
127
+ tmux session "bo"
128
+ ├── [queen] 👑 Queen オーケストレーター(金枠)
129
+ ├── [issue-42] 👑 Issue #42 の Leader(青枠)
130
+ │ ├── pane 0: Leader
131
+ │ ├── pane 1: ⚡ Worker (coder, 緑枠)
132
+ │ └── pane 2: 🧪 Worker (tester, シアン枠)
133
+ └── [review-42] 🔮 Issue #42 の Review Leader(マゼンタ枠)
134
+ ├── pane 0: Review Leader
135
+ ├── pane 1: 🔍 Worker (code-reviewer, 青枠)
136
+ ├── pane 2: 🛡 Worker (security, 赤枠)
137
+ └── pane 3: 🧪 Worker (test-auditor, 黄枠)
138
+ ```
139
+
140
+ `tmux attach -t bo` で全エージェントの動作をリアルタイムに確認できます。
141
+
142
+ ## 検証
143
+
144
+ ```bash
145
+ npx beeops check
146
+ ```
147
+
148
+ コマンド、スキル、フック登録、パッケージ解決など、すべてのコンポーネントが正しくインストールされているか検証します。
149
+
150
+ ## ライセンス
151
+
152
+ MIT
153
+
154
+ ## 作者
155
+
156
+ [YuugouOhno](https://github.com/YuugouOhno)
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # beeops
2
+
3
+ [![npm version](https://img.shields.io/npm/v/beeops)](https://www.npmjs.com/package/beeops)
4
+ [![license](https://img.shields.io/npm/l/beeops)](https://github.com/YuugouOhno/beeops/blob/main/LICENSE)
5
+ [![CI](https://github.com/YuugouOhno/beeops/actions/workflows/ci.yml/badge.svg)](https://github.com/YuugouOhno/beeops/actions/workflows/ci.yml)
6
+ [![Node.js](https://img.shields.io/node/v/beeops)](https://nodejs.org)
7
+
8
+ 3-layer multi-agent orchestration system (Queen → Leader → Worker) for [Claude Code](https://docs.anthropic.com/en/docs/claude-code), powered by tmux.
9
+
10
+ ## Prerequisites
11
+
12
+ - **Node.js** >= 18
13
+ - **git**
14
+ - **tmux**
15
+ - **python3**
16
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI (`claude`)
17
+ - [GitHub CLI](https://cli.github.com/) (`gh`)
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm install beeops
23
+ npx beeops init
24
+ ```
25
+
26
+ ## Quick Start
27
+
28
+ Run `/bo` in Claude Code to start the Queen. She'll sync GitHub Issues, dispatch Leaders to git worktrees, and manage the full workflow — from implementation through code review and CI checks.
29
+
30
+ ```
31
+ Queen (orchestrator)
32
+ ├─ Leader → decomposes issue, dispatches Workers, creates PR
33
+ │ ├─ Worker (coder)
34
+ │ └─ Worker (tester)
35
+ └─ Review Leader → dispatches review Workers, aggregates findings
36
+ ├─ Worker (code-reviewer)
37
+ ├─ Worker (security)
38
+ └─ Worker (test-auditor)
39
+ ```
40
+
41
+ Each layer runs as a separate Claude Code instance in a tmux pane. Communication flows through YAML reports and `tmux wait-for` signals. No external servers or databases required.
42
+
43
+ Attach with `tmux attach -t bo` to watch all agents work in real-time.
44
+
45
+ ## Architecture
46
+
47
+ - **Queen** (L1) — Reads GitHub Issues, builds a queue, dispatches Leaders and Review Leaders
48
+ - **Leader** (L2) — Decomposes an issue into subtasks, launches Workers in parallel, creates PRs
49
+ - **Review Leader** (L2) — Launches review Workers, aggregates findings, approves or requests fixes
50
+ - **Workers** (L3) — Execute a single subtask: coding, testing, or reviewing
51
+
52
+ The system includes **12 specialized skills**, **3 hooks** (UserPromptSubmit for context injection, Stop for session logging, PostToolUse for mid-session checkpoints), and **locale support** (en/ja) with a 4-step fallback chain.
53
+
54
+ Workers receive multi-layer context injection (base + specialization), so each role gets tailored instructions while sharing common autonomous-operation rules.
55
+
56
+ ## Configuration
57
+
58
+ ```bash
59
+ npx beeops init [options]
60
+ ```
61
+
62
+ | Option | Description |
63
+ |--------|-------------|
64
+ | `--local` (default) | Register hooks in `.claude/settings.local.json` (personal use) |
65
+ | `--shared` | Register hooks in `.claude/settings.json` (team-shared, git committed) |
66
+ | `-g`, `--global` | Register hooks in `~/.claude/settings.json` (all projects) |
67
+ | `--with-contexts` | Copy default context files locally for customization |
68
+ | `--locale <lang>` | Set locale (`en` default, `ja` available) |
69
+
70
+ To customize agent behavior, run `npx beeops init --with-contexts` and edit files in `.claude/beeops/contexts/`. Delete any file to fall back to the package default.
71
+
72
+ To verify your installation:
73
+
74
+ ```bash
75
+ npx beeops check
76
+ ```
77
+
78
+ ## License
79
+
80
+ MIT