feat(commands): /team-onboarding を動的生成方式に変更 - #101
Conversation
静的テンプレートから実行命令列 (Phase A-G) への全面書き換え。 プロジェクトごとに異なる ONBOARDING.md を実データ (CLAUDE.md / state.json / セッション履歴) から動的抽出して生成する設計に変更。 主な変更: - CLAUDE.md §18 の禁止事項を Grep で動的ミラー (ハードコード排除) - state.json の 10 ブロック構造を前提とした learning.failure/success_patterns 抽出 - Project Switch Engine (.loop-project-exclude/override.md) 判定を組み込み - 出力先を ./ONBOARDING.md に固定 (docs/ は用途別使用中のため回避) - state.json 未存在時の退避動作を明示 (新規プロジェクト対応) Verify ループ STABLE 成立時の自動更新フック実体は 権限境界明確化のため Issue #100 に分離。 動作検証として本プロジェクトに対して実行し ONBOARDING.md を生成済み (禁止事項 8 件 / Agent 37 体 / Command 34 個を反映)。 Refs: #100 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/claudeos/commands/team-onboarding.md:
- Around line 139-146: 説明文と例が「置換」に誤解されないように、.claude/claudeos/hooks/hooks.json
の既存 PostToolUse 配列に対して新しいエントリ "onboarding-refresh-on-stable" を append
する手順を明記してください:具体的には PostToolUse
配列が存在しない場合は配列を新規作成し、存在する場合は既存配列を上書きせず末尾に追加することを明記し、既存フック(例:
"capture-result")が保持される旨を明記するとともに、ファイル全体の「before」例と「after(追記後)」の完全な JSON
全体例を併記して /team-onboarding と ONBOARDING.md の再実行意図も簡潔に説明してください。
- Around line 39-40: The glob patterns used for Agent/Command collection
(Glob("**/*.md") and Glob("*.md")) are relative and cause missed files; update
the patterns to explicit rooted paths by replacing Glob("**/*.md") with
Glob(".claude/claudeos/agents/**/*.md") and Glob("*.md") with
Glob(".claude/claudeos/commands/*.md"), and also reconcile the Phase E mismatch
where agents/*.md is used so all phases consistently use the
`.claude/claudeos/agents/**/*.md` pattern; ensure the updates are applied
wherever Glob("**/*.md"), Glob("*.md"), or "agents/*.md" appear (notably lines
referenced around 39–40 and 106–110).
- Around line 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.
- Around line 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 分配を参照している箇所)です。
- 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.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ba888ed9-3f87-443c-9795-8c91fe992854
📒 Files selected for processing (2)
.claude/claudeos/commands/team-onboarding.mdONBOARDING.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Prepare
- GitHub Check: test-and-validate
- GitHub Check: PSScriptAnalyzer
🧰 Additional context used
📓 Path-based instructions (3)
{docs/**,**.md,.claude/**}
📄 CodeRabbit inference engine (AGENTS.md)
Structure sub-agent responses using fixed 4-section format: Summary, Risks, Findings, Next Action (in that order), with Risks listed before Findings
Files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
**/*: Perform Codex review using /codex:review --base main --background for all changes
Perform adversarial Codex review using /codex:adversarial-review --base main --background for authentication/authorization changes, database schema modifications, concurrent processing additions, and pre-release final verification
Use CodeRabbit static analysis as a complementary tool to Codex review (not a replacement): execute /coderabbit:review committed --base main before PR creation, /coderabbit:review all --base main during Verify phase, and /coderabbit:review uncommitted for post-fix re-verification
Enforce CodeRabbit finding resolution: Critical and High severity findings are mandatory fixes blocking merge, Medium severity is mandatory with exception documentation allowed, Low severity is optional based on time/token availability
Limit CodeRabbit feedback loops: maximum 3 rounds per file, maximum 5 rounds for overall review; escalate remaining findings to Issues when limits reached
Prohibit direct push to main branch; all changes must use branches or WorkTree with mandatory PR and CI success before merge
Require Codex review approval before merging any PR
At 5-hour limit, ensure minimal commit unit, push changes, create PR (Draft acceptable), update GitHub Projects status, collect test/lint/build/CI results, document remaining tasks and restart point, update README.md with end-of-session summary, and produce final status report
Do not directly push to main branch, modify main without PR, merge without CI success, execute unlimited repairs, merge without verification, apply fixes without root cause understanding, or deep dive when token budget is depleted
Files:
ONBOARDING.md
**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.md: Include in PR body: change description, test results, impact scope, and remaining tasks
Keep all documentation files (README.md, docs/) synchronized with implementation; ensure external-facing documentation is complete and not abandoned
Files:
ONBOARDING.md
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: Claude/CLAUDE.md:0-0
Timestamp: 2026-04-14T02:12:21.915Z
Learning: Applies to Claude/**/README.md : README must be updated when user-facing features, setup procedures, architecture, or quality gates change
📚 Learning: 2026-04-14T02:12:21.915Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: Claude/CLAUDE.md:0-0
Timestamp: 2026-04-14T02:12:21.915Z
Learning: Applies to Claude/**/README.md : README must be updated when user-facing features, setup procedures, architecture, or quality gates change
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T06:21:13.377Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: Claude/templates/claude/CLAUDE.md:0-0
Timestamp: 2026-04-14T06:21:13.377Z
Learning: Applies to Claude/templates/claude/**/README.md : Update README.md whenever the following changes: user-facing features, setup procedures, architecture, or quality gates. Treat README as the external-facing truth. Do not leave README unable to withstand external explanation.
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T02:12:41.360Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: Claude/templates/claudeos/examples/CLAUDE.md:0-0
Timestamp: 2026-04-14T02:12:41.360Z
Learning: Applies to Claude/templates/claudeos/examples/**/CLAUDE.md : Define README update policy in CLAUDE.md at project root
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T06:20:36.544Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-14T06:20:36.544Z
Learning: Applies to README.md : Maintain README.md as the authoritative external truth source; update when user-facing features, setup procedures, architecture, or quality gates change; use tables and diagrams extensively for clarity
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T02:12:41.360Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: Claude/templates/claudeos/examples/CLAUDE.md:0-0
Timestamp: 2026-04-14T02:12:41.360Z
Learning: Applies to Claude/templates/claudeos/examples/**/CLAUDE.md : Define project language in CLAUDE.md at project root
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T02:12:41.360Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: Claude/templates/claudeos/examples/CLAUDE.md:0-0
Timestamp: 2026-04-14T02:12:41.360Z
Learning: Applies to Claude/templates/claudeos/examples/**/CLAUDE.md : Define branch strategy in CLAUDE.md at project root
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T02:12:41.360Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: Claude/templates/claudeos/examples/CLAUDE.md:0-0
Timestamp: 2026-04-14T02:12:41.360Z
Learning: Applies to Claude/templates/claudeos/examples/**/CLAUDE.md : Define test procedures in CLAUDE.md at project root
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T02:12:54.820Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-14T02:12:54.820Z
Learning: Applies to {docs/**,**.md,.claude/**} : Structure sub-agent responses using fixed 4-section format: Summary, Risks, Findings, Next Action (in that order), with Risks listed before Findings
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T06:20:36.544Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-14T06:20:36.544Z
Learning: Configuration directory is .claude/claudeos containing agents, skills, commands, rules, hooks, scripts, contexts, examples, mcp-configs, and kernel documentation
Applied to files:
ONBOARDING.md
📚 Learning: 2026-04-14T02:12:21.915Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: Claude/CLAUDE.md:0-0
Timestamp: 2026-04-14T02:12:21.915Z
Learning: Applies to Claude/.claude/CLAUDE.md : Project-specific configuration should be placed at `.claude/CLAUDE.md` in the repository root and overrides global Claude settings when necessary
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T06:20:36.544Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-14T06:20:36.544Z
Learning: Execute automatic startup sequence on session start: Register 4 loop commands (/loop 30min ClaudeOS Monitor, /loop 2h ClaudeOS Development, /loop 1h15m ClaudeOS Verify, /loop 1h15m ClaudeOS Improvement) totaling 5 hours with phase distribution: Monitor 10% / Development 40% / Verify 25% / Improvement 25%
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
📚 Learning: 2026-04-14T06:21:13.377Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCLI-CodexCLI-CopilotCLI-StartUpTools-New PR: 0
File: Claude/templates/claude/CLAUDE.md:0-0
Timestamp: 2026-04-14T06:21:13.377Z
Learning: Execute the following 4 loop commands in order at session start: `/loop 30min ClaudeOS Monitor`, `/loop 2h ClaudeOS Development`, `/loop 1h15m ClaudeOS Verify`, `/loop 1h15m ClaudeOS Improvement`. Do not begin normal development work until all 4 registrations are complete.
Applied to files:
ONBOARDING.md.claude/claudeos/commands/team-onboarding.md
🔇 Additional comments (1)
ONBOARDING.md (1)
15-39: フォールバック設計は明確で運用しやすいです。Summary:
state.json未存在時の退避挙動が具体的に記述されており、初回運用で迷いにくいです。
Risks: 現時点では重大なリスクは見当たりません。
Findings: Goal/KPI/学習履歴の欠損時メッセージと次回反映条件が一貫しています。
Next Action: この方針を維持しつつ、自動再生成フック(Issue#100)実装後に整合性を再確認してください。
| | `.claude/claudeos/agents/` | `Glob("**/*.md")` | Agent Teams 未整備として記録 | | ||
| | `.claude/claudeos/commands/` | `Glob("*.md")` | コマンド未整備として記録 | |
There was a problem hiding this comment.
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 に統一してください。
差分案
-| `.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")` | コマンド未整備として記録 |
@@
-{.claude/claudeos/agents/*.md を Glob し、ファイル名とフロントマターの description を表形式で列挙}
+{.claude/claudeos/agents/**/*.md を Glob し、ファイル名とフロントマターの description を表形式で列挙}Also applies to: 106-110
🤖 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 39 - 40, The glob
patterns used for Agent/Command collection (Glob("**/*.md") and Glob("*.md"))
are relative and cause missed files; update the patterns to explicit rooted
paths by replacing Glob("**/*.md") with Glob(".claude/claudeos/agents/**/*.md")
and Glob("*.md") with Glob(".claude/claudeos/commands/*.md"), and also reconcile
the Phase E mismatch where agents/*.md is used so all phases consistently use
the `.claude/claudeos/agents/**/*.md` pattern; ensure the updates are applied
wherever Glob("**/*.md"), Glob("*.md"), or "agents/*.md" appear (notably lines
referenced around 39–40 and 106–110).
| | Development | 60m | 設計・実装・WorkTree 管理 | | ||
| | Verify | 45m | test / lint / build / CodeRabbit / CI 確認、STABLE 判定 | | ||
| | Improvement | 45m | リファクタリング・ドキュメント更新・再開メモ | | ||
| 1. `Grep(pattern="^## .*禁止", path="./CLAUDE.md", output_mode="content", -A=30)` — `## 18. 禁止事項` セクションを取得 |
There was a problem hiding this comment.
🧩 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.
| `state.json` が存在した場合、**10 ブロック構造** を前提に以下を読む: | ||
|
|
||
| | ロール | 責務 | | ||
| | ブロック | 抽出対象 | | ||
| |---|---| | ||
| | 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 } | ||
| } | ||
| | `project` | プロジェクト識別情報 | | ||
| | `goal` | 現在の目標(title / description) | | ||
| | `kpi` | 達成目標値と現在値 | | ||
| | `execution` | `phase` / `remaining_minutes` — 進行中であれば再開ポイント扱い | | ||
| | `automation` | `auto_issue_generation` / `self_evolution` フラグ | | ||
| | `priority` | 優先順位リスト | | ||
| | `learning` | `failure_patterns` / `success_patterns` — これが最重要。最大 5 件を「このプロジェクトでよくハマる点」として転記 | | ||
| | `github` | Projects / Issues / PR の最新状態 | | ||
| | `status` | ループ実行状態 | | ||
| | `codex` | `last_review_status` / `blocking_issues` — 未解決の重大指摘があれば Onboarding 先頭で警告 | | ||
|
|
There was a problem hiding this comment.
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 分配を参照している箇所)です。
| ## 10. セッション開始手順 | ||
|
|
||
| CLAUDE.md §0 の 4 ループ登録コマンドを、**このプロジェクトの state.json から抽出した** 時間配分で生成: | ||
|
|
||
| {state.json.execution.loop_distribution があればそれを優先、無ければ CLAUDE.md §0 デフォルト値} | ||
|
|
There was a problem hiding this comment.
セッション開始手順に必須レビューコマンドが不足しています。
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.
| 1. `.claude/claudeos/hooks/hooks.json` に以下のエントリが存在しない場合、追記を **提案する**(勝手に編集しない。ユーザー確認後に Edit): | ||
| ```json | ||
| { | ||
| "PostToolUse": [ | ||
| { "name": "onboarding-refresh-on-stable", "description": "STABLE 判定成立時に /team-onboarding を再実行し ONBOARDING.md を更新" } | ||
| ] | ||
| } | ||
| ``` |
There was a problem hiding this comment.
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.
Pull request overview
/team-onboarding コマンドを静的テンプレート方式から、リポジトリの実データ(CLAUDE.md / state.json / .claude/claudeos / Git 履歴など)を収集して ONBOARDING.md を動的生成する方式へ移行するPRです。
Changes:
.claude/claudeos/commands/team-onboarding.mdを Phase A〜G の実行命令列として全面刷新- 生成物サンプルとして
ONBOARDING.mdを新規追加(動的抽出結果の例)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
ONBOARDING.md |
/team-onboarding により生成されるオンボーディング成果物のサンプルを追加 |
.claude/claudeos/commands/team-onboarding.md |
プロジェクト判定→データ収集→禁止事項/学習履歴抽出→ONBOARDING生成→Verify連動提案までの手順を定義 |
| 1. `Grep(pattern="^## .*禁止", path="./CLAUDE.md", output_mode="content", -A=30)` — `## 18. 禁止事項` セクションを取得 | ||
| 2. リスト項目(`- ` で始まる行)を **すべて** 抽出し、件数を明示して ONBOARDING.md に転記 |
There was a problem hiding this comment.
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 に転記 |
| | Development | 60m | 設計・実装・WorkTree 管理 | | ||
| | Verify | 45m | test / lint / build / CodeRabbit / CI 確認、STABLE 判定 | | ||
| | Improvement | 45m | リファクタリング・ドキュメント更新・再開メモ | | ||
| 1. `Grep(pattern="^## .*禁止", path="./CLAUDE.md", output_mode="content", -A=30)` — `## 18. 禁止事項` セクションを取得 |
There was a problem hiding this comment.
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. 禁止事項` セクションを、見出し開始から**次の `##` 見出し直前まで**構造ベースで取得 |
| | `.claude/claudeos/agents/` | `Glob("**/*.md")` | Agent Teams 未整備として記録 | | ||
| | `.claude/claudeos/commands/` | `Glob("*.md")` | コマンド未整備として記録 | |
There was a problem hiding this comment.
Phase B の Glob パターンが取得対象ディレクトリを含んでいないため、実行ディレクトリ次第で repo 全体の Markdown を拾ってしまい、Agent 一覧が誤生成になります。Glob(".claude/claudeos/agents/**/*.md") のようにベースパス込みで指定するか、対象ディレクトリに対して明示的に絞り込む形に修正してください。
| | `.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")` | コマンド未整備として記録 | |
Summary
/team-onboardingを静的テンプレートから 実行命令列 (Phase A-G) に全面書き換えONBOARDING.mdを実データから動的抽出して生成背景と狙い
レビュー指摘により、従来の
/team-onboardingが以下の 8 点で公式 Claude Code の/team-onboardingと乖離していることが判明:本 PR はこれら全 8 点を解消。
主な変更
.claude/claudeos/commands/team-onboarding.mdGrep(pattern="^## .*禁止")で CLAUDE.md §18 をミラー./ONBOARDING.md固定出力。11 セクション構成ONBOARDING.md(新規)本プロジェクトに対して動作検証を実行した結果の生成物。
.claude/claudeos/agents/から Glob 取得).claude/claudeos/commands/から Glob 取得)設計原則
関連 Issue
onboarding-refresh-on-stable.md実装(本 PR から分離)Test plan
.claude/claudeos/commands/team-onboarding.mdの Phase A-G が tool 起動命令として明示されているONBOARDING.md§7 で検証)🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート
新機能
ドキュメント