用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/bobmatnyc/claude-mpm --skill toolchains-python-core命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
MCP (Model Context Protocol) - Build AI-native servers with tools, resources, and prompts. TypeScript/Python SDKs for Claude Desktop integration.
Model Context Protocol (MCP) server build and evaluation guide, including local conventions for tool surfaces, config, and testing
Control monitoring server and dashboard
基于 SOC 职业分类
正在显示 SKILL.md
| name | toolchains-python-core |
| description | Python 3.13+ core patterns for minimalism, efficiency, code reuse, and performance |
| version | 1.0.0 |
| category | toolchains-python |
| tags | ["python","patterns","performance","minimalism","efficiency"] |
| effort | medium |
Modern Python development patterns targeting 3.13+ for minimal, efficient, reusable, and performant code.
New code: Use @dataclass(slots=True) for data classes, PEP 695 generics (def first[T](...)), Protocol for structural typing, TaskGroup for async concurrency.
Performance: Profile first with py-spy or scalene. Use generators for single-pass iteration, set for membership tests, connection pooling for I/O.
:=) in while-loops and comprehension filters to eliminate duplicate calls — avoid in deeply nested expressionsmatch/case over if-elif chains for structural/type dispatch; powerful with dataclass destructuring@dataclass(frozen=True) for value objects, @dataclass(slots=True) for memory savings (~200 bytes/instance)NamedTuple for lightweight immutable records; dataclass when you need defaults, mutability, or methodsfield(default_factory=list) for mutable defaults — never def f(items=[])dict.get(key, default) over if key in dict for simple lookupscontextlib.suppress(Exception) instead of empty try/except/pass__slots__ or @dataclass(slots=True) reduces per-instance memory by 200+ bytesset for membership testing (O(1) vs O(n) for lists), frozenset for hashable setsstr.join() over += for string building; f-strings over .format() (fastest string formatting)itertools for composable lazy iteration: chain, islice, groupby, batched (3.12+)memoryview for zero-copy binary slicing on large buffers@functools.lru_cache / @functools.cache (3.9+) for memoization of pure functionscollections.deque for O(1) append/pop from both ends; defaultdict to avoid key existence checksexecutemany() or bulk inserts, never N+1 loopsisinstance() enforcementfunctools.partial for specialization without subclassingfunctools.cached_property for one-time expensive computed attributes (thread-safe in 3.12+)typing.overload for functions with type-dependent return signaturesdef first[T](lst: list[T]) -> T: replaces TypeVar boilerplate (60% reduction)type statement (3.12+): type Vector = list[float] replaces TypeAliasTypeIs (3.13) preferred over TypeGuard — narrows both branches of conditionalTaskGroup (3.11+) replaces asyncio.gather() — structured concurrency with auto-cancellation on failureexcept* (3.11+) for handling ExceptionGroup from concurrent failuresCancelledError; call task.result() outside the async with blocktomllib in stdlib (3.11+) for TOML parsing — no external dependency neededReadOnly TypedDict items (3.13) for immutable typed dict fieldscProfile for call counts, py-spy/scalene for line-level profiling, tracemalloc for memory leaksTaskGroup for structured async I/O concurrency; ProcessPoolExecutor for CPU-bound offloadingselectinload() in SQLAlchemyuvloop for 2-4x async event loop throughput (drop-in replacement for asyncio loop)list(range(n)), bytearray(n)global lookups in tight loops — assign to local variable firstmypy --strict for new projects; gradual adoption with --disallow-untyped-defs for existingProtocol for structural subtyping — don't force users to inherit from your base classParamSpec + Concatenate for typing decorators that modify function signaturesSelf type (3.11+) for fluent method chaining returnsTypedDict for typed dictionaries with known keys; Unpack for kwargs typingdef f(items=[]) — shared across callsexcept: — catches KeyboardInterrupt, SystemExit; use except Exception:eval() / exec() on untrusted input — injection vulnerabilityNone, sometimes value — use Optional[T] explicitlyisinstance() chains instead of polymorphism or match/casewith statements for file/connection/lock resources@property getters that just return an attribute