ワンクリックで
autumn-add-usage-tracking
Skill for adding feature gating and usage tracking using Autumn.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Skill for adding feature gating and usage tracking using Autumn.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when finishing a feature, fixing a bug, before committing React code, or when the user types `/doctor`, asks to scan, triage, or clean up React diagnostics. Covers lint, accessibility, bundle size, architecture. Includes a regression check and a full local-triage workflow that fetches the canonical playbook.
Git workflow for pushing code and opening pull requests on GitHub. ALWAYS use this before you git push, push to a remote, open or create a pull request, raise a PR, or "ship" code. Covers confirming the user actually asked to push, cutting a Conventional-Commits feature branch off main, writing a Conventional-Commit PR title, and using the repo's .github PR template as the body. Use whenever the user says push, ship, open/create a PR, raise a pull request, or commit-and-push.
Fetch official brand/product/tool logos (Stripe, GitHub, Notion, AWS, Figma, etc.) as clean SVGs from SVGL (svgl.app) — as saved .svg files, inline markup, or installed React components. Check this whenever logos or SVGs come up, e.g. adding brand marks to integration/partner rows, footers, pricing tables, or slides; replacing a blurry logo with a vector; getting light/dark variants; or finding an official logo. Prefer it over hand-writing SVG markup or grabbing random files. Skip for generic UI icons, illustrations, charts, favicons from an existing logo, or designing a brand-new custom logo.
Expert guidance for Satori, the library that converts JSX/HTML and CSS into SVG (the engine behind dynamic Open Graph images and social cards). Use whenever writing or debugging Satori markup e.g. authoring JSX for OG images, choosing CSS that Satori actually supports, fixing layout that renders wrong, embedding fonts, rendering emoji or images, or resolving Satori errors like "Expected length unit" or unsupported property issues. Reach for this any time someone renders HTML/CSS to SVG or PNG with Satori, even if they do not name it.
Work with c15t consent management docs, APIs, and integrations for Next.js, React, and JavaScript. Use when the user asks about c15t setup, components, hooks, styling, cookie/consent UX, GDPR/CCPA/IAB TCF compliance, script or iframe blocking, GTM/GA4/PostHog/Meta integrations etc, or self-hosting c15t/backend.
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
| name | autumn-add-usage-tracking |
| description | Skill for adding feature gating and usage tracking using Autumn. |
Always consult docs.useautumn.com for code examples and latest API.
Autumn tracks feature usage and enforces limits. Backend checks required for security.
check → work → track
| Field | Description |
|---|---|
allowed | Can customer proceed |
balance | Units remaining |
included_usage | Total usage included in plan |
unlimited | No limit enforced |
| Type | Behavior |
|---|---|
boolean | Access granted or denied |
metered | Usage tracked against limit |
credit_system | Pool for multiple features |
| Layer | Purpose | Trust |
|---|---|---|
| Frontend | UX (show/hide UI) | Untrusted |
| Backend | Enforcement | Required |
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: process.env.AUTUMN_SECRET_KEY });
// 1. Check
const { data } = await autumn.check({ customer_id, feature_id: "api_calls" });
if (!data.allowed) return { error: "Limit reached" };
// 2. Work
const result = await doWork();
// 3. Track
await autumn.track({ customer_id, feature_id: "api_calls", value: 1 });
return result;
from autumn import Autumn
autumn = Autumn('am_sk_test_xxx')
response = await autumn.check(customer_id="user_123", feature_id="api_calls")
if not response.allowed:
raise HTTPException(403, "Limit reached")
result = await do_work()
await autumn.track(customer_id="user_123", feature_id="api_calls", value=1)
import { useCustomer } from "autumn-js/react";
const { check, refetch } = useCustomer();
const handleAction = async () => {
const { data } = await check({ featureId: "messages" });
if (!data?.allowed) {
showUpgradePrompt();
return;
}
await performAction();
await refetch();
};
const { customer } = useCustomer();
const feature = customer?.features?.api_calls;
<p>{feature?.balance} / {feature?.included_usage}</p>
Track the underlying metered feature, not the credit system:
// Config: credits → api_calls (1), image_gen (10)
// Wrong
await autumn.track({ customer_id, feature_id: "credits", value: 10 });
// Right - Autumn deducts 10 credits automatically
await autumn.track({ customer_id, feature_id: "image_gen", value: 1 });
idempotency_key to prevent double-countingvalue for bulk operations