Install
$ agentstack add skill-lugassawan-swe-workbench-language-python Open-source listing, not yet scanned by AgentStack. Follow the source repository for install instructions.
Security review
⚠ Flagged1 finding(s); flagged for manual review. · v0.1.0 How review works →
- • Prompt-injection patterns
- • Secret / credential exfiltration
- • Dangerous shell & filesystem operations
- • Untrusted network calls
- • Known-malicious package signatures
- high Dangerous shell/eval execution.
What it can access
- ● Network access Used
- ● Filesystem access Used
- ● Shell / process execution Used
- ✓ 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.
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
Python
Type hints
- Annotate all function signatures;
Anyis a smell unless at a genuine boundary. - Use
dataclassfor data containers with behavior;TypedDictfor dict-shaped data at boundaries. - Prefer
Protocolover ABC when duck typing suffices — no inheritance required. from __future__ import annotationsfor forward refs in 3.9 and earlier.
from dataclasses import dataclass, field
@dataclass
class Order:
id: str
items: list[str] = field(default_factory=list)
total: float = 0.0
Errors and exceptions
- Use exceptions for exceptional paths, not flow control.
- Raise specific subclasses; catch the narrowest class you can handle.
except Exception:is almost always wrong — at minimum log and re-raise.contextlib.suppress(SomeError)for intentional ignore; bareexcept:never.
try:
result = load(path)
except FileNotFoundError:
raise MissingConfigError(path) from None
Context managers
withfor any resource with a cleanup obligation: files, locks, DB connections.@contextlib.contextmanagerfor ad-hoc managers without a full class.- Never hold a resource longer than the
withblock.
@contextlib.contextmanager
def managed_resource():
r = acquire()
try:
yield r
finally:
release(r)
Generators and iterators
- Prefer generators over materializing full lists when you only iterate once.
yield fromto delegate to sub-generators.- Reach for
itertoolsbefore writing loops:chain,islice,groupby,product.
def read_chunks(path: Path, size: int = 4096):
with open(path, "rb") as f:
while chunk := f.read(size): # walrus operator, 3.8+
yield chunk
Concurrency
- GIL caveat: threads don't parallelize CPU-bound work — use
ProcessPoolExecutorormultiprocessing. asynciofor IO-bound concurrency;asyncio.TaskGroup(3.11+) for structured fan-out.ThreadPoolExecutorfor legacy sync IO or blocking C extensions.- One event loop per process; never nest or mix loops.
async def fetch_all(urls: list[str]) -> list[str]:
async with asyncio.TaskGroup() as tg:
tasks = [tg.create_task(fetch(u)) for u in urls]
return [t.result() for t in tasks]
Pattern matching (3.10+)
Use match for structural dispatch on data shapes; avoid it as a glorified if/elif chain.
match command:
case {"action": "move", "direction": dir}:
move(dir)
case {"action": "quit"}:
quit()
case _:
raise ValueError(f"unknown command: {command}")
Dependencies and packaging
pyproject.tomlis the standard — nosetup.pyin new projects.uvfor fast installs;poetryfor lockfile publishing workflows.- Pin transitive deps via lockfile (
uv.lock,poetry.lock) in applications; use version ranges in libraries. - Always isolate with a virtualenv — never install into the system Python.
Tooling
- Imports:
ruff check --select I --fix - Format:
ruff format/black . - Lint:
ruff check(+mypyfor types) - Test:
pytest(see Testing below)
Testing
pytestoverunittest— fixtures, parametrize, and plugins make it richer.@pytest.mark.parametrizeinstead of loops inside tests.unittest.mock.patchfor external boundaries only; don't mock internals.pytest-asynciofor async tests;respxorhttpxmock transport for HTTP clients.
@pytest.mark.parametrize("a, b, expected", [(1, 2, 3), (0, 0, 0)])
def test_add(a, b, expected):
assert add(a, b) == expected
Performance
- Profile before optimizing:
cProfilefor CPU hotspots,tracemallocfor memory. py-spysamples live processes without code changes.- C extensions (
cffi,Cython) only after profiling confirms a Python bottleneck. - Cache attribute lookups in tight loops:
fn = obj.methodoutside the loop.
Avoid
- Mutable default arguments (
def f(x=[])— useNone, assign inside). from module import *— pollutes namespace, breaks static analysis.global/nonlocalexcept in narrow closures.- Broad
try/exceptblocks that swallow errors silently. subprocess.run(shell=True)with user-controlled input — use the list form.- Reimplementing what
itertools,functools, orcollectionsalready provide.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: lugassawan
- Source: lugassawan/swe-workbench
- License: MIT
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.