Practice Safe Refactoring
The safe refactoring workflow is: invoke the skill, then verify tests still pass. This ensures your changes don't break existing behavior.
The project has a refactor skill already set up in .claude/skills/refactor/. You have test coverage from the previous exercise. Now practice refactoring routes.py safely. The get_album_stats function handles both data preparation and statistics calculation. Extract the data preparation logic into a helper function.
Bài tập này là một phần của khóa học
Software Development with Claude Code
Hướng dẫn bài tập
- Start Claude Code with
claude. - Use the refactor skill:
/refactor @routes.pyto extract data preparation logic into a helper function. - Run the tests to verify the refactoring didn't break anything.
- When done, type
/exitto exit Claude Code.
Bài tập tương tác thực hành
Biến lý thuyết thành hành động với một trong các bài tập tương tác của chúng tôi
Bắt đầu bài tập