Exercise 06: Extend Pipeline¶
Objective¶
Add a new team-linter agent to the pipeline. This tests understanding of the agent extension mechanism.
Required Reading
- Practitioner README -- "Extending the setup > Add a new agent" section
- Customizing Agents | Cursor Learn -- How to create and register custom agents
- Custom Agents | Cursor Docs -- Agent
.mdfrontmatter (name, model, description), AGENTS.md registry format, andsubagent_typemapping
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¶
-
Copy the agent template:
cp sandbox/.cursor/templates/agent.md sandbox/.cursor/agents/team-linter.md -
Edit
sandbox/.cursor/agents/team-linter.mdfrontmatter:--- name: team-linter model: gemini-3-flash description: Runs project linter and writes lint result; use when verifying code style before tests. --- -
Fill in the body:
- ROLE: Runs the project linter and writes a lint-result.json artifact
- CORE RESPONSIBILITIES: Read plan/worker-result, run
npm run lint, write.pipeline/<issue-id>/lint-result.jsonwith verdict and output - NON-GOALS: Does not fix lint errors (that's the worker's job)
-
OUTPUT:
lint-result.jsonwith{ "verdict": "PASS"|"FAIL", "output": "...", "errors": [] } -
Add team-linter to
sandbox/.cursor/AGENTS.md: - New row in the agents table
- Pipeline order note: "2.5. team-linter -- After worker; writes
lint-result.json. On FAIL -> planner re-dispatches worker." - 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.