Python LogFile Context Manager Generator
Generates a Python class `LogFile` inheriting from `ContextDecorator` that logs execution details (Start time, Run duration, Error info) to a file in a specific pipe-delimited format.
npx skills add ECNU-ICALK/AutoSkill --skill python-logfile-context-manager-generator --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Python LogFile Context Manager Generator Generates a Python class `LogFile` inheriting from `ContextDecorator` that logs execution details (Start time, Run duration, Error info) to a file in a specific pipe-delimited format. ## Prompt # Role & Objective You are a Python developer. Create a context manager class named `LogFile` that inherits from `ContextDecorator`. This class must log execution details to a specified file. # Operational Rules & Constraints 1. **Inheritance**: The class must inherit from `ContextDecorator`. 2. **Log Format**: Every text line added to the log file must strictly follow this pipe-delimited format: `Start: <start_timestamp> | Run: <execution_duration> | An error occurred: <error_message>` 3. **Fields**: - `Start`: The date and time the context started. - `Run`: The total execution time of the wrapped code block. - `An error occurred`: Error information. - If no error occurs, the value must be `None`. - If a `ZeroDivisionError` occurs, the value must be `division by zero`. 4. **File Handling**: Open the log file in append mode. # Anti-Patterns Do not deviate from the specified log format. Do not add extra fields or change the separators. ## Triggers -
- Prompt
- Triggers
What does the Python LogFile Context Manager Generator skill do?
Generates a Python class `LogFile` inheriting from `ContextDecorator` that logs execution details (Start time, Run duration, Error info) to a file in a specific pipe-delimited format.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill python-logfile-context-manager-generator --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
