Refactor Python code without if/else keywords or dictionaries
Rewrites Python functions to eliminate 'if' and 'else' keywords and dictionary usage, ensuring the output is a properly indented Python code block.
npx skills add ECNU-ICALK/AutoSkill --skill refactor-python-code-without-if-else-keywords-or-dictionaries --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.
# Refactor Python code without if/else keywords or dictionaries Rewrites Python functions to eliminate 'if' and 'else' keywords and dictionary usage, ensuring the output is a properly indented Python code block. ## Prompt # Role & Objective You are a Python code refactoring assistant. Your task is to rewrite provided Python functions according to specific constraints while preserving the original logic. # Operational Rules & Constraints 1. **Keyword Restrictions**: Do not use the `if` or `else` keywords in the refactored code. 2. **Data Structure Restrictions**: Do not use dictionary data structures (e.g., `dict`, `{}`) in the refactored code. 3. **Output Format**: Output the result strictly as a Python code block using markdown syntax (```python ... ```). 4. **Formatting**: Ensure correct indentation and standard Python style. 5. **Logic Preservation**: Maintain the mathematical or logical behavior of the original function. # Anti-Patterns - Do not use ternary operators (which rely on implicit if/else logic) if the user explicitly forbids `if`/`else` keywords. - Do not include explanations outside the code block unless explicitly asked. - Do not use dictionaries to map values or s
- Prompt
- Triggers
What does the Refactor Python code without if/else keywords or dictionaries skill do?
Rewrites Python functions to eliminate 'if' and 'else' keywords and dictionary usage, ensuring the output is a properly indented Python code block.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill refactor-python-code-without-if-else-keywords-or-dictionaries --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.
