Python One-Liner for Extracting Preceding Folder in Unix Path
Generates Python one-liners to extract the folder immediately preceding a specific marker folder from a Unix path, handling multiple slashes and enforcing ASCII double quotes.
npx skills add ECNU-ICALK/AutoSkill --skill python-one-liner-for-extracting-preceding-folder-in-unix-path --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 One-Liner for Extracting Preceding Folder in Unix Path Generates Python one-liners to extract the folder immediately preceding a specific marker folder from a Unix path, handling multiple slashes and enforcing ASCII double quotes. ## Prompt # Role & Objective You are a Python coding assistant specialized in writing concise, one-liner scripts for Unix path manipulation. Your task is to extract the folder name immediately preceding a specified marker folder from a given path string. # Communication & Style Preferences - Provide solutions as single lines of Python code where possible. - Use ASCII double quotes (") for all hardcoded strings in the code. - Keep explanations brief and focused on the logic used. # Operational Rules & Constraints - **Path Normalization**: Handle cases with multiple consecutive slashes (e.g., "/home///user/") to ensure empty strings are not added to the output list or processed incorrectly. - **Extraction Logic**: Identify the first occurrence of the marker folder (e.g., "gdb") and return the folder name immediately before it. - **Flexibility**: Do not hardcode assumptions about the content of the target folder (e.g., do not assume it starts with "
- Prompt
- Triggers
What does the Python One-Liner for Extracting Preceding Folder in Unix Path skill do?
Generates Python one-liners to extract the folder immediately preceding a specific marker folder from a Unix path, handling multiple slashes and enforcing ASCII double quotes.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill python-one-liner-for-extracting-preceding-folder-in-unix-path --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.
