Agent skill

maestro-v2-migration

Guide for working with maestroCLI's v2 architecture. Covers the context-to-memory rename, 4-state task model, plain file backend, pre-agent hooks, research phase, and memory promotion. Use when touching v2 code, encountering legacy patterns (e.g. 'context' instead of 'memory', old task states), adding new v2 features, or debugging v2 behavior. Also use when you see imports from adapters/fs/context, references to 'contextAdapter', or task states that don't match the 4-state model.

Stars 26
Forks 4

Install this agent skill to your Project

npx add-skill https://github.com/ReinaMacCredy/maestro/tree/main/.claude/skills/maestro-v2-migration

SKILL.md

maestroCLI v2 Architecture Guide

Why This Exists

maestroCLI went through a significant architectural shift in v2. Sessions that touch v2 code without understanding these changes waste time rediscovering what was renamed, what was removed, and what the new patterns look like. This guide prevents that.

The v2 Changes (in dependency order)

1. Context --> Memory Rename

Everything called "context" in v1 is now "memory" in v2.

v1 (deprecated) v2 (current)
ContextPort MemoryPort
FsContextAdapter FsMemoryAdapter
contextAdapter memoryAdapter
context-write command memory-write command (but context-write still works as CLI alias)
src/adapters/fs/context.ts src/adapters/fs/memory.ts
src/ports/context.ts src/ports/memory.ts
.maestro/features/<name>/context/ .maestro/features/<name>/memory/ (filesystem path unchanged for backward compat)

If you see context in imports or variable names in core code, it is legacy. The filesystem directories under .maestro/features/ may still use context/ for backward compatibility -- that is intentional, not a bug.

2. Execution Layer Stripped

v1 had an execution layer that managed worktrees, delegation, and worker lifecycle. v2 stripped this entirely. The orchestrator (Claude Code, Codex, or the user) now manages execution directly.

What was removed:

  • Worktree creation/management
  • Worker prompt generation
  • Delegation protocol
  • Execution state tracking

What replaced it:

  • The MCP server exposes task state transition tools
  • The orchestrator calls task_claim, task_done, task_block, task_unblock directly
  • No intermediate execution layer between the orchestrator and task state

3. Four-State Task Model

v1 had a complex task lifecycle. v2 uses exactly 4 states:

open --> claimed --> done
                \-> blocked --> (unblock) --> open
State Meaning Transition
open Available for work task_claim --> claimed
claimed An agent is working on it task_done --> done, task_block --> blocked
done Work completed Terminal
blocked Cannot proceed, needs decision task_unblock --> open

There are no other states. If you see pending, in_progress, failed, partial, or stale in task code, that is v1 legacy and should be migrated.

4. Plain File Task Backend (Default)

v1 used beads_rust (br) as the task backend. v2 defaults to a plain filesystem backend (FsTaskAdapter).

Backend Config value Adapter When to use
Plain files "fs" (default) FsTaskAdapter Default for all new projects
beads_rust "br" BrTaskAdapter Legacy projects, explicit opt-in

The backend is selected via configAdapter.get().taskBackend in services.ts. Both backends implement the same TaskPort interface -- code above the adapter layer should not care which backend is active.

5. Pre-Agent Hook for Task Spec Injection

v2 added a pre-agent hook (hooks/pre-agent.mjs) that runs before a worker agent starts. It injects the task specification into the agent's context automatically.

This means worker prompts no longer need to manually include task specs -- the hook handles it. If you are adding new context that workers need, consider whether it belongs in:

  • The task spec (injected by pre-agent hook)
  • The worker prompt template
  • A memory file (loaded on demand)

6. Research Phase with External Tool Detection

v2 added a research phase that detects external tools available to the agent (MCP servers, CLI tools) and incorporates them into task planning. This runs during task_claim or early in the task lifecycle.

The research phase scans for:

  • Available MCP server tools
  • CLI tools in PATH
  • Project-specific tooling (test runners, linters, build tools)

7. Memory Promotion on Feature Complete

When feature_complete is called, v2 suggests promoting valuable feature-scoped memories to project-level memories via memory_promote. This ensures learnings from a feature survive beyond the feature's lifecycle.

The suggestPromote logic runs automatically -- it scans feature memory files and suggests which ones contain decisions or constraints that apply project-wide.

How to Apply This Guide

When adding a new feature:

  • Use MemoryPort (not ContextPort)
  • Use the 4-state task model
  • Implement against TaskPort interface (agnostic to backend)
  • Consider whether the pre-agent hook should inject your data

When encountering legacy code:

  • Check if it uses v1 patterns (context, old task states, execution layer)
  • Migrate to v2 patterns if the file is being modified anyway
  • Do not migrate files you are not otherwise touching -- scope discipline

When debugging:

  • Check which task backend is active (configAdapter.get().taskBackend)
  • Check task state transitions match the 4-state model
  • Check that memory (not context) adapters are being used
  • Check pre-agent hook execution order

Expand your agent's capabilities with these related and highly-rated skills.

ReinaMacCredy/maestro

maestro-skill-author

Create, update, or debug maestro built-in skills. Covers SKILL.md frontmatter, reference directory structure, step-file architecture, build-time embedding, naming conventions, alias management, and registry validation. Use when creating a new maestro built-in skill, modifying an existing SKILL.md, adding reference files, debugging skill loading failures, updating the skills registry, or working on the skills full port. Also use when frontmatter validation fails, skills don't appear in skill-list, or reference files fail to load.

26 4
Explore
ReinaMacCredy/maestro

maestro:brainstorming

Use before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

26 4
Explore
ReinaMacCredy/maestro

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

26 4
Explore
ReinaMacCredy/maestro

maestro:plan-review-loop

Deep-review any plan (maestro, Codex, Claude Code plan mode, or plain markdown) using iterative subagent review loops with BMAD-inspired adversarial edge-case discovery. Spawns reviewer subagents that find issues using pre-mortem, inversion, and red-team techniques, auto-fixes them with structured fix strategies, and re-reviews until the plan passes with zero actionable issues. Use when the user says 'review the plan', 'deep review', 'check the plan thoroughly', 'review loop', 'validate before approving', or wants rigorous plan validation before execution. Also use proactively before plan-approve when the plan is complex or high-risk.

26 4
Explore
ReinaMacCredy/maestro

maestro:research

Structured research workflow for maestro features. Guides tool selection across three tiers (codebase exploration, Context7 for library docs, NotebookLM for deep analysis), defines research patterns, finding organization via memory_write, and completion criteria. Use during the research pipeline stage after feature_create and before plan_write. Also use when investigating a problem space, comparing technical approaches, gathering context on unfamiliar code, or needing to understand external library APIs before making architectural decisions.

26 4
Explore
ReinaMacCredy/maestro

cli-for-agents

Designs or reviews CLIs so coding agents can run them reliably: non-interactive flags, layered --help with examples, stdin/pipelines, fast actionable errors, idempotency, dry-run, and predictable structure. Use when building a CLI, adding commands, writing --help, or when the user mentions agents, terminals, or automation-friendly CLIs.

26 4
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results