一键导入
symusic-code-style
// Encodes symusic's engineering taste across C++ core, nanobind bindings, and Python-facing APIs. Use when implementing or reviewing features to preserve performance-first architecture and ergonomic, predictable interfaces.
// Encodes symusic's engineering taste across C++ core, nanobind bindings, and Python-facing APIs. Use when implementing or reviewing features to preserve performance-first architecture and ergonomic, predictable interfaces.
Decision framework for selecting and evolving third-party dependencies in symusic across C++, Python packaging, bindings, testing, and docs.
Configure and use automated code quality tools (ruff, mypy, pre-commit) for scientific Python projects. Covers linting rules, type checking configuration, formatting, and CI integration.
Create and publish distributable scientific Python packages following Scientific Python community best practices. Covers pyproject.toml, src layout, Hatchling, metadata, CLI entry points, and PyPI publishing.
Write and organize tests for scientific Python packages using pytest. Covers fixtures, parametrization, numerical testing with NumPy utilities, property-based testing with Hypothesis, and CI integration.
| name | symusic-code-style |
| description | Encodes symusic's engineering taste across C++ core, nanobind bindings, and Python-facing APIs. Use when implementing or reviewing features to preserve performance-first architecture and ergonomic, predictable interfaces. |
| metadata | {"domain":"symusic","role":"project-specific-style-guide","scope":"implementation-and-review","output-format":"checklist-and-rationale"} |
Use this skill whenever a change touches src/, include/, py_src/, python/symusic/, or tests/.
Performance is a product feature, not an optimization pass.
src/, include/) and expose them through thin nanobind layers.API symmetry beats cleverness.
foo() + foo_inplace() dual interface.Tick, Quarter, Second) and container types (Note, Track, Score).Type-level correctness should be explicit at boundaries.
Cross-language predictability is mandatory.
Readable systems code over minimalist one-liners.
include/, src/)C++20, no compiler extensions).i32, vec, shared, pyvec) consistently instead of mixing raw STL usage styles.copy, deepcopy, non-inplace transforms) and keep deep-copy semantics explicit.close_enough, ge_or_close) and step derivation logic.py_src/bindings/)MEM_LEAK_WARNING) behind build flags rather than ad-hoc runtime branches.python/symusic/)TypeError for wrong object kind, ValueError for invalid value domain).tests/ + pyproject.toml)inplace and non-inplace API symmetry where relevant?tick/quarter/second) consistent and explicitly handled?