Skip to content

feat: add /migration-analysis Claude command for Go-to-TypeScript planning#3700

Merged
zackverham merged 2 commits intomainfrom
migration-analysis-command
Mar 11, 2026
Merged

feat: add /migration-analysis Claude command for Go-to-TypeScript planning#3700
zackverham merged 2 commits intomainfrom
migration-analysis-command

Conversation

@zackverham
Copy link
Collaborator

@zackverham zackverham commented Mar 11, 2026

Summary

  • Adds a /migration-analysis Claude command that scans the live Go codebase to produce a migration roadmap for the Go-to-TypeScript effort
  • Analyzes package inventory, dependency graph, migration tiers, TypeScript coverage, and reverse dependencies
  • Shows only the final roadmap by default; pass --verbose to see intermediate step details
  • Results are dynamic — re-run anytime to get an updated view as migration progresses

Type of Change

  • Tooling

Approach

The command is a structured prompt in .claude/commands/migration-analysis.md that guides Claude through 6 analysis steps:

  1. Package inventory — enumerates LOC, source/test files, subpackages
  2. Dependency graph — extracts internal imports (excluding test files) at both top-level and subpackage granularity
  3. Migration tiers — computes a topological ordering via a Python script, surfacing circular dependencies
  4. TypeScript coverage — checks for existing TS equivalents of Go packages
  5. Reverse dependencies — identifies foundation packages with the most consumers
  6. Migration roadmap — compiles everything into a prioritized plan with tier visualization, subpackage extraction opportunities, risk assessment, and recommended order

A $ARGUMENTS check at the top controls verbosity: default mode suppresses intermediate output, --verbose shows all steps.

User Impact

None — this is a developer tooling command only used within Claude Code sessions.

Automated Tests

N/A — this is a Claude command prompt, not executable code. The Prettier formatting fix ensures CI check-format passes.

🤖 Generated with Claude Code

…nning

Adds a reusable Claude command that analyzes the Go backend package
dependency graph, computes migration tiers, checks existing TypeScript
coverage, and generates a migration roadmap. All analysis is dynamic
(scans the live codebase) so results stay accurate as migration progresses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@dotNomad dotNomad left a comment

Choose a reason for hiding this comment

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

This is very helpful. Getting those tiers is a great way to grab the next step of this migration.


Using the dependency data from Step 2, compute migration tiers using an iterative algorithm. Run this as a Python script, filling in the dependency dictionary from the Step 2 results:

```bash
Copy link
Collaborator

Choose a reason for hiding this comment

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

When it got to this block it had to re-run because of this:

Key insight: config only imports clients/types, not the full clients package. And bundles also only imports clients/types. This means the apparent config -> clients and bundles -> clients cycles can
be broken by extracting clients/types as an independent package.
Similarly, deployment imports inspect/dependencies/renv, not the full inspect package. And inspect imports bundles/matcher, not necessarily the full bundles package (though it also imports bundles).
Let me re-run the tier computation with subpackage-accurate dependencies

Thought that was worth noting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I saw it catching some cycles like that we should investigate more closely.

Make the migration analysis command show only the final roadmap by
default, with --verbose flag to show intermediate step details.
Fix Prettier formatting issues that were failing CI check-format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zackverham zackverham marked this pull request as ready for review March 11, 2026 20:23
@zackverham zackverham requested a review from a team as a code owner March 11, 2026 20:23
@zackverham zackverham changed the title feat: add /migration-analysis Claude command for Go-to-TypeScript pla… feat: add /migration-analysis Claude command for Go-to-TypeScript planning Mar 11, 2026
@zackverham zackverham merged commit f9870d2 into main Mar 11, 2026
12 checks passed
@zackverham zackverham deleted the migration-analysis-command branch March 11, 2026 20:26
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.

2 participants