# Vitalyvorobyev Ringgrid API Shaping

> ---

- Skill: `tomevault-io/vitalyvorobyev-ringgrid-api-shaping` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/vitalyvorobyev-ringgrid-api-shaping`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/vitalyvorobyev-ringgrid-api-shaping/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/vitalyvorobyev-ringgrid-api-shaping

---

---
name: api-shaping
description: Use this when designing or refactoring public APIs across workspace crates. Keeps APIs small, explicit, and stable while allowing fast internals.
---------------------------------------------------------------------------------------------------------------------------------------------------------

# API shaping (lightweight)

## Aim

* Small public surface
* Clear data ownership (views vs owned)
* Fast internals without leaking complexity

## Prefer

* `Detector` structs that own scratch buffers → avoid allocations per call.
* `Config` structs with safe defaults, but don’t hide “magic” thresholds.
* `ImageView<T>` / `ImageViewMut<T>` in APIs; keep crates buffer-agnostic.
* Separate “core algorithm” from “pipeline convenience wrapper”.

## Avoid

* Generic abstractions that obscure hot loops.
* Exposing internal scratch buffers in public API.
* “One mega function” that does everything.

## Patterns that work here

* `detect_*(&mut self, img: &ImageView<_>, cfg: &Config) -> Output`
* `Output` types that can be iterated cheaply (`Vec<Edgel>`, `Vec<LaserSample>`)
* Optional features for parallelism/SIMD later, not in baseline.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/vitalyvorobyev) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-14 -->

