agentleFS
korniakornia/kornia-rs/.claude/skills/kornia-api-flavor/SKILL.md

kornia-api-flavor

Skill748 starsChanged 7 days agoApache-2.0View on GitHub

Use before designing a new public function, trait, config struct or binding in kornia-rs — shapes of signatures (pre-allocated &mut dst, generic Image<T, C, A>, sealed-trait dtype dispatch, fallible constructors, shared layout structs). Read before sketching any new public API.

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Generics over concrete: keep Image<T, C, A> generic over allocator and channels (const generics).

    line 14
  2. Distinctive:

    Config structs: document units and coordinate frames (pixels vs normalized coordinates, radians vs degrees).

    line 18

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

kornia-rs API flavor

  1. Output buffers: image ops are fn op(src: &Image<T, C, A1>, dst: &mut Image<T, C2, A2>) -> Result<(), E>. Validate src/dst sizes first and return a descriptive error on mismatch.
  2. Naming: <output>_from_<input> (gray_from_rgb).
  3. Dtype dispatch: one generic entry point bound by a sealed trait (e.g. GrayFromRgb) with explicit impls for u8, f32, f64. No blanket impl<T: Float> (conflicts without specialization). See kornia-simd.
  4. Generics over concrete: keep Image<T, C, A> generic over allocator and channels (const generics); do not hard-code Vec.
  5. Errors: each crate has a thiserror enum; wrap lower-crate errors with #[from]. Fallible constructors (new(..) -> Result<Self, _>).
  6. Config structs document units and coordinate frames (pixels vs normalized coordinates, radians vs degrees).
  7. Return types: domain structs/Option, not tuples of vectors.
  8. Bindings parity: a Rust API exposed to Python (kornia-py/src) or C++ (kornia-cpp/src, include/) must keep the same naming and semantics; add tests on the binding side.
  9. Feature gating: hardware-specific code (cuda, gstreamer, v4l, turbojpeg) stays behind features; the default build must compile without.
  10. Docs: new public API is not done until it has rustdoc with Arguments, Returns, Errors, Example, and an entry in the crate README and a changelog.d/ fragment when user-visible.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.