midspiral/lemmafit/lemmafit-react-pattern

Claude Code and agent skill by midspiral/lemmafit

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

React integration pattern for lemmafit verified apps. Use when building React components that consume the verified Dafny API, wiring up state with Api.Init/Dispatch/Present, or creating new UI for a lemmafit app.

Install

npx vskill@latest install midspiral/lemmafit/lemmafit-react-pattern

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

React Pattern for Lemmafit

  • Use the auto-generated TypeScript API from src/dafny/app.ts (never edit app.ts directly)
  • For any code that touches logic, check if it has been written in Dafny already and is available in the API
  • Do not re-write logic in React that already exists in Dafny/API

Modularity

Build modular React apps — never put everything in a single App.tsx. Organize src/ by the same layers used in SPEC.yaml:

src/
├── dafny/app.ts # Auto-generated verified API (DO NOT EDIT)
├── hooks/ # State layer — custom hooks that wrap the verified API
│ └── useAppState.ts # Calls Api.Init, Api.Dispatch, Api.Present
├── components/ # Presentation layer — pure UI components
│ ├── WorkoutForm.tsx
│ └── SetList.tsx
├── utils/ # Utils layer — formatters, parsers, constants
│ └── format.ts
├── App.tsx # Root — composes hooks + components, no logic
└── main.tsx # Entry point
Layer rules
  • Logic (dafny/) — All business logic lives in Dafny. The React side never re-implements or duplicates what the verified API provides.
  • State (hooks/) — Custom hooks are the only place that calls Api.Init, Api.Dispatch, and Api.Present. Components never import from dafny/ directly.
  • Presentation (components/) — Pure components that receive data and callbacks via props. No direct API calls, no useState for domain state.
  • Utils (utils/) — Display helpers like formatters and constants. No side effects, no state.
  • Root (App.tsx) — Wires hooks to components. Should be short — if it's growing, extract a component or hook.
Why this matters
  • Verified logic stays in one place (Dafny) — the React layer is just plumbing
  • Components are testable and reusable without the verified API
  • When the Dafny model changes, only hooks/ needs updating — components stay stable

Standard Pattern

tsx
import * as Api from './dafny/app';
function App() {
const [state, setState] = useState(() => Api.Init());
const inc = () => setState(Api.Dispatch(state, Api.Inc()));
const value = Api.Present(state);
return <button onClick={inc}>{value}</button>;
}

Key Rules

  • Always initialize state with Api.Init()
  • Dispatch actions through Api.Dispatch(state, action)
  • Read display values through Api.Present(state)
  • Never modify state directly — all transitions go through the verified Step function

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
52
Repository forks
3
7-day trend score
20

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/midspiral/lemmafit/lemmafit-react-pattern/badge)](https://verified-skill.com/skills/midspiral/lemmafit/lemmafit-react-pattern)

Something wrong with this skill or its page? Tell us.