SkillSub Pro Python Assistant
Paste the following prompt into your AI chat to install this skill:
Please refer to https://skillhub.cn/install/skillhub.md to install @user_eceb0be6/python-all-helper.
About this skill
The Core Problem: The Cost of Comprehension in Python Learning & Collaboration
For algorithm learners and developers, two high-cost tasks recur frequently:
1. From Problem Statement to Runnable Code: Facing an algorithm problem (e.g., on LeetCode), one must traverse the entire cycle of "understand constraints → devise strategy → write code → analyze complexity." This process is time-consuming and can lead to mental blocks, lacking a direct comparison of solution pros and cons.
2. From Code to Maintained Documentation: When taking over existing Python code—whether from a teammate, a legacy system, or one's own past snippet—the first task is to quickly understand its logic, parameters, and return values to debug or modify it. Manually adding comments is tedious and often inconsistent or incomplete.
These scenarios fundamentally represent a consumption of information interpretation and structured expression. The python全能编程助手 (SkillSub Pro) aims to automate the generation of these two types of structured outputs through a unified entry point.
How the Skill Works: Dual-Mode Intelligent Processing
The core of this skill is intelligent input detection and a dual-engine output system. You don't need to select a mode; just provide the raw input.
1. The Problem-Solving Engine
Trigger: Input includes a problem description, problem number (e.g., LeetCode 1), or keywords like "solve", "implement".
Workflow and Output Structure:
* Parsing and Strategy Generation: Analyzes problem constraints and objectives, selects optimal or multiple solution strategies (e.g., Hash Map vs. Two Pointers), and generates a clear, step-by-step solution approach.
* Complete Code Generation: Produces directly runnable Python code. The code itself is interspersed with detailed comments explaining each line or critical block.
* Accompanying Analysis: Provides standard time and space complexity analysis (e.g., Time Complexity O(n)).
Example: Inputting
LeetCode 1 Two Sumwill yield an output containing a fully annotatedtwo_sumfunction implementation, an explanation of the hash table strategy, and complexity analysis.
2. The Code-Commenting Engine
Trigger: Input contains explicit Python code blocks (e.g., def or class statements).
Workflow and Output Structure:
* Code Parsing: Identifies functions, classes, parameters, control flows, and other structures within the code.
* Standardized Comment Generation: Adds detailed Chinese comments in accordance with PEP 257. Comments cover:
* Function/class-level docstring (summary, parameters, return values).
* Inline comments for key logical lines, explaining algorithmic steps or variable purposes.
* Complete File Output: Returns the complete code with comments added, ready for immediate use.
Example: Inputting a quicksort snippet will result in the skill adding comments that explain the divide-and-conquer approach, pivot selection, and the step-by-step operation of the partition
whileloop.
Applicable Boundaries & Important Caveats
This is a highly specialized tool. Understanding its boundaries enables more efficient use:
- Focused on the Python Ecosystem: The skill's design and examples revolve around the Python language. Inputting code or problems in other languages may not yield expected results.
- Primarily for Algorithms and Scripts: It is best suited for algorithm problem-solving, data processing scripts, and utility functions—i.e., small to medium-scale code. For large engineering code involving complex state management or multi-module interactions, generated comments may not fully capture its architectural intent.
- Comments are in Chinese: Generated solution explanations and code annotations are in Chinese. If your team's working language is English, factor in the cost of secondary translation.
- Not a Code Verification Tool: Generated code is runnable but not guaranteed to be optimal for all edge cases. Complexity analysis is theoretical. Always unit-test critical logic.
- Input Quality Dictates Output Quality: Providing clear, unambiguous problem descriptions or well-structured code will yield more accurate results. Overly vague or heavily coupled code may impair comment accuracy.
Use Cases
- When solving problems on platforms like LeetCode, input the problem number or description to instantly get a complete Python solution with multiple approaches, detailed annotations, and complexity analysis.
- When inheriting an uncommented or poorly annotated piece of Python algorithm code (e.g., a colleague's implementation or an open-source snippet), paste it to automatically generate comprehensive Chinese documentation adhering to PEP 257 standards.
- When learning a new algorithmic concept like dynamic programming or graph traversal, input the algorithm name to generate a complete teaching example that includes a classic problem, clear solution walkthrough, and step-by-step code annotations.
- During technical interview preparation, input classic questions like 'Reverse Linked List' or 'LRU Cache' to quickly obtain a standard Python implementation along with the explanatory narrative expected by interviewers.
Best For
- Computer science students preparing for algorithm interviews: Need to obtain multi-solution comparisons and clear complexity analyses for practice problems to deepen understanding and prepare interview explanations.
- Developers maintaining Python data-processing or script libraries: Frequently need to quickly understand the functionality of others' or legacy code snippets and supplement them with standardized comments to ensure maintainability.
- Instructors or teaching assistants for courses on algorithms and data structures: Need to rapidly generate standardized teaching materials with detailed solution walkthroughs and code annotations for classroom examples or assignment problems.
- Junior engineers new to Python who are practicing coding to improve their skills: Require step-by-step annotated code examples during their learning process and need to convert existing practice code into readable documentation.
Related Skills
A systematic code error fixing skill that follows a five-step workflow: Reproduce, Isolate, Understand, Fix, Verify, to help developers resolve code errors.
Supports inline SVG/HTML rendering and Mermaid code output, covering common technical diagram creation like architecture and flow diagrams.
A comprehensive browser automation guide covering navigation, interaction, multi-tab management, and data collection, tailored for domestic web ecosystems and tools like Playwright/Selenium.
This skill provides end-to-end automation for WeChat Mini Program development, covering building, debugging, previewing, testing, and publishing, with integrated code quality analysis and dependency management.