Lab 8 — Agent skills and tool scaling
← Back to labs index

Lab 8 — Agent skills and tool scaling

This standalone snapshot extends harness ask in two ways:

The exercise matches the Claude Code Lab 8.

What changes

harness/skills.py keeps the earlier in-process models of a skill registry with approval state, tool discovery and MCP namespacing.

Learner steps

Start from: labs/app/ at tag lab07-done (see the track guide).

  1. Install this lab and configure Foundry as before:

    python -m venv .venv
    . .venv/bin/activate          # Windows: .\.venv\Scripts\Activate.ps1
    pip install -e '.[dev]'
    cp .env.example .env
    az login
    cd ../app
    

Part A: a release-notes skill

  1. Read assets/.harness/skills/release-notes/SKILL.md, then install and commit it:

    cp -R ../lab08-skills-tools/assets/. .
    git add .harness && git commit -m "chore: add release-notes skill"
    harness skills
    
  2. Invoke it explicitly:

    harness ask
    
    /release-notes
    

    Then /exit and, in a new session, invoke it implicitly:

    harness ask "What changed since tag lab04-done? Write it up as release notes."
    

    Observe: in the second run, a use_skill tool call picked from the description. Then git log runs and CHANGELOG.md is written, although a one-shot run has no one to answer a permission prompt: the skill’s allowed-tools pre-approved write_file(CHANGELOG.md). Commits are grouped by Conventional Commit type (your Lab 5 convention pays off here). Nothing is committed. Review CHANGELOG.md and commit it yourself.

Part B: an MCP server for orders

  1. Register the server for this project, with an absolute path:

    harness mcp add orders -- python "$(cd ../lab08-skills-tools && pwd)/orders_mcp.py"
    harness mcp list
    
    harness mcp add orders -- python (Resolve-Path ..\lab08-skills-tools\orders_mcp.py).Path
    harness mcp list
    
  2. Use it:

    harness ask -n restock
    

    Type /mcp to see the server and its tools, then:

    Using the orders tools, find pending orders that we cannot fulfil with the current stock in catalog.csv. Write RESTOCK.md listing each SKU, quantity needed, stock on hand and shortfall.
    

    Observe: tool calls named mcp__orders__list_orders / mcp__orders__get_order, the permission prompt for each new tool (answer a to allow the same call for the session), and how the model joins MCP data with local files. Check RESTOCK.md against catalog.csv yourself. Did it correctly ignore the large cancelled order?

  3. Unregister the server so it doesn’t follow you into later labs:

    harness mcp remove orders
    
  4. Record
    • How the skill was triggered (slash command vs description match), and which calls its allowed-tools let through without a prompt.
    • The MCP tool names and whether you were asked to approve them.
    • Anything in RESTOCK.md that was wrong.
  5. Checkpoint. Commit CHANGELOG.md and RESTOCK.md if you’re keeping them, then in app/:

    git tag lab08-done
    
  6. Back in the lab folder, run the offline checks and inspect the declared capabilities:

    pytest checks/
    harness lab-info
    

harness ask keeps tracing (Lab 7), permissions (Lab 6), file memory (Lab 5), plan mode and todos (Lab 4), sessions (Lab 3) and the Lab 2B tools, built-in policy, project hooks and rules. This is a teaching harness, not a sandbox: only use it on the practice app.