Communitygithub.com

TerminalSkills/skills

使用 Umami 追蹤網站分析 — 這是一個注重隱私、開源的 Google Analytics 替代方案。當使用者詢問「追蹤網站分析」、「Umami」、「隱私友善分析」、「自架分析」、「GDPR 分析」、「取代 Google Analytics」或「無 Cookie 網站流量追蹤」時使用。涵蓋設定、事件追蹤、自訂屬性、API 與自架部署。

skills 是什麼?

此技能旨在協助 AI 代理整合 Umami,這是一個注重隱私的開源網頁分析平台,可作為 Google Analytics 的替代方案。它能處理從初始設定到自訂事件追蹤、API 存取及自架部署的完整任務。它支援多種平台,包含 Docker、Vercel、Netlify 和 Railway,並提供不同框架(如 Next.js)的追蹤腳本整合範例。其關鍵優勢在於完全符合 GDPR/CCPA 規範,無需 Cookie 同意橫幅,並且提供輕量級(小於 2KB)的腳本。代理能使用此技能自動部署 Umami、注入追蹤程式碼、設定自訂事件(例如按鈕點擊和表單提交),並透過 REST API 建構自訂儀表板,從而實現完整的網站分析工作流程。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/TerminalSkills/skills/tree/HEAD/skills/umami

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Umami

概述

Umami 是一個注重隱私的網頁分析平台 — 它在不使用 Cookie 或收集個人資料的情況下追蹤頁面瀏覽量、訪客和自訂事件。預設符合 GDPR/CCPA 規範(無需同意橫幅)。可在您自己的基礎架構上自架部署,或使用 Umami Cloud。提供簡潔的儀表板、即時統計資料以及用於程式化存取的 API。這是最受歡迎的開源 Google Analytics 替代方案。

使用時機

  • 需要網站分析但無需 Cookie 同意橫幅
  • 必須符合 GDPR/CCPA 規範
  • 不想將分析資料交給 Google
  • 想在自己的基礎架構上自架分析服務
  • 喜歡簡單、乾淨的分析功能,不想用 GA4 的複雜性
  • 需要透過 API 存取分析資料以建立儀表板或報表

說明

自架設定

# Docker Compose
git clone https://github.com/umami-software/umami.git
cd umami
docker compose up -d

# 或者一鍵部署到 Vercel/Netlify/Railway
# 請參閱:https://umami.is/docs/install

加入追蹤腳本

<!-- 加入到您網站的 <head> 中 -->
<script
  defer
  src="https://analytics.mysite.com/script.js"
  data-website-id="your-website-id"
></script>
// Next.js — app/layout.tsx
import Script from "next/script";

export default function RootLayout({ children }) {
  return (
    <html>
      <head>
        <Script
          defer
          src="https://analytics.mysite.com/script.js"
          data-website-id="your-website-id"
        />
      </head>
      <body>{children}</body>
    </html>
  );
}

自訂事件追蹤

// 追蹤自訂事件
// Umami 會暴露一個全域的 `umami` 物件

// 追蹤按鈕點擊
document.getElementById("signup-btn")?.addEventListener("click", () => {
  umami.track("signup-click", { plan: "pro", source: "header" });
});

// 追蹤表單提交
function handleSubmit(formData: FormData) {
  umami.track("form-submit", {
    form: "contact",
    subject: formData.get("subject"),
  });
}

// 在 React 中追蹤
function PricingCard({ plan }: { plan: string }) {
  return (
    <button
      onClick={() => umami.track("pricing-click", { plan })}
      data-umami-event="pricing-click"
      data-umami-event-plan={plan}
    >
      Choose {plan}
    </button>
  );
}

API 存取

// api/analytics.ts — 程式化擷取分析資料
const UMAMI_URL = "https://analytics.mysite.com";
const UMAMI_TOKEN = process.env.UMAMI_API_TOKEN;

async function getPageViews(websiteId: string, days = 30) {
  const endDate = Date.now();
  const startDate = endDate - days * 24 * 60 * 60 * 1000;

  const res = await fetch(
    `${UMAMI_URL}/api/websites/${websiteId}/pageviews?startAt=${startDate}&endAt=${endDate}&unit=day`,
    { headers: { Authorization: `Bearer ${UMAMI_TOKEN}` } }
  );
  return res.json();
}

async function getTopPages(websiteId: string) {
  const endDate = Date.now();
  const startDate = endDate - 7 * 24 * 60 * 60 * 1000;

  const res = await fetch(
    `${UMAMI_URL}/api/websites/${websiteId}/metrics?startAt=${startDate}&endAt=${endDate}&type=url`,
    { headers: { Authorization: `Bearer ${UMAMI_TOKEN}` } }
  );
  return res.json();  // [{ x: "/pricing", y: 1234 }, ...]
}

範例

範例 1:為 SaaS 加入隱私友善分析

使用者提示:「在我們的 SaaS 中加入分析功能,不使用 Cookie 或同意橫幅。」

代理將部署 Umami、加入追蹤腳本、設定關鍵動作(註冊、升級、功能使用)的自訂事件,並為內部儀表板建立 API 整合。

範例 2:建立自訂分析儀表板

使用者提示:「將我們的 Umami 資料匯入行銷團隊的自訂儀表板。」

代理將使用 Umami API 取得頁面瀏覽量、熱門頁面、來源和事件,然後在 React 儀表板中顯示。

指南

  • 無 Cookie = 無同意橫幅 — 預設符合 GDPR 規範
  • data-umami-event 屬性 — 無需 JavaScript 即可追蹤點擊
  • 使用 umami.track(name, data) 追蹤自訂事件 — 靈活的事件追蹤
  • 自架以獲得完整控制權 — Docker、Vercel、Railway 或任何 Node.js 主機
  • 用於程式化存取的 API — 建立自訂儀表板和報表
  • 多站台支援 — 一個 Umami 實例可追蹤多個網站
  • 即時儀表板 — 立即查看目前活躍訪客
  • UTM 追蹤 — 活動歸因自動生效
  • 輕量級腳本 — 小於 2KB,不會減慢您的網站速度
  • PostgreSQL 或 MySQL — 您可自由選擇後端資料庫

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

TerminalSkills/skills

>- Run GitHub Actions locally with act. Use when a user asks to test GitHub Actions workflows locally, debug CI pipelines without pushing, or run workflows offline.

TerminalSkills/skills

>- You are an expert in AG2 (formerly AutoGen), the open-source multi-agent conversation framework. You help developers build systems where multiple AI agents collaborate through structured conversations — with tool use, human-in-the-loop, code execution, group chat orchestration, and nested conversations — for complex tasks like software development, research, and data analysis.

TerminalSkills/skills

>- Generate short-form videos with AI — script writing, text-to-speech narration, stock footage selection, subtitle generation, and video assembly. Use when: creating TikTok/YouTube Shorts/Reels content, automating video production, building content pipelines.

TerminalSkills/skills

>- Animate 3D objects and characters in Blender with Python. Use when the user wants to keyframe properties, create armatures and rigs, set up IK/FK chains, animate shape keys for facial animation, edit F-Curves, use the NLA editor to blend actions, add drivers for expression-based animation, or script any animation workflow in Blender.

TerminalSkills/skills

>- Automate motion capture and tracking workflows in Blender with Python. Use when the user wants to import BVH or FBX mocap data, retarget motion to armatures, track camera or object motion from video, solve camera motion, clean up motion capture data, or script any tracking pipeline in Blender.

TerminalSkills/skills

>- You are an expert in Bolt.new by StackBlitz, the AI-powered full-stack development environment that runs entirely in the browser. You help developers go from idea to deployed app in minutes using natural language prompts — Bolt generates complete applications with frontend, backend, database, and deployment, all running in a WebContainer without local setup.

TerminalSkills/skills

>- Assists with using Bun as an all-in-one JavaScript/TypeScript runtime, package manager, bundler, and test runner. Use when building HTTP servers, managing packages, running tests, or migrating from Node.js. Trigger words: bun, bun serve, bun install, bun test, bun build, javascript runtime, bun runtime.

TerminalSkills/skills

>- Self-host customer support with Chatwoot. Use when a user asks to set up open-source customer support, add live chat without SaaS costs, build a multi-channel inbox, or deploy a free Intercom alternative.

TerminalSkills/skills

>- You are an expert in Chi, the lightweight, idiomatic Go HTTP router built on `net/http`. You help developers build composable HTTP services using Chi's middleware stack, route groups, URL parameters, sub-routers, and context-based request scoping — providing Express-like ergonomics while staying 100% compatible with Go's standard library.

TerminalSkills/skills

When the user wants to edit, review, or improve existing marketing copy. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' or 'copy sweep.' This skill provides a systematic approach to editing marketing copy through multiple focused passes.

TerminalSkills/skills

>- Add live chat and customer support with Crisp. Use when a user asks to add a chat widget, implement live customer support, set up a help desk, create a knowledge base, or add a chatbot to a website.

TerminalSkills/skills

>- Assists with building custom interactive data visualizations using D3.js. Use when creating charts, graphs, maps, force layouts, or hierarchical diagrams that require fine-grained control beyond what charting libraries provide. Trigger words: d3, data visualization, chart, svg, scales, force graph, treemap, choropleth.

TerminalSkills/skills

dbt (data build tool) transforms data in your warehouse using SQL SELECT statements. Learn project setup, models, tests, documentation, incremental materializations, and integration with data warehouses like PostgreSQL, BigQuery, and Snowflake.

TerminalSkills/skills

>- You are an expert in dlt, the open-source Python library for building data pipelines. You help developers load data from any API, file, or database into warehouses and lakes using simple Python decorators — with automatic schema inference, incremental loading, and built-in data contracts. dlt is the "requests library for data pipelines.

TerminalSkills/skills

Data Version Control for ML projects. Track large datasets and models alongside Git, build reproducible ML pipelines, and run experiments with metric comparison. Works with any storage backend including S3, GCS, Azure, and local filesystems.

TerminalSkills/skills

>- You are an expert in E2B, the cloud platform for running AI-generated code in secure sandboxes. You help developers give AI agents the ability to execute code, install packages, read/write files, and run long processes in isolated cloud environments — each sandbox is a lightweight VM that boots in ~150ms with full Linux, filesystem, and networking.

TerminalSkills/skills

>- Transcode, convert, edit, and process audio and video with FFmpeg. Use when a user asks to convert video formats (webm to mp4, mkv to mp4), extract audio from video, compress video files, trim or cut clips, concatenate videos, add subtitles, create thumbnails, apply filters, change resolution or bitrate, re-encode media, create GIFs from video, add watermarks, normalize audio, stream media, or build automated media processing pipelines.

TerminalSkills/skills

>- Create advanced animations with GSAP. Use when building complex timelines, scroll-driven animations, SVG morphing, text animations, or high-performance web animations beyond CSS capabilities.

TerminalSkills/skills

>- Generate deterministic MP4 videos from HTML, CSS, media, and seekable animations using HeyGen's HyperFrames framework. Use when someone asks to "render HTML to video", "make a video with HyperFrames", "create a programmatic video", "turn an animation into MP4", "build a launch/product video from HTML", "render GSAP/Lottie/Three.js to video", or set up an agent-driven video pipeline. Covers init/preview/render/add/lint/inspect commands, data-* timing attributes, animation adapters, and the component catalog.

TerminalSkills/skills

When the user wants to perform load testing, stress testing, or performance testing of APIs and websites using k6. Also use when the user mentions "k6," "load test," "performance test," "stress test," "spike test," "soak test," "thresholds," "virtual users," or "VUs." For browser-based testing, see selenium.

相關技能