Composition

Skills in MDZ compose through links and delegation, enabling complex behaviors from simple, validated components.

Links

Links reference other files using path syntax:

~/skill/code-review           <!-- skill link -->
~/agent/architect             <!-- agent link -->
~/tool/browser                <!-- tool link -->

In prose:

Apply the methodology from ~/skill/orchestrate-map-reduce.

Tooling validates that linked files exist. You won't discover a missing dependency at runtime.

Anchor References

Within Current Skill

Use # to reference a section in the current document:

#section-name

In Another Skill

Combine links and anchors:

~/skill/helper#section-name

Section Names

Section names are derived from headings by:

  1. Converting to lowercase
  2. Replacing spaces with hyphens
  3. Removing special characters
## Validate Prompt#validate-prompt

## 2. Execute Phase#2-execute-phase

Skill Invocation with USE

Invoke a skill to perform a task using the USE keyword:

USE ~/skill/code-review TO /check style and patterns/

USE ~/skill/orchestrate TO /coordinate the workflow/

Tooling validates that the linked skill exists.

Passing Templates with WITH

Pass a section template when invoking a skill:

USE ~/skill/mapper TO /process items/ WITH #item-prompt

The WITH clause passes an anchor to the invoked skill as a template parameter.

Folder Conventions

MDZ uses folder conventions to determine reference types:

  • agent/ — Agents for delegation (autonomous subagents)
  • skill/ — Reusable skill modules
  • tool/ — External tool integrations

This replaces the old sigil-based syntax. The type is now inferred from the path.

Benefits

  • Dependency graph visualization
  • Circular dependency detection
  • IDE autocomplete for available files
  • Clear file organization

Agent Delegation with DELEGATE

For orchestrating autonomous subagents, use the DELEGATE keyword with an agent link:

DELEGATE /initial analysis/ TO ~/agent/explorer

DELEGATE /architecture design/ TO ~/agent/architect

Tool Execution with EXECUTE

For executing external tools, use the EXECUTE keyword:

EXECUTE ~/tool/browser TO /take screenshot/

EXECUTE ~/tool/file-system TO /read configuration/

GOTO for Section Navigation

Jump to a section anchor using GOTO:

GOTO #validation-prompt

GOTO ~/skill/helper#setup

Keyword Summary

  • USE — Invoke skills for reusable workflows
  • EXECUTE — Run tools for external actions
  • DELEGATE — Spawn autonomous agents
  • GOTO — Jump to section anchors
  • WITH — Pass template sections

Patterns

Sub-Agent Delegation

DELEGATE /research phase/ TO ~/agent/explorer

DELEGATE /design system/ TO ~/agent/architect

Conditional Execution

IF $result = "failure" THEN
  GOTO #recovery-strategy
ELSE
  GOTO #main-workflow
END

Iterative Composition

FOR $skill IN $skills
  Load $skill source
  USE ~/skill/orchestrate TO /coordinate execution/
  Collect results
END

Link Handling

By default, links stay as-is—the LLM interprets ~/skill/name syntax directly. With optional preprocessing:

  • Inlining — Referenced skill content embedded inline
  • Section extraction — Only the referenced section included

Both approaches are valid. Inlining reduces LLM load-time; leaving links keeps the prompt concise. Experiment to find what works best for your use case.

Best Practices

  • Use consistent folder organization (agent/, skill/, tool/)
  • Create reusable prompt sections within skills
  • Use descriptive section names
  • Keep skills focused and composable
  • Document expected parameters in Input sections