DEV Community

SybilGambleyyu
SybilGambleyyu

Posted on • Originally published at sybilgambleyyu.github.io

A practical debt and cleanup workflow

Cleanup sprints fail when they start with opinions. Start with signals: what is old, what is hot, what still imports the suspect module, which branches are leftovers.

1. Surface old code

fileage --days 365 --ext .py -n 40
todogrep --min-age 90 -t FIXME,HACK --code-only
Enter fullscreen mode Exit fullscreen mode

2. Check heat and importers

gitchurn --prefix src/legacy -n 15 --min 3
whoimports src/legacy/foo.py
Enter fullscreen mode Exit fullscreen mode

3. Clean local branches

gitstale --merged --days 14 --print-delete
gitstale --gone
Enter fullscreen mode Exit fullscreen mode

4. Pack context for an AI-assisted refactor

ctxpack -b main -i @refactor --diff | redactx > refactor.md
Enter fullscreen mode Exit fullscreen mode

Install: curl -fsSL https://raw.githubusercontent.com/SybilGambleyyu/devkit/main/install.sh | bash

Canonical: sybilgambleyyu.github.io/posts/debt-workflow/

Top comments (0)