Repository navigation
feat(commands): /team-onboarding を動的生成方式に変更 #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,117 +1,191 @@ | ||||||||||
| # /team-onboarding | ||||||||||
|
|
||||||||||
| 新しいメンバーが ClaudeOS プロジェクトに参加する際のオンボーディングガイドを対話的に提供するコマンドです。 | ||||||||||
| 現在のプロジェクトを解析し、プロジェクト固有の `ONBOARDING.md` を動的生成するコマンドです。 | ||||||||||
|
|
||||||||||
| ## 実行内容 | ||||||||||
| ClaudeOS フレームワーク全般の説明ではなく、**このリポジトリで実際に何をどう扱うか** を、 | ||||||||||
| 実データ(`CLAUDE.md` / `state.json` / `.claude/claudeos/` / Git 履歴 / セッション学習履歴)から | ||||||||||
| 抽出して記述します。 | ||||||||||
|
|
||||||||||
| 以下のステップをシーケンシャルに案内します。 | ||||||||||
| --- | ||||||||||
|
|
||||||||||
| ### Step 1: 環境確認 | ||||||||||
| ## 実行契約(Claude はこの順で tool を起動すること) | ||||||||||
|
|
||||||||||
| ```text | ||||||||||
| 以下の環境が揃っているか確認してください: | ||||||||||
| 以下は説明ではなく **Claude への命令列** です。ステップを飛ばさず、順に実行してください。 | ||||||||||
| 各ステップの「入力」が揃わない場合は、該当ステップで代替動作に切り替え、生成物にその旨を明記します。 | ||||||||||
|
|
||||||||||
| - Claude Code CLI インストール済み | ||||||||||
| - Git / GitHub CLI (gh) インストール済み | ||||||||||
| - Node.js (LTS) インストール済み | ||||||||||
| - リポジトリへのアクセス権限確認済み | ||||||||||
| - GitHub Token 設定済み | ||||||||||
| ``` | ||||||||||
| ### Phase A: プロジェクト判定 | ||||||||||
|
|
||||||||||
| 1. **CWD 取得**: `Bash("pwd")` で現在のプロジェクトルートを取得する | ||||||||||
| 2. **Git 情報取得**: 並列で `Bash("git remote get-url origin")` と `Bash("git rev-parse --abbrev-ref HEAD")` を実行 | ||||||||||
| 3. **CLAUDE.md 存在確認**: `Read("./CLAUDE.md")` — 存在しない場合は Phase B に進まず、以下のメッセージで中断: | ||||||||||
| ``` | ||||||||||
| このプロジェクトには CLAUDE.md が存在しないため、/team-onboarding は実行できません。 | ||||||||||
| 先に ClaudeOS の初期化を実施してください。 | ||||||||||
| ``` | ||||||||||
| 4. **Project Switch Engine 判定**: `Glob(".loop-project-exclude.md")` と `Glob(".loop-project-override.md")` を並列実行 | ||||||||||
| - `exclude` が存在 → 対象外プロジェクトとして中断(Onboarding 不要) | ||||||||||
| - `override` が存在 → 内容を読み取り、後続 Phase の判定に優先適用 | ||||||||||
|
|
||||||||||
| ### Step 2: ClaudeOS 設定ファイル配置 | ||||||||||
| ### Phase B: 設定データ収集 | ||||||||||
|
|
||||||||||
| プロジェクトの CLAUDE.md を確認し、以下のファイルが正しく配置されているか検証します。 | ||||||||||
| 以下を **並列で** 実行する(Read / Glob / Bash の独立呼び出しは 1 メッセージで束ねること): | ||||||||||
|
|
||||||||||
| | ファイル | 場所 | 用途 | | ||||||||||
| | 取得対象 | tool | 存在しない場合 | | ||||||||||
| |---|---|---| | ||||||||||
| | `CLAUDE.md` | リポジトリルート | プロジェクト運用ポリシー | | ||||||||||
| | `state.json` | リポジトリルート | Goal / KPI / フェーズ管理 | | ||||||||||
| | `.claude/claudeos/` | リポジトリ内 | エージェント定義・コマンド定義 | | ||||||||||
| | `~/.claude/CLAUDE.md` | グローバル | 全プロジェクト共通設定 | | ||||||||||
| | `./CLAUDE.md` | `Read` | Phase A で弾くので到達しない | | ||||||||||
| | `./state.json` | `Read` | 動的生成前で未存在が通常。欠損時は `CLAUDE.md` §4 Goal Driven System から Goal / KPI の初期値テンプレを抽出 | | ||||||||||
| | `./README.md` | `Read` | `README未整備` と記録 | | ||||||||||
| | `.claude/claudeos/CLAUDE.md` | `Read` | 継承なし、グローバル設定のみとみなす | | ||||||||||
| | `.claude/claudeos/agents/` | `Glob("**/*.md")` | Agent Teams 未整備として記録 | | ||||||||||
| | `.claude/claudeos/commands/` | `Glob("*.md")` | コマンド未整備として記録 | | ||||||||||
|
Comment on lines
+39
to
+40
|
||||||||||
| | `.claude/claudeos/agents/` | `Glob("**/*.md")` | Agent Teams 未整備として記録 | | |
| | `.claude/claudeos/commands/` | `Glob("*.md")` | コマンド未整備として記録 | | |
| | `.claude/claudeos/agents/` | `Glob(".claude/claudeos/agents/**/*.md")` | Agent Teams 未整備として記録 | | |
| | `.claude/claudeos/commands/` | `Glob(".claude/claudeos/commands/*.md")` | コマンド未整備として記録 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# 目的: リポジトリ内で使われている Grep(...) 記法の実例を収集し、引数形式を検証する
rg -n -C2 'Grep\s*\(' --type=md
rg -n -C2 'output_mode\s*=' --type=md
rg -n -C2 '\-A\s*=?\s*[0-9]+' --type=mdRepository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 86
🏁 Script executed:
# ファイル存在確認と内容確認
ls -la ".claude/claudeos/commands/team-onboarding.md" 2>&1 | head -20
echo "---"
# ファイルサイズを確認
wc -l ".claude/claudeos/commands/team-onboarding.md" 2>&1
echo "---"
# 該当行周辺を確認 (45-50行目)
sed -n '45,50p' ".claude/claudeos/commands/team-onboarding.md" 2>&1Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 508
🏁 Script executed:
# より広範なGrepパターン検索 (大文字小文字区別なし)
rg -i 'grep\s*\(' -A 2 -B 2 --type=md 2>&1 | head -100Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 86
🏁 Script executed:
# markdown形式で "-A" を含む行を検索
rg '\-A' --type=md -n 2>&1 | head -50Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 4216
🏁 Script executed:
# 全ファイルタイプでGrep()を検索(定義と使用例)
rg -i 'grep\s*\(' -A 3 -B 1 2>&1 | head -80Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 86
🏁 Script executed:
# .claude ディレクトリ内を探索
find .claude -type f -name "*.md" -o -name "*.json" -o -name "*.txt" 2>&1 | head -50Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 2101
🏁 Script executed:
# Grep関数の定義やドキュメントを探索
rg -i 'def.*grep|function.*grep|grep.*function' --type=md --type=json 2>&1Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 86
🏁 Script executed:
# team-onboarding.md の全文を確認(仕様を理解するため)
head -100 ".claude/claudeos/commands/team-onboarding.md"Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 3273
🏁 Script executed:
# プラグイン定義を確認
cat ".claude/claudeos/.claude-plugin/plugin.json" 2>&1 | head -150Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 1045
🏁 Script executed:
# marketplace.jsonも確認
cat ".claude/claudeos/.claude-plugin/marketplace.json" 2>&1 | head -150Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 532
🏁 Script executed:
# CLAUDE.md を確認(ツール定義がある可能性)
head -200 ".claude/claudeos/CLAUDE.md" 2>&1Repository: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New
Length of output: 4639
Grep() 関数の引数形式を統一してください。CLI フラグと命名パラメータが混在しています。
-A=30 の記法は grep/rg の CLI オプション形式ですが、前の引数(pattern=, path=, output_mode=)は関数の命名パラメータ形式です。この混在はツール実装の解釈エラーを招きます。
修正例
Grep(pattern="^## .*禁止", path="./CLAUDE.md", output_mode="content", afterLines=30)
または
Grep(pattern="^## .*禁止", path="./CLAUDE.md", output_mode="content", lines_after=30)
リポジトリ内に他の Grep() 呼び出し例がないため、.claude-plugin/ の tool 定義または CLAUDE.md のツール仕様セクションで期待される引数形式を確認し、それに統一してください。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/claudeos/commands/team-onboarding.md at line 47, The Grep() call
mixes CLI-style flags with named parameters causing parsing ambiguity; update
the call (Grep) to use the tool's expected named-parameter form (e.g., replace
the CLI-style "-A=30" with a named argument such as afterLines=30 or
lines_after=30) and ensure this matches the argument name defined in the tool
spec (check the .claude-plugin tool definition or the CLAUDE.md tool-spec
section for the exact parameter name) so all Grep() invocations use a consistent
named-parameter format.
Copilot
AI
Apr 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phase C の抽出範囲を固定長(-A=30)にしているため、禁止事項セクションが今後拡張された場合に末尾が欠けて「全項目を動的ミラー」の契約を満たせなくなります。行数ではなく「次の見出しまで」など構造に基づいて範囲決定する方式にしてください。
| 1. `Grep(pattern="^## .*禁止", path="./CLAUDE.md", output_mode="content", -A=30)` — `## 18. 禁止事項` セクションを取得 | |
| 1. `Bash("awk '/^## .*禁止/{flag=1} flag{print} flag && /^## / && !/^## .*禁止/{exit}' ./CLAUDE.md | sed '${/^## /d;}'")` — `## 18. 禁止事項` セクションを、見出し開始から**次の `##` 見出し直前まで**構造ベースで取得 |
Copilot
AI
Apr 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phase C の Grep(..., -A=30) だと ## 18. 禁止事項 の直後にある ## 19. 自動停止条件 の箇条書き(- STABLE 達成 など)まで一緒に取得され、手順 2 の「- で始まる行をすべて抽出」に従うと禁止事項が混入します。## 18 から次の ## 見出し直前までを切り出すなど、セクション境界で抽出範囲を限定してください。
| 1. `Grep(pattern="^## .*禁止", path="./CLAUDE.md", output_mode="content", -A=30)` — `## 18. 禁止事項` セクションを取得 | |
| 2. リスト項目(`- ` で始まる行)を **すべて** 抽出し、件数を明示して ONBOARDING.md に転記 | |
| 1. `## 18. 禁止事項` 見出しを起点に取得し、**次の `## ` 見出し直前まで** を禁止事項セクションとして切り出す(固定行数の `-A` では取得しない) | |
| 2. 手順 1 で切り出した **禁止事項セクション内のみ** から、リスト項目(`- ` で始まる行)を抽出し、件数を明示して ONBOARDING.md に転記 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state.json スキーマ定義と参照フィールドが不整合です。
Summary: Phase D の定義にない execution.loop_distribution を Phase E が前提にしています。
Risks: 実装者がどのキーを信頼すべきか判断できず、常時デフォルトフォールバック化する恐れがあります。
Findings: 抽出対象一覧(Line 53-67)と生成ロジック(Line 126-129)の契約が一致していません。
Next Action: loop_distribution を Phase D の抽出契約に明記するか、Phase E 側の参照を既定キーへ合わせてください。
Also applies to: 126-129
🤖 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 53 - 67,
state.json のスキーマ不整合:Phase E が参照する execution.loop_distribution が Phase D
の抽出契約に定義されていないため、実装側がどのキーを使うか不明瞭です。修正方法は一つに統一してください — ① Phase D の抽出対象一覧に
execution.loop_distribution を明記してスキーマに追加する(抽出ロジック/生成ロジック両方で利用可能にする)、または ② Phase
E 側の参照を既存の既定キー(例: execution.distribution など)に切り替えて参照先を整合させる。対象となる識別子は
execution.loop_distribution、Phase D、Phase E、抽出対象一覧(state.json
スキーマ)および生成ロジック(loop 分配を参照している箇所)です。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
セッション開始手順に必須レビューコマンドが不足しています。
Summary: /codex:setup と /codex:status のみで、規約上必須のレビュー実行フローが欠けています。
Risks: Verify での品質ゲート運用漏れが発生し、PR マージ判断が不完全になります。
Findings: /codex:review --base main --background と CodeRabbit 補完フロー(/coderabbit:review ...)が手順に含まれていません。
Next Action: セッション開始または Verify 手順に、規約で定める Codex/CodeRabbit 実行コマンドを明示してください。
As per coding guidelines, "Perform Codex review using /codex:review --base main --background for all changes" and "Use CodeRabbit static analysis as a complementary tool to Codex review ...".
Also applies to: 144-149
🤖 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 124 - 129, Update
the session start and/or Verify steps to include the required automated review
commands: add an explicit execution of "/codex:review --base main --background"
and the CodeRabbit complement "/coderabbit:review ..." (with appropriate target
args) into the step list where "/codex:setup" and "/codex:status" are currently
specified (see the session start block and the Verify procedure referenced at
lines ~124-129 and ~144-149); ensure the text specifies running Codex review for
all changes and running CodeRabbit static analysis as a complementary flow so
the required review gate is always invoked during session start or before Verify
completes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hook 追記の JSON 例は「置換」に誤解されやすいです。
Summary: PostToolUse 配列のみの断片提示だと既存要素消失の誤編集を誘発します。
Risks: 既存フック(例: capture-result)が欠落し、運用フローが壊れる可能性があります。
Findings: 「追記提案」意図に対して、提示 JSON がマージ方法を示していません。
Next Action: 「既存配列へ append」手順を明示し、全体例を併記してください。
🤖 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 139 - 146,
説明文と例が「置換」に誤解されないように、.claude/claudeos/hooks/hooks.json の既存 PostToolUse
配列に対して新しいエントリ "onboarding-refresh-on-stable" を append する手順を明記してください:具体的には
PostToolUse 配列が存在しない場合は配列を新規作成し、存在する場合は既存配列を上書きせず末尾に追加することを明記し、既存フック(例:
"capture-result")が保持される旨を明記するとともに、ファイル全体の「before」例と「after(追記後)」の完全な JSON
全体例を併記して /team-onboarding と ONBOARDING.md の再実行意図も簡潔に説明してください。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glob の探索範囲指定が不正確で、列挙漏れを起こします。
Summary: Agent/Command の収集指定がカレント依存で、意図したディレクトリを確実に走査できません。
Risks: ONBOARDING の Agent 数・Command 数が欠落/過少になる可能性があります。
Findings:
Glob("**/*.md")とGlob("*.md")がベースパスなし、かつ Phase E ではagents/*.mdと再び不一致です。Next Action: 収集パターンを
.claude/claudeos/agents/**/*.mdと.claude/claudeos/commands/*.mdに統一してください。差分案
Also applies to: 106-110
🤖 Prompt for AI Agents