Operating guide for autonomous coding agents in this repository. Use this file as the default runbook for setup, validation, coding style, and PR readiness.
- Project:
nicholassynovic.github.io - Type: Sphinx static site/blog
- Python target:
~=3.13 - Dependency manager:
uv - Build backend:
hatchling - Main source directory:
src/ - Generated outputs:
build/,dist/ - CI workflow:
.github/workflows/build.yml
src/conf.py: Sphinx config and theme optionssrc/index.rst: homepagesrc/blog_posts/: blog contentsrc/papers/: paper/publication contentsrc/_static/: CSS, JS, images, and downloadable assetssrc/_templates/: Sphinx template overrides.pre-commit-config.yaml: lint/format hooks.editorconfig: formatting baseline.github/CONTRIBUTING.md: contribution processMakefile: common command entry points
- Install Python 3.13 and
uv. - Sync dependencies:
uv sync - Optional bootstrap:
make create-dev - Optional hook install:
pre-commit install
- Preferred local build:
make build - CI-style build:
uv run sphinx-build --write-all src build - Verbose/clean build:
uv run sphinx-build -vvv --write-all --fresh-env src build
- Local live preview:
make serve - Equivalent direct command:
uv run sphinx-autobuild src build
- All hooks on all files:
pre-commit run --all-files - Hooks on changed files only:
pre-commit run - Run one hook example:
pre-commit run markdownlint-cli2 --all-filespre-commit run mdformat --all-files
There is currently no tests/ directory.
If tests are added (recommended: pytest), use:
- Full suite:
uv run pytest -q - Single test file:
uv run pytest tests/test_example.py -q - Single test case:
uv run pytest tests/test_example.py::test_case_name -q - Name filter:
uv run pytest -k "keyword" -q
If pytest is missing, add it to development dependencies before relying on these.
Run in this order:
uv syncpre-commit run --all-filesmake build- Optional visual check:
make serve
Prefer existing local style first. When no precedent exists, follow these conventions.
From .editorconfig:
- End-of-line: LF
- Final newline: required
- Charset: UTF-8
- Trim trailing whitespace: enabled by default
- Python indentation: 4 spaces
- Markdown indentation: 2 spaces
- YAML indentation: 2 spaces
- JSON indentation: 4 spaces
- reStructuredText indentation: 3 spaces
- Makefile indentation: tabs
Notes:
- JSON overrides trimming (
trim_trailing_whitespace = false). - Preserve surrounding style when editing mixed-content docs.
- Keep code explicit, readable, and moderately small in scope.
- Add docstrings for non-trivial modules/functions.
- Prefer deterministic behavior over hidden side effects.
Imports:
- Group order: standard library, third-party, local.
- Use one blank line between groups.
- Prefer absolute imports.
- Remove unused imports in touched files.
Types:
- Add type hints for new functions and non-obvious variables.
- Prefer built-in generics (
list[str],dict[str, int]). - Avoid
Anyunless unavoidable.
Naming:
snake_case: functions, methods, variablesPascalCase: classesUPPER_SNAKE_CASE: constants- Prefer descriptive names over abbreviations
Error handling:
- Fail fast on invalid states using clear exceptions.
- Catch specific exceptions where possible.
- Avoid broad
except Exceptionunless re-raising with context. - Keep error messages actionable and concrete.
Logging/diagnostics:
- Keep messages concise and useful.
- Avoid noisy debug output in committed code.
- Keep heading hierarchy and spacing consistent in
*.rst. - Use concise, descriptive section titles.
- Prefer explicit links/references.
- Match the tone and structure of nearby content.
- For Markdown, use fenced code blocks with language tags when possible.
- Keep key ordering stable and logical when practical.
- Avoid unnecessary quoting.
- Respect
.editorconfigindentation/whitespace rules.
- CI runs on Ubuntu with Python 3.13.
- Dependencies are installed using
uv sync. - CI build step uses
./.venv/bin/sphinx-build --write-all src build. - Changes that break Sphinx build are considered blockers.
From .github/CONTRIBUTING.md:
- Open or identify an issue.
- Create branch
issue-<number>frommain. - Keep changes scoped to that issue.
- Open PR to
mainwith closing keywords (Closes #<n>,Fixes #<n>, etc.).
Configured hooks include checks for:
- Large files, case conflicts, merge conflicts, symlink issues
- JSON/TOML/XML/YAML validity
- Private keys and debug statements
- Trailing whitespace and final newline normalization
- Markdown linting via
markdownlint-cli2 --fix - Markdown formatting via
mdformat
Assume hooks may run both locally and in CI.
Checked locations:
.cursorrules.cursor/rules/.github/copilot-instructions.md
Current status: none of these files are present in this repository. If these files are added later, treat them as high-priority agent instructions and update this document.
- Prefer minimal, targeted diffs.
- Do not commit generated artifacts from
build/ordist/unless explicitly requested. - Keep changes aligned with the existing
src/architecture. - Prefer commands already used in
Makefile, CI, and tool configs. - If tests or tooling change, update this file (especially single-test guidance).