Miochat Plugin Builderのロゴ

Miochat Plugin Builder

コミュニティ
Pretend-to
miochat-plugin-builder

Master Guide for building and managing MioChat plugins using terminal and file-editor tools.

概要

公開者Pretend-to
リポジトリmio-chat-backend
スキル名miochat-plugin-builder
スター
38
フォーク
3
同梱ファイル
1
ライセンスMIT
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Pretend-to/mio-chat-backend.git /tmp/mio-chat-backend
mkdir -p .claude/skills
cp -r /tmp/mio-chat-backend/lib/chat/llm/skills/miochat-plugin-builder .claude/skills/miochat-plugin-builder
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

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

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

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

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

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

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

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

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

スキルの指示

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

MioChat Plugin Builder: Master Edition (V3 Hook Architecture)

You are a Master Architect of the MioChat ecosystem. You extend the system by managing plugins in the root /plugins/ (Standard Project-Level) or /plugins/custom/ (Agile Single-File) directories.

[!IMPORTANT] Directory Standards:

  • /plugins/<plugin-name>/: The ONLY place for new project-level plugins.
  • lib/plugins/: RESERVED for system core plugins. Do not add new plugins here.

🏗️ Project-Level Plugins (V3 Standard)

V3 plugins support logic-separation via hooks and automatic configuration via presets.

  • Location: /plugins/<plugin-name>/
  • Structure:
    text
    plugins/my-plugin/
    ├── package.json      # Metadata & Dependencies
    ├── index.js          # Plugin Entry Class
    ├── tools/            # MioFunction tools (Business Logic)
    ├── hooks/            # [Optional] BaseHook implementations (AOP Logic)
    └── presets/          # [Optional] Preset JSON files (Auto-Seeding)

1. index.js Implementation

The index.js should handle initialization and optional hook propagation.

javascript
import Plugin from '../../lib/plugin.js' 

export default class MyPlugin extends Plugin {
  constructor() {
    super({ importMetaUrl: import.meta.url })
  }

  async initialize() {
    await super.initialize() // MUST call super to load tools/hooks
    
    // Optional: Propagate private hooks to the global execution chain
    // this._propagateHooks() 
  }

  getInitialConfig() {
    return { apiKey: '', maxRequests: 100 }
  }
}

2. Developing Tools (tools/)

Tools represent actions and functions available to the LLM agent. Place files inheriting MioFunction in the tools/ directory.

Basic Tool Example
javascript
import { MioFunction } from '../../../lib/function.js'

export default class MyTool extends MioFunction {
  constructor() {
    super({
      name: 'my_tool',
      description: 'Tool description for LLM system prompt',
      parameters: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'Search keyword' }
        },
        required: ['query']
      }
    })
    this.func = this.execute.bind(this)
  }

  async execute(e) {
    const { query } = e.params
    return { success: true, result: `Searched for ${query}` }
  }
}
Dynamic Schema & Polymorphism (getDescription / getParameters)

MioFunction allows overriding getDescription(context) and getParameters(type, context) to dynamically tailor prompt instructions and parameters based on the execution context (e.g. Group Chat vs Single Chat vs specific External Channels):

javascript
export default class ContextAwareTool extends MioFunction {
  constructor() {
    super({
      name: 'smart_profile',
      description: 'Single chat default instructions',
      parameters: {
        type: 'object',
        properties: { prompt: { type: 'string' } },
        required: ['prompt']
      }
    })
    this.func = this.execute.bind(this)
  }

  // Dynamic description based on context (e.g., group chat vs single chat)
  getDescription(context = null) {
    if (context?.isGroup || context?.metaData?.memberId) {
      return 'Group chat instructions: manage role title and duties in the group...'
    }
    return this.description // Fallback to default
  }

  // Dynamic parameters schema based on context
  getParameters(type = null, context = null) {
    if (context?.isGroup || context?.metaData?.memberId) {
      return {
        type: 'object',
        properties: {
          title: { type: 'string', description: 'Group member title' },
          intro: { type: 'string', description: 'Group member duties' },
          prompt: { type: 'string', description: 'Personal prompt instructions' }
        },
        required: ['prompt']
      }
    }
    return this.parameters // 100% backwards compatible fallback
  }

  async execute(e) {
    const { prompt, title, intro } = e.params
    return { success: true, prompt, title, intro }
  }
}

3. Developing Hooks (hooks/)

Hooks allow you to intercept tool execution. Just place files inheriting BaseHook in the hooks/ directory.

javascript
import BaseHook from '../../../lib/hooks/BaseHook.js'
import { HOOK_POINTS } from '../../../lib/hooks/types.js'

export default class MyRateLimitHook extends BaseHook {
  constructor(options) {
    super({
      name: 'my-limiter',
      hookPoint: HOOK_POINTS.TOOL_BEFORE_EXECUTE,
      priority: 80,
      namespace: options.namespace // Injected automatically
    })
  }

  async execute(ctx) {
    const { user, config } = ctx
    if (user.usage > config.maxRequests) {
      ctx.error = 'Usage limit exceeded'
      return false // Block execution
    }
    return true
  }
}

[!TIP] Detailed Hook Points: For a full list of system-wide hook points (including TOOL_, LLM_, and PLUGIN_ lifecycle hooks) and advanced AOP design patterns, please refer to the core documentation: hooks.md.

4. Using Presets (presets/)

Any .json files in the presets/ folder are automatically synchronized to the system database upon plugin loading.

Preset JSON Structure:

json
{
  "name": "Expert Role",
  "category": "common",      // common | recommended | hidden
  "hidden": true,            // [IMPORTANT] Set to true to hide from UI preset list
  "opening": "Hello world",
  "history": [
    { "role": "system", "content": "System prompt goes here" }
  ],
  "tools": ["sh", "read"],
  "model": "gpt-4o",
  "provider": "plugin-name",
  "recommended": false,
  "avatar": "url"
}

Note: The system prompt should be the first element in the history array with role: \"system\".

You can output custom frontend UI components by setting extraRender in the tool result or calling this.setOuterRender(e, renders).

Placement Modes:

  • 'inner': Inside the collapsible tool box.
  • 'outer': Directly in the message flow.

🧪 Debugging & Validation (The Loop)

1. Find Hashed Tool Name

  • API: GET /api/plugins/:pluginName/tools
  • Header: X-Admin-Code: ******

2. Execute Debug Call

  • API: POST /api/plugins/:pluginName/tools/:toolName/debug
  • Body: {"parameters": { ... }}

💡 Expert Debugging Tips

  • Active Port: Usually 3080 for the production/live instance.
  • Hot Reload:
    • Saving tools/*.js: Automatic reload.
    • Saving hooks/*.js: Automatic reload via Plugin.initialize.
    • Saving index.js: Triggers plugin-level hot reload via middleware.js watcher.

🛠️ Master Workflow (V3 Loop)

  1. Plan: Define tools, hooks (for security/audit), and presets (for UX).
  2. Develop: Implement logic.
  3. Hot Reload: Save files. Observe logs: [PluginName] 已加载 N 个私有钩子.
  4. Identify: Call GET /.../tools to find names.
  5. Validate: Call POST /.../debug with test parameters.
  6. Refine: Fix code and repeat.

Note: Call Skill(skill_name: "miochat-plugin-builder") to refresh these instructions.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Miochat Plugin Builder」では何ができますか?

Master Guide for building and managing MioChat plugins using terminal and file-editor tools.

TypingMindでMiochat Plugin Builderを使うメリットは何ですか?

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

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

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/Pretend-to/mio-chat-backend/tree/master/lib/chat/llm/skills/miochat-plugin-builderを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Miochat Plugin Builderを使えるAIモデルはどれですか?

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

Miochat Plugin Builderは何個のAIモデルで使えますか?

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

AIスキル「Miochat Plugin Builder」は無料ですか?

はい。Pretend-toがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

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

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

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

すべて見る

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

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