Skip to content

Commit bc7a43f

Browse files
committed
chore: set up AI assistance by providing AGENTS.md and update-dependencies skill
1 parent 0cc1f48 commit bc7a43f

4 files changed

Lines changed: 186 additions & 14 deletions

File tree

.agents/research.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Its core purpose is not just to wrap HTTP endpoints, but to hide a number of inc
1111

1212
The project is fairly mature in terms of developer ergonomics: it has strong documentation, broad automated tests, typed Pydantic models, linting/type-checking/security checks, and CI across Python 3.10 to 3.14. The main architectural weakness is concentration of logic in large modules, especially the CLI module. There are also a few places where runtime `assert` statements are used as correctness guards, which is less robust than explicit error handling.
1313

14+
The package version is managed in `pyproject.toml`; the repository is on the `0.2.0.dev9` development line.
15+
1416
## What The Project Does
1517

1618
At a high level, this repository provides a stable and scriptable interface around Varvis for:
@@ -67,6 +69,8 @@ The package entry point is simple:
6769
- `src/varvis_connector/__main__.py` creates `VarvisCLI` and runs it
6870
- `src/varvis_connector/__init__.py` re-exports `VarvisClient` and package version
6971

72+
The package metadata in `pyproject.toml` is set up for public distribution. It includes README, author, GPL-3.0-only license metadata, license file declaration, keywords, PyPI classifiers for Python 3.10 through 3.14, and project URLs for homepage, hosted documentation, repository, issues, and changelog.
73+
7074
## Runtime Architecture
7175

7276
### 1. Main abstraction: `VarvisClient`
@@ -614,14 +618,9 @@ The docs are good and materially useful.
614618

615619
The development guide is better than average because it explains not only how to contribute, but why the code contains certain defensive logic.
616620

617-
### Documentation mismatch observed
618-
619-
The development docs mention workflow filenames `docs.yaml` and `release.yaml`, but the repository currently contains:
620-
621-
- `build_and_release.yaml`
622-
- no `docs.yaml`
621+
### Documentation publishing
623622

624-
So at least part of the development documentation is stale relative to the current workflow file names.
623+
The documentation is published through the `docs.yaml` workflow and hosted on GitHub Pages. Production releases trigger the release orchestration workflow, which builds the package and then calls the docs workflow to publish the generated Sphinx documentation.
625624

626625
## CI / Release / Maintenance Workflow
627626

@@ -633,6 +632,7 @@ The project uses:
633632

634633
- `uv` for environment and dependency management
635634
- `uv_build` as build backend
635+
- Pydantic, requests, and tqdm as runtime dependencies
636636
- Ruff for linting/formatting
637637
- basedpyright for type checking
638638
- Bandit for security linting
@@ -650,22 +650,34 @@ The repository contains workflows for:
650650
- scheduled dependency update issue/branch creation
651651
- gitleaks secret scanning
652652
- build/release orchestration
653+
- documentation publishing to GitHub Pages
653654

654655
### Interesting maintenance choices
655656

656657
- tests and code quality run across Python 3.10 to 3.14
657658
- tests intentionally serialize CI concurrency to reduce load on the Varvis server
658659
- dependency updates are partially automated through a scheduled workflow that opens an issue, creates a branch, updates `uv.lock`, and pushes a commit
659660
- `git-cliff` is used both for changelog generation and for conventional-commit enforcement
661+
- `uv` uses a seven-day dependency cooldown through `exclude-newer`, with a package-specific exception for `pip`
662+
- gitleaks ignores version-tag push events as a standalone workflow trigger because the release orchestration workflow calls it explicitly for releases
663+
- pre-commit mirrors the main local quality gates, including Ruff, Bandit, basedpyright, shellcheck, markdown formatting, and project-local commit/changelog checks
660664

661665
### Release state
662666

663-
The release workflow is not fully implemented yet:
667+
The release workflow is fully responsible for package publication on version tags.
668+
669+
`build_and_release.yaml` runs on tags matching `v*.*.*`. It gates releases with gitleaks and dependency audit for all tags. Non-development tags additionally require code quality and tests. Development tags containing `.dev` can build and publish after the security-oriented gates without running the full code quality and test gate inside the release workflow.
670+
671+
The build job creates wheel and source distributions with `make build`, derives the package version from the tag name, and uploads the `dist/` directory as a workflow artifact.
672+
673+
Publication is split by tag type:
664674

665-
- GitHub release publishing step is currently `echo "TODO"`
666-
- PyPI publishing step is also `echo "TODO"`
675+
- non-development tags publish artifacts to GitHub Releases
676+
- non-development tags publish to PyPI through trusted publishing/OIDC
677+
- development tags publish to TestPyPI
678+
- all successful release builds trigger the documentation workflow for GitHub Pages
667679

668-
So the repository has strong scaffolding for release automation, but not a fully completed publishing pipeline.
680+
GitHub release notes are generated from the current top section of `CHANGELOG.md`, and the release assets include both wheel and source distribution files.
669681

670682
## Code Quality Assessment
671683

@@ -718,9 +730,9 @@ This is not fatal, but it is a tradeoff toward operator convenience over interna
718730

719731
Many command handlers call `exit(1)` directly. Others rely on the top-level `VarvisCLI.run()` exception trap. The result is a somewhat mixed control-flow style.
720732

721-
#### Minor stale docs / naming drift
733+
#### Release workflow complexity
722734

723-
There are a few documentation/workflow naming mismatches, which suggests the documentation is maintained actively but not perfectly synchronized with recent automation changes.
735+
The release workflow is one of the higher-risk pieces of repository automation. It coordinates security gates, optional quality/test gates for development tags, package artifact upload/download, GitHub Release publication, PyPI/TestPyPI publication, changelog extraction, and documentation publishing. Small YAML changes here can affect published artifacts directly.
724736

725737
## Specific Findings And Nuances Worth Remembering
726738

@@ -731,7 +743,7 @@ There are a few documentation/workflow naming mismatches, which suggests the doc
731743
- The CLI is intentionally pipeline-friendly and carefully avoids polluting stdout when data output is expected there.
732744
- Virtual panel update performs client-side merge behavior by fetching the current remote panel first.
733745
- File download handling has decent filename/path safety checks.
734-
- The project currently looks like an initial public release with mature tooling but a short external changelog history.
746+
- The project is an early but actively publishable package line, with mature tooling and an implemented release pipeline rather than only local build support.
735747

736748
## Suggested Reading Order For Future Work
737749

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
name: update-dependencies
3+
description: Update all dependencies in the current project, including Python packages in `uv.lock` and pre-commit hook revisions in `.pre-commit-config.yaml`. Use when the user asks to "update dependencies", "update all dependencies", refresh the lockfile, refresh pre-commit hooks, or bring direct dependency minimum versions in `pyproject.toml` up to the versions actually adopted after an update.
4+
---
5+
6+
# Update Dependencies
7+
8+
## Overview
9+
10+
Update this repository's dependencies with the project's own automation, validate the result end to end, fix small breakages, and roll back only the dependency updates that are not worth fixing. Keep the final state intentional and report exactly what changed.
11+
12+
## Workflow
13+
14+
1. Read `AGENTS.md`, `.agents/research.md`, `pyproject.toml`, `Makefile`, and `.pre-commit-config.yaml` before making changes.
15+
2. Capture the starting state for later reporting:
16+
- direct dependencies from `pyproject.toml`
17+
- optional dependencies and dependency groups from `pyproject.toml`
18+
- pre-commit hook revisions from `.pre-commit-config.yaml`
19+
- current version pins in `uv.lock` for direct dependencies if needed
20+
3. Run the project's update command:
21+
22+
```bash
23+
make depupgrade
24+
```
25+
26+
1. Inspect which files changed. Expect at least:
27+
- `uv.lock`
28+
- `.pre-commit-config.yaml`
29+
- sometimes `pyproject.toml`
30+
2. Update minimum versions in `pyproject.toml` for direct dependencies that were actually upgraded.
31+
- Only change direct dependencies already listed in `pyproject.toml`.
32+
- Do not add or remove dependencies unless the update flow clearly requires it.
33+
- Keep version specifiers simple and consistent with the file's current style, usually `>=<new_version>`.
34+
3. Run the full validation flow after the update.
35+
4. If validation fails, fix small compatibility issues directly.
36+
5. If a failure is caused by one updated dependency and the fix is too large for the update task, roll back only that dependency update, then rerun validation.
37+
6. Summarize all dependency changes and any rollback decisions.
38+
7. Update `.agents/research.md` if the repository-specific dependency update workflow or skill inventory changed in a way future work should know about.
39+
40+
## Validation
41+
42+
Load environment variables from `.env` before validation commands that need them.
43+
44+
Run the full repo checks expected for non-trivial code changes:
45+
46+
```bash
47+
test -f .env && set -a && source .env && set +a
48+
ruff check
49+
ruff format
50+
basedpyright
51+
bandit -c pyproject.toml -r src/
52+
make testall
53+
make build
54+
make docs
55+
```
56+
57+
Also refresh pre-commit hook state when useful:
58+
59+
```bash
60+
uv run pre-commit run --all-files
61+
```
62+
63+
If a command fails because the update changed generated files or formatting, fix that and rerun the failed command plus any downstream checks.
64+
65+
## Failure Triage
66+
67+
Use this order:
68+
69+
1. Determine whether the failure is caused by the dependency update or by unrelated local dirt.
70+
2. If unrelated local dirt exists, avoid reverting it and work only with the update-related files.
71+
3. If the failure is clearly caused by a small API or typing change, patch the project and keep the newer dependency.
72+
4. If the failure points to one upgraded dependency and the fix would be broad, risky, or time-consuming, roll back that dependency instead of forcing a large refactor.
73+
74+
Treat these as "too big" unless the user asked for broader maintenance:
75+
76+
- wide API migrations across multiple modules
77+
- behavior changes that require redesign rather than adaptation
78+
- new dependency-family incompatibilities that spread across the repo
79+
80+
## Rolling Back One Dependency
81+
82+
Prefer the narrowest rollback possible.
83+
84+
For a direct dependency:
85+
86+
1. Find the previous working version from the git diff or pre-update state.
87+
2. Restore the intended minimum version in `pyproject.toml`.
88+
3. Re-lock to the previous version for that package.
89+
90+
For a transitive dependency:
91+
92+
1. Re-lock that package to the previous version without broad manual edits.
93+
2. Keep the rest of the update set intact.
94+
95+
Useful commands:
96+
97+
```bash
98+
uv lock -P <package>==<old_version>
99+
uv sync --all-groups --all-extras
100+
```
101+
102+
If pre-commit hook updates cause the problem and the issue is not worth fixing, revert only the affected hook revision in `.pre-commit-config.yaml` and rerun validation.
103+
104+
## Reporting
105+
106+
Always report:
107+
108+
- direct dependencies updated in `pyproject.toml`
109+
- point out major-version changes in direct dependencies
110+
- package updates reflected in `uv.lock`
111+
- pre-commit hook revision changes
112+
- any fixes made to keep the update
113+
- any dependency rolled back and why
114+
- validation commands run and their final outcome
115+
116+
Prefer a concise grouped summary rather than dumping raw lockfile diffs, but include exact package names and final versions.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Update Dependencies"
3+
short_description: "Update project dependencies safely"
4+
default_prompt: "Use $update-dependencies to update project dependencies, validate the result, and report the changes."

AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# AGENTS.md
2+
3+
## Project context
4+
5+
Read `.agents/research.md` **in depth** to get an overview about this project.
6+
7+
## Testing
8+
9+
- load the environment variables in `.env` before running tests
10+
- test only what you need during implementation (i.e. only affected / new tests)
11+
- make a full test run when completing a task
12+
13+
## Rules
14+
15+
General rules:
16+
17+
- do not install or update any dependencies on your own; if you think installing or updating dependencies is necessary
18+
give a notice so the user can do this manually
19+
- prefer simple and short solutions over complex ones
20+
- only move code to separate helper functions / methods if it is needed (i.e. called in more than one place)
21+
- write a short comment before each code block that summarizes what the block does
22+
- comments don't have to be full sentences but rather short notes, starting with lower case, ending without a period
23+
- never update the changelog -- this is done automatically
24+
25+
To complete an implementation tasks other than minor tasks like documentation work, make sure:
26+
27+
- new functions / methods / classes have proper docstrings
28+
- updated functions / methods / classes have updated docstrings
29+
- write full sentences in docstrings
30+
- all tests pass
31+
- if a bash script was modified, `shellcheck -x` must pass
32+
- `ruff check` must pass (if not, try `ruff check --fix` to fix any problems)
33+
- run `ruff format` to format the generated / updated code
34+
- `basedpyright` must pass
35+
- `bandit -c pyproject.toml -r src/` must pass
36+
- the package can be built successfully via `make build`
37+
- the documentation can be built successfully via `make docs`
38+
- `.agents/research.md` is updated according to the changes introduced to complete the task; treat
39+
`.agents/research.md` as knowledge base that should always reflect the current state of the project;
40+
don't use language that indicates changes -- the document is *not* a changelog

0 commit comments

Comments
 (0)