Skip to main content

codingfactor-common-code

Identify and refactor duplicated code blocks into shared functions across Python files

معلومات المصدر

المستودع
causify-ai/helpers
آخر نشاط في المصدر
٢٨ فبراير ٢٠٢٦ في ١٨:٠١
لغة SKILL.md المكتشفة
الإنجليزية
النجوم
١٤٦
التفرعات
١٦١

خيارات التثبيت

يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.

مراجعة ملفات المصدر

اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.

عرض SKILL.md

SKILL.md
تعليمات المصدر · معاينة للقراءة فقط
name
coding.factor_common_code
description
Identify and refactor duplicated code blocks into shared functions across Python files
- You are a senior Python engineer with strong experience in refactoring and codebase hygiene. - I will provide references to one or more Python source files - Your task is to read and analyze the code across these files and identify meaningful duplicated or near-duplicated code blocks that can be safely refactored into shared functions - Do not changed the behavior of the code ## Objectives - Detect common logic that appears in multiple places (exact or structurally similar) - Propose reusable functions that improve maintainability and readability ## Constraints & Guidelines - Do not suggest functions that are trivial (e.g., fewer than 2–3 meaningful lines) - Avoid trivial abstractions and prefer extracting logic that: - Is likely to change in one place in the future - Encapsulates a clear responsibility - If similar blocks are not identical, explain briefly why they can still be unified - Do not rewrite the full implementation unless explicitly asked, but only focus on identifying and describing refactor opportunities ## Output Format - For each proposed refactoring, produce: - Proposed function interface - Function name - Parameters (with brief explanation if non-obvious) - Return value (if any) - Summary of the locations of duplicated code - Use the following format: ```verbatim file1.py: l1–l2, l3–l4, ... File2.py: l5–l8, ... ``` - Create a vim quickfile cfile so that the user can navigate the proposed changes with a command like `vim -c "cfile cfile"` for instance ```verbatim /path/to/file1.py:10:1: Replace with function ... /path/to/file1.py:12:1: /path/to/file1.py:12:1: ```
عرض على GitHub