Add Behaviorのロゴ

Add Behavior

コミュニティ
jmagly
add-behavior

Scaffold a new behavior definition with BEHAVIOR.md and optional scripts inside an existing addon or framework

概要

公開者jmagly
リポジトリaiwg
スキル名add-behavior
スター
225
フォーク
34
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 指示だけで完結

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

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jmagly/aiwg.git /tmp/aiwg
mkdir -p .claude/skills
cp -r /tmp/aiwg/agentic/code/addons/aiwg-utils/skills/add-behavior .claude/skills/add-behavior
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

Add Behavior

Scaffold a new behavior definition with BEHAVIOR.md and optional scripts and inputs inside an existing addon or framework.

Triggers

Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):

  • "I need a new behavior" → scaffold behavior in specified target
  • "create a reactive behavior" → prompt for name and target, scaffold
  • "add a hook-based behavior" → scaffold with scripts directory
  • "behavior for X context" → derive name, prompt for target

Trigger Patterns Reference

PatternExampleAction
Named add"add behavior auto-lint --to aiwg-utils"Scaffold directly
Description-driven"create a behavior that triggers on file save"Derive name, prompt target
Interactive"add behavior --interactive --to sdlc-complete"Guided design mode
Target omitted"add behavior my-behavior"Ask which addon or framework

Understanding Behaviors

Behaviors are the newest AIWG artifact type. They bind reactive directives and toolsets to specific agent contexts. Unlike skills (which activate on natural language patterns) or commands (which require explicit invocation), behaviors:

  • React to events — file saves, session starts, code changes, tool completions
  • Bind to contexts — specific file types, project states, or agent sessions
  • Execute automatically — no user invocation needed once activated
  • Compose with tools — can bundle external scripts and structured inputs

Behaviors deploy primarily to OpenClaw (~/.openclaw/behaviors/) and are defined using the cross-platform BEHAVIOR.md format.

Process

1. Parse Arguments

Extract from $ARGUMENTS:

  • <name> — kebab-case behavior name (required)
  • --to <target> — addon or framework directory name (required)
  • --interactive — enable guided design questions

If either <name> or --to is missing, ask before proceeding.

2. Validate Target

Confirm the target exists:

bash
# Check addons
ls agentic/code/addons/<target>/

# Check frameworks
ls agentic/code/frameworks/<target>/

3. Interactive Design (if --interactive)

Ask before generating:

  1. Trigger event: What event or context activates this behavior?
    • Examples: on-file-save, on-session-start, on-tool-complete, on-agent-context
  2. Context binding: Does it bind to specific file types, directories, or agent states?
  3. Directive: What should the agent do when triggered?
  4. Scripts: Does it need external scripts for tool execution?
  5. Inputs: Does it accept structured input parameters?
  6. Scope: Is it user-level (home dir) or project-level?

4. Run Scaffolding

bash
aiwg add-behavior <name> --to <target>

5. Customize BEHAVIOR.md

The generated BEHAVIOR.md uses the cross-platform format:

markdown
---
name: <name>
description: <one-sentence purpose>
version: 1.0.0
trigger: <event-type>
context:
  - <file-glob-or-state>
platforms:
  - openclaw
---

# Behavior Name

[Description of what this behavior does and when it activates]

## Trigger

Activates when: `<trigger event description>`

Context constraints:
- `<constraint 1>` — e.g., only in `.ts` files
- `<constraint 2>` — e.g., only during construction phase

## Directive

When triggered, the agent will:

1. [Action 1]
2. [Action 2]
3. [Action 3]

## Inputs (if applicable)

| Input | Type | Required | Description |
|-------|------|----------|-------------|
| <input> | string | Yes | What it controls |

## Scripts (if applicable)

| Script | Purpose |
|--------|---------|
| `scripts/<name>.sh` | What it does |

## Deactivation

This behavior is inactive when:
- <condition that suppresses it>

6. Create Supporting Files (if needed)

For behaviors with scripts:

bash
mkdir -p <target>/behaviors/<name>/scripts/
# Add executable scripts
chmod +x <target>/behaviors/<name>/scripts/*.sh

For behaviors with structured inputs:

bash
mkdir -p <target>/behaviors/<name>/inputs/
# Add JSON Schema or YAML input definitions

7. Update Manifest

The CLI tool updates <target>/manifest.json. Verify:

json
{
  "behaviors": ["existing-behavior", "<name>"]
}

Generated Structure

<target>/behaviors/<name>/
├── BEHAVIOR.md        # Behavior definition (cross-platform format)
├── scripts/           # Optional: executable scripts
└── inputs/            # Optional: structured input schemas

Manifest updated: <target>/manifest.json

Output Format

Behavior Created: <name>
────────────────────────
Location: <target>/behaviors/<name>/

Created:
  ✓ BEHAVIOR.md
  ✓ scripts/  (placeholder)
  ✓ inputs/   (placeholder)

Manifest updated: <target>/manifest.json

Deployment target: ~/.openclaw/behaviors/<name>/

Next Steps:
  1. Define trigger event and context constraints
  2. Write directive steps
  3. Add scripts (if external tools needed)
  4. Define input schema (if parameterized)
  5. Deploy: aiwg use <target> --provider openclaw

Examples

Example 1: Session-start behavior

User: "add behavior session-preflight --to aiwg-utils"

Action:

bash
aiwg add-behavior session-preflight --to aiwg-utils

Result: agentic/code/addons/aiwg-utils/behaviors/session-preflight/BEHAVIOR.md scaffolded. Defines behavior that runs aiwg doctor automatically at session start.

Example 2: File-save behavior with scripts

User: "create a behavior that lints TypeScript files on save in sdlc-complete"

Extraction: name=ts-lint-on-save, target=sdlc-complete, trigger=on-file-save, context=**/*.ts

Action:

bash
aiwg add-behavior ts-lint-on-save --to sdlc-complete --interactive

Result: BEHAVIOR.md plus scripts/run-lint.sh.

Example 3: Agent-context binding

User: "add behavior threat-model-context --to sdlc-complete"

Result: Behavior that activates when the threat-modeler agent is in context, loading relevant security rules automatically.

References

  • @$AIWG_ROOT/src/cli/handlers/scaffolding.ts — CLI handler implementation
  • @$AIWG_ROOT/docs/cli-reference.md — Full CLI reference
  • @$AIWG_ROOT/agentic/code/addons/aiwg-utils/skills/devkit-create-skill/SKILL.md — Related skill scaffolding pattern

よくある質問

AIスキル「Add Behavior」では何ができますか?

Scaffold a new behavior definition with BEHAVIOR.md and optional scripts inside an existing addon or framework

TypingMindでAdd Behaviorを使うメリットは何ですか?

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

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

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

Add Behaviorを使えるAIモデルはどれですか?

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

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

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

AIスキル「Add Behavior」は無料ですか?

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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