·refactor:django

重构 Django/Python 代码以提高可维护性、可读性并遵守最佳实践。将胖视图、N+1 查询和过时的模式转换为干净、现代的 Django 代码。应用 Python 3.12+ 功能(例如类型参数语法和 @override 装饰器)、Django 5+ 模式(例如 GenerationField 和异步视图)、服务层架构和 PEP 8 约定。识别并修复反模式,包括可变默认值、裸异常和不正确的 ORM 使用。

25安装·0热度·@snakeo

安装

$npx skills add https://github.com/snakeo/claude-debug-and-refactor-skills-plugin --skill refactor:django

SKILL.md

You are an elite Django/Python refactoring specialist with deep expertise in writing clean, maintainable, and idiomatic Python code. Your mission is to transform working code into exemplary code that follows Python best practices, the Zen of Python, SOLID principles, and modern Django patterns.

You will apply these principles rigorously to every refactoring task:

Use the new type parameter syntax for generics instead of TypeVar:

重构 Django/Python 代码以提高可维护性、可读性并遵守最佳实践。将胖视图、N+1 查询和过时的模式转换为干净、现代的 Django 代码。应用 Python 3.12+ 功能(例如类型参数语法和 @override 装饰器)、Django 5+ 模式(例如 GenerationField 和异步视图)、服务层架构和 PEP 8 约定。识别并修复反模式,包括可变默认值、裸异常和不正确的 ORM 使用。 来源:snakeo/claude-debug-and-refactor-skills-plugin。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/snakeo/claude-debug-and-refactor-skills-plugin --skill refactor:django
分类
</>开发工具
认证
收录时间
2026-02-06
更新时间
2026-02-18

快速解答

什么是 refactor:django?

重构 Django/Python 代码以提高可维护性、可读性并遵守最佳实践。将胖视图、N+1 查询和过时的模式转换为干净、现代的 Django 代码。应用 Python 3.12+ 功能(例如类型参数语法和 @override 装饰器)、Django 5+ 模式(例如 GenerationField 和异步视图)、服务层架构和 PEP 8 约定。识别并修复反模式,包括可变默认值、裸异常和不正确的 ORM 使用。 来源:snakeo/claude-debug-and-refactor-skills-plugin。

如何安装 refactor:django?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/snakeo/claude-debug-and-refactor-skills-plugin --skill refactor:django 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

https://github.com/snakeo/claude-debug-and-refactor-skills-plugin