用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill linktree-cost-tuning命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Implement user sign-up and sign-in flows with Clerk. Use when building authentication UI, customizing sign-in experience, or implementing OAuth social login. Trigger with phrases like "clerk sign-in", "clerk sign-up", "clerk login flow", "clerk OAuth", "clerk social login".
Implement session management and middleware with Clerk. Use when managing user sessions, configuring route protection, or implementing token refresh and custom JWT templates. Trigger with phrases like "clerk session", "clerk middleware", "clerk route protection", "clerk token", "clerk JWT".
Configure enterprise SSO, role-based access control, and organization management. Use when implementing SSO integration, configuring role-based permissions, or setting up organization-level controls. Trigger with phrases like "clerk SSO", "clerk RBAC", "clerk enterprise", "clerk roles", "clerk permissions", "clerk organizations".
正在显示 SKILL.md
基于 SOC 职业分类
| name | linktree-cost-tuning |
| description | Cost Tuning for Linktree. Trigger: "linktree cost tuning". |
| allowed-tools | Read, Write, Edit, Grep |
| version | 1.7.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","linktree","social"] |
| compatibility | Designed for Claude Code |
Linktree uses tiered pricing (Free, Starter, Pro, Premium) with cost scaling driven by analytics API call volume and link event tracking. Every page view, link click, and analytics query generates API activity. For brands managing multiple Linktree profiles or high-traffic pages with thousands of daily clicks, redundant analytics polling and uncached link data lookups create unnecessary API spend. Optimizing retrieval patterns and choosing the right tier based on actual feature usage prevents overpaying for unused premium capabilities.
| Component | Cost Driver | Optimization |
|---|---|---|
| Plan tier | Monthly subscription (Starter $5, Pro $9, Premium $24) | Audit feature usage — downgrade if premium features unused |
| Analytics API calls | Per-request for click/view data | Cache analytics responses; poll on 15-min intervals max |
| Link event tracking | Volume of click events across all links | Aggregate events client-side before API submission |
| Profile API reads | Repeated fetches of link tree structure | Cache profile data with 5-min TTL; structure changes rarely |
| Webhook deliveries | Events pushed per link interaction | Filter low-value events; batch webhook processing |
class LinktreeAnalyticsCache {
private cache = new Map<string, { data: any; expiry: number }>();
private readonly minPollInterval = 900_000; // 15 minutes
private lastPoll = 0;
async getAnalytics(profileId: string, fetchFn: () => Promise<any>): Promise<any> {
const cacheKey = `analytics:${profileId}`;
const cached = this.cache.get(cacheKey);
if (cached && Date.now() < cached.expiry) return cached.data;
if (Date.now() - this.lastPoll < this.minPollInterval) {
return cached?.data ?? null; // Return stale data rather than over-polling
}
this.lastPoll = .();
data = ();
..(cacheKey, { data, : .() + . });
data;
}
(: , : <>): <> {
cacheKey = ;
cached = ..(cacheKey);
(cached && .() < cached.) cached.;
data = ();
..(cacheKey, { data, : .() + });
data;
}
}
class LinktreeCostTracker {
private dailyCalls = { analytics: 0, profile: 0, events: 0 };
private budgets = { analytics: 1000, profile: 500, events: 5000 };
record(type: 'analytics' | 'profile' | 'events'): void {
this.dailyCalls[type]++;
const pct = (this.dailyCalls[type] / this.budgets[type]) * 100;
if (pct > 80) {
console.warn(`Linktree ${type} at ${pct.toFixed(0)}%: ${this.dailyCalls[type]}/${this.budgets[type]}`);
}
}
getReport(): Record<string, { used: number; budget: number }> {
.(
.(.).( [k, {
: .[k keyof .],
: .[k keyof .]
}])
);
}
}
| Issue | Cause | Fix |
|---|---|---|
| Analytics API rate limited | Polling more frequently than 15-min interval | Enforce minimum poll interval with cache layer |
| Stale profile data shown | Cache TTL too long after link edits | Invalidate profile cache on write operations |
| Event tracking costs spike | High-traffic page generating thousands of click events | Aggregate events in 1-minute batches before submission |
| Over-provisioned plan tier | Paying for Pro features used on Free tier | Audit feature matrix; match tier to actual usage |
| Webhook delivery failures | Processing too many low-value events | Filter events by type; only subscribe to high-value actions |
See linktree-performance-tuning.