chore: add Cursor skills, refactor rules, and fix pre-existing lint#37
Merged
Conversation
Add 6 Cursor agent skills covering benchmark running, library integration, pre-commit validation, performance analysis, documentation generation, and transform spec validation (.cursor/skills/). Rewrite .cursor/rules architecture docs to reflect current implementation — strip migration history, fix wrong __call__ signatures, correct library names, and reduce from ~400 lines each to ~120 lines. Also fix pre-existing issues surfaced by the updated ruff/pyproject-fmt hooks: - augly_impl.py: inline unnecessary lambdas (PLW0108) - compare_video_results.py: convert single-item membership tests to == (FURB171) - examples/: add __init__.py, fix __call__ signatures and type annotations - pyproject.toml: remove removed PD901 rule, apply pyproject-fmt formatting - .pre-commit-config.yaml: bump ruff to v0.15.1, pyproject-fmt to v2.16.1 - run_all.sh: comment out non-albumentationsx libraries (local testing state) Co-authored-by: Cursor <cursoragent@cursor.com>
Reviewer's GuideAdds a set of Cursor skills and examples for running and analyzing benchmarks, refactors Cursor rules/docs, and updates tooling/config to match current linting and local benchmark usage, while fixing a few small Ruff issues. Sequence diagram for running benchmarks via the benchmark-runner skillsequenceDiagram
actor Developer
participant Cursor as CursorAgent
participant Skill as benchmark_runner_skill
participant RunAll as run_all_sh
participant Bench as BenchmarkCode
participant Results as ResultsJSON
participant Compare as compare_results_py
participant Docs as update_docs_sh
Developer->>Cursor: Request to run benchmarks
Cursor->>Skill: Activate benchmark-runner skill
Skill->>RunAll: ./run_all.sh -d images -o output
RunAll->>Bench: Execute image benchmarks for LIBRARIES
Bench-->>Results: Write output/library_results.json files
RunAll-->>Skill: Exit status and paths to results
Developer->>Cursor: Request comparison report
Cursor->>Skill: Use benchmark-runner postprocessing
Skill->>Compare: python -m tools.compare_results -r output/
Compare-->>Developer: Comparison table
Developer->>Cursor: Request doc update
Cursor->>Skill: Use documentation workflow
Skill->>Docs: ./tools/update_docs.sh
Docs-->>Developer: Updated README and docs
Class diagram for custom image and video transform spec modulesclassDiagram
class CustomImageTransformsModule {
+str LIBRARY
+function __call__(transform, image) Any
+list~TransformDefinition~ TRANSFORMS
}
class KorniaVideoTransformsModule {
+str LIBRARY
+torch_device device
+function __call__(transform, video) Any
+list~TransformDefinition~ TRANSFORMS
}
class TransformDefinition {
+str name
+Any transform
}
CustomImageTransformsModule "1" *-- "many" TransformDefinition : uses
KorniaVideoTransformsModule "1" *-- "many" TransformDefinition : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Pull request overview
This PR adds Cursor agent tooling, refactors architecture documentation, and fixes pre-existing linting issues surfaced by updated hooks.
Changes:
- Added 6 Cursor skills for benchmark operations (running benchmarks, library integration, validation, performance analysis, documentation, transform specs)
- Rewrote
.cursor/rules/docs to reflect current implementation (removed migration history, fixed signatures, reduced ~400 lines to ~120) - Fixed ruff violations: inline lambdas (PLW0108), single-item membership tests (FURB171), removed obsolete PD901 rule
- Applied pyproject-fmt formatting and bumped hook versions
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/compare_video_results.py | Convert single-item membership tests to equality checks or sets |
| run_all.sh | Comment out non-albumentationsx libraries (testing state) |
| pyproject.toml | Remove PD901 rule, apply pyproject-fmt formatting |
| examples/kornia_video_transforms.py | New custom transform spec example for Kornia video |
| examples/custom_video_specs_template.py | New template for custom video transform specs |
| examples/custom_image_transforms.py | New custom image transform examples |
| benchmark/transforms/augly_impl.py | Inline unnecessary lambdas |
| .pre-commit-config.yaml | Bump ruff to v0.15.1, pyproject-fmt to v2.16.1 |
| .cursor/skills/*/SKILL.md | New Cursor agent skills documentation |
| .cursor/rules/*.mdc | Refactored architecture docs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In the
transform-spec-validatorskill, the quick validation and testing snippets incorrectly assume the spec module itself is callable (callable(module),module(transform, test_image)); these should instead check and callmodule.__call__(e.g.,assert callable(module.__call__)andmodule.__call__(transform, test_image)) to match how spec files are actually structured. - In
examples/custom_image_transforms.py,LIBRARYis set to"albumentationsx"while the code imports and usesalbumentations; verify this string is correct for how the runner selects environments and libraries, or adjust it so the library identifier and implementation match.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the `transform-spec-validator` skill, the quick validation and testing snippets incorrectly assume the spec module itself is callable (`callable(module)`, `module(transform, test_image)`); these should instead check and call `module.__call__` (e.g., `assert callable(module.__call__)` and `module.__call__(transform, test_image)`) to match how spec files are actually structured.
- In `examples/custom_image_transforms.py`, `LIBRARY` is set to `"albumentationsx"` while the code imports and uses `albumentations`; verify this string is correct for how the runner selects environments and libraries, or adjust it so the library identifier and implementation match.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…) in validation snippets The quick validation and testing examples incorrectly treated the spec module itself as callable. Updated to check callable(module.__call__) and invoke module.__call__(transform, test_image) to match actual spec file structure. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add 6 Cursor agent skills covering benchmark running, library integration, pre-commit validation, performance analysis, documentation generation, and transform spec validation (.cursor/skills/).
Rewrite .cursor/rules architecture docs to reflect current implementation — strip migration history, fix wrong call signatures, correct library names, and reduce from ~400 lines each to ~120 lines.
Also fix pre-existing issues surfaced by the updated ruff/pyproject-fmt hooks:
Summary by Sourcery
Add Cursor agent skills and examples for running and analyzing benchmarks, update transform spec and example templates, and align tooling/configuration with updated linting and local benchmark usage.
New Features:
Bug Fixes:
Enhancements: