Skip to content

chore: add Cursor skills, refactor rules, and fix pre-existing lint#37

Merged
ternaus merged 2 commits into
mainfrom
cursor-skills-analysis
Feb 19, 2026
Merged

chore: add Cursor skills, refactor rules, and fix pre-existing lint#37
ternaus merged 2 commits into
mainfrom
cursor-skills-analysis

Conversation

@ternaus

@ternaus ternaus commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

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)

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:

  • Introduce six Cursor skills for benchmark running, library integration, pre-commit validation, performance analysis, documentation generation, and transform spec validation.
  • Add example custom image and video transform specification files for AlbumentationsX and Kornia, plus a reusable video spec template.
  • Provide a quick reference and README for the new Cursor skills to document their usage and triggers.

Bug Fixes:

  • Fix linter issues by simplifying unnecessary lambdas in AugLy transforms and tightening membership checks in video comparison tooling.

Enhancements:

  • Refine pyproject and tooling configuration to use inline setuptools package discovery options and clean up ruff/mypy settings.
  • Adjust benchmark run script to only execute AlbumentationsX locally for focused testing.

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>
@ternaus ternaus requested a review from Copilot February 19, 2026 04:26
@sourcery-ai

sourcery-ai Bot commented Feb 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds 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 skill

sequenceDiagram
    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
Loading

Class diagram for custom image and video transform spec modules

classDiagram
    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
Loading

File-Level Changes

Change Details Files
Introduce Cursor skills for benchmark workflows and a quick reference/README to guide Cursor AI usage.
  • Add six SKILL.md files covering benchmark running, library integration, pre-commit validation, performance analysis, documentation generation, and transform spec validation
  • Document all skills, triggers, and maintenance in a central README
  • Provide a QUICKREF with test prompts and structure guidance for skills
.cursor/skills/benchmark-runner/SKILL.md
.cursor/skills/library-integration/SKILL.md
.cursor/skills/pre-commit-validation/SKILL.md
.cursor/skills/performance-analysis/SKILL.md
.cursor/skills/documentation-generator/SKILL.md
.cursor/skills/transform-spec-validator/SKILL.md
.cursor/skills/README.md
.cursor/skills/QUICKREF.md
Refine and shorten Cursor rules documentation for custom image and video transform architectures.
  • Rewrite architecture docs to match current implementation and remove historical migration notes
  • Correct call signature descriptions and library naming/usage
  • Reduce each document from ~400 lines to ~120 lines for better signal-to-noise
.cursor/rules/custom.mdc
.cursor/rules/image_custom_transforms_architecture.mdc
.cursor/rules/video_custom_transforms_architecture.mdc
Add example custom transform specification files for images and videos, including Kornia video examples.
  • Provide a concrete albumentationsx-based custom image transform spec with multiple parametric transforms and composed augmentations
  • Add a generic template for custom video transform specs showing LIBRARY, call, and TRANSFORMS patterns
  • Add a Kornia-specific video transforms example using CUDA/half precision when available
examples/custom_image_transforms.py
examples/custom_video_specs_template.py
examples/kornia_video_transforms.py
Align project configuration with updated pyproject-fmt and Ruff expectations and tweak linting rules.
  • Reformat pyproject.toml to the newer pyproject-fmt style (collapsing blank lines, using nested tables for setuptools.packages.find, normalizing arrays and inline tables)
  • Remove the obsolete PD901 ignore from the Ruff config and normalize lint.per-file-ignores spacing and empty-list formatting
  • Clarify pyright execution environment comment alignment while keeping semantics the same
pyproject.toml
Fix lint issues in benchmark utilities and tools surfaced by updated Ruff rules.
  • Inline unnecessary lambdas in augly image transform factory where the underlying functions already match the required callable signature
  • Replace one-element list membership checks with direct equality and use sets where appropriate for multi-element membership in hardware detection logic
benchmark/transforms/augly_impl.py
tools/compare_video_results.py
Update pre-commit hook versions and adjust default benchmark run libraries for local testing.
  • Bump Ruff pre-commit hook from v0.14.11 to v0.15.1 and pyproject-fmt from v2.11.1 to v2.16.1
  • Temporarily comment out non-albumentationsx libraries in run_all.sh and set LIBRARIES to only run albumentationsx for local benchmarking
.pre-commit-config.yaml
run_all.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
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>
@ternaus ternaus merged commit 3c340ea into main Feb 19, 2026
2 checks passed
@ternaus ternaus deleted the cursor-skills-analysis branch February 19, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants