# Smoke Import

> Fast sanity-check that new or edited packages import cleanly, without running a full dependency sync or test suite. Use after creating/editing a Python package's __init__.py, adding a new module to a monorepo, wiring sibling packages, or before wiring a package into a router — any time you want the cheapest possible "did I wire this up" signal.

- Skill: `jcdavis131/smoke-import` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jcdavis131/smoke-import`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jcdavis131/smoke-import/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jcdavis131 (https://skillmd.com/u/jcdavis131)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/jcdavis131/smoke-import

---


# Smoke-Import

The cheapest correctness signal in a Python monorepo is "does it import". Run it before tests, before builds, before wiring into an app. It catches broken `__init__.py`, circular imports, missing sibling packages, and typo'd module names in under a second.

## The one-liner (uv monorepo)

```bash
uv run --no-sync python -c "import sys; sys.path.insert(0, 'packages/<pkg>'); import <pkg>; print('imports ok')"
```

Why each flag earns its place:
- `--no-sync` — skip dependency resolution. You're testing import wiring, not the lockfile. Saves seconds-to-minutes per check.
- `sys.path.insert(0, ...)` — import the package straight from the tree without installing it. Lets you check a package that isn't yet a declared dependency of anything.
- `print('imports ok')` — a positive sentinel. Silence is ambiguous; an explicit string is unambiguous success.

## Multiple sibling packages at once

```bash
uv run --no-sync python -c "import sys
for p in ['packages/observability', 'packages/data-ingest']:
    sys.path.insert(0, p)
import observability, data-ingest
print('imports ok')"
```

Use this when a router or app depends on several new packages together — the cross-package wiring is what you're actually checking.

## For non-uv projects

```bash
python -c "import sys; sys.path.insert(0, 'packages/<pkg>'); import <pkg>; print('imports ok')"
```

## When to run

- After creating a new package (`packages/<pkg>/__init__.py`).
- After editing a package's top-level `__init__.py` or moving modules between packages.
- Before wiring a package into an app router or service.
- After a rename / move, before anything heavier.

## When NOT to run

- Pure data / config edits with no Python surface.
- You're about to run the test suite anyway — the import will be checked there.
- The package has heavy import-time side effects (DB connections, network) — smoke-import lies for those; prefer a targeted `pytest --collect-only`.

## Limitations

Smoke-import only checks the import graph. It does NOT execute the package's logic, does NOT validate types, and does NOT catch runtime errors inside functions. Follow with a real test for anything beyond wiring.

