coordinator.agents¶
coordinator.agents ¶
Agent persona templates for subagent prompts.
Each persona is a plain string injected into the Task tool prompt when the coordinator spawns a subagent. Keep these short and directive -- the subagent's context window should be spent on the actual task, not on lengthy system prompts.
find_agents_file ¶
Resolve the agents.yaml path: AGENTS_FILE env > .cursor/ > .claude/ > None.
Source code in coordinator/agents.py
load_local_agents ¶
Parse agents.yaml into project-local override maps (no global state).
Discovery order: AGENTS_FILE env var > .cursor/agents.yaml > .claude/agents.yaml.
Returns a dict with six sub-maps keyed by agent name
{"personas": {...}, "descriptions": {...}, "roles": {...}, "models": {...}, "passes": {...}, "schemas": {...}}
Each agent entry in the YAML may define persona, description,
role (validated against VALID_ROLES), model (default model slug),
passes (int >= 1, clamped), schema (default extraction-schema
name for this agent's tasks), and extends (the name of a base agent
this entry inherits unspecified fields from -- see apply_inheritance).
Malformed values are warned about and skipped rather than raising,
mirroring the coordinator's tolerant loading.
Source code in coordinator/agents.py
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 | |
load_local_config ¶
Parse top-level coordinator settings (reserved keys) from agents.yaml.
Returns {"rigor": str|None, "max_extensions": int|None}. These keys
configure the coordinator itself and are never treated as agent definitions
(see RESERVED_AGENT_KEYS). Malformed values are warned about and ignored.
Source code in coordinator/agents.py
resolve_rigor ¶
resolve_rigor(rigor: str | None = None, max_extensions: int | None = None, *, config: dict | None = None) -> dict
Resolve the effective rigor settings for a run.
Returns {"rigor": <name>, "max_extensions": int, "passes": {agent: n}}.
Precedence
- rigor name: explicit
rigorarg > configrigor> DEFAULT_RIGOR - max_extensions: explicit
max_extensionsarg > (whenrigoris explicitly given) that profile's cap > configmax_extensions> the resolved profile's cap - passes: the resolved rigor profile's passes map, used as defaults that sit below agents.yaml per-agent passes and task-level passes
Source code in coordinator/agents.py
apply_inheritance ¶
apply_inheritance(local: dict[str, dict], contributed: dict[str, dict] | None = None) -> dict[str, dict]
Fill unspecified fields of extends: agents from their base agent.
Mutates local in place (and returns it). For each agent that declares
extends: <base>, any attribute it did not set explicitly is copied from
the base's effective value. The base may be a coordinator built-in, a
capability-contributed agent, or another project-local agent, and chains are
followed (A extends B extends engineer). Unknown bases and cycles are warned
about and skipped, leaving whatever the agent did set explicitly.
contributed is the {name: definition} map (loaded lazily when
omitted) so a base that is a contributed agent resolves correctly.
Source code in coordinator/agents.py
contributed_agent_maps ¶
Split a contributed-agent map into per-attribute sub-maps.
contributed is the {name: definition} map from
coordinator.contrib.contributed_agents() (loaded lazily when omitted).
Returns {"personas", "descriptions", "roles", "models", "schemas",
"names"} so callers can merge capability contributions the same way they
merge project-local overrides.
Source code in coordinator/agents.py
build_agent_registry ¶
build_agent_registry(local: dict[str, dict] | None = None, contributed: dict[str, dict] | None = None) -> list[dict]
Return the merged roster of built-in + contributed + project-local agents.
Precedence (lowest to highest): coordinator core built-ins < agents
contributed by an enabled capability (e.g. the zettelkasten trio) <
project-local overrides (agents.yaml). The result is a list (sorted by
name) of dicts, one per agent:
{"name", "role", "description", "model" (or None), "passes",
"has_persona", "builtin"}
Used by the dashboard's workflow builder and the coordinator's list_agents
so both surface the same agents. Pass local / contributed to reuse
already-loaded maps; otherwise they are loaded from disk / discovered.