AGENT SKILL

repo-development

Maintain the einops repository safely: focused tests, backend/env selection, docs and notebook checks, formatting/type checking, CI matrix interpretation, release boundaries, and staleness refresh cues.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
repo-development
license
MIT
metadata
{ "disco-role": "operating" }
description
Maintain the einops repository safely: focused tests, backend/env selection, docs and notebook checks, formatting/type checking, CI matrix interpretation, release boundaries, and staleness refresh cues.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

repo-development

Use this sub-skill when the task is about maintaining the einops repository rather than writing package-usage recipes. It covers development commands, backend-aware test selection, docs/notebook checks, README-to-docs conversion, CI interpretation, packaging boundaries, and refresh/staleness checks.

For tensor operation patterns, API examples, framework-specific user code, or named einsum/packing recipes, route to sibling sub-skills such as tensor-operations, named-einsum-and-packing, or framework-integrations.

Evidence scope

This guidance was distilled from these source-evidence names: README.md Development section, pyproject.toml, einops/tests/run_tests.py, einops/tests/__init__.py, scripts/convert_readme.py, scripts/test_notebooks.py, scripts/pytorch_examples_source/converter.py, .github/workflows/run_tests.yml, .github/workflows/test_notebooks.yml, .github/workflows/deploy_docs.yml, .github/workflows/deploy_to_pypi.yml, and mkdocs.yml.

Do not depend on machine-local checkout paths or environment-specific details. Prefer the bundled references and scripts below; if repository development files or workflows have changed since this skill was produced, perform a repo-skill refresh before relying on stale commands.

Quick routing

Maintainer intent Use this guidance
Run minimal package tests without installing all frameworks references/docs-and-tests.md and scripts/run_selected_einops_tests.py
Interpret EINOPS_TEST_BACKENDS or framework names references/docs-and-tests.md
Format, lint, or type-check changes references/docs-and-tests.md
Build or serve documentation references/docs-and-tests.md
Convert README content into docs index safely scripts/convert_readme_for_docs.py
Check notebook dependencies or execute selected tutorials references/docs-and-tests.md and scripts/notebook_execution_check.py
Understand CI matrix coverage references/docs-and-tests.md
Avoid unsafe deploy/publish steps references/docs-and-tests.md
Diagnose common maintainer failures references/maintainer-troubleshooting.md

Safe command patterns

  • Tests are distributed with the package. Use the native runner for broad checks: python -m einops.tests.run_tests numpy.
  • Include numpy with backend tests unless intentionally investigating a symbolic-only case; the README says every framework is tested against numpy.
  • Omit --pip-install when dependencies are already installed. That flag uses pip install in the current environment.
  • For a dry-run plan or a focused pytest node, use the bundled wrapper: python scripts/run_selected_einops_tests.py numpy --pytest-target test_ops.py::test_repeat_numpy. Add --execute only when ready to run.
  • For check-only style validation, prefer CI-like non-mutating commands: ruff check ., ruff format . --check, and mypy . in an environment with the default development dependencies.
  • The Hatch check script in pyproject.toml is intentionally mutating: it runs ruff format, ruff check --fix, then mypy.

Backend selection rules

  • Native runner synonyms: pytorch -> torch, tf -> tensorflow, and paddlepaddle -> paddle.
  • Exact backend names are comma-joined in EINOPS_TEST_BACKENDS, for example EINOPS_TEST_BACKENDS=numpy,torch.
  • Missing EINOPS_TEST_BACKENDS is an error for tests that call the package test utilities directly. The native runner and bundled wrapper set it for you.
  • Optional frameworks can conflict in one environment, especially TensorFlow, OneFlow, and Paddle protobuf stacks. Use a smaller backend set or a fresh environment instead of repairing a shared environment blindly.

Docs and notebook safety

  • hatch run docs:build and hatch run docs:serve first convert README content into the docs index, so they can mutate generated docs content.
  • Use scripts/convert_readme_for_docs.py --readme README.md --output docs_src/index.md for a dry-run preview; add --execute only when the mutation is intended.
  • Notebook execution needs notebook tooling plus runtime frameworks. CI installs nbformat, nbconvert, jupyter, pillow, pytest, numpy, tensorflow, and CPU torch before running notebook tests.
  • Use scripts/notebook_execution_check.py to list missing dependencies and, if approved, execute named notebooks with --execute and a bounded timeout.

CI and release boundaries

  • Test CI runs Python 3.10, 3.11, and 3.13 for the main backend bundle numpy pytorch tensorflow jax mlx.core, plus pytensor on Python 3.10 and 3.13.
  • CI ruff compliance uses a check-only form: ruff check . and ruff format . --check.
  • Docs deploy is a GitHub workflow with repository write permission and a force deploy command. Treat it as credentialed infrastructure, not a local maintainer default.
  • PyPI deploy is triggered by a GitHub release and uses UV_PUBLISH_TOKEN from a secret. Local uv publish commands are outside this sub-skill except as a boundary warning.
  • Safe packaging inspection may run build-only commands in an isolated release rehearsal, but never run credentialed publish/deploy steps unless the human maintainer explicitly owns the credentials and authorizes that action.

Refresh and staleness cues

Refresh this sub-skill if any of these maintainer surfaces change: supported Python version, Hatch envs or scripts, native test runner semantics, backend synonyms, EINOPS_TEST_BACKENDS parsing, notebook execution script, README docs conversion, mkdocs configuration, CI matrices, or docs/PyPI deploy workflows.

Bundled files

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351