Agent Skillsnubjs/nub › download-stats

download-stats

GitHub

用于生成 nub 项目全量下载统计 CSV,覆盖 npm 和 GitHub 渠道。解决数据粒度、延迟及去重问题,支持图表与导出分析。

.claude/skills/download-stats/SKILL.md nubjs/nub

Trigger Scenarios

查询下载量或安装数 生成 adoption stats 报告 导出分发渠道统计数据

Install

npx skills add nubjs/nub --skill download-stats -g -y
More Options

Non-standard path

npx skills add https://github.com/nubjs/nub/tree/main/.claude/skills/download-stats -g -y

Use without installing

npx skills use nubjs/nub@download-stats

指定 Agent (Claude Code)

npx skills add nubjs/nub --skill download-stats -a claude-code -g -y

安装 repo 全部 skill

npx skills add nubjs/nub --all -g -y

预览 repo 内 skill

npx skills add nubjs/nub --list

SKILL.md

Frontmatter
{
    "name": "download-stats",
    "metadata": {
        "internal": true
    },
    "description": "Generate all-time download-stats CSVs for nub across its distribution channels (npm + GitHub release assets, which subsume Homebrew). Invoke (via the Skill tool) when asked to check, chart, or export download numbers, install counts, or adoption stats. Encodes the channel map, each channel's real granularity and lag, and the checksum-asset inflation gotcha."
}

download-stats — pull nub's download numbers into CSVs

One command generates the CSVs:

node scripts/download-stats.mjs            # writes tmp/download-stats/*.csv
node scripts/download-stats.mjs --npm-only # skip the gh-authenticated GitHub half
node scripts/download-stats.mjs --out <dir> --package @nubjs/nub --repo nubjs/nub

Outputs:

  • npm-daily.csv — one row per day since first publish: the meta package, each @nubjs/nub-<platform> package (auto-discovered from the meta package's optionalDependencies), platforms_total, and a running cumulative for the meta package.
  • github-releases.csv — per-release, per-asset cumulative download counters, stamped with snapshot_date. Re-running appends (replacing any same-day rows), so repeated runs accumulate the time series GitHub itself never provides.

Channel map — where a nub install actually lands

Install path Counted in
npm install -g @nubjs/nub (and CI installs via lockfile) npm registry counts
curl install.sh GitHub release assets
nub upgrade GitHub release assets
Homebrew tap (nubjs/homebrew-tap) GitHub release assets — the formula's url is the release nub-<platform>.tar.gz; taps get no formulae.brew.sh analytics (that API covers homebrew-core only)

The two channels are fully independent; summing them does not double-count. Within GitHub assets, brew / curl / nub upgrade are indistinguishable — the per-asset platform split is the only lens.

Granularity and gotchas (the reasons this skill exists)

  • npm: daily is the finest granularity. api.npmjs.org/downloads/range/<start>:<end>/<pkg> returns UTC-day buckets; there is no hourly API. A single request caps at ~18 months — the script stitches windows, so all-time works regardless of age.
  • npm lags ~2 days. The trailing day(s) read 0 until npm's batch job runs; the script trims trailing zero-days so charts don't show a fake cliff. Don't quote "yesterday" from npm.
  • Per-version npm splits have no historyapi.npmjs.org/versions/<pkg>/last-week is a trailing-7-day snapshot only.
  • GitHub asset counters are cumulative-only. No history endpoint exists; a time series only exists if you snapshot repeatedly (hence the append behavior). Deltas between snapshots = downloads in that interval.
  • Exclude .sha256 assets when quoting GitHub numbers. Every release ships a checksum file per tarball and installers fetch them; they inflate the raw sum ~15%. Filter asset !~ /sha256/ and asset !~ /^nub-launcher-/ for the real binary count — the launcher templates are fetched by nub compile to cross-compile, not by anyone installing nub.
  • The meta npm package is the canonical "installs" number. Platform packages roughly mirror it (each install pulls exactly one) but diverge on lockfile-driven CI, which can fetch platform tarballs at different rates — use them as an OS split, not a total.
  • npm counts are registry downloads (CI, mirrors, bots included), not unique users or machines.

Version History

  • b140840 Current 2026-08-16 20:09
  • 4fd083f 2026-07-19 12:03
  • ab079b4 2026-07-11 18:56

Same Skill Collection

.agents/skills/linux-vm-test/SKILL.md
.agents/skills/windows-vm-test/SKILL.md
.claude/skills/audit-thread/SKILL.md
.claude/skills/git-archaeology/SKILL.md
.claude/skills/linux-vm-test/SKILL.md
.claude/skills/md-toc/SKILL.md
.claude/skills/plan-thread/SKILL.md
.claude/skills/pm-perf-tracing/SKILL.md
.claude/skills/research-thread/SKILL.md
.claude/skills/soak/SKILL.md
.claude/skills/todo/SKILL.md
.claude/skills/type-declarations/SKILL.md
.claude/skills/windows-vm-test/SKILL.md
skills/nub/SKILL.md
.agents/skills/agent-browser/SKILL.md
.claude/skills/ad-hoc-test/SKILL.md
.claude/skills/address-issue/SKILL.md
.claude/skills/agent-browser/SKILL.md
.claude/skills/aube-bump/SKILL.md
.claude/skills/aube-sync/SKILL.md
.claude/skills/ci-adhoc-test/SKILL.md
.claude/skills/ci-triage/SKILL.md
.claude/skills/ci-watch/SKILL.md
.claude/skills/cpu-reduction/SKILL.md
.claude/skills/dev-loop/SKILL.md
.claude/skills/disk-reduction/SKILL.md
.claude/skills/dynamic-churn/SKILL.md
.claude/skills/epic/SKILL.md
.claude/skills/impact-analysis/SKILL.md
.claude/skills/implementation-thread/SKILL.md
.claude/skills/lat-md/SKILL.md
.claude/skills/probe-platforms/SKILL.md
.claude/skills/prose-writing/SKILL.md
.claude/skills/release/SKILL.md
.claude/skills/remote-build/SKILL.md
.claude/skills/rust-build-hygiene/SKILL.md
.claude/skills/rust-build/SKILL.md
.claude/skills/visual-review/SKILL.md
.claude/skills/worktree/SKILL.md

Metadata

Files
0
Version
b140840
Hash
4dd3c5c3
Indexed
2026-07-11 18:56

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-16 23:10
浙ICP备14020137号-1 $mapa de visitantes$