Skip to content

Change the repository

This page is for an agent that changes the code or the documentation in this repository.

  • Write all comments and docstrings in English. Use type hints in new code.
  • Do not add a runtime dependency. pyserial is the only one. Optional packages go in [project.optional-dependencies].
  • Keep the Python side of the visualiser on the standard library. Keep viz/index.html free of a build step.
  • In background mode, read the serial port only on the reader thread. Give work to it through a request, as calibrate() does.
  • Do not add recording or file output to the package.
  • When you change a page in docs/src/content/docs/, make the same change in docs/src/content/docs/zh/. Do the same in the other direction.
  • Write the Chinese text as original Chinese. Do not translate sentence by sentence.
  • Do not commit files from docs/internal/, docs/dist/ or docs/node_modules/.
  • Change the version only in pyproject.toml.
  • If no user is present, do not run commands that open the serial port (eskin stream, eskin viz). Use the tests.
Path Content
src/eskin/protocol.py Wire format constants and FrameParser. No I/O.
src/eskin/reader.py EskinReader and port discovery.
src/eskin/frame.py The Frame dataclass.
src/eskin/cli.py The eskin command.
src/eskin/viz/ The web server and the page of the visualiser.
tests/ Tests with a fake serial port. test_docs.py checks that the two languages have the same pages.
docs/ The Astro site. English pages in src/content/docs/, Chinese pages in src/content/docs/zh/.
.github/workflows/ CI, release and deployment.

Run these commands before you finish. All of them must pass.

Terminal window
uv run ruff check
uv run ruff format --check
uv run pytest
npm --prefix docs ci && npm --prefix docs run build
  1. Add the code in src/eskin/.
  2. Add tests in tests/. Use encode_frame() and the fake serial classes in tests/test_reader.py.
  3. Describe the feature in the user guide in both languages.
  4. Run the checks.
  5. Ask the user to do the hardware check in “Test with hardware” on the Contributing page.
  1. Create the page with the same file name in both language trees.
  2. Add the page to the sidebar in docs/astro.config.mjs, with the Chinese label.
  3. Run uv run pytest tests/test_docs.py and build the site.
  1. Change version in pyproject.toml.
  2. Run the checks.
  3. Tell the user to push the tag v<version>. Do not push tags yourself.