AI Refactor Kit is a private workspace for planning large software refactors — we ground AI in a legacy codebase, design a simpler modern architecture, and plan a safe migration to it.

These platforms have needed deep refactoring for years — held back until AI matured enough to trust at that scale. That time has come. Team members sign in with Google to read and discuss the refactor plans for the projects they've been granted access to; it's invite-only and shared only with the team. The playbook below is how we take one on.

01Projectswhat we’re planning
5 under planning

5 projects under planning. Sign in with your account to see the ones you have access to.

02Playbookhow we take on a refactor
understand · design · plan

Understand the legacy

a repo is too big for one context — dissect the real thing
  • Ground — clone, index & mine the actual code
  • Structural tools — ripgrep · ast-grep · tree-sitter · LSP
  • Map — dependency & call graphs, git-churn hotspots
  • Audit the current state — perf · a11y · SEO · security — the baseline
  • Capture — lock current behavior in tests first
  • Consolidate — one grounded corpus for the AI

Design the target

simpler, cheaper, serverless
  • Architecture — SSR on the Cloudflare edge · D1 · R2 · KV
  • One monorepo — all code, infra, tests & data in one place
  • AI-legible — structured for maximum AI help, minimal tokens
  • Infra as code — free-tier as the discipline
  • API-first — OpenAPI, capability reusable by other tools
  • Backup & recovery — tested; nothing single-copy

Plan the path

incremental, reversible, gated
  • Migrate — small, reversible steps
  • Execute — trunk-based behind hard gates
  • Verify — parallel legacy-vs-refactored E2E + audits re-run
  • Monitor — AI probes production continuously
  • Govern — the team reads & discusses, cited
Built on the stack it prescribes.Privacy · TermsAstro · Cloudflare · Planning AI on Fable · Claude Code