Skip to content

techniques

techniques

Technique wirer — injects technique manifests into cadenza context.

Reads agent technique declarations and: - Injects technique manifests as cadenzas for relevant phases - Configures MCP server access per phase - Wires A2A agent card and inbox cadenzas - Injects memory protocol and mateship skills as cadenzas

Each phase, the agent receives a technique manifest telling them what tools are available right now.

Classes

TechniqueWirer

TechniqueWirer(techniques_dir=None)

Wires technique declarations into per-sheet cadenza context.

Reads agent technique configs and produces: 1. Technique manifests (markdown) per phase 2. Per-sheet cadenza injections referencing technique docs 3. A2A agent card config for registration

Initialize the technique wirer.

Parameters:

Name Type Description Default
techniques_dir Path | None

Directory containing technique module documents. Falls back to searching common locations if not specified.

None
Source code in src/marianne/compose/techniques.py
def __init__(self, techniques_dir: Path | None = None) -> None:
    """Initialize the technique wirer.

    Args:
        techniques_dir: Directory containing technique module documents.
            Falls back to searching common locations if not specified.
    """
    self.techniques_dir = techniques_dir
Functions
wire
wire(agent_def, defaults, *, workspace='')

Wire techniques for an agent, returning cadenza additions and A2A config.

Parameters:

Name Type Description Default
agent_def dict[str, Any]

Agent definition with optional techniques and a2a_skills fields.

required
defaults dict[str, Any]

Global defaults with technique declarations.

required
workspace str

Workspace path for manifest output.

''

Returns:

Type Description
dict[str, Any]

Dict with keys: cadenzas: dict[int, list[dict]] — per-sheet cadenza additions agent_card: dict | None — A2A agent card if a2a_skills defined technique_manifests: dict[int, str] — per-sheet manifest text

Source code in src/marianne/compose/techniques.py
def wire(
    self,
    agent_def: dict[str, Any],
    defaults: dict[str, Any],
    *,
    workspace: str = "",
) -> dict[str, Any]:
    """Wire techniques for an agent, returning cadenza additions and A2A config.

    Args:
        agent_def: Agent definition with optional ``techniques`` and
            ``a2a_skills`` fields.
        defaults: Global defaults with technique declarations.
        workspace: Workspace path for manifest output.

    Returns:
        Dict with keys:
            ``cadenzas``: dict[int, list[dict]] — per-sheet cadenza additions
            ``agent_card``: dict | None — A2A agent card if a2a_skills defined
            ``technique_manifests``: dict[int, str] — per-sheet manifest text
    """
    # Merge default techniques with agent-specific overrides
    merged_techniques = dict(defaults.get("techniques", {}))
    agent_techniques = agent_def.get("techniques", {})
    if isinstance(agent_techniques, dict):
        merged_techniques.update(agent_techniques)

    cadenzas: dict[int, list[dict[str, str]]] = {}
    manifests: dict[int, str] = {}

    # Generate per-sheet technique manifests
    for sheet_num in range(1, SHEETS_PER_CYCLE + 1):
        phase = SHEET_PHASE.get(sheet_num, "")
        active_techniques = self._get_active_techniques(
            merged_techniques, phase
        )
        if active_techniques:
            manifest = self._generate_manifest(active_techniques, phase)
            manifests[sheet_num] = manifest

    # Wire technique document cadenzas
    for tech_name, tech_config in merged_techniques.items():
        if not isinstance(tech_config, dict):
            continue
        kind = tech_config.get("kind", "skill")
        phases = tech_config.get("phases", [])

        # Find technique document if available
        tech_doc_path = self._find_technique_doc(tech_name)
        if tech_doc_path:
            for sheet_num in range(1, SHEETS_PER_CYCLE + 1):
                phase = SHEET_PHASE.get(sheet_num, "")
                if phase in phases or "all" in phases:
                    if sheet_num not in cadenzas:
                        cadenzas[sheet_num] = []
                    cadenzas[sheet_num].append({
                        "file": str(tech_doc_path),
                        "as": "skill" if kind == "skill" else "tool",
                    })

    # Build A2A agent card
    agent_card = self._build_agent_card(agent_def)

    return {
        "cadenzas": cadenzas,
        "agent_card": agent_card,
        "technique_manifests": manifests,
    }