オプション
家 Skill その他 multica-creating-agents

multica-creating-agents

multica-ai/multica multica-ai/multica

`multica agent` CLI または `POST /api/agents` を通じて Multica エージェントを作成、確認、またはデバッグする際に使用します — 各フィールドの意味、永続化される形式、メタデータ専用か、あるいはクレーム時にデーモンによって消費されるか、どの入力が検証・拒否されるか、`custom_env` シークレットのアクセス制御方法、およびスキルバインディングの動作について。既存のエージェントへの課題の割り当てや、実行時のタスクプロンプトには使用しないでください。

...すべて拡張します
80
更新された時間 2026年8月12日

Multicaエージェントの作成

これは、Multicaのエージェント作成パスに関する仕様書です。createエントリ ポイントが受け付ける内容、サーバーが検証して拒否する内容、各フィールドの 永続化方法、およびクレーム時にデーモンが実際に読み取るフィールドについて 説明しています。 これは パラメータのマニュアルではありません。ソースコードを追跡して得られた事実を記述したものであり、すべての記述は references/creating-agents-source-map.md 内の「ファイル:行」情報によって裏付けられています。

クイックスタート(読み取り専用検査)

これらのコマンドは状態を読み取るだけで、副作用はありません:

multica agent get --output json      # 完全な永続化エージェントレコード
multica agent skills list --output json   # 現在のスキルバインディング
multica agentenvget --output json  # プレーンテキストの環境変数(所有者/管理者のみ、エージェントは拒否される)

`agent get` は、`runtime_id`、`model``thinking_level`、`service_tier`、`custom_args`、`has_custom_env``custom_env_key_count`、および`skills` を含む永続化されたエージェント情報を返します。平文の`custom_env` が返されることはありません。

コアモデル

エージェントはワークスペーススコープの行(テーブルagent)です。作成は単一の POST /api/agentsmultica agent create)で行われます。 タスクの取得時、デーモンは エージェント行を再読み込みし、ランタイムペイロードを組み立てます。つまり、エージェントが実行されるのは、 作成時の出力ではなく、永続化されたフィールドに基づきます。

よく混同される2つの異なるテキストフィールド:

  • descriptionはカタログの概要です。これはリストに保存・表示されますが、 デーモンはこれをエージェントの実行時プロンプトに挿入しません。あくまで 人間向けのメタデータとして扱ってください。上限は 255 Unicode コードポイントです。
  • instructionsは、実行時の動作に関する契約です。デーモンはこれを クレーム時に読み取り、エージェントの永続的な指示としてプロバイダーに送信します。 ペルソナ、責任範囲、境界、出力、エスカレーションルールはここに記述し、 descriptionには記述しないでください。

CLI / API エントリポイント

最小限の作成呼び出し(--nameおよび--runtime-idは両方とも必須):

multica agent create --name --runtime-id \
  --description""\
  --instructions""\
  --output json

runAgentCreate はJSON ボディを生成し、それを/api/agents に POST します。このコマンドは、 フラグが指定された場合にのみキーを追加します。つまり、descriptionや instructionsについては キーを追加し、残りの項目(runtime-configcustom-argsmodelthinking-levelservice-tiervisibility など)はフラグがChangedの場合にのみ追加されます。そのため、省略された フラグについては、空の文字列を送信するのではなく、サーバーのデフォルト値が適用されます。

HTTP ボディ(CreateAgentRequest)で指定可能なパラメータは、namedescriptioninstructionsavatar_urlruntime_idruntime_configcustom_envcustom_argsmodelthinking_levelservice_tiervisibilitymax_concurrent_tasksmcp_config です。

フィールドの契約

省略時のデフォルト値:runtime_config{},custom_env{}, custom_args[],avatar_url→ ランダムな絵文字:,visibilityprivate,max_concurrent_tasks6 (すべて挿入前にサーバー側でマテリアライズされます)。custom_args/runtime_config は []string/any型であり、そのままマーシャリングされます。JSON 形式の不一致による 拒否は CLI 側で発生し、create ハンドラー側では発生しません。

thinking_level の検証はプロバイダーレベルでのみ行われます。固定カタログ プロバイダーは認識できないリテラルを拒否しますが、Codex/OpenCode などの 動的カタログプロバイダーは、構文的に安全なトークンを受け入れます。 選択されたモデルで サポートされていない値は、ここでは拒否されません。デーモンは実行時にローカルのモデル カタログを確認し、警告をログに記録した上で、互換性のないオーバーライドを無視します。

--modelと同様に、エージェント の作成および更新時にCLIから--thinking-levelで設定します。このフラグはトップレベルの thinking_levelフィールドへの単純なパススルーであり、更新時に空の文字列(--thinking-level "")を指定すると、 ランタイムのデフォルト値にリセットされます。 CLIでは、有効なレベルを意図的に列挙していません。 これらは実行環境やモデルごとに異なります(Claudeは現在 low|medium|high|xhigh|maxを使用しています。Codexの値は実行環境の モデルカタログから取得されます)。 CLIはトークンを転送し、サーバーがプロバイダーの 固定列挙型または安全トークンゲートを適用し、デーモンが正確なモデル/レベル チェックを実行します。プロバイダーに「thinking」の概念がないランタイムは、空でない 値をすべて400エラーで拒否します。

service_tierは、これに対応する第一級の Codex 速度制御です。作成/更新時には --service-tierで設定し、更新時に --service-tier ""を使用してクリアします。ランタイムのモデルカタログは、可用性と 表示用コピー(現在は優先度、Fast と表示)の両方を管理します。 サーバーは安全な 将来のCodexカタログIDを受け入れますが、デーモンは実行前に正確なモデル/ティアの組み合わせを 検証し、古くて互換性のないオーバーライドは無視します。明示的なモデルが指定されていない エージェントは、有効なconfig.tomlのモデルが不明であるため、失敗(closed)となります。

model 対 custom_args

model は、デーモンが直接読み取る第一級の永続化カラムです。 custom_argsは、プロバイダーのCLI引数の生のデータです。CLIのヘルプには、一部のプロバイダー (codex app-server、openclaw)がcustom_args内の--modelを拒否すると記載されていますが、これは ドキュメントに記載されたCLIのガイダンスであり、サーバーによって強制される不変条件ではありません。create ハンドラーには、custom_argsを検査してmodelフラグを確認する処理は一切ありません。

環境変数とシークレット

`custom_env`はシークレット情報です。CLIには3つの入力チャネルが用意されており、そのうち2つは シークレットをシェル履歴やプロセス一覧から除外します:

multica agent create --name --runtime-id --custom-env-stdin --output json
multica agent create --name --runtime-id --custom-env-file<0600-json> --output json

--custom-env-stdinは標準入力 (stdin) から JSON オブジェクトを読み込みます。--custom-env-file はファイルから読み込みます(推奨モードは 0600)。 3つ目の方法である --custom-env は、値をコマンドライン上に配置するため、シェル履歴 やpsコマンドから確認されてしまいます。機密性の高い情報には使用しないでください。

読み取り側の事実(避けるべき誤った前提):

  • エージェントリソースは、custom_env を平文で公開することはありません。agent list/get/create/updateおよび WS イベントは、has_custom_env(bool) と custom_env_key_count(int) のみを返します。
  • 平文の値を読み取るには、専用のGET /api/agents/{id}/env エンドポイント(multica agent env get)が必要です。これはワークスペースの所有者/管理者 メンバーに限定されており、エージェントのアクターは、バックグラウンドのメンバーの 役割にかかわらずアクセスが拒否されます。つまり、稼働中のエージェントは他のエージェントのシークレットを読み取ることはできません。
  • 作成後の値の書き込みは、エージェントの更新を経由しません。汎用的な 更新ハンドラーは、custom_envフィールドをすべて 400 エラー(「PUT /api/agents/{id}/env を使用してください」)で拒否します。平文での環境変数の書き込みは、 PUT /api/agents/{id}/envmultica agent env set)によって処理され、これは所有者/管理者のみが利用可能で、 監査ログ行が記録されます。

mcp_config

mcp_config は、エージェントの MCP サーバー設定( {"mcpServers": {…}} のような JSON オブジェクト)です。これも機密情報であり — MCP エントリには通常 API トークンが埋め込まれています — かつ、エージェントの作成および更新の両方で、 custom_env と同じ 3 つの入力チャネルを提供します:

multica agent create --name --runtime-id --mcp-config-file<0600-json> --output json
multica agent update --mcp-config-stdin --output json
multica agent update --mcp-config'null'   # 設定をクリアします

--mcp-config-stdin/--mcp-config-fileを使用すると、値がシェル履歴 やps コマンドに記録されません。一方、インラインの--mcp-configでは記録されます。 CLIではJSON オブジェクトまたはリテラル「null」が必要です。トップレベルの配列やプリミティブ型は クライアント側で拒否され、stdinやファイル入力が空の場合、黙ってクリアされるのではなくエラーとなります。

mcp_config が custom_env と異なる点は 2 つあります:

  • エージェントの更新を通じて設定可能です。 custom_envとは異なり、mcp_configには 専用の監査対象エンドポイントはありません。汎用のPUT /api/agents/{id}で 受け付けられます。生のリクエストボディに応じて3つの状態があります:フィールドが省略 → 変更なし;null→ クリア;オブジェクト → 置換。
  • 読み取り時にシリアライズされますが、一部が伏せられます。 agentget/list は、 エージェントのシークレットを閲覧する権限を持つ呼び出し元に対してのみmcp_config を返します。それ以外の場合は、 フィールドはnullとなり、mcp_config_redacted は true になります。エージェントアクターはこれを 決して確認できず、ワークスペースは全員に対して伏せ込みを強制することができます。

プロバイダーのサポートは統一されていません。Qwen Codeは、--mcp-configオプションで渡されるデーモン所有の0600権限の一時JSONファイルを介して、管理されたmcp_configを受け入れます。これは実行終了時に削除されます。Qwen Codeのネイティブ設定を継承するには、このフィールドを設定しない(null)ままにしてください。

スキルのバインディング

エージェントの作成だけでは、ワークスペースのスキルはバインドされません。バインドは、エージェントが作成された後の別の 呼び出しで行われます。2つの異なる動詞があります:

  • add は追加型です。指定された ID を既存のバインディングにマージします (POST /api/agents/{id}/skills/add)。
  • set は全置換です。指定された ID でバインディングリスト全体を上書きします (PUT /api/agents/{id}/skills)。--skill-ids ''を指定するとすべてがクリアされます。
multica agent skills add --skill-ids --output json
multica agent skills list --output json

クレーム発生時、デーモンはまずエージェントのスキルをワークスペースに紐付けられたスキルとして組み立て、 その後、プラットフォームの組み込みスキルを付加します。LoadAgentSkills は、各 バインドされたスキルのコンテンツとそのサポートファイルをロードします。組み込みスキルは コンパイル時に埋め込まれ、SKILL.mdおよび同階層のファイルから読み込まれます。これらはいずれも プロバイダーにはスキルコンテンツとして到達します。これが、機能(capability)はバインドされたスキル内に記述すべきであり、 指示文に貼り付けるべきではない理由です。

承認が必要な副作用

読み取り専用(安全):agent getagent skills listagent env get

状態を変更する(明示的な命令が必要 — 推測で実行してはならない):

  • multica agent create— 新しいエージェント行を挿入します。
  • multica agent skills add/set— バインディングを変更します(setは破壊的です: 新しいリストに含まれていないバインディングは破棄されます)。
  • multica agent env setカスタム_envマップ全体を上書きし、 監査行を書き込みます。

よくある誤った前提

  • descriptionはプロンプトである」。そうではありません — 実行時に渡されるのは 命令のみです。命令が空の詳細な説明は、動作契約のない 名前付きシェルを生成します。
  • 「Create によってエージェントのスキルがバインドされる。」そうではありません。後で明示的にバインドしてください。
  • agent updateで環境をローテーションできる。」できません。custom_env に対して 400 エラーを返します。 env エンドポイントを使用してください。
  • mcp_config はupdate時にcustom_envのように動作する。」そうではありません。mcp_configは agent update--mcp-config)経由で設定可能であり、--mcp-configをnullに設定すると クリアされます。専用のenvエンドポイントの背後で制御されているのはcustom_envのみです
  • agent get はenv の値を表示する。」表示されるのはhas_custom_envcustom_env_key_count のみです。
  • 「create時に無効なthinking_level/modelの組み合わせが検出される。」検出されるのは 未知のプロバイダーレベルの文字列のみです。モデル固有の不一致は実行時に失敗します。
  • 「スキルに関しては、setと addは互換性があります。」setはすべての バインディングを置き換えます。addを意図してsetを使用すると、機能が無言で削除されます。

参考文献

references/creating-agents-source-map.mdには、上記の各契約が、現在のツリー上の ファイルと行番号、実行時の影響、および安全な読み取り専用 検証コマンドに対応付けられています。

GitHubで見る

Creating Multica agents

This is the contract for Multica's agent-creation path: what the create entry points accept, what the server validates and rejects, how each field is persisted, and which fields the daemon actually reads at claim time. It is not a parameter manual — it states source-traced facts, and every claim is backed by file:line in references/creating-agents-source-map.md.

Quick start (read-only inspection)

These commands read state and have no side effects:

multica agent get <agent-id> --output json      # full persisted agent record
multica agent skills list <agent-id> --output json   # current skill bindings
multica agent env get <agent-id> --output json  # plaintext env (owner/admin only, agents denied)

agent get returns the persisted agent including runtime_id, model, thinking_level, service_tier, custom_args, has_custom_env, custom_env_key_count, and skills. It never returns plaintext custom_env.

Core model

An agent is a workspace-scoped row (table agent). Creation is a single POST /api/agents (multica agent create). At task claim time the daemon re-reads the agent row and assembles the runtime payload — so the persisted fields, not the create-time output, are what the agent runs on.

Two distinct text fields, often confused:

  • description is a catalog summary. It is stored and shown in listings; the daemon does NOT inject it into the agent's runtime prompt. Treat it as human-facing metadata only. Capped at 255 Unicode code points.
  • instructions is the runtime behavior contract. The daemon reads it at claim time and ships it to the provider as the agent's durable instructions. Persona, responsibilities, boundaries, output and escalation rules go here, not in description.

CLI / API entry points

Minimum create call (--name and --runtime-id are both required):

multica agent create --name <name> --runtime-id <runtime-id> \
  --description "<short catalog summary>" \
  --instructions "<runtime behavior contract>" \
  --output json

runAgentCreate builds a JSON body and posts it to /api/agents. It only adds a key when its flag was provided — description/instructions on a non-empty value, the rest (runtime-config, custom-args, model, thinking-level, service-tier, visibility, …) on the flag being Changed — so omitted flags fall through to server defaults rather than sending empty strings.

The HTTP body (CreateAgentRequest) accepts: name, description, instructions, avatar_url, runtime_id, runtime_config, custom_env, custom_args, model, thinking_level, service_tier, visibility, max_concurrent_tasks, mcp_config.

Field contracts

Defaults when omitted: runtime_config{}, custom_env{}, custom_args[], avatar_url → a random emoji:<glyph>, visibilityprivate, max_concurrent_tasks6 (all materialized server-side before the insert). custom_args/runtime_config are typed []string/any and marshaled as-is — the JSON-shape rejection happens in the CLI, not the create handler.

thinking_level is validated only at the provider level: fixed-catalog providers reject an unrecognized literal, while dynamic-catalog providers such as Codex/OpenCode accept a syntactically safe token. A value unsupported for the chosen model is NOT rejected here — the daemon checks its local model catalog at execution time, logs a warning, and omits the incompatible override.

Set it from the CLI with --thinking-level on agent create and agent update, mirroring --model: the flag is a thin pass-through to the top-level thinking_level field, and on update an empty string (--thinking-level "") clears it back to the runtime default. The CLI deliberately does not enumerate the valid levels — they are runtime/model-specific (Claude currently uses low|medium|high|xhigh|max; Codex values are discovered from the runtime's model catalog). It forwards the token, the server applies the provider's fixed-enum or safe-token gate, and the daemon performs the exact model/level check. A runtime whose provider has no thinking concept rejects any non-empty value with a 400.

service_tier is the matching first-class Codex speed control. Set it with --service-tier <catalog-id> on create/update; use --service-tier "" on update to clear it. The runtime model catalog owns both availability and display copy (currently priority, shown as Fast). The server accepts safe future Codex catalog IDs, while the daemon verifies the exact model/tier pair before execution and omits a stale incompatible override. Agents without an explicit model fail closed because the effective config.toml model is unknown.

model vs custom_args

model is a first-class persisted column the daemon reads directly. custom_args are raw provider CLI args. The CLI help notes that some providers (codex app-server, openclaw) reject --model inside custom_args — but that is documented CLI guidance, not a server-enforced invariant; nothing in the create handler inspects custom_args for a model flag.

Env & secrets

custom_env is secret material. The CLI offers three input channels; two keep secrets out of shell history and the process list:

multica agent create --name <name> --runtime-id <runtime-id> --custom-env-stdin --output json
multica agent create --name <name> --runtime-id <runtime-id> --custom-env-file <0600-json> --output json

--custom-env-stdin reads the JSON object from stdin; --custom-env-file reads it from a file (suggested mode 0600). The third channel, --custom-env <json>, puts the value on the command line where shell history and ps can see it — avoid it for real secrets.

Read-side facts (these are the wrong assumptions to avoid):

  • Agent resources never expose plaintext custom_env. agent list/get/create/update and WS events return only has_custom_env (bool) and custom_env_key_count (int).
  • Reading plaintext values requires the dedicated GET /api/agents/{id}/env endpoint (multica agent env get). It is gated to workspace owner/admin members, and agent actors are denied regardless of the backing member's role — a running agent cannot read another agent's secrets.
  • Writing values after creation does NOT go through agent update. The generic update handler rejects any custom_env field with a 400 ("use PUT /api/agents/{id}/env"). Plaintext env writes are handled by PUT /api/agents/{id}/env (multica agent env set), which is owner/admin-only and writes an audit row.

mcp_config

mcp_config is the agent's MCP server configuration (a JSON object such as {"mcpServers": {…}}). It is also secret material — MCP entries routinely embed API tokens — and offers the same three input channels as custom_env, on BOTH agent create and agent update:

multica agent create --name <name> --runtime-id <runtime-id> --mcp-config-file <0600-json> --output json
multica agent update <agent-id> --mcp-config-stdin --output json
multica agent update <agent-id> --mcp-config 'null'   # clears the config

--mcp-config-stdin / --mcp-config-file keep the value out of shell history and ps; the inline --mcp-config <json> does not. The CLI requires a JSON object or the literal null; a top-level array or primitive is rejected client-side, and empty stdin/file input errors rather than silently clearing.

Two ways mcp_config differs from custom_env:

  • It IS settable through agent update. Unlike custom_env, mcp_config has no dedicated audited endpoint — the generic PUT /api/agents/{id} accepts it. Tri-state per the raw request body: field omitted → no change; null → clear; object → replace.
  • It is serialized on read, but redacted. agent get/list return mcp_config only to callers allowed to view agent secrets; otherwise the field is null and mcp_config_redacted is true. Agent actors never see it, and a workspace may force redaction for everyone.

Provider support is not uniform: Qwen Code accepts a managed mcp_config through a daemon-owned 0600 temporary JSON file passed with --mcp-config; it is removed when the run exits. Leave the field unset (null) to inherit Qwen Code native settings.

Skill binding

Creating an agent does NOT bind any workspace skill — binding is a separate call after the agent exists. Two distinct verbs:

  • add is additive — it merges the given ids with existing bindings (POST /api/agents/{id}/skills/add).
  • set is replace-all — it overwrites the entire binding list with exactly the given ids (PUT /api/agents/{id}/skills); --skill-ids '' clears all.
multica agent skills add <agent-id> --skill-ids <skill-id> --output json
multica agent skills list <agent-id> --output json

At claim time the daemon assembles the agent's skills as workspace-bound skills FIRST, then appends the platform built-in skills. LoadAgentSkills loads each bound skill's content plus its supporting files; built-in skills are embedded at compile time and loaded from SKILL.md + sibling files. Both reach the provider as skill content — which is why capability belongs in a bound skill, not pasted into instructions.

Side effects needing approval

Read-only (safe): agent get, agent skills list, agent env get.

State-changing (require an explicit instruction — do not run speculatively):

  • multica agent create — inserts a new agent row.
  • multica agent skills add / set — mutate bindings (set is destructive: it drops bindings not in the new list).
  • multica agent env set — overwrites the full custom_env map and writes an audit row.

Common wrong assumptions

  • "description is the prompt." It is not — only instructions reaches the runtime. A rich description with empty instructions yields a named shell with no operating contract.
  • "Create binds the agent's skills." It does not; bind explicitly afterward.
  • "agent update can rotate env." It cannot — it 400s on custom_env; use the env endpoint.
  • "mcp_config behaves like custom_env on update." It does not — mcp_config IS settable via agent update (--mcp-config), with --mcp-config null to clear; only custom_env is gated behind the dedicated env endpoint.
  • "agent get shows env values." It shows only has_custom_env and custom_env_key_count.
  • "An invalid thinking_level/model combo is caught at create." Only an unknown provider-level literal is — model-specific gaps fail at run time.
  • "set and add are interchangeable for skills." set replaces all bindings; using it when you meant add silently removes capabilities.

References

references/creating-agents-source-map.md maps every contract above to its file:line on the current tree, the runtime effect, and a safe read-only verification command.

すべてのファイル

0件のファイル

multica-creating-agentsをインストール

スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。

ZIPをダウンロード

リポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。

git clone https://github.com/multica-ai/multica/tree/main/server/internal/service/builtin_skills/multica-creating-agents # Copy the skill folder to .claude/skills/ or .codex/skills/

コピー コピー
クイックセットアップ: skill フォルダを .claude/skills/ にコピーすると、Claude が自動的にそのスキルを検出して使用します。
リポジトリ multica-ai/multica

関連スキル

tilemaps
更新された時間 2026年8月4日
v4-new-features
更新された時間 2026年8月4日
agent-github-pr-manager
更新された時間 2026年8月3日
pixijs-application
更新された時間 2026年8月4日
OR