Scripting logo

Scripting

Community
jstanden
scripting

Cerb scripting -- Twig at the base, extended with Cerb commands, functions, filters, and tests. Load it whenever you write or debug the contents of a scripting value, wherever that value lives.

Overview

Publisherjstanden
Repositorycerb
Skill namescripting
Stars
83
Forks
38
Bundled files
Instructions only
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 jstanden on GitHub. Read the source before you install it.

Installation

Install the Scripting 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/jstanden/cerb/tree/12.0.x/features/cerberusweb.core/assets/agent_filesystems/cerb-agents/skills/scripting
  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/jstanden/cerb.git /tmp/cerb
mkdir -p .claude/skills
cp -r /tmp/cerb/features/cerberusweb.core/assets/agent_filesystems/cerb-agents/skills/scripting .claude/skills/scripting
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Scripting 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 Scripting 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 Scripting 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.

Cerb scripting

Cerb scripts are written in Twig -- the PHP-ecosystem templating language (twig.symfony.com), not a lookalike. Cerb embeds a real Twig environment, sandboxes it, and extends it.

Standard Twig works. Its syntax, its operators, and its built-in filters, functions, and tests behave as documented upstream -- upper, join, default, merge, slice, date, json_encode and the rest are all there. Reach for what you know about Twig first; you don't need Cerb documentation to justify a standard feature.

What the sandbox removes is template composition and introspection. These tags are the complete allowed set:

apply  do  filter  for  if  sandbox  set  verbatim  with

So there is no {% macro %}, {% include %}, {% import %}, {% from %}, {% use %}, {% extends %}, {% embed %}, or {% block %}, and no include(), source(), template_from_string(), constant(), or dump(). A scripting value is one self-contained template with nothing to compose against and no way to reach into the host -- which is the same reason it can't reach the automation around it.

Scope: a scripting value is ONE Twig template, not an automation

A scripting value is the body of one template. It is plain text with Twig tokens in it, and nothing else. Whatever it holds is rendered as a template and evaluates to a single string.

  • Do NOT write KATA. No start:, no set: / decision: / outcome: / await: blocks, no key: value trees, no @bool / @int / @text / @key annotations, no &refs. That is the syntax of the automation AROUND this field, not of the field itself; emitting it here just prints literal garbage.
  • Do NOT wrap the value in markdown code fences, a YAML/KATA key, or any indentation scaffolding. The field takes the raw template text exactly as it should appear.
  • Do NOT put explanatory prose in the value — explanations go in chat. Only {# ... #} Twig comments belong in the template.
  • Control flow INSIDE the value is Twig: {% if %}, {% for %}, {% set %}. Control flow BETWEEN steps — running commands, awaiting input, branching across records — is the automation's job, in KATA, outside this field. If the goal actually needs that, say so rather than writing KATA here.
  • Produce exactly one template per request: the complete new value of this one field, not several alternatives pasted together.

Core model

  • Everything typed is literal text output until a special token appears.
  • {{ ... }} prints an expression; {% ... %} runs a statement/command; {# ... #} is a comment.
  • Variables are set with {% set x = ... %} and are scoped to the current template only — they do not carry across separate actions/templates. A variable defined solely inside a loop is not visible after it; define it before the loop to persist values across iterations.
  • For multi-line text, prefer the block form {% set body %}...{% endset %} over assigning a quoted string. The body is ordinary template text — line breaks, quotes and apostrophes need no escaping, and {{ ... }} and {% ... %} work inside it — so a paragraph reads as a paragraph instead of a concatenation.
  • Values pass through filters via | (e.g. {{name|upper}}), and filters stack left to right (e.g. {{x|default('there')|upper}}).

What Cerb adds on top

Cerb ships a large set of its own filters, functions, and tests alongside Twig's, plus commands. They are not upstream Twig, so look them up rather than recalling them, and don't assume one is portable to a Twig project elsewhere:

  • /cerb-docs/references/docs/scripting/filters.md — the filter index, with a page per filter under filters/ (82 of them).
  • /cerb-docs/references/docs/scripting/functions.md — the function index, with a page per function under functions/ (57 of them).
  • /cerb-docs/references/docs/scripting/tests.md — the tests usable after is / is not.
  • /cerb-docs/references/docs/scripting/commands.md — the {% %} commands Cerb adds.

The rule runs one way only. A standard Twig feature needs no lookup; a name you can't place in stock Twig probably belongs to Cerb, so confirm it in the reference above before you use it.

Placeholders are pre-set variables supplied by the surrounding context (e.g. automation event inputs). Identify which are available before using them.

Ground truth (always verify against the mounted docs)

  • /cerb-docs/references/docs/scripting.md — overview and topic index.
  • /cerb-docs/references/docs/scripting/ — per-topic pages: variables, strings, arrays-objects, dates, conditional-logic, operators, loops, regex, json, xml, commands, functions, filters, tests (plus functions/ and filters/ subdirectories for individual entries).
  • /cerb-docs/references/solutions/automations/ — worked, copy-pasteable scripting solutions (e.g. loop-search-results, filter-array-values, map-array-values, json-encode-decode). Prefer adapting one of these to reinventing a snippet.

For how a scripting value fits into an automation, workflow, snippet, or bot — and which placeholders a given trigger/event supplies — load the automations skill. Read it to understand the surroundings; never copy its KATA into a scripting value.

Method

  1. Confirm the CONTEXT (automation, snippet, bot behavior, HTTP action, etc.), since that determines available placeholders and expected output.
  2. Look up exact names/signatures of filters, functions, and tests in the docs rather than guessing — Cerb's set differs from vanilla Twig. Prefer search/find to locate, then read only the needed section.
  3. Write idiomatic, minimal templates — text plus Twig tokens, nothing else. Show expected rendered output when helpful.
  4. Flag scope pitfalls (loop-local variables, per-action scope) and empty-value handling (default filter) proactively.

Style

  • Be concise and practical. Prefer a working example over prose.
  • When you catch yourself about to type a line ending in : with children indented under it, stop — that is KATA, and it belongs to the automation, not to this field.
  • State any assumptions and offer the obvious next step (e.g. wrap in an automation input, collect into an array, verify a filter name).

Frequently asked questions

What does the Scripting AI skill do?

Cerb scripting -- Twig at the base, extended with Cerb commands, functions, filters, and tests. Load it whenever you write or debug the contents of a scripting value, wherever that value lives.

Why use Scripting on TypingMind?

Because you install it once and use it with any model. Scripting 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 Scripting in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jstanden/cerb/tree/12.0.x/features/cerberusweb.core/assets/agent_filesystems/cerb-agents/skills/scripting. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Scripting?

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 Scripting?

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

Is the Scripting AI skill free?

It is published on GitHub by jstanden. Check the repository for licensing terms. 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 👇