refactor-django

Automate Django refactoring workflows with test-first planning and CI guardrails.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/cookeyholder/django-devcontainer-template --skill refactor-django-cookeyholder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-django
Source: https://github.com/cookeyholder/django-devcontainer-template/tree/main/.agent/skills/refactor-django
Command: npx skills add https://github.com/cookeyholder/django-devcontainer-template --skill refactor-django-cookeyholder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This workflow provides a repeatable, wave-based approach to refactoring Django projects, safeguarding behavior with tests and clear guardrails while enabling incremental improvements.

Core Features & Use Cases

  • OpenSpec-style planning and phased waves to structure refactors (planning, execution, validation)
  • Service layer extraction, fat view/model decomposition, and Django signal decoupling
  • Type hints / mypy integration, pre-commit tooling, and CI guardrails for safe rollouts
  • End-to-end refactor pipelines suitable for teams aiming to improve maintainability and reduce tech debt

Quick Start

Define a Django project and enable the refactor workflow to begin phased Wave 1 planning.

Frequently Asked Questions about refactor-django

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely extract a service layer from fat Django views?

Decoupling Django signals is handled through a structured multi-wave process that separates signal logic from core models. This refactoring workflow uses test-first guidance and CI guardrails to ensure signal decoupling does not break existing application behavior.

How do I add type hints and mypy checks to an existing Django project?

Django refactoring follows a multi-wave process covering planning, implementation, and validation. Each wave includes pre-commit setup, test-first guidance, and open-spec proposals to ensure incremental improvements maintain project safety and reduce technical debt systematically.

Can I refactor Celery tasks in a Django project incrementally?

Celery task refactors are supported within this incremental Django refactoring workflow. The process applies safety nets and test-first guidance to ensure task behavior remains intact while restructuring code across phased implementation waves.

What is the best way to structure a Django refactoring plan for a team?

Structuring a Django refactoring plan uses OpenSpec-style planning to define phased waves for execution. This approach provides teams with clear guardrails, test-first validation, and structured documentation to reduce technical debt safely.