Add Behavior logo

Add Behavior

Community
jmagly
add-behavior

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

Overview

Publisherjmagly
Repositoryaiwg
Skill nameadd-behavior
Stars
225
Forks
34
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by jmagly on GitHub. Read the source before you install it.

Installation

Install the Add Behavior AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/jmagly/aiwg/tree/main/agentic/code/addons/aiwg-utils/skills/add-behavior
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Add Behavior in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Add Behavior on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Add Behavior is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Frequently asked questions

What does the Add Behavior AI skill do?

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

Why use Add Behavior on TypingMind?

Because you install it once and use it with any model. Add Behavior is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Add Behavior in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jmagly/aiwg/tree/main/agentic/code/addons/aiwg-utils/skills/add-behavior. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Add Behavior?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Add Behavior?

As many as you like. As long as a model supports skills, you can use Add Behavior with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Add Behavior AI skill free?

Yes. It is published on GitHub by jmagly under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇