Skip to content

feat: V3 CLI invocation migration skills are available from the wizard#1382

Merged
hatayama merged 21 commits into
v3-betafrom
feature/add-v3-cli-invocation-migration-skill
Jun 21, 2026
Merged

feat: V3 CLI invocation migration skills are available from the wizard#1382
hatayama merged 21 commits into
v3-betafrom
feature/add-v3-cli-invocation-migration-skill

Conversation

@hatayama

@hatayama hatayama commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • V3 migration users can install an AI migration skill directly from the migration wizard.
  • The skill helps update SKILL.md, Markdown, shell scripts, and PowerShell scripts that still call uloop with V2-style arguments.

User Impact

  • Users no longer have to discover the script migration guidance separately after C# source migration.
  • Existing skill folders are detected by actual installed files, and Install/Remove reflects whether the migration skill is present.
  • Older skill folder layouts can be removed cleanly, so the wizard state does not get stuck after uninstalling.

Changes

  • Splits the wizard into C# source structure migration and AI skill/script migration sections.
  • Adds bundled temporary migration skill content with POSIX and PowerShell detection scripts plus first-party command guidance.
  • Adds CLI support for installing and removing the migration skill across supported skill targets and folder layouts.
  • Hardens detector matching and ignores the bundled source skill to avoid self-reported candidates.

Verification

  • cli/dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)"
  • go test ./internal/cli
  • scripts/check-go-cli.sh
  • git diff --check
  • codex-review --mode branch v3-beta
  • Focused EditMode tests for ThirdPartyToolMigrationWizardWindowTests and ToolSkillSynchronizerTests passed.
  • PowerShell detector direct execution was skipped because pwsh is not installed locally.

Review in cubic

hatayama added 16 commits June 21, 2026 00:30
Add a temporary AI skill for migrating V2 uloop CLI invocations, expose dedicated CLI and migration-window install/remove paths, and cover first-party option and output-field detection without changing normal skill installs.
Clarify the wizard by separating mechanical C# source structure migration from the temporary AI skill used for SKILL.md and script updates.
Keep C# migration controls with the C# section, and move AI skill install controls outside the explanatory panel so the two migration paths read as distinct sections.
Align the C# and AI migration sections visually, add C# migration guidance, and separate the two paths with a divider so the wizard reads as two distinct workflows.
Use read-only selectable text fields for wizard copy while preserving the existing label-style presentation.
Show an optional prompt example after installing the migration skill so users know how to ask their AI agent to update SKILL.md and script invocations.
Apply the shared primary button style to the migration action so it matches the check and migration skill install actions.
Allow the V3 migration skill installer to locate Unity CLI Loop when the package is referenced through a manifest file dependency outside the project.
Recheck the installed migration skill files when the button is clicked so stale UI state cannot choose the wrong action. Remove the temporary V3 migration skill from both supported install layouts because older or alternate layouts should still be treated as installed.
Prune excluded directories before PowerShell detector recursion and read one-line files correctly. Restrict manifest-local package root resolution to the Unity CLI Loop package so unrelated local dependencies cannot shadow the temporary migration skill source.
Keep third-party local package skills discoverable through the general manifest path while using a filtered path only for resolving the Unity CLI Loop package root.
Skip the bundled temporary migration skill source when scanning and make the PowerShell output-field check case-sensitive so already migrated camelCase field reads are not reported again.
Treat punctuation and Markdown backticks as command terminators in both detectors so SKILL.md and Markdown examples are reported consistently.
Exclude TemporarySkills/v3-cli-invocation-migration regardless of the package parent layout so detector reruns do not report the bundled reference examples as self-noise.
Allow uninstall-v3-migration to remove the known temporary skill name even when the Unity CLI Loop package source cannot be resolved.
Make uninstall-v3-migration clear both flat and grouped install layouts so temporary migration skills do not remain after cleanup.
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a v3-cli-invocation-migration temporary skill with SKILL.md, a V2→V3 reference table, and a POSIX detection script. Extends the Go CLI with install-v3-migration/uninstall-v3-migration subcommands. Adds C# infrastructure for skill install-state detection and file synchronization, wired through service/use-case layers. Updates the migration wizard UI with selectable TextFields, an AI skill section with install/remove toggle, revised text constants, and new USS styles.

Changes

V3 CLI Invocation Migration Skill

Layer / File(s) Summary
Skill definition, reference docs, and detection script
Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/SKILL.md, Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/references/first-party-v2-to-v3.md, Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/scripts/detect-v3-cli-invocation-candidates.sh
Introduces SKILL.md with workflow and guardrail rules for boolean argument conversion, first-party option mapping, output-field casing, and detector guardrails. Adds comprehensive V2→V3 migration reference table with boolean argument conversion rules and first-party option mappings. Provides POSIX awk-based detector script that scans for candidate boolean arguments, first-party options, and PascalCase output fields.
Go CLI: V3 migration commands, discovery, and package resolution
cli/internal/cli/skills.go, cli/internal/cli/skills_discovery.go, cli/internal/cli/skills_display.go, cli/internal/cli/skills_packages.go, cli/internal/cli/skills_v3_migration.go
Adds v3MigrationSkillName constant and routes install-v3-migration/uninstall-v3-migration subcommands with early target validation. Adds collectV3MigrationSkillDefinition for V3-specific package-root discovery with error handling. Enhances manifest-local package resolution with optional dependency-name filtering and checks manifest-derived roots before fallback to cache. Updates help output with new subcommand descriptions. Implements per-target install/uninstall runners that manage skill status, sync files to preferred layout, and remove alternate layouts.
C# infra: install-state detection and synchronizer methods
Packages/src/Editor/Domain/CliConstants.cs, Packages/src/Editor/Infrastructure/SkillSetup/SkillInstallLayout.cs, Packages/src/Editor/Infrastructure/SkillSetup/ToolSkillSynchronizer.cs
Adds TEMPORARY_SKILLS_DIR_NAME and V3_CLI_INVOCATION_MIGRATION_SKILL_NAME constants. Extends SkillInstallLayout with path-separator normalization on SkillSourceInfo construction, SKILL.md frontmatter parsing to extract skill name/metadata, and installed-state comparison by normalized directory content. Adds ToolSkillSynchronizer methods for V3 migration skill state lookup with fallback layout detection, generic specific-skill install/remove/state helpers, and dedicated V3 migration flows managing both grouped and ungrouped layouts.
C# service and use-case layer
Packages/src/Editor/Domain/SkillSetupService.cs, Packages/src/Editor/Infrastructure/SkillSetup/ToolSkillSetupService.cs, Packages/src/Editor/Application/UseCases/SkillSetupUseCase.cs
Adds three V3 migration method declarations to ISkillSetupPort and guarded implementations in SkillSetupService with input validation and cancellation checks. Implements the methods in ToolSkillSetupService by converting domain targets and delegating to ToolSkillSynchronizer. Exposes thin wrappers in SkillSetupUseCase that assert targets non-null before calling the service.
Wizard text, view, window, and USS styling
Packages/src/Editor/Presentation/Setup/ThirdPartyToolMigrationWizardText.cs, Packages/src/Editor/Presentation/Setup/ThirdPartyToolMigrationWizardView.cs, Packages/src/Editor/Presentation/Setup/ThirdPartyToolMigrationWizardWindow.cs, Packages/src/Editor/Presentation/Setup/SetupWizardWindow.uss
Revises wizard strings to "C# source structure migration" wording and adds AI skill section constants/button labels. Refactors view to use selectable TextFields, adds EnumField+skill-button section for AI migration, and introduces helper methods for C# section composition. Wires skill target-change and toggle callbacks in the window with async install/remove, updating flag, and state refresh. Removes migration-alert styles, adds setup-section-actions/setup-selectable-text/setup-step__description-label CSS, adjusts title spacing.
Tests: wizard, synchronizer, and Go CLI
Assets/Tests/Editor/ThirdPartyToolMigrationWizardWindowTests.cs, Assets/Tests/Editor/ToolSkillSynchronizerTests.cs, cli/internal/cli/skills_test.go
Updates expected wizard text strings to match C# source wording. Adds test cases for GetMigrationSkillButtonText and ShouldRemoveMigrationSkill helpers. Adds four async synchronizer tests covering install-specific, detect-alternate-layout, remove-specific, and remove-both-layouts flows. Extends Go CLI tests with V3 migration skill discovery (exclusion, inclusion, name validation, manifest-file package), install/uninstall commands, alternate layout removal, detector script execution (POSIX/PowerShell), and helpers for package-root markers and repository-root discovery.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(173, 216, 230, 0.5)
    note over User,ToolSkillSynchronizer: Wizard skill target selection and async toggle
  end
  participant User
  participant ThirdPartyToolMigrationWizardView
  participant ThirdPartyToolMigrationWizardWindow
  participant SkillSetupUseCase
  participant ToolSkillSynchronizer

  User->>ThirdPartyToolMigrationWizardView: Select SkillsTarget (EnumField)
  ThirdPartyToolMigrationWizardView->>ThirdPartyToolMigrationWizardWindow: migrationSkillTargetChanged(target)
  ThirdPartyToolMigrationWizardWindow->>SkillSetupUseCase: GetV3MigrationSkillInstallStateAtProjectRoot
  SkillSetupUseCase->>ToolSkillSynchronizer: GetV3MigrationSkillInstallStateAtProjectRoot
  ToolSkillSynchronizer-->>SkillSetupUseCase: SkillInstallState
  SkillSetupUseCase-->>ThirdPartyToolMigrationWizardWindow: SkillInstallState
  ThirdPartyToolMigrationWizardWindow->>ThirdPartyToolMigrationWizardView: UpdateMigrationSkillState(isUpdating=false)

  User->>ThirdPartyToolMigrationWizardView: Click install/remove button
  ThirdPartyToolMigrationWizardView->>ThirdPartyToolMigrationWizardWindow: toggleMigrationSkill()
  ThirdPartyToolMigrationWizardWindow->>ThirdPartyToolMigrationWizardView: UpdateMigrationSkillState(isUpdating=true)
  ThirdPartyToolMigrationWizardWindow->>SkillSetupUseCase: InstallV3MigrationSkillFilesAsync or RemoveV3MigrationSkillFilesAsync
  SkillSetupUseCase->>ToolSkillSynchronizer: InstallV3MigrationSkillFilesAtProjectRoot or RemoveV3MigrationSkillFilesAtProjectRoot
  ToolSkillSynchronizer-->>SkillSetupUseCase: SkillInstallResult
  SkillSetupUseCase-->>ThirdPartyToolMigrationWizardWindow: complete
  ThirdPartyToolMigrationWizardWindow->>SkillSetupUseCase: GetV3MigrationSkillInstallStateAtProjectRoot
  SkillSetupUseCase-->>ThirdPartyToolMigrationWizardWindow: updated SkillInstallState
  ThirdPartyToolMigrationWizardWindow->>ThirdPartyToolMigrationWizardView: UpdateMigrationSkillState(isUpdating=false)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • hatayama/unity-cli-loop#951: The main PR extends the layout-aware skill installation infrastructure introduced in #951—adding V3 migration install/state/remove logic in ToolSkillSynchronizer and enhancing SkillInstallLayout/its state comparison—so it directly builds on and modifies the same core classes.
  • hatayama/unity-cli-loop#1079: Both PRs modify the skill setup/synchronization infrastructure (e.g., ToolSkillSynchronizer/ToolSkillSetupService-level install-state flows used for project-root skill installs/removals), so the V3 migration skill operations in the main PR are directly affected by the same install pipeline changes in #1079.
  • hatayama/unity-cli-loop#1125: Both PRs modify the V3 third-party/custom tool migration wizard by touching the same ThirdPartyToolMigrationWizardWindow/ThirdPartyToolMigrationWizardText-driven status/progress/button text logic, with the main PR extending it further with migration-skill install/remove UI/state handling.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.58% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main feature: enabling V3 CLI invocation migration skills to be available from the wizard UI.
Description check ✅ Passed The description comprehensively covers the changeset, explaining user impact, changes made, and verification performed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/add-v3-cli-invocation-migration-skill

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hatayama hatayama closed this Jun 21, 2026
Move the bundled migration skill source under a tilde-suffixed folder so Unity does not import it as package content. Update the CLI lookup path and detector self-exclusion to match the ignored folder name, and drop Unity meta files that are no longer needed for the ignored source tree.
@hatayama hatayama reopened this Jun 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/scripts/detect-v3-cli-invocation-candidates.sh (1)

11-17: 💤 Low value

Line-by-line regex detection has expected limitations.

The boolean argument pattern correctly detects --option=true/false and --option true/false syntax, but by design it:

  • Processes files line-by-line (won't detect multi-line commands with backslash continuations)
  • May match inside code examples, comments, or string literals
  • Uses greedy matching that spans multiple arguments

For a migration detection tool where candidates are reviewed by humans, these tradeoffs are acceptable. False positives are preferable to false negatives in this context.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Packages/src/TemporarySkills`~/v3-cli-invocation-migration/Skill/scripts/detect-v3-cli-invocation-candidates.sh
around lines 11 - 17, The regex pattern in the
detect-v3-cli-invocation-candidates.sh script has documented limitations that
are acceptable for this use case. Add comments in the awk script around the
regex pattern (specifically the pattern that matches --option=true/false and
--option true/false syntax) to document the known limitations: that it processes
files line-by-line and won't detect multi-line commands with backslash
continuations, may match inside code examples/comments/string literals, and uses
greedy matching. Also document that these limitations are acceptable because the
tool is designed for human review and false positives are preferable to false
negatives in this migration detection context.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@Packages/src/TemporarySkills`~/v3-cli-invocation-migration/Skill/scripts/detect-v3-cli-invocation-candidates.sh:
- Line 7: In the find command on line 7 within
detect-v3-cli-invocation-candidates.sh, there are two redundant patterns
excluding paths with TemporarySkills~/v3-cli-invocation-migration. The pattern
with the `*/` prefix (with wildcard) successfully matches and excludes the
directory, while the pattern without the `*/` prefix does not match due to how
find prepends directory paths. Remove the second, redundant `-path
'TemporarySkills~/v3-cli-invocation-migration'` pattern (the one without the
`*/` wildcard) from the prune section to simplify the find command while
maintaining the same exclusion behavior.

---

Nitpick comments:
In
`@Packages/src/TemporarySkills`~/v3-cli-invocation-migration/Skill/scripts/detect-v3-cli-invocation-candidates.sh:
- Around line 11-17: The regex pattern in the
detect-v3-cli-invocation-candidates.sh script has documented limitations that
are acceptable for this use case. Add comments in the awk script around the
regex pattern (specifically the pattern that matches --option=true/false and
--option true/false syntax) to document the known limitations: that it processes
files line-by-line and won't detect multi-line commands with backslash
continuations, may match inside code examples/comments/string literals, and uses
greedy matching. Also document that these limitations are acceptable because the
tool is designed for human review and false positives are preferable to false
negatives in this migration detection context.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b8ebc74a-7c06-4803-92bb-3e4f4155ff7c

📥 Commits

Reviewing files that changed from the base of the PR and between fe84ae5 and 18cba34.

⛔ Files ignored due to path filters (1)
  • Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/scripts/detect-v3-cli-invocation-candidates.ps1 is excluded by none and included by none
📒 Files selected for processing (6)
  • Packages/src/Editor/Domain/CliConstants.cs
  • Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/SKILL.md
  • Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/references/first-party-v2-to-v3.md
  • Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/scripts/detect-v3-cli-invocation-candidates.sh
  • cli/internal/cli/skills_discovery.go
  • cli/internal/cli/skills_test.go
💤 Files with no reviewable changes (2)
  • Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/SKILL.md
  • Packages/src/TemporarySkills~/v3-cli-invocation-migration/Skill/references/first-party-v2-to-v3.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • Packages/src/Editor/Domain/CliConstants.cs
  • cli/internal/cli/skills_discovery.go
  • cli/internal/cli/skills_test.go

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 22 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread cli/internal/cli/skills_discovery.go
Comment thread cli/internal/cli/skills_test.go Outdated
Validate that the dedicated migration skill source declares the expected name before installation, avoid following PowerShell reparse point directories during scans, simplify the POSIX self-exclusion pattern, and make the POSIX detector test skip when sh is unavailable.
hatayama added 2 commits June 21, 2026 19:24
Read PowerShell detector inputs as UTF-8 so Windows PowerShell reports physical line numbers for UTF-8 no-BOM files. Normalize single-skill source paths before syncing so nested migration skill files are not deleted on Windows.
Document encoding, line ending, path separator, and shell validation rules so macOS-first changes are checked against Windows failure modes before they regress again.
@hatayama
hatayama force-pushed the feature/add-v3-cli-invocation-migration-skill branch from d9a6d61 to 9f97ad6 Compare June 21, 2026 10:24
Normalize the manifest package-root assertion before comparing paths so the Windows test accepts equivalent slash and backslash forms.
@hatayama
hatayama merged commit a327f4a into v3-beta Jun 21, 2026
9 checks passed
@hatayama
hatayama deleted the feature/add-v3-cli-invocation-migration-skill branch June 21, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant