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
- Very specific: line 14
Generics over concrete: keep Image<T, C, A> generic over allocator and channels (const generics).
- Distinctive: line 18
Config structs: document units and coordinate frames (pixels vs normalized coordinates, radians vs degrees).
≈ “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.
Files
kornia-rs API flavor
- Output buffers: image ops are
fn op(src: &Image<T, C, A1>, dst: &mut Image<T, C2, A2>) -> Result<(), E>. Validatesrc/dstsizes first and return a descriptive error on mismatch. - Naming:
<output>_from_<input>(gray_from_rgb). - Dtype dispatch: one generic entry point bound by a sealed trait
(e.g.
GrayFromRgb) with explicit impls foru8,f32,f64. No blanketimpl<T: Float>(conflicts without specialization). Seekornia-simd. - Generics over concrete: keep
Image<T, C, A>generic over allocator and channels (const generics); do not hard-codeVec. - Errors: each crate has a
thiserrorenum; wrap lower-crate errors with#[from]. Fallible constructors (new(..) -> Result<Self, _>). - Config structs document units and coordinate frames (pixels vs normalized coordinates, radians vs degrees).
- Return types: domain structs/
Option, not tuples of vectors. - 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. - Feature gating: hardware-specific code (
cuda,gstreamer,v4l,turbojpeg) stays behind features; the default build must compile without. - 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.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- kornia-archSkill
- kornia-bindingsSkill
- kornia-code-reviewSkill
- kornia-coding-styleSkill
- kornia-curationSkill
- kornia-simdSkill
- kornia-workflowSkill
- releaseSkill
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
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.

