Skip to content

Exercise 06: Extend Pipeline

Objective

Add a new team-linter agent to the pipeline. This tests understanding of the agent extension mechanism.

Required Reading

Adding a new agent in Cursor uses AGENTS.md with subagent_type mapping.

In Claude Code, you define the agent's role, model, and responsibilities. The difference is the dispatch mechanism: direct model invocation. The agent definition (role, responsibilities, output schema) is the transferable design artifact.

Context

The pipeline works end-to-end (Exercises 01-05 complete). Now extend it with a team-specific agent.

Tasks

  1. Copy the agent template:

    cp sandbox/.cursor/templates/agent.md sandbox/.cursor/agents/team-linter.md
    

  2. Edit sandbox/.cursor/agents/team-linter.md frontmatter:

    ---
    name: team-linter
    model: gemini-3-flash
    description: Runs project linter and writes lint result; use when verifying code style before tests.
    ---
    

  3. Fill in the body:

  4. ROLE: Runs the project linter and writes a lint-result.json artifact
  5. CORE RESPONSIBILITIES: Read plan/worker-result, run npm run lint, write .pipeline/<issue-id>/lint-result.json with verdict and output
  6. NON-GOALS: Does not fix lint errors (that's the worker's job)
  7. OUTPUT: lint-result.json with { "verdict": "PASS"|"FAIL", "output": "...", "errors": [] }

  8. Add team-linter to sandbox/.cursor/AGENTS.md:

  9. New row in the agents table
  10. Pipeline order note: "2.5. team-linter -- After worker; writes lint-result.json. On FAIL -> planner re-dispatches worker."
  11. Subagent types: add linter -> team-linter

Validation

python3 docs/practitioner/tutorials/verify.py --exercise 06

Checks: team-linter.md exists with valid frontmatter, AGENTS.md references team-linter and lint-result.json.

Reflection
  • How does adding a new agent affect the pipeline flow?
  • What would you need to change in the planner to dispatch to the team-linter?
  • Could this agent be tiered (fast/standard/high)? When would that make sense?
Answer

team-linter.md frontmatter:

---
name: team-linter
model: gemini-3-flash
description: Runs project linter and writes lint result; use when verifying code style before tests.
---

Body should define: ROLE (runs linter, writes artifact), CORE RESPONSIBILITIES (read plan/worker-result, run npm run lint, write lint-result.json), NON-GOALS (does not fix lint errors), OUTPUT schema (verdict, output, errors).

AGENTS.md additions: new row in table, pipeline order "3.5. team-linter", subagent type linter -> team-linter.