スキル一覧に戻る
Cissou34730

python-refactor

by Cissou34730

0🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: python-refactor description: Assist with automated, safe, and explainable Python refactorings. Detects simple anti-patterns and offers AST-based transformations with patches and unit-test friendly changes.

Python Refactor Skill

Overview

This skill helps authors and agents perform automated, small, safe Python refactorings. It focuses on detectable, low-risk transformations (formatting to f-strings, simplify boolean expressions, remove unused imports, small function extraction suggestions) and produces patch files or dry-run diffs.

Use this skill when you want a reproducible, reviewable set of refactor suggestions that can be applied automatically or passed to a human reviewer.

Quick Start

  • Use the scripts/analyze.py to scan a directory for refactor opportunities.
  • Use the scripts/refactor.py to generate patches (preview mode by default).
  • Use the scripts/apply_patch.py to apply confirmed patches safely (creates backups).

When to use

  • Large repositories where repetitive low-risk refactors are needed.
  • Codebases with inconsistent formatting or migration to modern Python features (f-strings, type hints).
  • As a pre-PR pass to reduce mechanical review comments.

Scripts

  • scripts/analyze.py: static analysis for refactor candidates.
  • scripts/refactor.py: performs AST transforms and outputs unified diffs.
  • scripts/apply_patch.py: applies diffs to files with backups.

Resources

  • references/python-style-guide.md: opinionated style guidance used by the skill.
  • references/refactoring-patterns.md: patterns the skill recognizes and how it changes code.

Safety and Scope

This skill only performs transformations that can be verified via unit tests. Always run tests after applying patches and review diffs before committing.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です