Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .claude/claudeos/commands/team-onboarding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# /team-onboarding

新しいメンバーが ClaudeOS プロジェクトに参加する際のオンボーディングガイドを対話的に提供するコマンドです。

## 実行内容

以下のステップをシーケンシャルに案内します。

### Step 1: 環境確認

```text
以下の環境が揃っているか確認してください:

- Claude Code CLI インストール済み
- Git / GitHub CLI (gh) インストール済み
- Node.js (LTS) インストール済み
- リポジトリへのアクセス権限確認済み
- GitHub Token 設定済み
```

### Step 2: ClaudeOS 設定ファイル配置

プロジェクトの CLAUDE.md を確認し、以下のファイルが正しく配置されているか検証します。

| ファイル | 場所 | 用途 |
|---|---|---|
| `CLAUDE.md` | リポジトリルート | プロジェクト運用ポリシー |
| `state.json` | リポジトリルート | Goal / KPI / フェーズ管理 |
| `.claude/claudeos/` | リポジトリ内 | エージェント定義・コマンド定義 |
| `~/.claude/CLAUDE.md` | グローバル | 全プロジェクト共通設定 |

### Step 3: ループコマンド説明

ClaudeOS は以下の 4 つのループで自律開発を実行します:

| ループ | 時間 | 責務 |
|---|---|---|
| Monitor | 30m | GitHub / CI / Issue の状態確認・優先順位決定 |
| Development | 60m | 設計・実装・WorkTree 管理 |
| Verify | 45m | test / lint / build / CodeRabbit / CI 確認、STABLE 判定 |
| Improvement | 45m | リファクタリング・ドキュメント更新・再開メモ |

### Step 4: Agent Teams 説明

ClaudeOS の Agent Teams は以下のロールで構成されます:

| ロール | 責務 |
|---|---|
| CTO | 最終判断・優先順位・継続可否 |
| ProductManager | Issue 生成・要件整理 |
| Architect | アーキテクチャ設計 |
| Developer | 実装・修正・修復 |
| Reviewer | Codex + CodeRabbit レビュー・コード品質 |
| Debugger | 原因分析・rescue 実行 |
| QA | テスト・回帰確認・品質評価 |
| Security | secrets・権限・脆弱性確認 |
| DevOps | CI/CD・PR・Deploy Gate |
| Analyst | KPI 分析・メトリクス評価 |
| EvolutionManager | 改善提案・自己進化管理 |
| ReleaseManager | リリース管理・マージ判断 |

### Step 5: state.json の読み方

`state.json` はセッションの単一の真実(Single Source of Truth)です:

```json
{
"goal": { "title": "プロジェクトの目標" },
"kpi": { "success_rate_target": 0.9 },
"execution": {
"phase": "Monitor | Development | Verify | Improvement",
"remaining_minutes": 300
},
"token": { "used": 0, "remaining": 100 }
}
```
Comment on lines +64 to +76

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state.json の例が現行スキーマ(docs/common/schemas/state.schema.json)と整合していません。execution は start_time/max_duration_minutes/elapsed_minutes/remaining_minutes/phase が必須で、phase も単一値(例: "Monitor")の enum です。オンボーディングで混乱しないよう、(1) スキーマに沿った最小例に更新するか、(2) 「抜粋(省略)」であることを明記してください。

Copilot uses AI. Check for mistakes.

### Step 6: 開発フローの把握

```
Issue 起票 → Monitor で優先順位確認
→ Development でブランチ作成・実装
→ commit / push / PR 作成
→ Verify で CI・レビュー確認
→ STABLE 達成 → merge
→ Improvement でドキュメント整備
→ 次の Monitor へ
```

### Step 7: 禁止事項の確認

- `main` への直接 push 禁止
- Issue なし作業禁止
- CI 未通過 merge 禁止
- 無限修復(Auto Repair は最大 15 回)
- Token 超過のまま深掘り継続禁止

### Step 8: 最初のセッション開始

準備完了後、以下を実行してセッションを開始します:

```text
/loop 30m ClaudeOS Monitor
/loop 60m ClaudeOS Development
/loop 45m ClaudeOS Verify
/loop 45m ClaudeOS Improvement
```

## 参照先

| ドキュメント | 場所 |
|---|---|
| プロジェクト設定 | `CLAUDE.md` (リポジトリルート) |
| グローバル設定 | `~/.claude/CLAUDE.md` |
| 運用ループ詳細 | `.claude/claudeos/loops/` |
| Agent 定義 | `.claude/claudeos/agents/` |
| CI Manager | `.claude/claudeos/ci/ci-manager.md` |
Comment on lines +1 to +117

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

/team-onboarding 追加に伴う README 更新が不足しています。

新しいユーザー向けコマンドと運用手順(ループ時間・レビュー運用)を導入しているため、利用者導線として README 側の反映が必要です。

Based on learnings "README must be updated when user-facing features, setup procedures, architecture, or quality gates change".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/claudeos/commands/team-onboarding.md around lines 1 - 117, Summary:
README lacks documentation for the new user-facing /team-onboarding command and
its onboarding/loop procedures. Fix: update the project README to add a new
"Commands / Onboarding" section that documents the /team-onboarding command
(referencing .claude/claudeos/commands/team-onboarding.md), include the
onboarding steps, the loop schedule examples (the /loop 30m/60m/45m/45m
snippets), the expected preconditions (CLI, GitHub token, Node, repo access),
and links to related docs (.claude/claudeos/loops/, .claude/claudeos/agents/,
CLAUDE.md); also update the README TOC/quickstart to surface this command and
the operational rules (no direct main pushes, CI gate, Auto Repair max 15) so
users can find setup and usage easily.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,6 @@ Claude/templates/claude/START_PROMPT-backup*.md
scripts/lib/CLAUDE.md
scripts/main/CLAUDE.md
tests/CLAUDE.md
Claude/templates/claude/instructions/CLAUDE.md
.claude/claudeos/commands/CLAUDE.md
Claude/templates/claude/Claude/
61 changes: 53 additions & 8 deletions Claude/templates/claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ClaudeOS v7.4 — プロジェクト設定
## Autonomous Operations Edition
# ClaudeOS v7.5 — プロジェクト設定
## Autonomous Operations Edition + CodeRabbit Review Integration

このファイルはプロジェクト単位の Claude Code 運用ポリシーです。
グローバル設定(`~/.claude/CLAUDE.md`)の方針を継承しつつ、プロジェクト固有の設定を定義します。
Expand All @@ -21,9 +21,9 @@

```
/loop 30m ClaudeOS Monitor
/loop 2h ClaudeOS Development
/loop 1h ClaudeOS Verify
/loop 1h ClaudeOS Improvement
/loop 60m ClaudeOS Development
/loop 45m ClaudeOS Verify
/loop 45m ClaudeOS Improvement
```

4 本すべての登録が完了するまで、通常の開発作業は開始しないでください。
Expand Down Expand Up @@ -117,9 +117,9 @@ agents、skills、commands、rules、hooks、scripts、contexts、examples、mcp
| ループ | 時間目安 | 責務 | 禁止事項 |
|---|---|---|---|
| Monitor | 30m | 要件・設計・README 差分確認、Git/CI 状態確認、タスク分解 | 実装・修復 |
| Build | 2h | 設計メモ作成、実装、テスト追加、WorkTree 管理 | ついでの大規模整理、main 直接 push |
| Verify | 1h | test / lint / build / security 確認、STABLE 判定 | 未テストの merge |
| Improve | 1h | 命名整理、リファクタリング、README / docs 更新、再開メモ | 破壊的変更の無断実行 |
| Build | 60m | 設計メモ作成、実装、テスト追加、WorkTree 管理 | ついでの大規模整理、main 直接 push |
| Verify | 45m | test / lint / build / security / CodeRabbit 確認、STABLE 判定 | 未テストの merge |
| Improve | 45m | 命名整理、リファクタリング、README / docs 更新、再開メモ | 破壊的変更の無断実行 |

失敗時: `Verify → CI Manager → Auto Repair → 再 Verify`

Expand Down Expand Up @@ -267,6 +267,42 @@ Agent Teams 使用禁止: Lint 修正のみ / 小規模バグ修正 / 順序依
- 深追い禁止
- 同一原因 3 回まで

## 8.5 CodeRabbit 統合(v7.5 追加)

CodeRabbit CLI プラグインを Verify / Review の補助ツールとして使用する。
Codex レビューの代替ではなく、静的解析(40+ 解析器)による補完として位置づける。

### 実行コマンド

| タイミング | コマンド | 目的 |
|---|---|---|
| PR 作成前(推奨) | `/coderabbit:review committed --base main` | コミット済み差分の事前品質チェック |
| Verify フェーズ | `/coderabbit:review all --base main` | 全変更の包括レビュー |
| 修正後の再確認 | `/coderabbit:review uncommitted` | 未コミット修正の即時確認 |

### Codex との統合順序

```
1. /coderabbit:review committed --base main ← 静的解析 + AI(高速・広範)
2. /codex:review --base main --background ← 設計・ロジックの深いレビュー
3. 両方の指摘を統合して修正
```

### 指摘対応ルール

| 重大度 | 対応 |
|---|---|
| Critical | 必須修正。未修正で merge 禁止 |
| High | 必須修正。未修正で merge 禁止 |
| Medium | 原則修正。技術的理由があれば理由を記録してスキップ可 |
| Low | 任意。時間・Token 残量に応じて対応 |

### 対応上限(無限ループ防止)

- 同一ファイルへの修正: 最大 3 ラウンド
- 全体レビューループ: 最大 5 ラウンド
- 上限到達時: 残指摘を Issue に起票して次フェーズへ進む

Comment on lines +270 to +305

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

CodeRabbit 統合を追加したなら、同ファイル内の Reviewer 定義/ログ定義も同期してください。

Line 270-305 で CodeRabbit を正式統合していますが、同ファイルの Agent Teams 定義とログフォーマットが Codex 中心のままで、運用手順が分断されています。Reviewer の責務とログ項目に CodeRabbit を明示して整合させてください。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Claude/templates/claude/CLAUDE.md` around lines 270 - 305, The Reviewer/Agent
Teams definitions and logging template are still Codex-centric while the
document adds CodeRabbit; update the Reviewer role entries (the "Reviewer"
section and any Agent Teams lists) to explicitly include CodeRabbit as a
reviewer agent and add its responsibilities (static-analysis + AI complement)
and the commands (/coderabbit:review committed, all, uncommitted) into the agent
capability table; also modify the log format/logging schema entries to include a
CodeRabbit field (e.g., coderabbit.findings / coderabbit.severity) so logs and
reviewer outputs reference CodeRabbit alongside Codex and ensure the integration
text and Reviewer duty list are consistent across the Agent Teams, Reviewer and
logging template sections.

## 9. STABLE 判定

以下をすべて満たした場合のみ STABLE とします。
Expand Down Expand Up @@ -463,3 +499,12 @@ Document always / README keeps truth
| CI | `claudeos/ci/ci-manager.md` |
| Evolution | `claudeos/evolution/self-evolution.md` |
| グローバル設定 | `~/.claude/CLAUDE.md` |


<claude-mem-context>
# Recent Activity

<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->

*No recent activity*
</claude-mem-context>
66 changes: 49 additions & 17 deletions Claude/templates/claude/START_PROMPT.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# ClaudeOS v7.4 セッション開始
# ClaudeOS v7.5 セッション開始

## LOOP_COMMANDS

/loop 30m ClaudeOS Monitor
/loop 2h ClaudeOS Development
/loop 1h ClaudeOS Verify
/loop 1h ClaudeOS Improvement
/loop 60m ClaudeOS Development
/loop 45m ClaudeOS Verify
/loop 45m ClaudeOS Improvement

4つ全て登録されたら次に進んでください。

## PROMPT_BODY

# ClaudeOS v7.4 完全無人運用版
# ClaudeOS v7.5 完全無人運用版

## Autonomous Operations Edition + AI Dev Factory + Priority Intelligence + Full CI Automation + Auto Loop Intelligence
## Autonomous Operations Edition + AI Dev Factory + Priority Intelligence + Full CI Automation + Auto Loop Intelligence + CodeRabbit Review Integration

## 指示確認プロトコル(必須)

LOOP_COMMANDS 登録・Codex セットアップ完了後、作業を開始する前に、以下の確認チェックリストを出力してください。

```
=== ClaudeOS v7.4 指示確認 ===
=== ClaudeOS v7.5 指示確認 ===
[✅/❌] 01 セッション開始・Codex設定・実行方針
[✅/❌] 02 コア構造・マルチプロジェクト・Goal Driven
[✅/❌] 03 state.json スキーマ・優先順位AI
Expand All @@ -43,9 +43,9 @@ LOOP_COMMANDS 登録・Codex セットアップ完了後、作業を開始する

```text
/loop 30m ClaudeOS Monitor
/loop 2h ClaudeOS Development
/loop 1h ClaudeOS Verify
/loop 1h ClaudeOS Improvement
/loop 60m ClaudeOS Development
/loop 45m ClaudeOS Verify
/loop 45m ClaudeOS Improvement
```

4つ全て登録されたら次に進む。
Expand Down Expand Up @@ -74,9 +74,8 @@ LOOP_COMMANDS 登録・Codex セットアップ完了後、作業を開始する

## 実行方針


- 設定された時間から5時間作業を厳密に守る
- Monitor、Development、Verify、Improvement を最大10回ループ(早期停止・終了はCTO判断、STABLE達成・5時間到達・Token枯渇・Blocked判定で早期終了)
- 設定された時間から5時間作業を厳密に守ってください。
- Monitor、Development、Verify、Improvement を最大10回ループとしてください(早期停止・終了はCTO判断、STABLE達成・5時間到達・Token枯渇・Blocked判定で早期終了)。

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「5時間厳守」と「4フェーズを最大10回ループ」が両方書かれているため、読者が実行上限を誤解しやすいです(現行の 30m+60m+45m+45m だと 1 サイクル約180分で、5時間内に10サイクルは成立しません)。「10回」が“フェーズ遷移回数”なのか“サイクル回数”なのかを明確化するか、5時間制約から導かれる上限に合わせて記述を更新してください。

Suggested change
- Monitor、Development、Verify、Improvement を最大10回ループとしてください(早期停止・終了はCTO判断、STABLE達成・5時間到達・Token枯渇・Blocked判定で早期終了)。
- Monitor、Development、Verify、Improvement の4フェーズを1サイクル(合計約180分)として扱い、5時間上限内で実行可能な範囲までループしてください(早期停止・終了はCTO判断、STABLE達成・5時間到達・Token枯渇・Blocked判定で早期終了)。

Copilot uses AI. Check for mistakes.
- LOOP 登録 4 本・Codex セットアップ・確認チェックリストが全て完了したら、CTO全権委任で自律開発を開始してください。

### 1. AgentTeams活用ルール
Expand Down Expand Up @@ -339,7 +338,7 @@ Agent は以下を唯一の定義ソースとする:
| ProductManager | Issue生成 / Projects同期 |
| Architect | 設計 |
| Developer | 実装 |
| Reviewer | Codexレビュー |
| Reviewer | Codexレビュー / CodeRabbitレビュー |
| Debugger | 原因分析 |
| QA | テスト |
| Security | リスク評価 |
Expand Down Expand Up @@ -374,11 +373,43 @@ Agent は以下を唯一の定義ソースとする:
[Analyst] KPI分析:
[EvolutionManager] 改善:
[ReleaseManager] 判断:
[CodeRabbit] レビュー結果: Critical=N High=N Medium=N Low=N
```

---

# Codex統合・Debug原則
# Codex統合・CodeRabbit統合・Debug原則

## CodeRabbit統合(v7.5)

CodeRabbit は静的解析(40+ 解析器)による広範な品質チェックを担う補完ツール。
Codex の深い設計レビューと組み合わせて使用する。

### 実行コマンド

```text
/coderabbit:review committed --base main # コミット済み差分の事前チェック
/coderabbit:review all --base main # Verify フェーズでの包括レビュー
/coderabbit:review uncommitted # 修正後の即時確認
```

### Codex との統合順序

```
1. /coderabbit:review committed --base main ← 静的解析 (広く・高速)
2. /codex:review --base main --background ← 設計・ロジックレビュー (深く)
3. 両方の指摘を統合して修正
```

### 指摘対応ルール

| 重大度 | 対応 |
|---|---|
| Critical / High | 必須修正。未修正で merge 禁止 |
| Medium | 原則修正。技術的理由があればスキップ可 |
| Low | 任意。Token・時間残量に応じて対応 |

同一ファイル修正: 最大 3 ラウンド / 全体ループ: 最大 5 ラウンド

Comment on lines +412 to 413

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

上限到達時の遷移条件を明記してください(無限停滞リスク)。

Line 412-413 ではラウンド上限は定義されていますが、上限到達後の必須アクションが未定義です。自律運用ではここが未定義だと停滞しやすいです。Issue起票→次フェーズ遷移 まで明記してください。

修正案(追記)
 同一ファイル修正: 最大 3 ラウンド / 全体ループ: 最大 5 ラウンド
+上限到達時は、未解決指摘を Issue に起票し、理由を記録して次フェーズへ進むこと。

Based on learnings Documentation must be kept accurate and maintainable as external-facing truth.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Claude/templates/claude/START_PROMPT.md` around lines 412 - 413,
ドキュメント行「同一ファイル修正: 最大 3 ラウンド / 全体ループ: 最大 5
ラウンド」を修正して、上限到達時の必須遷移を明確に記述してください:具体的には、同一ファイルまたは全体ループの上限に達したら自動で「Issue起票(タイトル・要約・再現手順・優先度を含む)」を作成し、該当タスクを次フェーズへ強制遷移(例:調査フェーズ→人間レビュー/エスカレーション)するフローを追加します(該当箇所:
START_PROMPT.md の該当行の直後に遷移条件と実行アクションを追記)。Ensure the transition includes a clear
trigger, the metadata to record, and the next-phase target to avoid infinite
stalls.

## 通常レビュー

Expand Down Expand Up @@ -789,13 +820,14 @@ GitHub Projects の更新タイミングは 01-session-startup.md「6. GitHub Pr
- 残課題
- 次アクション

## v7.4の本質
## v7.5の本質

- AI が Issue を自動生成する
- AI が GitHub Projects を統制する
- AI が state.json を基に優先順位判断する
- AI が CI を監視し、限定的に自己修復する
- AI が失敗と成功を学習する
- CodeRabbit + Codex の二重レビューで品質を担保する

## 最重要思想

Expand All @@ -818,5 +850,5 @@ GitHub Projects の更新タイミングは 01-session-startup.md「6. GitHub Pr

---

ClaudeOS v7.4 は、AI Dev Factory・優先順位AI・GitHub Projects連携・GitHub Actions CI Manager に加え、Auto Loop Intelligence・可視化・ドキュメント自動更新を統合した、完全自律 AI 開発運用基盤である。
ClaudeOS v7.5 は、AI Dev Factory・優先順位AI・GitHub Projects連携・GitHub Actions CI Manager に加え、Auto Loop Intelligence・可視化・ドキュメント自動更新・CodeRabbit + Codex 二重レビュー統合を実装した、完全自律 AI 開発運用基盤である。

6 changes: 3 additions & 3 deletions Claude/templates/claude/instructions/01-session-startup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

```text
/loop 30m ClaudeOS Monitor
/loop 2h ClaudeOS Development
/loop 1h ClaudeOS Verify
/loop 1h ClaudeOS Improvement
/loop 60m ClaudeOS Development
/loop 45m ClaudeOS Verify
/loop 45m ClaudeOS Improvement
```

4つ全て登録されたら次に進む。
Expand Down
3 changes: 2 additions & 1 deletion Claude/templates/claude/instructions/04-agent-teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| ProductManager | Issue生成 / Projects同期 |
| Architect | 設計 |
| Developer | 実装 |
| Reviewer | Codexレビュー |
| Reviewer | Codexレビュー / CodeRabbitレビュー |
| Debugger | 原因分析 |
| QA | テスト |
| Security | リスク評価 |
Expand Down Expand Up @@ -43,4 +43,5 @@
[Analyst] KPI分析:
[EvolutionManager] 改善:
[ReleaseManager] 判断:
[CodeRabbit] レビュー結果: Critical=N High=N Medium=N Low=N

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

サブエージェント出力フォーマットが固定4セクション規約と不整合です。

[CodeRabbit] ... の単独行追加だと、Summary → Risks → Findings → Next Action の固定順フォーマットを満たしません。CodeRabbit結果は Findings 内に統合する形へ寄せてください。

差分例(固定4セクションへの統合)
-[CodeRabbit] レビュー結果: Critical=N High=N Medium=N Low=N
+[Reviewer]
+Summary: レビュー全体の要約
+Risks: 重大リスク(なければ "なし")
+Findings: CodeRabbit(C/H/M/L) + Codex指摘の統合結果
+Next Action: 修正方針・担当・期限

As per coding guidelines "Structure sub-agent responses using fixed 4-section format: Summary, Risks, Findings, Next Action (in that order), with Risks listed before Findings".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[CodeRabbit] レビュー結果: Critical=N High=N Medium=N Low=N
[Reviewer]
Summary: レビュー全体の要約
Risks: 重大リスク(なければ "なし")
Findings: CodeRabbit(C/H/M/L) + Codex指摘の統合結果
Next Action: 修正方針・担当・期限
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Claude/templates/claude/instructions/04-agent-teams.md` at line 46, The
template adds a standalone line "[CodeRabbit] レビュー結果: Critical=N High=N Medium=N
Low=N" which breaks the required fixed 4-section sub-agent output order (Summary
→ Risks → Findings → Next Action); move or merge the CodeRabbit result line into
the Findings section content so the template preserves the exact 4-section
sequence and ordering, ensure the template explicitly emits "Summary", then
"Risks", then "Findings" (containing the CodeRabbit line), then "Next Action" in
that order without stray standalone lines.

```
Loading
Loading