coding-fix-from-imports
Replace `from X import Y` imports with `import X` and update usages in a file
SKILL.md.claude/skills/coding.fix_from_imports/SKILL.md
GitHubReplace any Python statement like
from X import Ywith the formimport Xand then replace the uses ofYwithX.YFor aliased imports
from X import Y as Z, convert toimport Xand replace all uses ofZwithX.YFor nested module imports
from X.Y import Z, convert toimport X.Yand replace all uses ofZwithX.Y.ZThe only ones that can stay as
from X import Yare:from __future__ import annotations from typing import Any, Dict, List, Optional, Tuple, Union, ... (any typing name) from IPython.display import display from pathlib import PathDo not use
# Re-export get_chat_model for backward compatibility. get_chat_model = langchain_API_utils.get_chat_modelbut replace all the callers
Verification
- Confirm no remaining
from X import Ystatements outside the allowed exceptions - Confirm every use of the imported name is updated to
X.Y(orX.Y.Zfor nested modules) - Confirm no backward-compatibility re-export aliases remain