r2mo-ui-upload

Generates upload API contracts and bindings from parsed front-matter attributes for forms and lists.

2|1|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/silentbalanceyh/r2mo-lain --skill r2mo-ui-upload
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r2mo-ui-upload
Source: https://github.com/silentbalanceyh/r2mo-lain/tree/main/docs/skills/r2mo-ui-upload
Command: npx skills add https://github.com/silentbalanceyh/r2mo-lain --skill r2mo-ui-upload

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This frontend skill consolidates file and image upload UX into a single, spec-driven component that enforces size/format rules, previews, and optional crop, all aligned with backend contracts to minimize integration errors.

Core Features & Use Cases

  • Upload controls adapt to the bound schema (file or image) and respect accept, max_size, max_count, preview, and crop attributes.
  • Preview and crop for images when requested; show progress and accessibility labels; provide clear error messaging.
  • Integrate with backend via api_refs; no hardcoded paths; usable within forms (pageform) or in list cells (pagelist).

Quick Start

Attach the r2mo-ui-upload component to a form field and configure its binding and API references to enable file uploads with previews.

Frequently Asked Questions about r2mo-ui-upload

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add frontend image upload with preview and validation to a TypeScript form?

Frontend image upload with preview and validation is handled by binding schema attributes like accept, max_size, and preview to a form field. This generates upload controls that enforce size and format rules while displaying live image previews.

Can I enforce file upload limits like max_count and max_size in a form without hardcoding?

File upload limits like max_count and max_size are enforced automatically by deriving controls from parsed front-matter attributes. The upload component reads these constraints directly from the schema, eliminating the need to hardcode validation logic.

How does spec-driven file upload align with backend API contracts in frontend applications?

Spec-driven file upload aligns with backend API contracts by using api_refs to deduce the endpoint, field names, and response mapping. This ensures the frontend upload component submits data to the correct backend path without hardcoded integration assumptions.

What is the best way to handle image cropping during file upload in a list or form context?

Image cropping during file upload is triggered when the crop attribute is present in the schema. The upload component adapts to list or form contexts, applying cropping functionality alongside preview and progress indicators.

Does this frontend upload component work for both form and list cell contexts?

This frontend upload component works for both pageform and pagelist contexts. It adapts its upload controls to the bound schema, allowing file and image uploads to function seamlessly whether placed in a form field or a list cell.

How do I configure upload API endpoints without hardcoding paths in my frontend code?

Upload API endpoints are configured without hardcoding paths by referencing api_refs from the spec. The component deduces the API contract, including the endpoint and response mapping, directly from these specification references.