Add Feature Skill
Add or configure optional features and integrations in this template.
Trigger
Use this skill when: user says "add [feature]", "enable [integration]", "setup [service]", or mentions specific integrations (payments, analytics, email, etc.)
Available Features
1. Payments (LemonSqueezy)
Enable:
- •Sign up at lemonsqueezy.com
- •Get API key from Settings → API
- •Add to
.env.local:codeLEMONSQUEEZY_API_KEY=your_api_key LEMONSQUEEZY_STORE_ID=your_store_id LEMONSQUEEZY_WEBHOOK_SECRET=your_webhook_secret
- •Create products/variants in LemonSqueezy dashboard
- •Update
lib/config/site.tspricing tiers with variant IDs - •The webhook at
/api/webhooks/lemonsqueezyhandles events
Usage:
tsx
import { createCheckout } from "@/lib/payments/lemonsqueezy";
// Create checkout
const checkoutUrl = await createCheckout({
variantId: "variant_id",
email: user.email,
customData: { userId: user.id },
});
2. Email (Resend)
Enable:
- •Sign up at resend.com
- •Verify your domain
- •Add to
.env.local:codeRESEND_API_KEY=re_xxxxx RESEND_FROM_EMAIL=hello@yourdomain.com
Usage:
tsx
import { sendEmail, emailTemplates } from "@/lib/email/resend";
// Send welcome email
await sendEmail({
to: user.email,
subject: "Welcome!",
html: emailTemplates.welcome({ name: user.name }),
});
3. Analytics (Posthog)
Enable:
- •Sign up at posthog.com
- •Create project and get API key
- •Add to
.env.local:codeNEXT_PUBLIC_POSTHOG_KEY=phc_xxxxx NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
Usage:
tsx
import { usePostHog } from "@/lib/analytics/posthog";
// Track event
const posthog = usePostHog();
posthog?.capture("button_clicked", { button_name: "signup" });
4. Error Tracking (Sentry)
Enable:
- •Sign up at sentry.io
- •Create project (Next.js)
- •Run setup wizard:
bash
npx @sentry/wizard@latest -i nextjs
- •Add DSN to
.env.local:codeNEXT_PUBLIC_SENTRY_DSN=https://xxx@sentry.io/xxx SENTRY_AUTH_TOKEN=sntrys_xxxxx
5. Blog with MDX
Enable:
- •Install dependencies:
bash
pnpm add @next/mdx @mdx-js/loader @mdx-js/react
- •Update
next.config.jsfor MDX support - •Create
content/blog/directory - •Add MDX files with frontmatter
6. Search (Command Palette)
Already included! The command palette (Cmd+K) is ready to use.
To customize:
- •Edit
components/command-palette.tsx - •Add custom commands and navigation
7. Real-time Features
Enable Supabase Realtime:
tsx
import { createClient } from "@/supabase/client";
// Subscribe to changes
const supabase = createClient();
const subscription = supabase
.channel("my-channel")
.on("postgres_changes", {
event: "*",
schema: "public",
table: "messages",
}, (payload) => {
console.log("Change:", payload);
})
.subscribe();
8. File Uploads
Enable with Supabase Storage:
- •Create bucket in Supabase dashboard
- •Set up RLS policies
tsx
import { createClient } from "@/supabase/client";
const supabase = createClient();
// Upload file
const { data, error } = await supabase.storage
.from("avatars")
.upload(`${userId}/avatar.png`, file);
Disable a Feature
To remove a feature:
- •Remove environment variables from
.env.local - •Remove the integration directory:
- •Payments:
rm -rf lib/payments/ - •Email:
rm -rf lib/email/ - •Analytics:
rm -rf lib/analytics/
- •Payments:
- •Remove from providers in
app/layout.tsx - •Remove unused dependencies from
package.json - •Update CLAUDE.md to note the feature is disabled
Checklist
- • Environment variables added
- • Integration tested locally
- • Error handling in place
- • Documentation updated
- • Build passes:
pnpm build