console icon indicating copy to clipboard operation
console copied to clipboard

CONSOLE-4937: Claude code command: Console Assist Convert

Open krishagarwal278 opened this issue 1 month ago • 5 comments

Summary

/console-assist convert <filepath> is an interactive Claude Code command that automates .jsx to TypeScript .tsx conversions with intelligent error fixing. Think of it as having a teammate who can convert legacy components, run builds and tests, automatically fix TypeScript errors, and commit everything - all while keeping you in the loop.

What It Does

The command handles the complete JSX to TSX conversion workflow:

  • Renames .jsx to .tsx and adds TypeScript type annotations (props, state, hooks, events)
  • Runs yarn build and automatically fixes TypeScript/compilation errors
  • Updates test files with proper types and fixes test failures
  • Iterates up to 3 times, re-running build and tests after each fix
  • Runs yarn lint and auto-fixes formatting issues
  • Updates all import references across the codebase
  • Creates a git commit with a descriptive message

Interactive & Intelligent

The command asks for your help when needed:

  • Before converting: "Are there existing type definitions?" / "Should I update test files?"
  • When stuck: Provides diagnostics and asks for guidance after 3 iteration cycles
  • Searches for similar converted components to reuse type patterns
  • Follows existing TypeScript patterns and OpenShift Console conventions

Perfect For

  • Converting legacy .jsx components to TypeScript
  • Large-scale TypeScript migration projects
  • Any JSX file where you want automated type annotation and error fixing

Example Workflow

User: /console-assist convert frontend/packages/dev-console/src/components/MyComponent.jsx


krishagarwal278 avatar Dec 02 '25 08:12 krishagarwal278