Plan refactors across modules
Send Qwen3.8-Max-0902 the modules to change, their dependencies and the existing tests, ask for the order of changes and how to verify each step first, then the changes one step at a time. Run the tests after each step and continue only when they pass.
Example: In what order should we split the old auth module?
Material
- Current state
- The auth module handles login, sessions and permission checks; the orders and admin services read its internal session table directly.
- Constraints
- No downtime; no major changes to the orders and admin services this quarter.
PromptGive a step-by-step refactoring plan: what each step changes and how to verify behavior is unchanged. Do the lowest-risk steps first.
Sample answer · written by hand to show the reasoning
Step 1: add API-level tests for login, sessions and permissions as the baseline for every later step. Step 2: add a session-lookup endpoint to auth that still reads the session table internally; leave the other services alone. Step 3: switch the orders and admin services from querying the table to calling that endpoint, a small change you can roll back on its own. Step 4: once no service reads the session table directly, split sessions into their own service. After each release, watch the login failure rate for a week and move on only if it hasn’t changed.