Advisor Protocolのロゴ

Advisor Protocol

組織
bis-med-it
advisor-protocol

Model-agnostic escalation protocol for complex mathematical reasoning, derivation verification, and theoretical validation. Use when the executing agent encounters dense mathematical content from a paper, unfamiliar identification schemes, non-standard prior derivations, or any situation where the agent's confidence in correctly translating mathematics to code is low. This skill routes the query to a more capable reasoning model; the specific provider and model are configurable and not hardcoded.

概要

公開者bis-med-it
リポジトリmarco-BIS
スキル名advisor-protocol
スター
28
フォーク
6
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    bis-med-itがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Advisor Protocol」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/bis-med-it/marco-BIS/tree/main/skills/advisor-protocol
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bis-med-it/marco-BIS.git /tmp/marco-BIS
mkdir -p .claude/skills
cp -r /tmp/marco-BIS/skills/advisor-protocol .claude/skills/advisor-protocol
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでAdvisor Protocolを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にAdvisor Protocolを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Advisor Protocolは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Advisor protocol

Purpose

The executing agent handles the routine workflow. When mathematical content exceeds its confidence, it asks a more capable reasoning model to check the work before proceeding, as a researcher would consult a senior colleague on a tricky derivation.

When to escalate

The executing agent should invoke the advisor when:

  1. Unfamiliar derivations. A paper introduces notation, distributional assumptions, or algebraic steps the agent cannot confidently verify.
  2. Novel identification schemes. Sign restrictions with complex penalty functions, narrative identification with inequality constraints, or set-identified models.
  3. Non-standard priors. Any prior structure not covered by the scripts/lib/bvar.py module docstrings or CONVENTIONS.md.
  4. Distributional theory. Posterior derivations involving non-conjugate cases, marginalisation over nuisance parameters, or asymptotic approximations.
  5. Ambiguous mathematical notation. When a paper's notation is inconsistent or context-dependent and the agent is unsure of the correct interpretation.
  6. Cross-checking implementations. After coding a complex formula, the agent can ask the advisor to verify the code matches the mathematics.

Do not escalate for: routine matrix algebra, standard OLS/GLS, well-documented Minnesota prior computation, basic time-series transformations, or anything already covered in verified reference documents.

Advisor configuration

The advisor is off by default. Before any call, read advisor.enabled in the repo-root config.yaml. If it is not true, do not call the advisor: tell the user the step would normally be escalated, continue without it, and suggest checking the derivation by hand or enabling the advisor.

The advisor is configured in the repo-root config.yaml under advisor: (enabled, provider, model, endpoint, api_key_env, an optional fallback provider, and settings: max_attempts, timeout_seconds, log_all_exchanges, require_human_review). The model named there is an example; set one the user has access to. Users or administrators set this once; the agent reads it at runtime.

The agent sends the query through the configured provider's API; the library implements no advisor calls.

Escalation protocol

Step 1: Prepare the query

The executing agent constructs a structured prompt for the advisor:

CONTEXT:
I am implementing [model/method] from [paper reference].
The executing environment is [Python/R/Julia].

MATHEMATICAL CONTENT:
[Extract the relevant equations, definitions, and notation from the paper.
Include surrounding context so the advisor understands the setup.]

SPECIFIC QUESTION:
[One of:]
- "Verify that the following derivation is correct: [steps]"
- "Translate this mathematical expression into pseudocode: [expression]"
- "This paper uses notation X for Y. Please confirm my interpretation: [interpretation]"
- "I have implemented this formula as [code]. Verify it matches the mathematics."
- "Derive the posterior distribution for [parameter] given [prior] and [likelihood]."

CONSTRAINTS:
- Provide step-by-step reasoning.
- Flag any assumptions that are implicit in the paper but should be made explicit.
- If the derivation has multiple valid interpretations, list them.
- Express the final result in explicit matrix notation with dimensions annotated.

Step 2: Call the advisor

Send the query through the configured provider's API as a standard request, with no provider-specific logic beyond API format translation. If the primary provider fails and a fallback is set, try the fallback. If no provider answers, tell the user to verify the mathematical content manually before proceeding.

Step 3: Process the response

  1. Parse the advisor's response.
  2. Extract: verified derivation steps, pseudocode, flagged assumptions, and any alternative interpretations.
  3. Present to the human for review (if require_human_review is true). The review happens after the call and before the response is used.
  4. Log the full exchange via the research-log skill.

Step 4: Incorporate into workflow

Once the human confirms the advisor's output:

  1. Save the verified derivation as a reference document in the relevant skill's references/ directory (created on first use; e.g., <skill-name>/references/verified_xyz_derivation.md) or alongside the lib module that needs it (e.g., scripts/lib/references/verified_xyz_derivation.md).
  2. Use the pseudocode to implement the formula.
  3. The reference document persists, so future runs of the same method do not need to re-escalate.

This creates a growing library of verified mathematical content over time.

Cost management

Advisor calls are expensive relative to routine execution. For each session, the agent records in the research log the number of advisor calls, tokens per call, and a cost estimate from the provider's published pricing. If costs are a concern, the user can:

  • Ask the agent to confirm with the user before each advisor call (an explicit step before invoking; require_human_review reviews the response after the call, so it saves no cost)
  • Use a local model as the advisor for cost-free but potentially lower-quality review
  • Pre-populate references/ with verified content to reduce future escalations

Institutional deployment considerations

Central banks and research institutions may have:

  • Air-gapped networks. Use a locally hosted model as the advisor.
  • Data confidentiality constraints. The advisor prompt should never include proprietary data, only mathematical content from published or working papers. The skill instructs the agent to send only equations and derivations, never datasets or proprietary data. This is a policy, not a technical filter.
  • Approved vendor lists. The configurable provider system accommodates this: set only the approved provider(s) in the configuration.
  • Audit requirements. The agent logs every advisor exchange in the research log, with timestamps, prompts, responses, and human confirmation status.

よくある質問

AIスキル「Advisor Protocol」では何ができますか?

Model-agnostic escalation protocol for complex mathematical reasoning, derivation verification, and theoretical validation. Use when the executing agent encounters dense mathematical content from a paper, unfamiliar identification schemes, non-standard prior derivations, or any situation where the agent's confidence in correctly translating mathematics to code is low. This skill routes the query to a more capable reasoning model; the specific provider and model are configurable and not hardcoded.

TypingMindでAdvisor Protocolを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Advisor Protocolはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにAdvisor Protocolをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/bis-med-it/marco-BIS/tree/main/skills/advisor-protocolを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Advisor Protocolを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Advisor Protocolで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもAdvisor Protocolを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Advisor Protocol」は無料ですか?

はい。bis-med-itがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇