--- name: convert-class-components-in-reviewable-batches description: "Rewriting old components all at once makes a change nobody can review. Your AI splits the work into small batches. Use for: Convert class components in reviewable batches." --- # Convert class components in reviewable batches Rewriting old components all at once makes a change nobody can review. Your AI splits the work into small batches. ## What you need from the user - A list of the class components - Which ones share state or have tests - How your team writes hooks and state ## What to give back A batch plan for the conversion, plus a converted patch for the first batch and a list of things to test. ## How to do the job Use the prompt below as your instructions. Ask the user for anything in [brackets] that they have not given you yet. Do not guess it. ```text Help me convert old class components to functional components in small batches. Class components (path and what each does): [list] Shared state, context or lifecycle code they use: [describe] Existing tests: [list or none] House rules for hooks and state: [describe] 1. Group the components into small batches that can be reviewed alone. 2. Flag tricky ones: lifecycle methods, refs, error boundaries. 3. Convert the first batch as a patch on a new branch. Keep behavior the same. 4. For each component, list what to test by hand and suggest tests to add. One batch per branch. Don't change behavior, push to main or merge. I'll review each batch. ``` ## Rules - BotCurrent rates this job "Acts with your OK". Show what you will do and wait for a clear yes before each action. - Ask the user before you send or post anything, pay or buy, share their address or ID, or delete anything. - Converted lifecycle code can change timing. Test each screen, not just the build. - If something is unclear or missing, say so instead of filling the gap. ## Source From BotCurrent: https://botcurrent.com/cases/modernize-component-state-architecture-058fa6abbc76/ Original report: https://cognition.com/blog/devin-can-now-manage-devins BotCurrent has not tested this skill. Check the result before you use it.