Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d6b013b
Sample code for: How to Refactor Python Code With an AI Agent
lpozo Oct 8, 2026
30df953
Update ai-refactor-python sample project
lpozo Oct 13, 2026
5644ade
Merge branch 'master' into ai-refactor-python
lpozo Oct 13, 2026
27e00c8
Sync ai-refactor-python sample project with the tutorial
lpozo Oct 14, 2026
76c2e23
Rename the starter archive to ai-refactor-python-starter.zip
lpozo Oct 14, 2026
3c0ac7e
Rename the starter project folder to ai-refactor-python-starter
lpozo Oct 14, 2026
7a6545a
Include the CLI characterization tests in the starter project
lpozo Oct 14, 2026
4f85148
Remove bug annotations from the CLI tests
lpozo Oct 14, 2026
d7e5c01
Sync REFACTOR.md in the final project with the tutorial
lpozo Oct 14, 2026
a2dfc19
Have the agent run the checks before it stops
lpozo Oct 14, 2026
98dee3d
Note in the plan template that line numbers predate the refactoring
lpozo Oct 14, 2026
20c902c
Restore the original app code in the starter project
lpozo Oct 14, 2026
dce4ec4
Drop the ErrorCode refactoring from the final project
lpozo Oct 14, 2026
86cefab
Wrap the refactor-plan skill description
lpozo Oct 14, 2026
2c53155
Sync sample project with technical review fixes
lpozo Oct 15, 2026
133cdec
Merge branch 'master' into ai-refactor-python
lpozo Oct 15, 2026
792c9de
Sync sample project with didactic review fixes
lpozo Oct 15, 2026
d1a739c
Match the REFACTOR.md line-number note to the tutorial
lpozo Oct 16, 2026
aba2df3
Merge branch 'master' into ai-refactor-python
lpozo Oct 16, 2026
d93dcad
Merge branch 'master' into ai-refactor-python
lpozo Oct 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ai-refactor-python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# How to Refactor Python Code With an AI Agent

This folder provides the sample project for the Real Python tutorial [How to Refactor Python Code With an AI Agent](https://realpython.com/ai-refactor-python/).

Unzip the `ai-refactor-python-starter.zip` archive to get the starter code: the RP To-Do app from [Build a Command-Line To-Do App With Python and Typer](https://realpython.com/python-typer-cli/) with a test suite that pins its current behavior, ready for you to refactor with an AI agent.

Unzip the `ai-refactor-python-final.zip` archive to get the finished project: the refactoring plan in `REFACTOR.md`, the Ruff, mypy, and coverage settings in `pyproject.toml`, and the code after applying every refactoring in the plan.
Binary file added ai-refactor-python/ai-refactor-python-final.zip
Binary file not shown.
Binary file not shown.
Loading