npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

track-to-spm

v0.0.5

Published

将埋点方案文档落地为 Vue 单文件组件(SFC)中的 SPM SDK 调用。面向 Cursor / Agent Skills:在对话里 @ 方案 + 目标 `.vue` 时,按固定工作流解析、发现项目约定、选挂载点并生成最小 diff。

Readme

Track to SPM

skills.sh

埋点方案文档落地为 Vue 单文件组件(SFC)中的 SPM SDK 调用。面向 Cursor / Agent Skills:在对话里 @ 方案 + 目标 .vue 时,按固定工作流解析、发现项目约定、选挂载点并生成最小 diff。

适用场景

在以下情况启用本 Skill:

  • 用户 @ 埋点方案 + 目标 .vue,或明确要求按方案插入 SPM
  • 对话中出现:埋点、埋点方案、SPM、曝光 / 浏览 / 点击埋点、按方案落码

不适用(需先补方案或做 discovery):

  • 纯 SDK 升级、全仓埋点审计
  • 无方案、无目标 Vue、或事件类型无法从方案归一

安装

npx skills add bjmhe/track-to-spm

或在 Cursor 中通过 skills.sh 安装。

核心原则

  1. 方案是唯一事实来源 — SPM、事件类型、参数名、展示条件均来自当次文档。
  2. 代码是唯一样式来源 — SDK 包名、方法名、载荷字段、表达式、引号风格从目标 .vue 及同应用已有埋点复制,禁止凭记忆填写。
  3. 最小改动 — 仅补必要的 import 与埋点调用。

工作流

flowchart LR
  scheme[方案] --> parse[解析] --> discover[发现] --> mount[挂载] --> code[落码] --> deliver[交付]

| 步骤 | 参考文档 | 产出 | | ------ | ------------------------------------------------------------ | ----------------------------------- | | 1 解析 | references/parsing.md | [{ name, spm, event, paramKeys }] | | 2 发现 | references/discovery.md | Discovery Record + 文件:行 证据 | | 3 挂载 | references/mounting.md | 生命周期钩子 / 曝光条件 / handler | | 4 落码 | references/code-templates.md | 最小 diff | | 5 交付 | SKILL.md Master checklist | 对照表、假设、验证步骤 |

流程不清时可参阅 references/examples.md(仅作流程说明,禁止照抄其中的虚构字面量)。

交付物格式

Agent 完成落码后应输出:

## 落码对照表

| 方案描述 | SPM | 事件 | 插入位置 |
| ... | ... | ... | `文件:行` |

## 推断与假设

- …;依据:`文件:行`

## 验证步骤

1. …(对应方案中的用户操作)

项目结构

track-to-spm/
├── SKILL.md                 # Agent Skill 主入口(workflow、checklist、guardrails)
└── references/
    ├── parsing.md           # 解析方案表格 / 非表格文案
    ├── discovery.md         # 从仓库 rg 发现 SDK、方法名、载荷 key、表达式
    ├── mounting.md          # page_view / exposure / click 挂载位置
    ├── code-templates.md    # 有参 / 无参 / 曝光包裹模板
    └── examples.md          # 抽象演练(无真实 SPM)

约束摘要

  • 不猜测 SDK、载荷字段或业务表达式;rg 无证据则向用户确认。
  • 不以 SPM 段数推断事件类型;以方案「事件」列归一后再映射 .pv / .ep / .ck(或 discovery 读到的实际方法名)。
  • 曝光在 UI 对用户可见之后;点击在对应 handler 第一行
  • 不使用非当次方案的 SPM 或 if 条件。

完整清单见 SKILL.md