Install
$ agentstack add skill-npow-claude-skills-build-python-library ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Build Python Library
Implements pip-installable Python libraries by scaffolding the project structure, building core abstractions with adapters, and verifying each module with pytest before proceeding.
Workflow
- Scaffold the project — create src layout, pyproject.toml, package structure, and py.typed marker. See [SCAFFOLDING.md](SCAFFOLDING.md).
- Define the public API — write
__init__.pywith explicit exports and__all__. Only types and functions users need. See [SCAFFOLDING.md](SCAFFOLDING.md). - Implement core abstractions — build protocols/ABCs, data classes, and shared types that all concrete implementations depend on. See [PATTERNS.md](PATTERNS.md).
- Test core abstractions — write pytest tests for core types and protocols. Run
pytestand verify zero failures before proceeding. See [TESTING.md](TESTING.md). - Implement concrete modules — build one module at a time (proxy wrappers, provider clients, adapters). See [PATTERNS.md](PATTERNS.md).
- Test each module before the next — write tests for the module just implemented. Run
pytestand verify zero failures before starting the next module. See [TESTING.md](TESTING.md). - Install and verify — run
pip install -e ".[dev]"and verify the package imports correctly from a clean script. See [TESTING.md](TESTING.md). - Run full test suite — run
pytest -vand verify all tests pass, then runpython -c "from packagename import ..."to verify public API. See [TESTING.md](TESTING.md).
Self-review checklist
Before delivering, verify ALL:
- [ ] Project uses src layout:
src/packagename/notpackagename/at root - [ ]
pyproject.tomlexists with[build-system],[project], and[project.optional-dependencies] - [ ]
py.typedmarker file exists in the package directory - [ ]
__init__.pyhas explicit__all__listing only public names - [ ] Every public function and class has a type-hinted signature (all parameters and return type)
- [ ] Every module has a corresponding test file (
src/pkg/foo.py→tests/test_foo.py) - [ ]
pytest -vpasses with zero failures - [ ]
pip install -e ".[dev]"succeeds - [ ]
python -c "from packagename import ..."imports all public API names without error - [ ] No third-party imports in core modules that lack a corresponding optional dependency group
- [ ] Proxy/wrapper classes delegate unknown attributes via
__getattr__to the wrapped object
Golden rules
Hard rules. Never violate these.
- Src layout always. Every project uses
src/packagename/structure. Never place the package at the repository root. This prevents accidental imports from the source directory instead of the installed package. - Test before you proceed. Never implement module N+1 until module N has passing tests. Run
pytestafter each module. This catches integration errors early instead of at the end. - Explicit public API.
__init__.pymust define__all__and import only the names users need. Internal modules start with underscore (_internal.py) or live in a_private/subdirectory. Never expose implementation details. - Type hints on every signature. Every function parameter and return type must have a type annotation. Use
Protocolfor duck-typed interfaces, notABCunless you need shared implementation. - Optional dependencies in extras. Third-party framework imports (langchain, chromadb, openai) must be in
[project.optional-dependencies]groups and imported lazily with try/except at usage point, not at module top level. - Proxy delegates everything. Wrapper classes must implement
__getattr__to forward unknown attribute access to the wrapped object. Never enumerate and re-implement every method — the proxy must work with future methods the wrapped library adds.
Reference files
| File | Contents | |------|----------| | [SCAFFOLDING.md](SCAFFOLDING.md) | Project structure template, pyproject.toml template, __init__.py patterns, py.typed setup | | [PATTERNS.md](PATTERNS.md) | Proxy/wrapper pattern, provider-agnostic interfaces, async/sync dual support, lazy imports | | [TESTING.md](TESTING.md) | pytest configuration, fixture patterns, mocking external services, test-per-module workflow, install verification |
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: npow
- Source: npow/claude-skills
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.