jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Openclaw Workspace Governance

openclaw-workspace-governance

複雑なOpenClawワークスペースの多Agentガバナンス、事実の階層化、クエリルーティング、セマンティック検索診断、ワークセットの維持管理といったシステムレベルのアップグレードと統治を行うためのSkillです。

⏱ コードレビュー 1時間 → 10分
📜 元の英語説明(参考)

🚨【高危预警 / IMPORTANT WARNING】这不是工具Skill,而是系统级架构升级!部署前务必备份工作区!This is NOT a standard tool skill, but a system-level architecture upgrade! Backup workspace before deployment! 虾滑 OpenClaw 工作区治理:用于治理和升级复杂 OpenClaw 工作区,覆盖多 Agent 治理、权威事实分层、查询分类路由、语义搜索诊断、工作集保鲜与维护收口。

🇯🇵 日本人クリエイター向け解説

一言でいうと

複雑なOpenClawワークスペースの多Agentガバナンス、事実の階層化、クエリルーティング、セマンティック検索診断、ワークセットの維持管理といったシステムレベルのアップグレードと統治を行うためのSkillです。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o openclaw-workspace-governance.zip https://jpskill.com/download/5160.zip && unzip -o openclaw-workspace-governance.zip && rm openclaw-workspace-governance.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/5160.zip -OutFile "$d\openclaw-workspace-governance.zip"; Expand-Archive "$d\openclaw-workspace-governance.zip" -DestinationPath $d -Force; ri "$d\openclaw-workspace-governance.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して openclaw-workspace-governance.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → openclaw-workspace-governance フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-18
同梱ファイル
16

💬 こう話しかけるだけ — サンプルプロンプト

  • Openclaw Workspace Governance を使って、最小構成のサンプルコードを示して
  • Openclaw Workspace Governance の主な使い方と注意点を教えて
  • Openclaw Workspace Governance を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] openclaw-workspace-governance

蝦滑 OpenClaw 作業空間ガバナンス(OpenClaw Workspace Governance)

🚨 高危/重要提示 (IMPORTANT WARNING) 🚨 これは通常のツール型 Skill ではありません。OpenClaw 作業空間に対するシステムレベルのアーキテクチャアップグレードとガバナンスソリューションです。 Agent にこのガイドラインを実装させる前に、必ず作業空間の完全なバックアップを取り、ファイルの状態と検索の優先順位に対する変更を理解していることを確認してください。スナップショットを取っていない本番環境で、全自動ガバナンスを盲目的に実行しないでください!

This is NOT a standard tool-level skill. It is a system-level architecture upgrade and governance framework for your OpenClaw workspace. Before allowing your Agent to implement these guidelines, you MUST take a full backup of your workspace. Do not run automated governance in a production environment without understanding how it alters document states and retrieval routing.

これは複雑な OpenClaw 作業空間向けのガバナンス型 Skill です。これは、より多くのプロセスを作成するためではなく、複雑さが増した後に、ドリフトを抑え、現在の事実層を明確にし、ライブドキュメントの面積を縮小し、セマンティック検索をより制御可能にするために役立ちます。

システム能力詳解 (System Capabilities)

本 Skill は、OpenClaw に以下のコア機能を与える完全なシステムレベルのフレームワークを提供します。

  • マルチエージェントアーキテクチャ (Multi-Agent Architecture):Supervisor を中心としたスケジューリングメカニズムを確立し、「書き込みとレビューの分離」を実現します。コード作成、コードレビュー、ルールレビュー、ドキュメント作成などの専門職を明確に区別し、単一の Agent が権限を越えて閉鎖することを防ぎます。
  • 階層型メモリシステム (Layered Memory System):無秩序な長文ドキュメントの積み重ねに別れを告げます。「原始ログ (Daily Notes)」から「テーマカード (Topic Cards)」へ、そして「長期記憶 (Long-Term Memory)」へと、段階的な蒸留と品質ゲートメカニズムを確立します。
  • セマンティック検索とルーティング (Semantic Retrieval Routing):システムクエリを分類し(例:状態クエリ、ルール境界、履歴追跡など)、ブリッジファイル (Bridge Files)、構造化メモリ、qmd セマンティック検索に基づいた正確な呼び出し優先順位を確立します。
  • 承認とセキュリティガバナンス (Approval & Governance):コアファイル(例:AGENTS.md)の変更には、独立したレビューと手動承認を強制します。特定の職務に対する「怠慢防止プロトコル(コードデリバリー契約)」を内蔵し、自動化されたタスクの実行の完全性を保証します。

適用シーン

作業空間に実際の複雑さが出現したときに、この Skill を使用してください。典型的な兆候は以下の通りです。

  • 複数の Agent または複数の役割の実行パスが出現している
  • ドキュメント、記憶、状態層が増加している
  • 「今、何が本当なのか」という問いに答えるのが難しくなっている
  • semantic search(セマンティック検索)は役立つが、盲目的に信頼できなくなっている
  • ライブドキュメントが多すぎる、ワーキングセットが不明確、メンテナンスが制御不能になっている

⚠️ これは上級者向け Skill であり、初心者向けパッケージや v1 の全自動オーケストレーターではありません。

非目標

この Skill は、自動で決定を下したり、自動でルールを変更したり、すべての古いドキュメントを「ライブドキュメント」として維持したりすることはありません。これはガバナンスのプレイブックを提供するものであり、無限の自動化エンジンではありません。

以下のことは行いません。

  • プライベートな役割の lore や内部組織文化を公開する
  • 個人の記憶、日記、またはプライベートな実行履歴をパッケージ化する
  • 承認結果を自動で決定する
  • ポリシーやルールを自動で変更する
  • v1 で全自動マルチエージェントオーケストレーションを行う
  • 「後で使うかもしれない」という理由で、すべての古いドキュメントをライブ状態に保つ

クイックスタート

ファイルを変更する前に、まずどのようなドリフトに遭遇しているかを明確に判断してください。メインラインはたった6つのステップです。

  1. 問題を分類する
  2. ガバナンスパスを選択する
  3. 問題に答えるべき権威ある事実層を見つける
  4. ドキュメントの役割と鮮度境界を厳しくする
  5. 代表的な質問で検証する
  6. メインラインが十分に完成したら、積極的に収束させる

作業空間が現在混乱している場合は、まず曖昧さを減らし、プロセスを追加しないでください。

コアワークフロー

1. まず問題を分類する

まず、直面しているドリフトの種類を判断し、最初からファイルを盲目的に変更しないでください。種類を明確に区別することで、その後のすべての行動がずれることがなくなります。

通常、以下の種類のドリフトに遭遇します。

  • governance drift:役割、承認、レビューの境界、またはルールが漂流している
  • current-state drift:今、何が本当なのかが不明確になっている
  • retrieval drift:semantic search、bridge files、topic cards、long-term memory が互いに競合し始めている
  • doc drift:古いドキュメントがまだ現在の事実を表していると偽っている
  • maintenance drift:ライブドキュメントが多すぎる、ワーキングセットがない、鮮度チェックが行われていない
  • phase drift:システムがプロセスドキュメントを継続的に生成しているが、収束していない

ファイルを変更する前に、まず種類を判断してください。

2. 異なる変更を適切なガバナンスパスに沿わせる

変更の実装、変更のドキュメント化、ガバナンス/ルールの変更は、同じことではありません。複雑な作業空間では、すべての変更を同じパスで処理することが最も恐れられます。

作業の種類を明確に区別してください。

  • implementation change:通常の実現または実装の変更
  • documentation/explanation change:ドキュメントの表現、状態ラベル、説明層の変更
  • governance/policy/process change:役割の境界、承認ルール、ルーティングルール、メンテナンスルールの変更

これらの一般的な役割を使用できます。

  • Coordinator:問題を定義し、パスを選択し、収束を担当する
  • Implementer:ファイル/スクリプト/操作の変更を実行する
  • Reviewer:実装の品質をチェックし、明らかな問題を見つける
  • Policy Auditor:ガバナンス、プロセス、ルールの変更を監査する
  • Consensus Peer:高リスクの構造変更前のオプションの同僚レビュー

一般的なデプロイ形態:

  • 2-agent:Coordinator + Implementer / Reviewer
  • 3-agent:Coordinator / Implementer / Reviewer
  • 4-5-agent:Policy Auditor とオプションの Consensus Peer を追加

基本ルール:

  • 高リスクの作業では、同じ役割が実装と最終レビューの両方を行わないようにする
  • ガバナンス/ポリシー/プロセスの変更は Policy Auditor を通過させる
  • 高リスクの構造変更前に、単一の計画者の判断が不十分な場合は、consensus-peer レビューを挿入する
  • 作業空間に Agent が1人しかいない場合は、「本来はここに2番目のレビューがあるべきだった」と明確に書き出し、自己レビューが同等であると偽らないようにする

必要に応じて参照してください。

  • references/multi-agent-governance.md

v1 の境界:

  • この Skill はデプロイ可能なガバナンスガイダンスを提供します
  • これは v1 の全自動マルチエージェントオーケストレーションシステムではありません

3. 権威ある事実層を確立する

すべての資料を平均的に扱わないでください。本当に重要なのは「資料が多いかどうか」ではなく、衝突時に誰が決定権を持つかです。

これらの層を明確に区別してください。

  • canon:ルール、承認、厳格な境界
  • bridge/current-state:「今、何が本当なのか」に答える短いファイル
  • health/consistency:実行の健全性と一貫性の状態
  • runtime snapshot:ある時点の実行事実
  • structured memory:中程度の永続性を持つトピック/インデックスカード
  • long-term memory:高い永続性を持つ事実のみを保持する
  • historical docs:背景、古い段階、古い計画、監査、レポート

2つの層が衝突する場合、平均化しないでください。どちらが勝つかを決定する必要があります。

必要に応じて参照してください。

  • references/source-of-truth-layering.md
  • references/query-class-routing.md

4. まずクエリクラスを分類し、次に検索順序を決定する

「セマンティック検索は信頼できるか」と抽象的に問わないでください。本当に問うべきは、どの種類の問題に対して信頼できるか?どのようなランタイム/キャッシュのアラインメント状態で信頼できるか?それが主要な裁定層なのか、それとも補助的な呼び出し層なのか?

推奨されるクエリクラス:

  • system-state
  • governance / rule-boundary
  • runtime-now
  • weekly-review / approval-state
  • user-preference / profile
  • historical trace / evidence
  • maintenance / upkeep

デフォルト戦略:

  • governance → canon first
  • system-state → bridge/health first
  • runtime-now → snapshot first
  • user-preference → curated profile/manual sources first
  • historical trace → discovery + verification
  • semantic search → 明確に検証されてより強力でない限り、supporting layer としてのみ使用する

必要に応じて参照してください。

  • references/query-class-routing.md
  • references/semantic-search-diagnostics.md

5. ドキュメントに役割の境界を付ける

古いドキュメントの最も危険な点は、存在することではなく、それがまだ現在の真実を表していると偽っていることです。ライブドキュメントの面積を小さくすることで、システムは安定します。

一般的なタグと役割:

  • historical-reference
  • needs-refresh
  • active/live maintenance docs
  • special-case active safety restriction

最小限のライブサブセットを定義するように努め、それ以外はデフォルトで二次的な参照層に降格させます。

必要に応じて参照してください。

  • references/live-vs-historical-docs.md

6. ワーキングセットと鮮度チェックを構築する

ワーキングセットは「すべての重要なファイル」ではなく、「継続的に新鮮に保つべき最小限のアクティブな集合」です。すべてのドキュメントを単一のしきい値で管理しないでください。

典型的なワーキングセットには以下が含まれます。

  • health / consistency ファイル
  • bridge/current-state ファイル
  • runtime snapshot
  • entrypoint/index docs
  • 最高の価値を持つトピックカードのみ

グループ化されたしきい値を使用し、包括的なしきい値を使用しないでください。

  • health/bridge/runtime/entry docs にはより短いしきい値を使用する
  • structured topic/index docs にはより長いしきい値を使用する

鮮度チェッカーを使用して、「誰が更新を覚えておくべきか」を繰り返し実行可能なチェックに変えます。

必要に応じて参照してください。

  • references/freshness-discipline.md

7. semantic-search ランタイムを真剣に診断する

セマンティック検索で問題が発生した場合、最も一般的な落とし穴はモデルの性能不足ではなく、パスのアラインメント、キャッシュ/インデックスの混線、またはスプリットブレイン(あるインデックスを診断し、別のインデックスをクエリする)です。

診断時には、この線に沿って進めることをお勧めします。

  1. まず before-state のベースラインを記録する
  2. ランタイム設定とキャッシュ/インデックスコンテキストがアラインしていることを確認する
  3. スプリットブレインが存在しないかチェックする
  4. 明らかなインデックス作成/埋め込みのギャップを修正する
  5. 少数の代表的なクエリクラスで回帰検証を行う
  6. 包括的な信頼ラベルを与えず、クエリクラスごとに信頼度をマークする

必要に応じて参照してください。

  • references/semantic-search-diagnostics.md

8. 代表的な質問で検証し、構造だけを見ない

構造が整って見えるからといって、システムが本当に問題に答えられるとは限りません。少なくとも、system-state、governance、maintenance、historical/preference のような実際の質問で一度テストしてください。

最低限の検証セット:

  • 1つの system-state 問題
  • 1つの governance 問題
  • 1つの maintenance 問題
  • 1つの historical または preference 問題

判定結果は3種類のみを使用することをお勧めします。

  • PASS
  • PASS WITH ESCALATION
  • FAIL

より小さなライブサブセットが日常的な質問にも実際に答えられる場合にのみ、成立とみなされます。

9. 積極的に終了させ、無限にフェーズを拡大しない

あるフェーズのメインラインがすでに着地している場合、それはメンテナンス観察期に収束させるべきであり、これ以上プロセスドキュメントを生成し続けるべきではありません。

各フェーズで明確にすべきこと:

  • 何が landed したか
  • 何が improving しているか
  • 何が deferred されたか
  • メインラインが十分に完成しており、閉じることができるか

メインラインが十分に完成したら:

  • メンテナンス観察期に移行する
  • ライブサブセットをできるだけ小さく保つ
  • 小さな修正を行い、新たな広範なフェーズを開始しない

必要に応じて参照してください。

  • references/completion-criteria.md

v1 推奨スクリプト

これらのスクリプトは、v1 の最も重要な3つのガバナンスチェックライン(鮮度、セマンティックランタイム、ドキュメントの状態)をカバーしています。

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

虾滑 OpenClaw 工作区治理(OpenClaw Workspace Governance)

🚨 高危/重要提示 (IMPORTANT WARNING) 🚨 这不是一个普通的工具型 Skill,而是针对 OpenClaw 工作区的系统级架构升级与治理方案。 在让你的 Agent 实施本指南之前,请务必对你的 Workspace 进行完整备份,并确保你理解其对文件状态和检索优先级的改变。请勿在未做快照的生产环境中盲目运行全自动治理!

This is NOT a standard tool-level skill. It is a system-level architecture upgrade and governance framework for your OpenClaw workspace. Before allowing your Agent to implement these guidelines, you MUST take a full backup of your workspace. Do not run automated governance in a production environment without understanding how it alters document states and retrieval routing.

这是一个面向复杂 OpenClaw 工作区的治理型 skill。它不是为了制造更多流程,而是为了在复杂度已经上来之后,帮你压住漂移、明确当前事实层、缩小 live docs 面积,并让语义检索变得更可控。

系统能力详解 (System Capabilities)

本 Skill 提供了一套完整的系统级框架,赋予你的 OpenClaw 以下核心能力:

  • 多 Agent 协作架构 (Multi-Agent Architecture):建立以 Supervisor 为中心的调度机制,实现“写审分离”。明确区分代码编写、代码审查、规则审核、文档撰写等专职岗位,防止单一 Agent 越权闭环。
  • 分层记忆系统 (Layered Memory System):告别无序的长文档堆砌。建立从“原始日志 (Daily Notes)”到“主题卡片 (Topic Cards)”,再到“长期记忆 (Long-Term Memory)”的逐层蒸馏与质量门控机制。
  • 语义检索与路由 (Semantic Retrieval Routing):将系统查询分类(如:状态查询、规则边界、历史溯源等),并建立基于桥接文件 (Bridge Files)、结构化记忆与 qmd 语义搜索的精准召回优先级。
  • 审批与安全治理 (Approval & Governance):强制核心文件(如 AGENTS.md)的修改必须经过独立评审与人工授权;内置针对特定岗位的“防偷懒协议(代码交付契约)”,保障自动化任务的执行完整性。

适用场景

当你的工作区已经出现真实复杂度时,再用这份 skill。典型信号包括:

  • 多个 Agent 或多角色执行路径已经出现
  • 文档、记忆、状态层越来越多
  • 回答“现在到底什么是真的”开始变难
  • semantic search(语义搜索)有用,但不再能无脑相信
  • live docs 过多、working set 不清、维护开始失控

⚠️ 这是进阶 skill,不是新手入门包,也不是 v1 的全自动 orchestrator。

非目标

这份 skill 不会替你自动拍板、自动改规则,也不会把所有旧文档都继续维持成“活文档”。它提供的是治理 playbook,不是无限自动化引擎。

它不试图做这些事:

  • 发布私有角色 lore 或内部组织文化
  • 打包个人记忆、日记或私有运行历史
  • 自动决定审批结果
  • 自动改政策或规则
  • 在 v1 里做全自动多 Agent 编排
  • 因为“怕以后要用”而让所有旧文档都保持 live

快速开始

先别急着改文件,先判清楚你遇到的是哪一种 drift。主线只有六步:

  1. 分类问题
  2. 选择治理路径
  3. 找到应该回答问题的权威事实层
  4. 收紧文档角色和 freshness 边界
  5. 用代表性问题验证
  6. 在主线足够完整时主动收口

如果工作区现在很乱,先减少歧义,不要先加流程。

核心工作流

1. 先分类问题

先判断你面对的是哪一类 drift,不要一上来就盲改文件。先分清类型,后面所有动作才不会跑偏。

你通常会遇到这些类型:

  • governance drift:角色、审批、审查边界或规则正在漂
  • current-state drift:现在到底什么是真的变得不清楚
  • retrieval drift:semantic search、bridge files、topic cards、long-term memory 开始互相打架
  • doc drift:旧文档还在假装自己代表当前事实
  • maintenance drift:live docs 太多,没有 working set,也没人做 freshness checks
  • phase drift:系统不停产出流程文档,却没有收口

不要先改文件,先判类型。

2. 让不同变更走对治理路径

实现改动、文档解释改动、治理/规则改动,不是一回事。复杂工作区里,最怕把所有改动都走同一条线。

把工作类型区分清楚:

  • implementation change:普通实现或落地改动
  • documentation/explanation change:文档措辞、状态标签、说明层改动
  • governance/policy/process change:角色边界、审批规则、路由规则、维护规则改动

可使用这些通用角色:

  • Coordinator:定义问题、选路径、负责收口
  • Implementer:执行文件/脚本/操作改动
  • Reviewer:检查实现质量,揪明显问题
  • Policy Auditor:审治理、流程、规则变化
  • Consensus Peer:高风险结构变更前的可选同级会审

常见部署形态:

  • 2-agent:Coordinator+Implementer / Reviewer
  • 3-agent:Coordinator / Implementer / Reviewer
  • 4-5-agent:额外加入 Policy Auditor 和可选 Consensus Peer

基本规则:

  • 高风险工作里,不要让同一角色既实现又做最终审查
  • 治理/政策/流程改动要过 Policy Auditor
  • 高风险结构改动前,如果单一规划者判断不够,插入 consensus-peer 会审
  • 如果工作区里只有 1 个 agent,要明确写出“本来这里该有第二审”,不要假装自审等价

按需阅读:

  • references/multi-agent-governance.md

v1 边界:

  • 这份 skill 提供可部署的治理指导
  • 不是 v1 的全自动多 Agent 编排系统

3. 建立权威事实分层

不要把所有资料平均对待。真正的关键不是“资料多不多”,而是冲突时谁说了算

把这些层分清楚:

  • canon:规则、审批、硬边界
  • bridge/current-state:回答“现在什么是真的”的短文件
  • health/consistency:运行健康和一致性状态
  • runtime snapshot:某一时点的运行事实
  • structured memory:中等持久度的 topic/index 卡片
  • long-term memory:只保留高持久事实
  • historical docs:背景、旧阶段、旧计划、审计、报告

两层冲突时,不要平均;必须决定谁赢。

按需阅读:

  • references/source-of-truth-layering.md
  • references/query-class-routing.md

4. 先分 query class,再决定检索顺序

别抽象地问“语义搜索靠不靠谱”。真正该问的是:对哪一类问题靠谱?在什么 runtime / cache 对齐状态下靠谱?它是主裁决层还是辅助召回层?

建议的 query class:

  • system-state
  • governance / rule-boundary
  • runtime-now
  • weekly-review / approval-state
  • user-preference / profile
  • historical trace / evidence
  • maintenance / upkeep

默认策略:

  • governance → canon first
  • system-state → bridge/health first
  • runtime-now → snapshot first
  • user-preference → curated profile/manual sources first
  • historical trace → discovery + verification
  • semantic search → 除非明确验证更强,否则只作为 supporting layer

按需阅读:

  • references/query-class-routing.md
  • references/semantic-search-diagnostics.md

5. 给文档打角色边界

旧文档最危险的不是存在,而是它还在假装自己代表 current truth。把 live docs 面积压小,系统才会稳。

常见标签与角色:

  • historical-reference
  • needs-refresh
  • active/live maintenance docs
  • special-case active safety restriction

尽量定义一个最小 live subset,其他默认降级成次级参考层。

按需阅读:

  • references/live-vs-historical-docs.md

6. 建 working set 和 freshness checks

working set 不是“所有重要文件”,而是“必须持续保鲜的最小活跃集合”。不要用一个统一阈值去管所有文档。

典型 working set 包括:

  • health / consistency 文件
  • bridge/current-state 文件
  • runtime snapshot
  • entrypoint/index docs
  • 只有最高价值的 topic cards

用分组阈值,不要用一个笼统阈值:

  • health/bridge/runtime/entry docs 用更短阈值
  • structured topic/index docs 用更长阈值

用 freshness checker 把“谁应该记得更新一下”变成可重复执行的检查。

按需阅读:

  • references/freshness-discipline.md

7. 认真诊断 semantic-search runtime

语义检索出问题时,最常见的坑不是模型不行,而是 path alignment、cache/index 混线,或者 split-brain(诊断一个索引、查询另一个索引)。

诊断时建议按这条线走:

  1. 先记录 before-state baseline
  2. 确认 runtime config 与 cache/index context 是否对齐
  3. 检查是否存在 split-brain
  4. 修掉明显的 indexing/embedding 缺口
  5. 用少量代表性 query classes 回归验证
  6. 不要给 blanket trust label,要按 query class 标可信度

按需阅读:

  • references/semantic-search-diagnostics.md

8. 用代表性问题验证,而不是只看结构

结构看起来整齐,不等于系统真的能回答问题。至少拿 system-state、governance、maintenance、historical/preference 这几类真实问题测一轮。

最低验证集:

  • 一个 system-state 问题
  • 一个 governance 问题
  • 一个 maintenance 问题
  • 一个 historical 或 preference 问题

判定结果建议只用三种:

  • PASS
  • PASS WITH ESCALATION
  • FAIL

只有当较小的 live subset 也确实能回答日常问题时,才算成立。

9. 主动收尾,不要无限扩相

如果一个 phase 已经主线落地,就该收口进 maintenance observation(维护观察期),而不是继续生产更多流程文档。

每个 phase 都要明确:

  • 什么是 landed
  • 什么是 improving
  • 什么是 deferred
  • 主线是否已经足够完整,可以关闭

一旦主线够完整:

  • 转入 maintenance observation
  • 保持 live subset 尽量小
  • 做小修,不要再开一轮 sprawling phase

按需阅读:

  • references/completion-criteria.md

v1 推荐脚本

这些脚本覆盖 v1 最关键的三条治理检查线:freshness、semantic runtime、doc status。

  • scripts/freshness-check.py
  • scripts/semantic-runtime-check.sh
  • scripts/doc-status-scan.py

v1 推荐参考文档

这些 references 构成 v1 的主参考集;它们负责解释治理原则,不负责替你自动执行一切。

  • references/multi-agent-governance.md
  • references/source-of-truth-layering.md
  • references/query-class-routing.md
  • references/live-vs-historical-docs.md
  • references/freshness-discipline.md
  • references/semantic-search-diagnostics.md
  • references/completion-criteria.md

v1 推荐示例

先用这些示例建 working set、system-state index 和 health 示例,再按你的工作区实际情况收窄。

  • assets/examples/working-set.example.md
  • assets/examples/working-set.example.json
  • assets/examples/current-health.example.json
  • assets/examples/system-state-index.example.md

v1 叙事要收紧

这是一份 workspace governance tool / governance playbook。它包含多 Agent 治理指导,但它不是 roleplay 包,也不是 v1 的全自动 multi-agent orchestrator。

它最核心的承诺只有五条:

  • 减少 drift
  • 让 current truth 更容易识别
  • 把 live docs 面积压小
  • 让 semantic retrieval 更可控
  • 让维护更可持续

发布与草案边界

当前正式发布内容以本目录下的 package-local 文件为准。旧的 docs/skill-draft-* 文件属于设计历史,不应继续和当前发布包竞争解释权。


This is a governance skill for complex OpenClaw workspaces. It is not here to add process for its own sake. It helps you reduce drift, clarify current truth, shrink the live-doc surface, and make semantic retrieval more controllable.

System Capabilities

This skill provides a complete system-level framework, empowering your OpenClaw with the following core capabilities:

  • Multi-Agent Architecture: Establishes a Supervisor-centric dispatch mechanism, ensuring "separation of writing and reviewing". It clearly separates roles like code generation, code review, policy auditing, and documentation, preventing any single agent from making unauthorized closed-loop decisions.
  • Layered Memory System: Moves away from chaotic long documents. It builds a progressive distillation and quality-gating mechanism from "Raw Daily Notes" to "Topic Cards" and finally to "Long-Term Memory".
  • Semantic Retrieval Routing: Classifies system queries (e.g., state queries, rule boundaries, historical traces) and establishes precise recall priorities across bridge files, structured memory, and qmd semantic search.
  • Approval & Governance: Mandates that modifications to core files (like AGENTS.md) must pass independent review and human authorization. It includes built-in "anti-laziness protocols (code delivery contracts)" for specific roles to ensure the completeness of automated tasks.

Scope

Use this skill when the workspace already has real complexity, such as:

  • multiple agents or role-like execution paths
  • growing docs / memory / state layers
  • uncertainty about what is current vs historical
  • semantic search that is useful but not equally trustworthy for every query class
  • maintenance drift caused by too many live docs and weak closure discipline

This is an advanced governance skill. It is not a beginner skill and not a full automated orchestrator in v1.

Non-goals

This skill does not try to:

  • publish private role lore or internal organization culture
  • ship personal memory, daily logs, or private operational history
  • automate approval decisions
  • automate policy changes
  • automate full multi-agent orchestration in v1
  • keep every old document live "just in case"

Quick Start

Use this skill in six steps:

  1. classify the drift or governance problem
  2. choose the right governance path
  3. identify the source-of-truth layers that should answer the question
  4. set doc-role and freshness boundaries
  5. validate the system with representative questions
  6. close the phase when the mainline is complete enough

If the workspace is unclear, start by reducing ambiguity rather than adding more process.

Core workflow

1. Classify the problem first

Identify which of these is happening:

  • governance drift (roles, approvals, reviewer boundaries, policy changes)
  • current-state drift (what is true now is unclear)
  • retrieval drift (semantic search, bridge files, topic cards, long-term memory are fighting)
  • doc drift (old docs are masquerading as current truth)
  • maintenance drift (too many docs are "live", no working set, no freshness checks)
  • phase drift (the system keeps producing process docs without closure)

Do not start by editing files blindly. First decide the drift type.

2. Route change types through the right governance path

Treat these as different work types:

  • implementation change: normal execution work
  • documentation/explanation change: doc wording, status labels, explanatory layers
  • governance/policy/process change: role boundaries, approval rules, routing rules, maintenance rules

Use these generic roles:

  • Coordinator: frames the work, chooses path, closes the loop
  • Implementer: makes the operational/file/script changes
  • Reviewer: checks implementation quality and catches obvious mistakes
  • Policy Auditor: checks governance, process, or rule changes
  • Consensus Peer: optional peer used before risky structural changes

Deployment shapes:

  • 2-agent: Coordinator+Implementer / Reviewer
  • 3-agent: Coordinator / Implementer / Reviewer
  • 4-5-agent: add Policy Auditor and optional Consensus Peer

Rules:

  • never let the same role both implement and perform final review on risky work
  • send governance/policy/process changes through Policy Auditor review
  • insert a consensus-peer pass before risky structural changes when one planner's judgment is not enough
  • if the workspace only has 1 agent, state explicitly where a second review would normally be required instead of pretending self-review is equivalent

Read when needed:

  • references/multi-agent-governance.md

Important v1 limit:

  • this skill gives deployable governance guidance
  • it does not provide full automated multi-agent orchestration in v1

3. Build source-of-truth layering

Separate these layers clearly:

  • canon: rules, approvals, hard boundaries
  • bridge/current-state: short files that answer "what is true now?"
  • health/consistency: operational health and alignment state
  • runtime snapshot: point-in-time runtime truth
  • structured memory: topic/index cards with medium durability
  • long-term memory: durable facts only
  • historical docs: background, prior phases, old plans, audits, reports

When two layers disagree, do not average them. Decide which layer wins.

Read when needed:

  • references/source-of-truth-layering.md
  • references/query-class-routing.md

4. Classify query classes before deciding retrieval order

Ask:

  • reliable for which query class?
  • under what runtime/cache alignment?
  • as primary authority or supporting recall?

Recommended query classes:

  • system-state
  • governance / rule-boundary
  • runtime-now
  • weekly-review / approval-state
  • user-preference / profile
  • historical trace / evidence
  • maintenance / upkeep

Default policy:

  • governance → canon first
  • system-state → bridge/health first
  • runtime-now → snapshot first
  • user-preference → curated profile/manual sources first
  • historical trace → discovery + verification
  • semantic search → supporting layer unless explicitly validated stronger for that class

Read when needed:

  • references/query-class-routing.md
  • references/semantic-search-diagnostics.md

5. Mark docs as live, historical, stale, or special-case

Use labels and roles such as:

  • historical-reference
  • needs-refresh
  • active/live maintenance docs
  • special-case active safety restriction

Define a minimal live subset and treat everything else as secondary by default.

Read when needed:

  • references/live-vs-historical-docs.md

6. Establish a working set and freshness checks

Create a narrow working set for documents that must remain fresh.

Typical working set includes:

  • health / consistency files
  • bridge/current-state files
  • runtime snapshot
  • entrypoint/index docs
  • only the highest-value topic cards

Use grouped thresholds rather than one blanket threshold. For example:

  • shorter threshold for health/bridge/runtime/entry docs
  • longer threshold for structured topic/index docs

Use the freshness checker to turn "someone should remember to update this" into a repeatable check.

Read when needed:

  • references/freshness-discipline.md

7. Diagnose semantic-search runtime carefully

When semantic search behaves strangely:

  1. capture a before-state baseline
  2. confirm whether runtime config and cache/index context are aligned
  3. check for split-brain behavior (diagnosing one index while querying another)
  4. repair obvious pending indexing/embedding gaps
  5. validate with a few representative query classes
  6. avoid blanket trust labels after the diagnosis — state trust by query class

Use the runtime checker script for aligned checks.

Read when needed:

  • references/semantic-search-diagnostics.md

8. Validate with representative questions

At minimum validate:

  • one system-state question
  • one governance question
  • one maintenance question
  • one historical or preference question

Judgment types:

  • PASS
  • PASS WITH ESCALATION
  • FAIL

Only keep a smaller live subset if it actually answers ordinary questions well enough.

9. Close phases on purpose

For each phase, decide:

  • what is landed
  • what is improving
  • what is deferred
  • whether the mainline is complete enough to close

Once the mainline is complete enough:

  • move into maintenance observation
  • keep the live subset small
  • make only small refinements instead of opening another sprawling phase

Read when needed:

  • references/completion-criteria.md

Preferred first-release scripts

Use these in v1:

  • scripts/freshness-check.py
  • scripts/semantic-runtime-check.sh
  • scripts/doc-status-scan.py

Preferred first-release references

Use these as the main governance/reference set in v1:

  • references/multi-agent-governance.md
  • references/source-of-truth-layering.md
  • references/query-class-routing.md
  • references/live-vs-historical-docs.md
  • references/freshness-discipline.md
  • references/semantic-search-diagnostics.md
  • references/completion-criteria.md

Preferred first-release examples

Use these as templates/examples:

  • assets/examples/working-set.example.md
  • assets/examples/working-set.example.json
  • assets/examples/current-health.example.json
  • assets/examples/system-state-index.example.md

Keep the v1 narrative tight

This is a workspace governance tool / governance playbook. It includes multi-agent governance guidance, but it is not a roleplay package and not a full automated multi-agent orchestrator in v1.

The core promise is simple:

  • reduce drift
  • make current truth easier to identify
  • keep live docs small
  • make semantic retrieval more controlled
  • make maintenance sustainable

Package rule

During the current release line, review the package-local files in this directory first. Treat older docs/skill-draft-* files as drafting history unless you are explicitly tracing design history.

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。