Skip to content
AlbertCode SWE

Module 11 · 12 min

Extend and automate

Custom commands and agents, tools and skills, MCP servers and plugins, and AlbertCode SWE in scripts and CI. None of them can widen its limits.

By the end of this module you can

  • Write a custom command and a read-only agent
  • Add an MCP server, and know which of its tools need your approval
  • Run AlbertCode SWE from a script, and answer its gates there

You can extend AlbertCode SWE without touching its code. None of it can widen what AlbertCode SWE is allowed to do: the mode, the contract and both approvals apply to everything an extension does (Extending).

Custom commands

A command is a prompt you write once and call by name. It is a Markdown file. Saved as .albertcode/commands/review.md, this one is /review:

Markdown
---
description: Review a file for correctness bugs
agent: reader          # optional: run as this custom agent
mode: ask              # optional: ask, governed or direct
argument-hint: <file>
---
Review $ARGUMENTS for correctness bugs, not style. Start with $1.
  • $ARGUMENTS is everything typed after the command, and $1 to $9 are its words.
  • When two places define the same name, the repository wins, then your settings folder, then plugins. A command can never take a built-in's name.
  • A command is text. Running one runs no program and reads no file, and the mode and the approvals apply as if you had typed it.

Custom agents, tools and skills

An agent is a role a task works as, and it can only narrow what AlbertCode SWE is allowed to do. Its tools come in groups such as read, edit and run, and an agent that cannot edit answers questions only. Make one with /agents new. Work as it with /agent reader, and go back with /agent default.

A saved tool is a fixed command with named holes. Each hole is filled with exactly one argument, never passed through a shell.

A skill writes down a project convention, in .albertcode/skills/. It changes what the model is told, never what it is allowed to do.

Saved tools and skills are off until you switch them on. The repository's contract decides whether they may be switched on at all.

MCP servers and plugins

MCP servers bring outside tools: Git, Playwright, databases, your company's services (MCP servers).

  • Connectors is a gallery of ready-made servers, each one run for real. A connector that signs in, such as Linear or Sentry, needs nothing but your account.
  • While Albert plans or answers questions, only tools that read are offered.
  • A tool that acts needs your approval, and every call is recorded in the evidence ledger.

A plugin installs commands, agents and MCP servers together (Plugins).

  • You see what a plugin adds before anything is installed.
  • No part of a plugin is ever run, except the MCP servers it declares, and only after you have seen exactly what each one runs.
  • Never put a secret in a plugin: write {env:NAME} instead.

Scripts and CI

Every step of a task is also a subcommand that prints JSON, so AlbertCode SWE fits a script or a CI job:

Terminal
albertcode run "Why does the cart total round down?" --lane ask
albertcode run "Add a test for the 10% code" --approve plan,result

The first command asks a question. The second makes a governed change, with both gates answered for you. Without --approve, a governed change stops at its plan and the command exits with status 3, so that a person can read the plan and answer it.

Practise

Five ways to extend it

You can extend AlbertCode SWE without touching its code, in five ways. Match each to what it is.

A command, an agent, a connector and a script

Start with the custom command in the lesson above.

  1. 1

    Save the example as .albertcode/commands/review.md, then run it on any file of your repository:

    /review src/cart.py
  2. 2

    Make a read-only agent: name it reader, and untick Edit files:

    /agents new
  3. 3

    Add a connector that needs no sign-in, then check it with /mcp list:

    albertcode mcp install git repository=.
  4. 4

    Ask a question from a script:

    albertcode run "Why does the cart total round down?" --lane ask
  5. 5

    Make a governed change from a script, with both gates answered for you:

    albertcode run "Add a test for the 10% code" --approve plan,result

Check your understanding

6 questions. Answer 5 correctly to complete the module. Checked here, in your browser.

  1. 01In a custom command's text, what does $ARGUMENTS stand for?
  2. 02/review is defined in the repository, in your settings folder and in a plugin. Which one runs?
  3. 03Which albertcode run option answers both gates of a governed change for you?
  4. 04A plugin's folder holds commands/review.md, a plugin.json and a hook script. What happens to the hook when you install it?
  5. 05While Albert is planning, which MCP tools are offered to it?
  6. 06You ask a custom agent whose tools are read and run to make a change. What happens?