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.
pyserialis the only one. Optional packages go in[project.optional-dependencies]. - Keep the Python side of the visualiser on the standard library. Keep
viz/index.htmlfree 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 indocs/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/ordocs/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.
Code map
Section titled “Code map”| 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. |
Checks
Section titled “Checks”Run these commands before you finish. All of them must pass.
uv run ruff checkuv run ruff format --checkuv run pytestnpm --prefix docs ci && npm --prefix docs run buildCommon tasks
Section titled “Common tasks”Add a feature
Section titled “Add a feature”- Add the code in
src/eskin/. - Add tests in
tests/. Useencode_frame()and the fake serial classes intests/test_reader.py. - Describe the feature in the user guide in both languages.
- Run the checks.
- Ask the user to do the hardware check in “Test with hardware” on the Contributing page.
Add a documentation page
Section titled “Add a documentation page”- Create the page with the same file name in both language trees.
- Add the page to the sidebar in
docs/astro.config.mjs, with the Chinese label. - Run
uv run pytest tests/test_docs.pyand build the site.
Release a version
Section titled “Release a version”- Change
versioninpyproject.toml. - Run the checks.
- Tell the user to push the tag
v<version>. Do not push tags yourself.