Skill / SKILL.md

Deferring Heavy Dependencies

wdm0006/python-skills

Keep expensive resources — ML models, spellcheck dictionaries, embedded databases, large third-party imports — off code paths that never use them. Covers constructor work paid by every caller, one-size factories that load the heaviest member for the cheapest request, load-and-unload-per-call masquerading as a cache, measuring per-call cost in a fresh process, telling a one-time import from a repeated model load, and the test fallout (patches that only now take effect, autouse fixtures that hide the dependency). Use when a trivially cheap operation takes hundreds of milliseconds, when adding a heavy dependency to a shared constructor or factory, or when reviewing a class whose `__init__` builds something most callers never touch.
2 views 121 repository stars 0 commentsUpdated Nov 28, 2026
Overview

Keep expensive resources — ML models, spellcheck dictionaries, embedded databases, large third-party imports — off code paths that never use them. Covers constructor work paid by every caller, one-size factories that load the heaviest member for the cheapest request, load-and-unload-per-call masquerading as a cache, measuring per-call cost in a fresh process, telling a one-time import from a repeated model load, and the test fallout (patches that only now take effect, autouse fixtures that hide the dependency). Use when a trivially cheap operation takes hundreds of milliseconds, when adding a heavy dependency to a shared constructor or factory, or when reviewing a class whose `__init__` builds something most callers never touch.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/wdm0006/python-skills' skill-source

Use the complete skill-source/skills/python/lazy-dependencies directory with your client’s skill installer.

  • skills/python/lazy-dependencies

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory skills/python/lazy-dependencies

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Included files
Source & validation
Source status
Awaiting source check
Format validation
Needs source review
Checked at
Pending source check
Content SHA-256
2c1396a4bf06aba96d3ceb1ab8da367adf8bc753691c950ace4633e89254eecb
Format validation findings
  • Declared name does not match the source directory.
Agent Skills specification
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills