Token导航 LogoToken导航

Agent Skill · 研究检索

recently-viewed-products(最近查看的产品)

recently-viewed-products 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

recently-viewed-products 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 57,864。

总安装 423周安装 18GitHub Stars 19下载 148核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:recently-viewed-products(最近查看的产品)
来源仓库:https://github.com/finsilabs/awesome-ecommerce-skills
仓库路径:skills/recently-viewed-products
安装命令:
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill recently-viewed-products
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill recently-viewed-products

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

recently-viewed-products 用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景快速定位候选结果。通过命令行调用,需提供查询目标和筛选条件。安装前建议确认权限范围和维护状态,注意可能触发联网或文件读写操作。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/recently-viewed-products

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill rec…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

recently-viewed-products 怎么安装?

在终端执行 npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill recently-view…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

recently-viewed-products 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

recently-viewed-products 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

recently-viewed-products 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

recently-viewed-products 用的人多吗?

公开数据是累计安装 423 次,近一周安装 18 次,下载 148 次,GitHub 19 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

recently-viewed-products 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
recently-viewed-products

最近查看的产品 · 本页

42319操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Recently Viewed Products

Overview

Track which products a shopper views and display them in a "Recently Viewed" widget on product pages, the cart, and the homepage. Uses browser storage for within-session and cross-session history. Product data is always re-fetched from the server to avoid showing stale prices or out-of-stock items.

When to Use This Skill

  • When implementing a "Continue where you left off" experience for returning visitors
  • When adding a "Recently Viewed" widget to product detail pages or the cart drawer
  • When integrating with a personalization engine that requires client-side behavioral data
  • When building a headless storefront and need lightweight browsing history without a backend dependency

Core Instructions

Step 1: Determine the merchant's platform and choose the right approach

PlatformRecommended ApproachWhy
ShopifyEnable the built-in Recently Viewed section in your OS2.0 theme, or install Also Bought • Related products / LimeSpot PersonalizerDawn and most OS2.0 themes include a native Recently Viewed section; LimeSpot ($15/mo) adds AI-powered personalization including recently viewed across sessions
WooCommerceUse WooCommerce's built-in Recently Viewed Products widget or shortcode, or install YITH WooCommerce Frequently Bought TogetherWooCommerce includes a recently viewed widget out of the box; place it via Appearance → Widgets or with the [recent_products] shortcode
BigCommerceUse the Recently Viewed widget in the BigCommerce Page Builder or enable it in the Cornerstone theme settingsCornerstone and BigCommerce Page Builder both include a native Recently Viewed widget that uses browser cookies automatically
Custom / HeadlessImplement localStorage-based view tracking with a server-side batch endpoint to fetch fresh product dataClient-side storage means no server state needed; re-fetching data on display ensures prices and stock are current

Step 2: Enable Recently Viewed on your platform


Shopify

Using a built-in section (OS2.0 themes — Dawn, Sense, Craft):

  1. Go to Online Store → Themes → Customize
  2. Navigate to a product page template
  3. Click Add section and search for "Recently Viewed" — it appears as Recently viewed products in the section list
  4. Configure it:

- Set Maximum products to show (4–8 recommended) - Set the section heading text ("Recently Viewed", "Your Browsing History", etc.) - Set product card style: show price, show rating, etc.

  1. The section uses JavaScript and browser storage (localStorage) automatically — no additional configuration needed

For the homepage:

  1. Go to your homepage template
  2. Add a Recently viewed products section in the same way
  3. This section will only render content for returning visitors who have previously browsed products

LimeSpot Personalizer (cross-device, AI-powered):

  1. Install from the Shopify App Store
  2. LimeSpot tracks views server-side (not just in the browser) so recently viewed persists across devices and browsers
  3. Configure the Recently Viewed widget placement in the LimeSpot dashboard — it can appear on any page via app blocks

WooCommerce

Built-in Recently Viewed widget:

  1. Go to Appearance → Widgets
  2. Find the WooCommerce Recently Viewed Products widget
  3. Drag it to your Shop Sidebar or Footer widget area
  4. Configure:

- Number of products to show: 4–6 recommended - Show title: Yes/No

  1. Alternatively, place the shortcode [woocommerce_recently_viewed_products per_page="4"] directly in a product page template, sidebar, or Gutenberg block

For Classic Editor / Gutenberg:

  • In Gutenberg, add a Shortcode block and paste [woocommerce_recently_viewed_products per_page="4"]
  • For Elementor: use the Shortcode widget to embed the same code

WooCommerce stores recently viewed product IDs in the visitor's session (PHP session / cookie) — no plugin required. The widget reads from this session automatically.


BigCommerce

Built-in Recently Viewed widget (Cornerstone theme):

  1. Go to Storefront → My Themes → Customize
  2. Navigate to a product page template
  3. In the sidebar, find the Recently Viewed section and enable it (or adjust its position in the page layout)
  4. Set the number of products to display
  5. BigCommerce uses browser cookies to track recently viewed products — no app needed

Page Builder approach:

  1. Go to Storefront → Page Builder
  2. Open any page where you want the widget
  3. Drag the Recently Viewed Products widget from the widget panel onto the page
  4. Configure display settings in the widget panel on the right

Custom / Headless

localStorage-based view tracking:

// lib/recentlyViewed.js
const STORAGE_KEY = 'rv_products';
const MAX_ITEMS = 12;
const TTL_MS = 30 * 24 * 60 * 60 * 1000; // 30 days

export function recordView(productId) {
  const items = getStoredItems();
  const filtered = items.filter(i => i.id !== productId); // remove existing entry
  const updated = [{ id: productId, viewedAt: Date.now() }, ...filtered].slice(0, MAX_ITEMS);
  try { localStorage.setItem(STORAGE_KEY, JSON.stringify(updated)); } catch {}
}

export function getRecentlyViewedIds(excludeId = null) {
  const now = Date.now();
  return getStoredItems()
    .filter(i => now - i.viewedAt < TTL_MS && i.id !== excludeId)
    .map(i => i.id);
}

function getStoredItems() {
  try { return JSON.parse(localStorage.getItem(STORAGE_KEY) ?? '[]'); }
  catch { return []; }
}

Record view on the product detail page:

// In ProductDetailPage.jsx — read localStorage only in useEffect to avoid SSR mismatch
import { useEffect } from 'react';
import { recordView } from '../lib/recentlyViewed';

export function ProductDetailPage({ product }) {
  useEffect(() => { recordView(product.id); }, [product.id]);
  return (
    <div>
      {/* product content */}
      <RecentlyViewedWidget excludeId={product.id} maxItems={4} />
    </div>
  );
}

Widget component — re-fetches fresh product data from the server:

// RecentlyViewedWidget.jsx
export function RecentlyViewedWidget({ excludeId, maxItems = 4 }) {
  const [products, setProducts] = useState([]);

  useEffect(() => {
    const ids = getRecentlyViewedIds(excludeId).slice(0, maxItems);
    if (ids.length === 0) return;

    fetch('/api/products/by-ids', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ ids }),
    })
      .then(r => r.json())
      .then(data => {
        // Preserve the viewed order (API may return in any order)
        const map = new Map(data.products.map(p => [p.id, p]));
        setProducts(ids.map(id => map.get(id)).filter(Boolean));
      })
      .catch(() => {}); // Non-critical — fail silently
  }, [excludeId, maxItems]);

  if (products.length === 0) return null;

  return (
    <section aria-label="Recently viewed">
      <h2>Recently Viewed</h2>
      <div className="recently-viewed-grid">
        {products.map(product => (
          <article key={product.id}>
            <a href={product.url}>
              <img src={product.image} alt={product.name} loading="lazy" width="150" height="150" />
              <p>{product.name}</p>
              <p>${product.price}</p>
            </a>
          </article>
        ))}
      </div>
    </section>
  );
}

Batch product endpoint (Node.js):

// api/products/by-ids.js
export async function getProductsByIds(req, res) {
  const { ids } = req.body;
  if (!Array.isArray(ids) || ids.length === 0 || ids.length > 20)
    return res.status(400).json({ error: 'Invalid ids' });

  const products = await db.products.findMany({
    where: { id: { in: ids }, published: true },
    select: { id: true, name: true, price: true, image: true, url: true, inStock: true },
  });
  res.json({ products });
}

Best Practices

  • Store only product IDs, not full product objects — prices and availability change; always re-fetch from the server when rendering the widget
  • Exclude the current product — pass excludeId to prevent showing the product the shopper is already viewing
  • Fail silently — the recently viewed widget is non-critical; catch all errors and render nothing rather than breaking the page
  • Hydrate after mount — in SSR frameworks, read from localStorage inside useEffect to avoid server/client mismatch
  • Respect privacy consent — only write to storage after the user has accepted analytics cookies if your cookie policy requires it
  • Consider TTL expiry — purge entries older than 30 days on read to avoid showing discontinued products

Common Pitfalls

ProblemSolution
Hydration mismatch in Next.js / SSRRead localStorage only inside useEffect, never during render; initialize state as empty array
localStorage throws in private browsingWrap all reads/writes in try/catch; fall back to in-memory array for the current session
Widget shows out-of-stock or deleted productsFilter server response to only include published: true products; never trust stored IDs to reflect current catalog state
Duplicate product appears at multiple positionsBefore prepending, filter out the existing entry for that product ID
Widget causes layout shift on loadReserve the widget's height with a min-height skeleton while data loads, or position it below the fold

Related Skills

  • @wishlist-save-for-later
  • @product-page-design
  • @product-comparison
  • @storefront-theming

平台分布

Codex

37.44%
按下载量换算55

Claude

29.38%
按下载量换算43

Cursor

17.15%
按下载量换算25

Gemini CLI

9.75%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills