AI Agents UI Development

Font Match Tool With Agentic AI Skills

Explore how repo-local skills helped build Fontify's browser-local Font Match tool for private, resilient, and testable font comparison.

Font matching from a photograph sounds simple until the input is rotated, curved, loosely cropped, or stored in a format the browser may not decode consistently. The engineering challenge is not merely to draw an upload box and return a list of fonts. It is to create a trustworthy workflow around image privacy, format validation, geometric normalization, deterministic scoring, accessible interaction, resource cleanup, localization, and testing.

Fontify's Font Match tool was developed with help from repo-local Agentic AI Skills: versioned instructions stored alongside the application source. These skills gave the coding agent durable knowledge of the repository's architecture and the product's rules. They helped turn a broad request to compare photographed text with an imported font catalog into an implementation that fits Fontify rather than a generic proof of concept.

There is an important distinction here: Agentic AI assisted the development process, but it is not part of the runtime matching path. The reference image and its analysis remain in the browser. Font Match does not upload the image to an AI model, embedding service, or remote image processor.

Fontify Font Match upload screen with its browser-local privacy notice and four-step workflow

Turning Repository Knowledge Into Engineering Guardrails #

A general coding agent understands React and TypeScript, but it does not automatically know which application owns a feature, where processing should live, which shared components to use, or what privacy promises the product must preserve. Fontify's repo-local skills supply that missing context in layers.

The application router first identifies Fontify as the owning application and keeps its conventions separate from the repository's other products. The Fontify profile then routes the work through the shared frontend rules and the Font Match-specific overlay. General coding directives reinforce component ownership, focused processing models, explicit asynchronous states, careful error handling, and tests for new behavior.

This routing matters. It prevents a locally executed visual-matching feature from drifting into an unnecessary server API or agent service. It also keeps application-specific code inside apps/fontify, while allowing established shared UI patterns to remain reusable.

The first implementation established the complete product loop: select an image, isolate a text line, enter its exact words, compare it with imported fonts, and review ranked candidates. As the tool was tested against more difficult samples, the repository gained a dedicated Font Match skill. That skill captured the lessons from the implementation, especially privacy, bounded image decoding, rotation and curvature handling, score semantics, cleanup, and focused validation. The next agentic change would begin with those decisions already available.

In other words, the implementation improved the skill, and the skill became a guardrail for improving the implementation.

A Workflow That Explains Itself #

The opening screen makes the process visible before the user supplies any data: upload an image, select a text line, enter the visible words, and analyze the matches. The privacy notice is equally prominent because local processing is not a hidden implementation detail. It is part of the product contract.

Font Match accepts common photographic and web formats, including JPEG, PNG, WebP, HEIC, and HEIF, with explicit file-size and image-dimension limits. The repo-local skill instructs the agent to verify the declared format against the file bytes, bound parsing and pixel allocation, prefer native browser decoding, and load the reviewed HEIC fallback only when native decoding fails. Those rules translate a friendly "Choose image" action into a much more defensive intake pipeline.

Uploaded reference image ready for text-line selection and exact-word entry

Once loaded, the image stays available while the user selects the most useful evidence. The full image is initially selected, but the interface recommends a tight crop around one complete line. It also exposes image dimensions and file size, provides replace and remove actions, and supports keyboard movement and resizing of the selection.

These details reflect another benefit of the skills: they preserve product behavior beyond the happy path. A coding agent is directed to keep the selected image across recoverable failures, allow repeated-region analysis, isolate failures from individual catalog fonts, and release every object URL, bitmap, canvas, decoder result, and preview lease when it is no longer needed.

Exact Words Instead of OCR #

Font Match deliberately asks the user to enter the exact visible words. It compares glyph appearance and spacing. It does not attempt optical character recognition. That narrow product boundary removes a major source of uncertainty and allows every candidate font to render the same sequence found in the selected image.

A tightly cropped text fragment with the exact visible words entered for matching

The crop and the typed text work together. The image supplies letter shapes, stroke proportions, spacing, and baseline evidence. The exact text ensures the catalog candidates are compared using identical glyph content. The skill makes this requirement explicit and also requires the interface to describe a similarity score honestly. It helps rank candidates, but it does not prove the identity of a font.

This is a good example of a repo-local skill doing more than prescribing code style. It records a product decision that affects the algorithm, the interface, the test fixtures, and the claims the application may make.

Normalizing Real-World Text #

Photographed text rarely arrives as a perfectly horizontal specimen. It may be tilted, vertical, upside down, or printed along a curved baseline. The initial matcher handled straight text, while a later hardening pass added continuous rotation analysis, exact 180-degree alternatives, and guarded curve normalization.

The dedicated skill captures the design of that pipeline. It tells the agent to estimate a global orientation rather than checking only a few preset angles. It preserves rigid normalized variants in both reading directions and adds curve-flattened variants only when the crop contains enough evidence. Short samples retain the honest rigid fallback instead of claiming they were successfully dewarped. Reference variants are bounded and deduplicated so better geometry does not turn into uncontrolled browser work.

Font Match measuring the selected letter shapes and spacing during local analysis

The progress state shown during analysis is small, but it represents several coordinated operations: preparing the selected line, measuring its normalized glyph descriptor, loading compatible catalog fonts, rendering the exact sample text, and ranking candidates. The work is cancelable where browser APIs permit cancellation, and stale results are ignored and disposed when they do not.

Results Designed for Comparison, Not Certainty #

For each compatible catalog font, Font Match renders the same visible words horizontally on a bounded canvas. It normalizes the candidate specimen to the same comparison grid as the reference and scores it against each valid reference variant. The best similarity becomes the candidate's score. Extra variants do not create a ranking bonus. Results are bounded, scores remain finite, and ties are deterministic.

Ranked Fontify catalog candidates with matching text previews and visual similarity scores

The result cards make the ranking inspectable. Each card shows the catalog face, style and weight, font format, rendered sample, filename, and visual similarity score. The user can open a likely candidate in a new tab, analyze another region, or clear the results. The wording stays careful: these are the closest catalog candidates, not a declaration of identity.

In the example, 21st-Black ranks first at 97 percent similarity, followed by nearby weights and stylistic alternatives. Showing those alternatives is useful because practical font identification is comparative. A designer can inspect letterforms directly instead of treating a single opaque answer as authoritative.

Skills as a Repeatable Development System #

The most valuable contribution of the repo-local skills was not faster code generation in isolation. It was consistent reasoning across the feature's entire lifecycle:

  • Architecture: route Font Match to the Fontify frontend and keep processing browser-local.
  • Privacy: prohibit uploads, persistence, image logging, remote inference, and external processing.
  • Safety: validate formats and dimensions, cap expensive work, lazy-load the HEIC decoder, and ship its license and source notice.
  • Algorithm design: compare identical text, normalize arbitrary rotation, guard curve handling, bound reference variants, and rank deterministically.
  • Product behavior: preserve useful state after recoverable errors, support cancellation and repeated regions, localize all workflow states, and describe similarity without overstating it.
  • Verification: run focused parser and geometry tests alongside translation generation, linting, type checking, production builds, and real-browser HEIC fallback checks.

The focused test suite covers continuous rotation, upside-down and curved samples, identical-content ranking, legacy formats, and bounded HEIF parsing. Browser smoke testing complements those tests because native decoding, fallback orientation, preview alignment, network behavior, and resource cleanup cannot all be proven by a Node test alone. Even the skills themselves are validated, treating the agent's instructions as maintained engineering assets rather than informal prompt fragments.

The Larger Lesson #

Agentic development becomes substantially more useful when an agent can work from repository-specific constraints instead of rediscovering them in every session. In Font Match, those constraints connected product intent to implementation detail. Private-by-design processing shaped the architecture. Exact-word entry shaped the comparison method. Real-world photography shaped the geometry pipeline. Score semantics shaped the result cards and the tests.

The result is more than an AI-generated interface. It is a locally executed font-matching tool whose behavior, limits, validation strategy, and privacy model are encoded beside the source code. As the feature evolves, the repo-local skill gives future agentic work a reliable starting point. It turns lessons from one development cycle into safeguards for the next.

RapidKT Plain Text Website