fosmvvm-react-view-generator

Generate React ViewModel views with test files and FOSMVVM bindings.

3|2|Updated Apr 9, 2023
One-click install
npx skills add https://github.com/foscomputerservices/FOSUtilities --skill fosmvvm-react-view-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fosmvvm-react-view-generator
Source: https://github.com/foscomputerservices/FOSUtilities/tree/main/.claude/skills/fosmvvm-react-view-generator
Command: npx skills add https://github.com/foscomputerservices/FOSUtilities --skill fosmvvm-react-view-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill streamlines the creation of React UI components that render ViewModels using FOSMVVM patterns, eliminating repetitive boilerplate and ensuring consistency across views.

Core Features & Use Cases

  • Automated View: Generates a React component aligned to a given ViewModel and its server interactions.
  • Tests First: Produces a corresponding .test.js to validate rendering and interactions.
  • Use Case: Build a new screen by describing a ViewModel, then generate a ready-to-use view and tests following the FOSMVVM conventions.

Quick Start

Run the fosmvvm-react-view-generator to create a new React view for a specified ViewModel. Then integrate the generated {ViewName}View.jsx and {ViewName}View.test.js into your project under src/components/{Feature}/.

Frequently Asked Questions about fosmvvm-react-view-generator

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

FAQPage Schema
How do I auto-generate React views for ViewModels using the FOSMVVM pattern?

To auto-generate React views for ViewModels using the FOSMVVM pattern, use this skill to create components that render ViewModels, handle error states, and trigger ServerRequests via the .bind() method. It outputs both the view and its test file.

Can I generate test files alongside my React ViewModel components?

Yes, you can generate test files alongside your React ViewModel components. The generator enforces a tests-first approach by producing a corresponding .test.js file prior to the implementation file to validate rendering and interactions.

Do I need a global wrapper to render FOSMVVM React views correctly?

Yes, you need a global wrapper to render FOSMVVM React views correctly. The generated components enforce global FOSMVVM wrapper usage to ensure consistent behavior and server-bound interactions across your UI components.

What is the best way to reduce boilerplate when building React UI components for ViewModels?

The best way to reduce boilerplate when building React UI components for ViewModels is to auto-generate ready-to-use views aligned to your ViewModel descriptions. This eliminates repetitive setup and enforces consistent conventions across your project.

How does the .bind() pattern work for server-bound interactions in React?

The .bind() pattern works for server-bound interactions in React by connecting ViewModels to ServerRequests within the generated view. This allows your UI components to trigger server actions and handle error states consistently.

Where should I place the generated FOSMVVM React view and test files in my project?

You should place the generated FOSMVVM React view and test files in your project under src/components/{Feature}/. The generator outputs {ViewName}View.jsx and {ViewName}View.test.js for direct integration into your codebase.