Overview and setup

Skills and Commands Goal

We already have a coding agent from the prerequisite workshop. In this session we keep the same core idea, then make the agent more general. Instead of hard-coding one task, we give it reusable skills and explicit commands.

Skills and commands solve different problems:

  • Skills are behavior packages the agent can load on its own.
  • Commands are user-facing shortcuts that start with /.
  • Skills are discovered from folders that contain SKILL.md.
  • Commands are loaded from markdown files such as review.md.

We use OpenCode as an example implementation. OpenCode is an open-source alternative to Claude Code. It is a useful place to look at how skills and commands work in a real coding agent.

Prerequisites

You can run the notebook on a laptop or in GitHub Codespaces. Codespaces is a convenient option if you want the same kind of remote environment as the prerequisite coding-agent workshop. Any environment with Python and Jupyter is enough.

Prepare these accounts and keys:

  • An OpenAI API key.
  • Optional provider keys if you want to adapt the prototype to Anthropic, Groq, or Z.ai.
  • A GitHub account if you want to run the Claude Code demo with gh.

Install or confirm these local tools:

  • Python 3.10 or newer for the notebook path.
  • Jupyter.
  • uv for dependency management.
  • The GitHub CLI if you want to use the gh-fetch demo skill.
  • A coding agent such as Claude Code if you want to reproduce the opening demo.

The workshop assumes you are already familiar with agents and tool use.

If the agent loop feels new, do the prerequisite sessions first:

Project setup

Create a separate folder for the notebook work:

mkdir code
cd code

Initialize the project with uv and install the notebook dependencies:

pip install uv
uv init
uv add jupyter openai toyaikit python-frontmatter

toyaikit handles the model/tool loop for the workshop. It keeps the code short while still showing the messages, tool calls, and results. For a production agent you might pick a framework such as PydanticAI. The small runner is easier to look at while learning.

Create .env with your OpenAI key:

OPENAI_API_KEY='your-key'

Make sure the key never lands in git:

echo .env >> .gitignore

One optional convenience tool is dirdotenv. It loads environment variables from .env and .envrc into your shell.

Install it like this:

pip install dirdotenv
echo 'eval "$(dirdotenv hook bash)"' >> ~/.bashrc

Start Jupyter from the project folder:

uv run jupyter notebook

Open or create notebook.ipynb. We build the examples step by step there.

Workshop code

The public workshop repo contains:

  • the notebook
  • the demo skill
  • example skills
  • a fuller prototype
agent-skills/
|-- README.md
|-- gh-fetch-skill.md
|-- notebook.ipynb
|-- skills/
|   |-- coding_standards/
|   |-- counter/
|   |-- deploy_app/
|   |-- hello/
|   `-- joke/
`-- prototype/
    |-- commands/
    |-- skills/
    |-- src/
    `-- tests/

The notebook shows the teaching version. The prototype/ folder shows the same ideas as importable Python modules. It also includes tests, a CLI-oriented factory, and a more complete command implementation.

Continue with Part 1: Demoing skills and commands for the opening demo. It shows the difference between a skill and a command before we build our own version.

Questions & Answers

Sign in to ask questions