Part 1: Demoing skills and commands

The workshop starts with a live demo in Claude Code. You do not need this demo to build the notebook agent, but it gives the whole session a concrete shape: one skill fetches two command files from GitHub, then the commands drive the agent in two different roles.

The demo uses a skill named gh-fetch. Its job is to teach the agent how to fetch files from a GitHub repository with the GitHub CLI.

The gh-fetch skill

The skill is a markdown file with YAML frontmatter:

---
name: gh-fetch
description: Fetch content from GitHub repos using gh CLI
---

# GitHub Fetch Skill

Use this skill when the user wants to:
- Get files from a GitHub repo
- List files in a repo
- Explore repo structure
- Fetch command definitions from repos
- Save files from a repo locally

The frontmatter gives the agent a short name and a description it can use for selection. The body gives the step-by-step instructions. This is the split we will implement later: the agent first sees the short description, then it loads the full body only when the skill matches the task.

The body includes concrete gh api commands. To list a repository root:

gh api repos/owner/repo/contents/

To list a subdirectory:

gh api repos/owner/repo/contents/.claude/commands

To fetch and decode a file:

gh api repos/owner/repo/contents/path/file.md --jq '.content' | base64 -d

To save that file locally:

gh api repos/owner/repo/contents/path/file.md --jq '.content' | base64 -d > local/path/file.md

The skill also gives the agent a usage pattern:

  1. Parse the repo from user input in owner/name format.
  2. Use gh api to explore the repo structure.
  3. Decode file contents with base64 -d.
  4. Redirect output into a local file when the user wants files saved.
  5. Present the results clearly.

That is enough for Claude Code to fetch command definitions without the user spelling out every API call.

Installing the demo skill

Create a clean folder for the demo:

mkdir demo
cd demo

Download the skill from the workshop repo:

wget https://raw.githubusercontent.com/alexeygrigorev/workshops/refs/heads/main/agent-skills/gh-fetch-skill.md

Claude Code discovers project-local skills under .claude/skills/<name>/SKILL.md, so create that folder and move the file:

mkdir -p .claude/skills/gh-fetch
mv gh-fetch-skill.md .claude/skills/gh-fetch/SKILL.md

Start Claude Code from the demo folder:

claude

Now ask it to fetch the two command files:

get files kid and parent commands from
https://github.com/alexeygrigorev/claude-code-kid-parent
save them to .claude/commands/

The user does not say "use the gh-fetch skill". Claude sees the available skill description, decides it matches the GitHub file-fetching request, calls the skill tool, reads the gh api instructions, and saves the command files.

Restart Claude Code and continue the existing session:

claude -c

Now run the two commands:

/kid

The /kid command asks the agent to act like a child inventing a random coding project. Then run:

/parent

The /parent command asks the agent to implement the project idea in HTML and JavaScript. The generated app is not the important part. The demo shows the control flow: the skill is agent-selected, while the commands are user-selected.

Skill flow

The skill flow from the demo is:

  1. User asks to get command files from a GitHub repo.
  2. Agent sees gh-fetch: Fetch content from GitHub repos using gh CLI.
  3. Agent calls skill({"name": "gh-fetch"}).
  4. Tool returns the full skill instructions.
  5. Agent uses the gh api commands from the skill body.
  6. Agent writes the command files into .claude/commands/.

Skills let you add specialized behavior without changing the base system prompt every time. A short description is enough for discovery. The full instructions stay out of context until the agent needs them.

Command flow

The command flow from the same demo is:

  1. User types /kid.
  2. The system detects the leading /.
  3. The system looks up kid.md.
  4. The command template is rendered.
  5. The agent receives the rendered prompt.
  6. The agent acts on that prompt.

The agent never needs to reason about the literal /kid syntax. In a real implementation, the command layer catches it and sends only the rendered prompt to the agent.

The notebook version later uses a command tool for simplicity. That lets us avoid modifying the runner while still seeing how command markdown becomes a prompt.

Continue with Part 2: Recapping the coding agent for the agent loop and the coding tools we reuse from the prerequisite workshop.

Questions & Answers (0)

Sign in to ask questions