maestro
無料Intent-to-chain planner over the canonical Session/Run lifecycle
日本語の概要は準備中です。原文の説明を表示しています。
User-invoked learning toolkit — guided reading, investigation, pattern extraction, or second opinions. Manual `/maestro-learn` only; NEVER auto-invoke for code exploration or analysis — route those intents to the analyze step via /maestro-next
インストールする前に、エージェントに与えられる指示の中身を確認できます。
All findings persist to .workflow/knowhow/ and append <learning-entry> blocks to .workflow/specs/learnings.md.
</purpose>
| Subcommand | Section |
|---|---|
follow | Subcommand: follow |
investigate | Subcommand: investigate |
decompose | Subcommand: decompose |
consult | Subcommand: consult |
Routing errors:
| Code | Condition | Recovery |
|---|---|---|
| E_NO_SUBCOMMAND | No subcommand provided in $ARGUMENTS | Display valid subcommands (follow, investigate, decompose, consult), prompt user to select |
| E_INVALID_SUBCOMMAND | Unrecognized first token | Display valid subcommands with usage hints |
Subcommand selection guide:
follow — understand code logic flow (why/how). Input: code path. Method: sequential reading + forcing questions. Output: understanding map.decompose — extract reusable pattern catalog (what patterns). Input: module/directory. Method: 4 parallel dimension agents. Output: pattern catalog.follow --depth deep covers every branch but focuses on comprehension; decompose focuses on pattern classification and reusability. They are complementary, not alternatives.investigate — answer a specific question via hypothesis-driven search. Input: question. Method: scientific method (evidence → hypothesis → test). Output: evidence-backed report.follow input is a code path (top-down reading); investigate input is a question (hypothesis-driven search).
</routing>
Usage: /maestro-learn follow <path|wiki-id|topic> [--depth shallow|deep] [--save-wiki] [-y]
Target resolution (auto-detected):
| Input | Resolution |
|---|---|
File path (contains / or \) | Read source file |
Wiki ID (<type>-<slug>) | maestro wiki get <id> |
| Topic string | maestro search "<topic>" → top result; fallback: Grep src/ |
Flags:
--depth shallow (default): key patterns and structure only--depth deep: every function, every branch, every assumption--save-wiki: create wiki note entry with reading notes-y: Skip confirmation prompts for knowhow/spec writesStorage read: target file + wiki forward/backlinks + coding-conventions.md + .workflow/specs/learnings.md (dedup)
Storage write: .workflow/knowhow/KNW-follow-{slug}-{date}.md + append .workflow/specs/learnings.md
Output boundary: ALL file writes MUST target .workflow/knowhow/KNW-follow-{slug}-{date}.md and .workflow/specs/learnings.md only. NEVER modify source code or files outside these paths.
</context>
GATE 1: Resolve → Context Building (S_RESOLVE → S_CONTEXT)
GATE 2: Reading → Extraction (S_READ → S_EXTRACT)
GATE 3: Extraction → Persistence (S_EXTRACT → S_PERSIST)
GATE 4: Persistence → Completion (S_PERSIST → END)
-y, request_user_input showing files to write and learning-entries to append — user must confirm.<state_machine>
<states> S_RESOLVE — 解析 target (file/wiki/topic) PERSIST: — S_CONTEXT — 构建 1-hop 上下文邻域 PERSIST: — S_ORDER — 确定阅读顺序 PERSIST: — S_READ — 逐节应用 forcing questions PERSIST: — S_EXTRACT — 提取 patterns、cross-ref conventions PERSIST: — S_PERSIST — 写 understanding map + learning-entry 块 PERSIST: knowhow files </states> <transitions>S_RESOLVE: → S_CONTEXT WHEN: target resolved → S_RESOLVE WHEN: unresolvable DO: request_user_input with suggestions
S_CONTEXT: → S_ORDER DO: A_BUILD_CONTEXT_WEB
S_ORDER: → S_READ DO: A_BUILD_READING_ORDER
S_READ: → S_EXTRACT DO: A_GUIDED_READ (apply 4 forcing questions per section)
S_EXTRACT: → S_PERSIST DO: A_EXTRACT_PATTERNS
S_PERSIST: → END GATE: unless -y, request_user_input showing files to write and learning-entries to append — proceed only on confirm DO: write KNW-follow + append .workflow/specs/learnings.md [+ wiki note if --save-wiki]
</transitions> <actions>| Target type | Context |
|---|---|
| Wiki entry | maestro wiki forward <id> + maestro wiki backlinks <id> → read top 3 related |
| Code file | Parse imports → dependency files; grep exports → reverse deps; read top 3 dependents (50 lines) |
| Directory | List files, identify entry points → build reading order: entry → core → utils → tests |
--depth shallow: top-level structure only; --depth deep: every body and branchFor each section, apply 4 forcing questions:
| # | Question | Extracts |
|---|---|---|
| 1 | "What pattern is being used here?" | Design patterns, idioms, conventions |
| 2 | "Why this approach instead of alternatives?" | Trade-offs, rejected options |
| 3 | "What assumption does this depend on?" | Implicit contracts, input shape, ordering |
| 4 | "What would break if this changed?" | Fragility, downstream effects |
Extract: design patterns (with file:line anchors), naming conventions, error handling approach, data flow, assumptions.
Cross-ref against coding-conventions.md: documented → "confirmed convention", undocumented → "candidate for maestro-spec add".
Write understanding map: Key Concepts, Patterns (table: name/location/convention status), Assumptions, Open Questions, Connections.
</actions></state_machine>
<error_codes>
| Code | Condition | Recovery |
|---|---|---|
| E001 | No target path/wiki-id/topic provided | Prompt user for target |
| E002 | Target path not found and wiki/grep search returned no results | Check path or broaden search terms |
| W001 | Wiki forward/backlinks unavailable | Proceed without context web; note reduced coverage |
| W002 | coding-conventions.md not found | All patterns marked "unknown status" |
| W003 | Target > 1000 lines | Auto-switch to shallow; use --depth deep to override |
| </error_codes> |
<success_criteria>
<next_step_routing>
/maestro-learn decompose <path>/maestro-spec add coding <description>/maestro-learn consult <file>
</next_step_routing>Usage: /maestro-learn investigate <question> [--scope <path>] [--max-hypotheses N] [-y]
Flags:
--scope <path>: Restrict to files under this dir (default: entire project)--max-hypotheses N: Max hypotheses before escalation (default: 3)-y: Skip confirmation prompts for report/spec writesStorage write:
.workflow/knowhow/KNW-investigate-{slug}/evidence.ndjson — structured evidence (one JSON line per item).workflow/knowhow/KNW-investigate-{slug}/understanding.md — evolving understanding.workflow/knowhow/KNW-investigate-{slug}/report.md — final report.workflow/specs/learnings.md — appended <learning-entry> blocksStorage read: source files in scope + maestro search + .workflow/specs/learnings.md + debug-notes.md + codebase/architecture.md
Output boundary: ALL file writes MUST target .workflow/knowhow/KNW-investigate-{slug}/ and .workflow/specs/learnings.md only. NEVER modify source code or files outside these paths.
</context>
<state_machine>
<states> S_FRAME — 解析问题、确定 scope、搜索先验知识 PERSIST: understanding.md (initial) S_EVIDENCE — 系统收集证据 PERSIST: evidence.ndjson S_PATTERN — 比对已知模式 PERSIST: understanding.md (patterns) S_HYPOTHESIZE — 生成假设列表 PERSIST: understanding.md (hypotheses) S_CLI_EXPLORE — CLI 辅助探索(可选) PERSIST: evidence.ndjson (append) S_TEST — 逐假设测试 PERSIST: evidence.ndjson + understanding.md S_ESCALATE — 3-strike 升级 PERSIST: — S_REPORT — 综合报告 + persist PERSIST: report.md + .workflow/specs/learnings.md </states> <transitions>S_FRAME: → S_EVIDENCE DO: A_FRAME_QUESTION
S_EVIDENCE: → S_PATTERN DO: A_COLLECT_EVIDENCE
S_PATTERN: → S_HYPOTHESIZE DO: match evidence against debug-notes.md + .workflow/specs/learnings.md patterns
S_HYPOTHESIZE: → S_CLI_EXPLORE WHEN: CLI tools enabled (at least one tool in cli-tools.json enabled) AND hypotheses non-trivial (require cross-file tracing or data-flow analysis) DO: A_FORM_HYPOTHESES → S_TEST WHEN: no CLI tools OR trivial hypotheses (answerable by local Grep/Read) DO: A_FORM_HYPOTHESES
S_CLI_EXPLORE: → S_TEST DO: A_CLI_SUPPLEMENT (maestro delegate --to <first-enabled-tool> --mode analysis, run_in_background, STOP)
S_TEST: → S_REPORT WHEN: hypothesis confirmed DO: A_TEST_HYPOTHESIS → S_REPORT WHEN: all hypotheses tested (some confirmed) DO: A_TEST_HYPOTHESIS → S_ESCALATE WHEN: max_hypotheses all failed DO: A_TEST_HYPOTHESIS
S_ESCALATE: → S_HYPOTHESIZE WHEN: user broadens scope or provides new hypothesis DO: request_user_input → S_REPORT WHEN: user selects "Escalate" or still stuck DO: mark INCONCLUSIVE
S_REPORT: → END GATE: unless -y, request_user_input showing report.md path and learning-entries to append — proceed only on confirm DO: A_SYNTHESIZE_REPORT
</transitions> <actions>maestro search "<question>" + search .workflow/specs/learnings.md + read debug-notes.mdParallel evidence gathering:
git log --oneline -10 -- <relevant-files>Each item → append evidence.ndjson: {ts, type (code|git|search|doc), source (file:line), relevance (high|medium|low), content, note}
Generate ranked hypotheses: each is specific, testable claim about "how/why". Rank by plausibility (evidence strength). Write to understanding.md:
[HIGH] hypothesis — Evidence: {refs}[MEDIUM] hypothesis — Evidence: {refs}maestro delegate "PURPOSE: Gather evidence for hypotheses
TASK: Trace call chains and data flows per hypothesis | Find corroborating/contradicting patterns
EXPECTED: JSON [{hypothesis_rank, evidence: [{file, line, supports: bool, explanation}]}]
" --to <first-enabled-tool> --mode analysis
Run_in_background, STOP, wait. On callback: append to evidence.ndjson.
For each hypothesis (rank order):
Write report.md: Answer (or INCONCLUSIVE), Evidence Trail table, Hypotheses Tested table, Key Learnings, Open Questions. Append to .workflow/specs/learnings.md: confirmed → roles="implement", disproved → roles="analyze" (gotcha).
</actions></state_machine>
<error_codes>
| Code | Condition | Recovery |
|---|---|---|
| E001 | No question text provided | Prompt user for investigation question |
| E002 | --scope path not found | Check path |
| W001 | Prior knowledge search returned no results | Proceed without prior context; note cold-start |
| W002 | Very few evidence matches (<3) | Broaden search terms or expand scope |
| W003 | All hypotheses inconclusive | Investigation marked INCONCLUSIVE |
| </error_codes> |
<success_criteria>
<next_step_routing>
/maestro-spec add debug <finding>/maestro-learn follow <path>/maestro-learn decompose <module>
</next_step_routing>Usage: /maestro-learn decompose <path|module> [--patterns <list>] [--save-spec] [--save-wiki] [-y]
Target resolution: file path → that file; directory → all source files; module name → Glob src/**/{module}*.
Flags:
--patterns <list>: Comma-separated pattern names to look for (default: detect all)--save-spec: execute /maestro-spec add ... for each new pattern (not just recommend)--save-wiki: create wiki note per dimension group-y: Skip confirmation prompts for knowhow/spec writesStorage read: target files + coding-conventions.md + .workflow/specs/learnings.md (dedup)
Storage write: .workflow/knowhow/KNW-decompose-{slug}-{date}.md + append .workflow/specs/learnings.md
Output boundary: ALL file writes MUST target .workflow/knowhow/KNW-decompose-{slug}-{date}.md and .workflow/specs/learnings.md only. NEVER modify source code or files outside these paths.
</context>
<state_machine>
<states> S_RESOLVE — 解析 target 为具体文件列表 PERSIST: — S_DEDUP — 加载已有 patterns 用于去重 PERSIST: — S_ANALYZE — 4 维度并行 Agent 分析 PERSIST: — S_CROSSREF — 交叉引用、去重、标记状态 PERSIST: — S_CATALOG — 生成 pattern catalog 报告 PERSIST: outputs S_PERSIST — 写文件 + 可选 maestro-spec add/wiki create PERSIST: knowhow files </states> <transitions>S_RESOLVE: → S_DEDUP WHEN: file list resolved → S_RESOLVE WHEN: unresolvable DO: request_user_input
S_DEDUP: → S_ANALYZE DO: read coding-conventions.md + .workflow/specs/learnings.md → build known pattern set
S_ANALYZE: → S_CROSSREF DO: A_PARALLEL_DIMENSION_ANALYSIS
S_CROSSREF: → S_CATALOG DO: A_CROSSREF_DEDUP
S_CATALOG: → S_PERSIST DO: write KNW-decompose report (grouped by dimension: pattern table + details)
S_PERSIST: → END GATE: unless -y, request_user_input showing files to write and patterns to persist — proceed only on confirm DO: append .workflow/specs/learnings.md [+ execute maestro-spec add if --save-spec] [+ wiki note if --save-wiki]
</transitions> <actions>Spawn 4 Agents in single message:
| Agent | Dimension | Looks for |
|---|---|---|
| 1 | Structural | Class hierarchy, composition, DI/IoC, Factory/Builder/Singleton, barrel exports |
| 2 | Behavioral | Event flow, middleware chains, observer/pub-sub, command/strategy, state machines |
| 3 | Data | Repository/DAO, DTO pipelines, caching (memo/LRU/TTL), serialization, schema validation |
| 4 | Error | Error boundaries, retry/backoff/circuit-breaker, fallback chains, guard clauses, logging |
If --patterns specified: agents focus only on named patterns.
Each agent returns: [{ name, dimension, confidence (high/medium/low), anchors [file:line], description, rationale, tradeoffs }]
For each finding, match against known pattern set:
| Status | Condition |
|---|---|
| documented | Already in coding-conventions.md |
| known | In .workflow/specs/learnings.md (if file exists) |
| new | Not seen before (or learnings.md absent — treat all as new) |
Flag contradictions (finding conflicts with documented convention). Merge duplicates across agents (same pattern found by multiple dimensions).
</actions></state_machine>
<error_codes>
| Code | Condition | Recovery |
|---|---|---|
| E001 | No target path/module provided | Prompt user for target |
| E002 | No source files in target | Check target has .ts/.js files |
| W001 | One+ dimension agent failed | Proceed with available dimensions |
| W002 | .workflow/specs/learnings.md missing or malformed | Treat all patterns as new; create file on persist |
| W003 | Large target (>50 files) | Consider --patterns filter |
| </error_codes> |
<success_criteria>
<next_step_routing>
/maestro-learn follow <anchor-file>/maestro-learn consult <target>/maestro-spec add coding ...
</next_step_routing>Usage: /maestro-learn consult <target> [--mode review|challenge|consult] [-y]
Target resolution (auto-detected):
| Input | Resolution |
|---|---|
| File path | Read file content |
Wiki ID (<type>-<slug>) | maestro wiki get <id> |
HEAD / staged | git diff HEAD / git diff --staged |
| Phase number | Resolve the sealed plan artifact through the selected Session's ArtifactRegistry |
Flags:
--mode review|challenge|consult (default: review)-y: Skip confirmation prompts for knowhow/spec writes-y in consult mode: skips the final write confirmation only. The interactive Q&A loop is NOT affected by -y (it is the core interaction, not a confirmation). Use --mode review for non-interactive alternative.
Pre-load (optional): recommend maestro load --type spec for conventions + maestro search "<target topic>" for related entries.
Output: .workflow/knowhow/KNW-opinion-{slug}-{YYYY-MM-DD}.md
Output boundary: ALL file writes MUST target .workflow/knowhow/KNW-opinion-{slug}-{YYYY-MM-DD}.md and .workflow/specs/learnings.md only. NEVER modify source code or files outside these paths.
</context>
<state_machine>
<states> S_RESOLVE — 解析 target PERSIST: — S_CONTEXT — 加载 specs/wiki 上下文 PERSIST: — S_EXECUTE — 按 mode 执行分析 PERSIST: — S_SYNTHESIZE — 综合观点、生成报告 PERSIST: outputs S_PERSIST — 写文件、append .workflow/specs/learnings.md PERSIST: knowhow files </states> <transitions>S_RESOLVE: → S_CONTEXT WHEN: target resolved DO: read target content → S_RESOLVE WHEN: unresolvable DO: request_user_input for clarification
S_CONTEXT: → S_EXECUTE DO: load specs + wiki search (optional, proceed without)
S_EXECUTE: → S_SYNTHESIZE WHEN: mode == review DO: A_REVIEW → S_SYNTHESIZE WHEN: mode == challenge DO: A_CHALLENGE → S_SYNTHESIZE WHEN: mode == consult DO: A_CONSULT
S_SYNTHESIZE: → S_PERSIST DO: merge perspectives → agreements, disagreements, verdict, top 3 recommendations
S_PERSIST: → END GATE: unless -y, request_user_input showing files to write and learning-entries to append — proceed only on confirm DO: write KNW-opinion + append <learning-entry> blocks to .workflow/specs/learnings.md
</transitions> <actions>Spawn 3 Agents in single message:
| Agent | Focus | Question |
|---|---|---|
| Pragmatist | simplicity, YAGNI, maintenance | "Simplest thing that works? Maintenance burden?" |
| Purist | correctness, edge cases, type safety | "What assumptions can be violated?" |
| Strategist | scalability, architecture alignment | "Supports future growth? Fits architecture?" |
Each returns: persona, verdict (approve/concern/reject), confidence, findings[{severity, description, location, suggestion}], summary.
Spawn 1 adversarial Agent:
Interactive loop:
</state_machine>
<error_codes>
| Code | Condition | Recovery |
|---|---|---|
| E001 | No target provided | Prompt user for target (path, wiki ID, HEAD, staged, or phase) |
| E002 | Unknown --mode value | Use: review, challenge, or consult |
| E003 | Target resolution failed — path not found, wiki ID invalid, or no staged changes | Check target exists |
| W001 | One review agent failed | Proceed with available perspectives |
| W002 | Specs/wiki pre-load unavailable | Proceed without convention context; note reduced coverage |
| </error_codes> |
<success_criteria>
<next_step_routing>
/maestro-issue create <description>/maestro-learn decompose <path>/maestro-learn follow <path>
</next_step_routing>まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Intent-to-chain planner over the canonical Session/Run lifecycle
日本語の概要は準備中です。原文の説明を表示しています。
Quick execution for small tasks — minimal run lifecycle (start + done) with evidence recording. Full LLM capability, scoped to mechanically clear tasks.
日本語の概要は準備中です。原文の説明を表示しています。
Create or sync session worktree for parallel dev
日本語の概要は準備中です。原文の説明を表示しています。
Manage editing boundary restrictions
日本語の概要は準備中です。原文の説明を表示しています。
Maestro Flow 命令帮助系统。搜索命令、浏览技能、工作流推荐、新手引导。Triggers on "maestro-help", "帮助", "命令", "怎么用", "skill", "workflow", "maestro 怎么用".
日本語の概要は準備中です。原文の説明を表示しています。
Use when designing, reviewing, refining, fixing, or codifying frontend UI with Maestro's self-contained Impeccable core
日本語の概要は準備中です。原文の説明を表示しています。