Skip to content
cccskills
FreePublished on GitHub

maestro-update

Detect version, preview changes, apply workflow upgrades

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md6.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

<purpose> Detect current version, run schema migration to latest, then follow the version-specific upgrade workflow. Schema migrations are handled by `maestro update --migrate`; workflow docs (`~/.maestro/workflows/updates/`) handle setup. </purpose> <context> $ARGUMENTS — optional flags.

Flags:

  • --dry-run -- Preview migration plan without executing
  • --force -- Skip confirmation prompts (intended for CI/automated contexts). Migration diff is still displayed even with --force to maintain audit visibility.
  • --setup-only -- Skip schema migration, run only the setup for current version

Version source: .workflow/state.json → version field

Workflow docs: ~/.maestro/workflows/updates/

  • update-v{TO}-setup.md — post-migration setup for version {TO}

Schema registry: maestro update --migrate — handles all intermediate version bumps automatically

Output boundary: ALL file writes MUST target .workflow/state.json (version bump), .workflow/state.json.backup-* (backup), and .workflow/ config files touched by version-specific setup. NEVER modify source code or src/migrations/ files. </context>

<invariants> 1. **Backup before migration** — a timestamped backup of `.workflow/state.json` MUST be created before any schema migration runs; NEVER execute migration without backup 2. **Idempotent** — running update when already on latest version MUST be a no-op (display "up to date"); NEVER re-apply migrations 3. **Confirmation before execute** — migration diff MUST be displayed and user MUST confirm via request_user_input before execution (unless `--force`); NEVER silently apply schema changes 4. **Migration diff always visible** — even with `--force`, the migration diff MUST be displayed for audit visibility; NEVER skip diff display 5. **Restore path on failure** — if migration fails, the backup restore command MUST be displayed; NEVER leave user without recovery instructions 6. **Sequential migration** — all intermediate version steps MUST be applied in order by the schema registry; NEVER skip intermediate versions </invariants> <execution>

Phase Gates (MANDATORY, BLOCKING)

GATE 1: Detect → Check

  • REQUIRED: Current version read from .workflow/state.json.
  • BLOCKED if: state.json missing or unreadable (E001).

GATE 2: Check → Execute

  • REQUIRED: Dry-run migration check completed; target version identified.
  • REQUIRED: User confirmation via request_user_input (unless --force).
  • BLOCKED if: already up to date (display message and exit) or user cancels.

--dry-run short-circuit: execute GATE 1 (version detection) + dry-run migration check, display preview, EXIT before GATE 2 confirmation and GATE 3 execution.

GATE 3: Execute → Summary

  • REQUIRED: Backup created at .workflow/state.json.backup-v{current}-{timestamp}.
  • REQUIRED: Schema migration completed successfully.
  • REQUIRED: Version-specific setup doc followed (if exists).
  • BLOCKED if: migration failed — display restore command and exit.

Step 1: Detect Version

1. Read .workflow/state.json → extract version (default "1.0" if missing)
2. Display:
   === Maestro Update ===
   Current version: v{version}

IF --setup-only: → Glob: ~/.maestro/workflows/updates/update-v{version}-setup.md → IF exists: follow that document completely, then EXIT → IF not exists: display "No setup script for v{version}" → EXIT

1a. Check for active worktrees: read worktrees.json. If active entries exist, warn: 'Active worktrees detected ({N}). Schema migration may cause merge incompatibility. Consider merging active worktrees first.' (W003)

Step 2: Check for Updates

1. Run: maestro update --migrate "$(pwd)" --dry-run --json
2. Parse JSON output
3. IF status = "up-to-date":
     Display "Already up to date (v{version})"
     → Glob: ~/.maestro/workflows/updates/update-v{version}-setup.md
     → IF exists: request_user_input "Run setup for v{version}?" → load and follow
     → EXIT

4. Display target:
   Update available: v{current} → v{target}
   Schema migrations: {N} step(s) (handled automatically)

IF --dry-run → display info and EXIT.

Step 3: Execute

1. Display migration diff (always — even with --force):
   Show schema changes that will be applied.

2. Confirm (unless --force):
   request_user_input: "Upgrade v{current} → v{target}?"
   Options: [执行 / 取消]

3. Create backup:
   Bash: cp .workflow/state.json .workflow/state.json.backup-v{current}-{timestamp}

4. Run schema migration (handles all intermediate steps automatically):
   Bash: maestro update --migrate "$(pwd)" --json
   Parse result, display changes.

5. IF failed → display backup restore command → EXIT

6. Load version-specific setup:
   Read: ~/.maestro/workflows/updates/update-v{target}-setup.md
   IF exists → follow completely (hooks, deps, knowledge system config)

7. Display: "v{current} → v{target}: done"

Step 4: Summary

=== Update Complete ===
Version: v{current} → v{target}
Backup:  .workflow/state.json.backup-v{current}-{timestamp}

Next steps:
  /maestro        -- Continue workflow
</execution>

<error_codes>

CodeSeverityConditionRecovery
E001error.workflow/state.json not found or unreadableRun /maestro-init first
E002errorSchema migration failed (npx tsx returned error)Display backup restore command: cp .workflow/state.json.backup-* .workflow/state.json
E003errorVersion-specific setup doc failed to executeManual setup: read ~/.maestro/workflows/updates/update-v{target}-setup.md
W001warningNo version-specific setup doc found for target versionProceed without setup; schema migration alone is sufficient
W002warning--setup-only but no setup script exists for current versionDisplay message and exit
W003warningActive worktrees detected during updateConsider merging worktrees before migration
</error_codes>

<success_criteria>

  • Current version detected from state.json
  • Schema migrations run automatically (no manual intermediate steps)
  • Backup created before migration
  • Version-specific setup doc loaded and followed (if exists)
  • --setup-only runs only setup for current version
  • --dry-run previews without executing
  • Summary shows version change and backup path </success_criteria>
<completion> ### Next-step routing | Condition | Suggestion | |-----------|-----------| | Want to continue workflow | `/maestro` | </completion>

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Intent-to-chain planner over the canonical Session/Run lifecycle

The English summary is being prepared. Showing the original description.

catlog22/maestro-flow566Updated Oct 15, 2026

Quick execution for small tasks — minimal run lifecycle (start + done) with evidence recording. Full LLM capability, scoped to mechanically clear tasks.

The English summary is being prepared. Showing the original description.

catlog22/maestro-flow566Updated Oct 15, 2026

Create or sync session worktree for parallel dev

The English summary is being prepared. Showing the original description.

catlog22/maestro-flow566Updated Oct 15, 2026

Manage editing boundary restrictions

The English summary is being prepared. Showing the original description.

catlog22/maestro-flow566Updated Oct 15, 2026

Maestro Flow 命令帮助系统。搜索命令、浏览技能、工作流推荐、新手引导。Triggers on "maestro-help", "帮助", "命令", "怎么用", "skill", "workflow", "maestro 怎么用".

The English summary is being prepared. Showing the original description.

catlog22/maestro-flow566Updated Oct 15, 2026

Use when designing, reviewing, refining, fixing, or codifying frontend UI with Maestro's self-contained Impeccable core

The English summary is being prepared. Showing the original description.

catlog22/maestro-flow566Updated Oct 15, 2026

See all skills by catlog22

Report a problem with this skill