sima-likes

Implement a reusable likes system with LikeButton, LikesProvider, and guest merge.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/RosenGray/sima --skill sima-likes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sima-likes
Source: https://github.com/RosenGray/sima/tree/main/.cursor/skills/sima-likes
Command: npx skills add https://github.com/RosenGray/sima --skill sima-likes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a reusable likes/favorites infrastructure for ad sections across the app, including LikeButton on cards and detail views, a LikesProvider, AdLike model, server actions, storage, and guest-merge logic. It enables adding favorites to new sections or wiring LikeButton into cards and detail pages.

Core Features & Use Cases

  • Unified likes infrastructure shared by all ad sections (cards and detail)
  • LikeButton on listing cards and detail pages
  • Guest merge support for likes across login
  • Define and reuse entity type constants to drive storage and server actions

Quick Start

  • Define a new entity type constant in LikesProvider for your section (e.g. ENTITY_TYPE_CARS = "vehicles-cars").
  • Add LikeButton to listing cards with stopPropagation and entityType/publicId props.
  • Add LikeButton to detail header with the same props and stopPropagation behavior.
  • Ensure LikesProvider is wired in the app with initialLikedIds and guest merge extension if needed.

Frequently Asked Questions about sima-likes

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

FAQPage Schema
How do I implement a likes and favorites system for frontend ad listings?

To implement a likes and favorites system for frontend ad listings, use a shared LikesProvider and LikeButton components. This infrastructure supports listing cards and detail pages, applying optimistic UI updates and server-backed state.

How do I persist guest likes locally before a user logs in?

To persist guest likes locally before user login, save favorite states to localStorage. The system includes guest merge logic that synchronizes these locally stored likes with the server-backed state upon authentication.

How do I add a LikeButton to ad listing cards without triggering card clicks?

To add a LikeButton to ad listing cards without triggering card clicks, integrate the button with correct stopPropagation behavior. Pass the entityType and publicId props to ensure the like action is isolated from parent element events.

How do I manage favorites across different ad sections without duplicating logic?

To manage favorites across different ad sections without duplicating logic, define a shared entity type constant in LikesProvider for each section. This drives storage and server actions, providing a unified likes infrastructure for all ad pages.

Does this favorites solution support optimistic UI updates for ad detail pages?

Yes, this favorites solution supports optimistic UI updates for ad detail pages. The LikesProvider manages the state to immediately reflect like toggles on the detail header before the server action fully completes.