Skills

Skills are a way to give CodeBot extra knowledge. They are a folder containing a skill.md document with information in it, and optionally other files or 'references' which are additional documentation.

Security warning: Be aware of security. Skills are text given to the AI, and treated by it with high priority. Audit any skills you add from a third party or untrusted source.

Writing a Skill

Skills are useful when an AI does not know -- or can have no way of knowing -- specific information. A good skills files contains either or both of:

  • Information: the what. Anything the AI should know.

  • Action: the what to do and how. Information alone requires inference to apply, but often there are rules or systems or workflows an AI should follow to apply the information. Specify them.

A very common usage is domain expertise, such as key things to know in the area your app works (say, specific finance rules); or your company's internal processes or business rules. But they can contain anything you need CodeBot to know.

To create a new skill, go to Settings, Skills tab, and click New Skill. This can be a skill made available to your entire team (saved in the project/repo) or one just for yourself.

The name is for you, and the description is for CodeBot. You must state:

  • What the skill contains

  • When to load it

in the description. For example:

How to use the FooBar database components. Load this whenever you need to use a TFoo*-named component or see fooDB, fooVirtualDB, or foo*-named units in the uses clause.

Inbuilt skills

We've taught CodeBot a lot about good coding, or its other abilities, and this is done through writing skills. CodeBot comes with skills for a wide variety of Delphi-related functionality.

Installing Third Party Skills

Several Delphi developers and companies are writing skills for their technology, and we encourage you to make use of them.

Copy them into:

%APPDATA%\RemObjects Software\CodeBot\Skills

If you're a third party who writes skills, please feel free to install your skills in the above folder.

Auto-loaded skills

Skills can be loaded by CodeBot whenever it thinks one will be useful. It judges this based on the description of the skills. However, sometimes it is useful to guarantee a skill is present in certain conditions rather than leave it up to the AI.

Skills are Markdown files with frontmatter (a header between two sets of ---, with data in YAML format.) CodeBot supports some custom fields which allow auto-loading. These are available when clicking the Edit button on the Skills tab, or you can edit the skills file itself.

These fields are:

  • codebot-language: always load when CodeBot is being used for a specific language. For example, 'delphi'.

  • codebot-when: a comma-separated list of technologies or compiler versions. Supported tags are 'vcl' and 'fmx', and any Delphi compiler version such as 36 or 36.0 (both treated as the same) for Delphi 12. Skills for a compiler version are loaded for that version and newer, not that version only.

  • codebot-agents: a comma-separated list of agents. Use this to ensure your skill is loaded when CodeBot is doing something specific. For example, add planner to ensure your skill is loaded whenever CodeBot is planning. Supported values are codeWriter, codeWritingSubagent (specify both these for a skill to use when writing any code), codeReviewer, planner, questionAnswering (also the agent used when researching an answer), codebaseAnalyzer (the agent used for /init), and genericTask (a subagent used for any task, so specify this if you need your skill to be available if CodeBot delegates work to a subagent.)

For example:

---
name: HelloMethods
description: important info for writing methods. Load this when writing a new method.
metadata:
  codebot-language: delphi
  codebot-when: vcl, 36
  codebot-agents: codeWriter, codeWritingSubagent
---

ALWAYS create empty methods (stubs, event handlers, etc) with a comment that says "// HELLO"

The skill itself here is simple: a single imperative command. It is auto-loaded when using Delphi and you have a VCL project open and you are using Delphi 12 (compiler 36) or newer (ie Delphi 13, 14, ...) and when writing code. (The agents list itself is or-ed: any agent listed counts.

You can think of this as (lang = delphi AND projectUI = vcl AND compiler >= 36 AND (agent = codeWriter OR agent = codeWritingSubagent).)

Whether auto-loaded or not, all skills are available for CodeBot to load and choose to use at any time.

See Also