owner-clone-ai-mcp 1.28.2 → 1.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/domains/skills.js +51 -7
- package/package.json +1 -1
package/domains/skills.js
CHANGED
|
@@ -35,8 +35,24 @@ const tools = [
|
|
|
35
35
|
■ スキルとは
|
|
36
36
|
プロンプトテンプレート・ナレッジ・AIパートナー・ワークフローを組み合わせた再利用可能なタスクレシピ。
|
|
37
37
|
|
|
38
|
+
■ スキル種別 skill_type【まず最初に決める・重要】
|
|
39
|
+
◆ standard(標準・デフォルト): prompt_template に手順を書く従来型。手順・参照ナレッジIDを明示する。
|
|
40
|
+
◆ agent_goal(ゴール型・自律エージェント): 「ゴール(達成すべき目的/KPI)」だけを与え、
|
|
41
|
+
Claude Code 等の実行AIが自分で計画を立て、アカウント内のナレッジ・AIパートナー・スキルを
|
|
42
|
+
自分で探索・活用してゴールを達成する。手順を細かく書く必要はない。
|
|
43
|
+
- goal(agent_goal時必須): 達成すべきゴール本文。例「{{product}}を売るセールスレターを作成しナレッジ保存」。
|
|
44
|
+
- agent_preset_ids(空=全AIパートナーが候補): 使ってよいAIパートナーIDの候補プール。
|
|
45
|
+
実行AIが各ステップで最適なものを load_agent で自動選択し人格を切替えて使う(該当なしのステップは使わない)。
|
|
46
|
+
- knowledge_folder_ids / knowledge_item_ids(空=全ナレッジ対象): 参照範囲のヒント。
|
|
47
|
+
- ref_skill_ids(空=全スキルが候補): 実行AIが活用してよいスキルの候補(UUID・個別指定)。
|
|
48
|
+
- ref_skill_folder_ids: スキルカテゴリ(skill_folders)単位での候補指定。配下の全スキルを候補に含める(ref_skill_idsと合算)。
|
|
49
|
+
- 出力: agent_goal は【必ずナレッジ保存】(成果物を create_knowledge)。output_knowledge_folder_id で保存先指定可。
|
|
50
|
+
- スコープはソフト制限(プロンプトで伝える指示・完全なブロックではない)。
|
|
51
|
+
- agent_goal は prepare_skill 専用(invoke_skill=サーバー実行は不可)。
|
|
52
|
+
- 「ゴールを与えて自律達成させたい/手順は任せたい」なら agent_goal、「決まった手順で毎回同じ処理」なら standard。
|
|
53
|
+
|
|
38
54
|
■ 作成後の実行方法
|
|
39
|
-
作成後は prepare_skill
|
|
55
|
+
作成後は prepare_skill で実行します(agent_goal も prepare_skill)。
|
|
40
56
|
サーバーはDBからコンテキストを取得するのみで、AI処理はClaude Code自身が実行します。
|
|
41
57
|
|
|
42
58
|
■ prompt_template の書き方【実行モードによって異なる・重要】
|
|
@@ -130,9 +146,14 @@ allowed_plan_ids でプランを絞り込めます([] または省略 = 全プ
|
|
|
130
146
|
required: ['name'],
|
|
131
147
|
},
|
|
132
148
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
149
|
+
skill_type: { type: 'string', enum: ['standard', 'agent_goal'], description: 'スキル種別。standard=手順型(デフォルト)。agent_goal=ゴール型(自律エージェント)。agent_goalにすると goal が必須・prepare_skill専用(invoke_skill不可)になる' },
|
|
150
|
+
goal: { type: 'string', description: '【agent_goal時必須】達成すべきゴール本文。実行AIが分解・計画し、ナレッジ・AIパートナー・スキルを自分で使って達成する。例「{{product}}を売るセールスレターを作成しナレッジ保存」。{{param}}も使用可' },
|
|
151
|
+
agent_preset_ids: { type: 'array', items: { type: 'integer' }, description: '【agent_goal向け】使ってよいAIパートナーID(整数)の候補プール。空=全パートナーが候補。実行AIが各ステップで最適なものを load_agent で自動選択・切替して使う。list_agent_presetsで確認' },
|
|
152
|
+
ref_skill_ids: { type: 'array', items: { type: 'string' }, description: '【agent_goal向け】実行AIが活用してよいスキルの候補ID(UUID・個別指定)。空=全スキルが候補。list_skillsで確認。ref_skill_folder_idsと併用可(合算)' },
|
|
153
|
+
ref_skill_folder_ids: { type: 'array', items: { type: 'string' }, description: '【agent_goal向け】スキルカテゴリ(skill_folders)ID(UUID)。配下の全スキルを候補に含める。list_skill_foldersで確認。ref_skill_idsとの合算で候補が決まる。空=カテゴリ指定なし' },
|
|
154
|
+
knowledge_item_ids: { type: 'array', items: { type: 'string' }, description: '参照するナレッジのID一覧(UUID文字列。list_knowledge_itemsで確認)。standard=実行時に動的取得。agent_goal=参照範囲ヒント(空=全ナレッジ対象)' },
|
|
155
|
+
knowledge_folder_ids: { type: 'array', items: { type: 'string' }, description: '参照するナレッジフォルダID一覧(UUID文字列。list_knowledge_foldersで確認)。standard=フォルダ内ナレッジを実行時に動的取得。agent_goal=参照範囲ヒント(空=全ナレッジ対象)' },
|
|
156
|
+
preset_id: { type: 'integer', description: 'AIパートナーのID(整数。list_agent_presetsで返されるidをそのまま渡す)。指定するとそのAIパートナーのシステムプロンプト・ナレッジ検索モードが使われる。省略時はユーザーのClaude APIキーで実行(未設定の場合エラー)。※agent_goalでは agent_preset_ids(複数)を使う' },
|
|
136
157
|
workflow_id: { type: 'string', description: 'ワークフローのID(UUID。list_workflowsで確認)。指定するとワークフローエンジンに委譲(preset_idより優先される)' },
|
|
137
158
|
output_target: { type: 'string', enum: ['text', 'knowledge', 'both'], description: '出力先: text=テキスト返却のみ, knowledge=ナレッジ保存のみ, both=両方。デフォルト: text' },
|
|
138
159
|
output_knowledge_folder_id: { type: 'string', description: 'ナレッジ保存先フォルダID(UUID。list_knowledge_foldersで確認)。output_targetがknowledgeまたはbothのときのみ有効。省略時はフォルダなし' },
|
|
@@ -179,6 +200,11 @@ is_admin_published / allowed_plan_ids はAdmin権限がある場合のみ反映
|
|
|
179
200
|
category_id: { type: 'string', description: 'スキルカテゴリID(UUID)。null を渡すとルート(カテゴリなし)に移動。list_skill_categoriesで確認' },
|
|
180
201
|
is_admin_published: { type: 'boolean', description: '【Admin専用】全ユーザーへの公開状態を変更する。falseにすると非公開に戻す' },
|
|
181
202
|
allowed_plan_ids: { type: 'array', items: { type: 'string' }, description: '【Admin専用】公開対象プランIDのリスト。[] を渡すと全プラン公開に戻す' },
|
|
203
|
+
skill_type: { type: 'string', enum: ['standard', 'agent_goal'], description: 'スキル種別。standard=手順型、agent_goal=ゴール型(自律エージェント)。agent_goalにする場合は goal を必ず設定。詳細はcreate_skill参照' },
|
|
204
|
+
goal: { type: 'string', description: '【agent_goal時必須】達成すべきゴール本文。実行AIが計画してナレッジ・AIパートナー・スキルを自分で使い達成する' },
|
|
205
|
+
agent_preset_ids: { type: 'array', items: { type: 'integer' }, description: '【agent_goal向け】使ってよいAIパートナーID(整数)の候補プール。空=全候補。各ステップで実行AIが load_agent で自動選択。配列全体を置き換える' },
|
|
206
|
+
ref_skill_ids: { type: 'array', items: { type: 'string' }, description: '【agent_goal向け】活用してよいスキルの候補ID(UUID・個別指定)。空=全候補。配列全体を置き換える。ref_skill_folder_idsと併用可' },
|
|
207
|
+
ref_skill_folder_ids: { type: 'array', items: { type: 'string' }, description: '【agent_goal向け】スキルカテゴリ(skill_folders)ID(UUID)。配下の全スキルを候補に含める。list_skill_foldersで確認。配列全体を置き換える' },
|
|
182
208
|
},
|
|
183
209
|
required: ['id'],
|
|
184
210
|
},
|
|
@@ -374,12 +400,21 @@ const handlers = {
|
|
|
374
400
|
const paramStr = params.length
|
|
375
401
|
? params.map(p => ` - ${p.name}${p.required ? '(必須)' : '(任意)'}: ${p.description || ''}${p.default_value ? ` [デフォルト: ${p.default_value}]` : ''}`).join('\n')
|
|
376
402
|
: ' なし';
|
|
403
|
+
const isGoal = s.skill_type === 'agent_goal';
|
|
377
404
|
return [
|
|
378
405
|
`ID: ${s.id}`,
|
|
379
406
|
`コマンド名: ${s.name}`,
|
|
380
407
|
`表示名: ${s.display_name}`,
|
|
381
408
|
`説明: ${s.description || 'なし'}`,
|
|
382
|
-
|
|
409
|
+
`スキル種別: ${isGoal ? 'agent_goal(ゴール型・自律エージェント/prepare_skill専用)' : 'standard(手順型)'}`,
|
|
410
|
+
...(isGoal ? [
|
|
411
|
+
`ゴール: ${s.goal || '(未設定)'}`,
|
|
412
|
+
`AIパートナー候補(agent_preset_ids): ${(s.agent_preset_ids || []).length ? (s.agent_preset_ids || []).join(', ') : '空(全パートナーが候補・各ステップで自動選択)'}`,
|
|
413
|
+
`スキル候補(個別 ref_skill_ids): ${(s.ref_skill_ids || []).length ? (s.ref_skill_ids || []).join(', ') : '空'}`,
|
|
414
|
+
`スキル候補(カテゴリ ref_skill_folder_ids): ${(s.ref_skill_folder_ids || []).length ? (s.ref_skill_folder_ids || []).join(', ') : '空'}${!(s.ref_skill_ids || []).length && !(s.ref_skill_folder_ids || []).length ? '(個別・カテゴリ共に空=全スキルが候補)' : ''}`,
|
|
415
|
+
] : [
|
|
416
|
+
`プロンプトテンプレート:\n${s.prompt_template || 'なし'}`,
|
|
417
|
+
]),
|
|
383
418
|
`パラメータ:\n${paramStr}`,
|
|
384
419
|
`ナレッジ指定アイテム数: ${(s.knowledge_item_ids || []).length}件`,
|
|
385
420
|
`ナレッジ指定フォルダ数: ${(s.knowledge_folder_ids || []).length}件`,
|
|
@@ -401,7 +436,9 @@ const handlers = {
|
|
|
401
436
|
knowledge_item_ids, knowledge_folder_ids, preset_id, workflow_id,
|
|
402
437
|
output_target, output_knowledge_folder_id, output_knowledge_category,
|
|
403
438
|
is_shared, category_id, is_admin_published, allowed_plan_ids,
|
|
439
|
+
skill_type, goal, agent_preset_ids, ref_skill_ids, ref_skill_folder_ids,
|
|
404
440
|
} = args;
|
|
441
|
+
const isGoal = skill_type === 'agent_goal';
|
|
405
442
|
const data = await callApi('/skills', {
|
|
406
443
|
method: 'POST',
|
|
407
444
|
body: JSON.stringify({
|
|
@@ -411,13 +448,18 @@ const handlers = {
|
|
|
411
448
|
knowledge_folder_ids: knowledge_folder_ids || [],
|
|
412
449
|
preset_id: preset_id || null,
|
|
413
450
|
workflow_id: workflow_id || null,
|
|
414
|
-
output_target: output_target || 'text',
|
|
451
|
+
output_target: output_target || (isGoal ? 'both' : 'text'),
|
|
415
452
|
output_knowledge_folder_id: output_knowledge_folder_id || null,
|
|
416
453
|
output_knowledge_category: output_knowledge_category || 'other',
|
|
417
454
|
is_shared: is_shared === true,
|
|
418
455
|
folder_id: category_id || null,
|
|
419
456
|
is_admin_published: is_admin_published === true,
|
|
420
457
|
allowed_plan_ids: allowed_plan_ids || [],
|
|
458
|
+
skill_type: isGoal ? 'agent_goal' : 'standard',
|
|
459
|
+
goal: isGoal ? (goal || null) : null,
|
|
460
|
+
agent_preset_ids: agent_preset_ids || [],
|
|
461
|
+
ref_skill_ids: ref_skill_ids || [],
|
|
462
|
+
ref_skill_folder_ids: ref_skill_folder_ids || [],
|
|
421
463
|
}),
|
|
422
464
|
});
|
|
423
465
|
return [
|
|
@@ -426,7 +468,9 @@ const handlers = {
|
|
|
426
468
|
`コマンド名: ${data.name}`,
|
|
427
469
|
`表示名: ${data.display_name}`,
|
|
428
470
|
``,
|
|
429
|
-
|
|
471
|
+
isGoal
|
|
472
|
+
? `種別: ゴール型(自律エージェント)。実行方法: prepare_skill に id="${data.id}" を渡すと、ゴール達成のための自律エージェント指示書が返ります(invoke_skillは不可)。`
|
|
473
|
+
: `実行方法: prepare_skill(Claude Code等の自律実行)または invoke_skill(サーバー実行)に id="${data.id}" を渡して起動できます。`,
|
|
430
474
|
].join('\n');
|
|
431
475
|
},
|
|
432
476
|
|