From all-skills
Initialize development toolchains and conventions for new projects. Includes AGENTS.md, Prettier formatting, Vitest testing, AI agent skills, next-intl internationalization, and optional SaaS features (Supabase Auth/DB, Creem payments). Use when initializing new projects, scaffolding project structure, or configuring development toolchains.
How this skill is triggered — by the user, by Claude, or both
Slash command
/all-skills:project-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Quickly configure development toolchains, code standards, and AI agent skills for new projects. Automatically detects the project environment and adapts to the host project's package manager, framework, and existing toolchain. For Next.js SaaS projects, optionally configures Supabase authentication, database access, and Creem payment/subscription integration.
Quickly configure development toolchains, code standards, and AI agent skills for new projects. Automatically detects the project environment and adapts to the host project's package manager, framework, and existing toolchain. For Next.js SaaS projects, optionally configures Supabase authentication, database access, and Creem payment/subscription integration.
When executing the following steps, always detect the environment first, then adjust configuration based on the actual setup.
Before performing any operations, gather host project information:
Check package manager (determine by lockfile):
pnpm-lock.yaml → use pnpm add -Dyarn.lock → use yarn add -Dpackage-lock.json → use npm install -Dbun.lockb → use bun add -DCheck project type (read package.json dependencies):
next → Next.js projectvite → Vite projectCheck TypeScript:
tsconfig.json exists → TypeScript project (config files use .ts).js or .mjs)Check existing toolchain (read package.json devDependencies):
@antfu/eslint-config + eslint-plugin-format → Prettier already integrated via ESLinteslint-plugin-prettier → Prettier already integrated via ESLintprettier → Standalone Prettier already existsvitest → Vitest already existsCheck build tools:
vite.config.ts / vite.config.jsCheck SaaS dependencies (read package.json dependencies):
@supabase/supabase-js or @supabase/ssr → Supabase project (auth and/or database).env.local or .env.example containing CREEM_API_KEY → Creem payment configuredCheck SaaS file structure:
lib/supabase/ directory exists → Supabase client layer already set upapp/api/webhooks/creem/ directory exists → Creem webhook handler already presentlib/products.ts or lib/plans.ts exists → Payment/subscription product config presentAfter environment detection, ask the user which optional features they want to configure. If the user has already specified the modules in their initial request, skip the inquiry and proceed directly.
Present the following options to the user:
Please select the features to configure (multiple selections allowed):
Default (always enabled):
- [x] AGENTS.md project conventions
- [x] Prettier code formatting
- [x] Vitest testing framework
- [x] AI Agent Skills
- [x] ESLint code linting
Optional (select as needed):
- [ ] next-intl internationalization (Next.js projects)
- [ ] Supabase Auth authentication
- [ ] Supabase Database
- [ ] Creem Subscription payments
If environment detection found existing modules, annotate the options accordingly (e.g., "Supabase Auth (already detected)").
The following steps 3-6 and 11 are always executed. Steps 7-10 are only executed if the user selected them.
Read the template from templates/AGENTS.md and adjust based on detection results:
pnpm / yarn / npm / bun)type-check command is includedAGENTS.md in the project rootRefer to templates/prettier.config.md.
If Prettier is already integrated via ESLint (@antfu/eslint-config or eslint-plugin-prettier):
package.json has format and format:check scriptsIf no Prettier:
<pm> add -D prettier.prettierrc config file.prettierignore filepackage.json:
{
"format": "prettier --write .",
"format:check": "prettier --check ."
}
If Prettier already exists:
Refer to templates/vitest.config.md.
If Vitest already exists:
If no Vitest:
Install using the detected package manager:
<pm> add -D vitest @vitest/coverage-v8
Create config file:
vite.config.ts, or create standalone vitest.config.tsvitest.config.ts or vitest.config.mjs.ts extension (TypeScript project) or .mjs extension (JavaScript project)Add scripts to package.json:
{
"test": "vitest",
"test:run": "vitest run",
"test:coverage": "vitest run --coverage",
"test:ui": "vitest --ui"
}
Optional: Create vitest.setup.ts for global test configuration
Use the npx skills add command to install third-party skills into project-level .cursor/, .claude/, and .agents/ directories.
Important: Ensure you run these commands from the project root.
Execute the following commands sequentially (run each command individually, wait for completion before running the next):
# 1. Vercel React best practices + web design guidelines
npx skills add vercel-labs/agent-skills --skill vercel-react-best-practices web-design-guidelines --agent cursor claude-code agents -y
# 2. Frontend design guidelines
npx skills add anthropics/skills --skill frontend-design --agent cursor claude-code agents -y
# 3. shadcn/ui component patterns
npx skills add giuseppe-trisciuoglio/developer-kit --skill shadcn-ui --agent cursor claude-code agents -y
# 4. Vitest testing framework
npx skills add antfu/skills --skill vitest --agent cursor claude-code agents -y
Notes:
.cursor/skills/, .claude/skills/, and .agents/skills/ directoriesRefer to templates/next-intl.config.md.
Only execute this step if the user selected next-intl in Step 2.
Install using the detected package manager:
<pm> add next-intl
Create i18n/ directory and config files:
i18n/routing.ts - Define supported locales and default localei18n/request.ts - Configure request handlingi18n/navigation.ts - Export internationalized navigation componentsCreate languages/ directory and translation files:
languages/en.json - English translationslanguages/zh-CN.json - Simplified Chinese translationsUse proxy.ts instead of middleware.ts, otherwise you will get a warning: The "middleware" file convention is deprecated. Please use "proxy" instead. Learn more: https://nextjs.org/docs/messages/middleware-to-proxy
Update AGENTS.md to add internationalization-related instructions
Refer to templates/supabase-auth.config.md.
Only execute this step if the user selected Supabase Auth in Step 2.
If Supabase Auth is already configured (lib/supabase/client.ts exists):
If no Supabase Auth:
Install using the detected package manager:
<pm> add @supabase/supabase-js @supabase/ssr
Create lib/supabase/ directory with client files:
lib/supabase/client.ts - Browser client (uses createBrowserClient)lib/supabase/server.ts - Server client (uses createServerClient with cookie management)lib/supabase/middleware.ts - Middleware client (for auth in proxy/middleware)Create auth callback route:
app/auth/callback/route.ts - OAuth callback handler (exchanges code for session)Configure auth middleware:
proxy.ts (not middleware.ts)middleware.ts/work, /dashboard)Add environment variables to .env.example:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYOptional: Create hooks/use-auth.ts custom hook for client-side auth state
Refer to templates/supabase-db.config.md.
Only execute this step if the user selected Supabase Database in Step 2.
If Supabase database queries already exist (grep for .from( in lib/ or app/):
If no Supabase Database setup:
Ensure @supabase/supabase-js is installed (should be done in Step 8)
Verify server client in lib/supabase/server.ts supports database queries
Create admin client for server-side operations requiring elevated privileges:
lib/supabase/admin.ts - Uses SUPABASE_SERVICE_ROLE_KEY (server-only, never exposed to client)Create database type definitions:
npx supabase gen types typescript to auto-generate from schemaAdd environment variables to .env.example:
SUPABASE_SERVICE_ROLE_KEY (server-only)Document Row-Level Security (RLS) conventions:
user_id for user-scoped dataRefer to templates/creem-subscription.config.md.
Only execute this step if the user selected Creem Subscription in Step 2.
If Creem is already configured (app/api/webhooks/creem/ exists):
If no Creem setup:
Create product/plan configuration:
lib/products.ts - Define product tiers, pricing, feature limits, Creem product IDslib/constants.ts - Define free/pro tier limits, optional whitelistCreate checkout server action:
app/actions/subscription.ts - createCheckout() and getSubscriptionStatus() server actionsCreate webhook handler:
app/api/webhooks/creem/route.ts - POST handler for Creem webhook eventscheckout.completed, subscription.active, subscription.paid, subscription.canceled, subscription.expired, subscription.paused, subscription.past_due, subscription.scheduled_cancelCreate subscription utilities:
hooks/use-subscription.ts - Client-side hook for subscription status (uses SWR)Add environment variables to .env.example:
CREEM_API_KEY - Creem API keyCREEM_WEBHOOK_SECRET - Webhook signature verification secretNODE_TARGET - Environment target (production/staging)NEXT_PUBLIC_SITE_URL - Site URL for checkout redirectNEXT_PUBLIC_PROJECT_ID - Creem product IDCreate subscriptions table in Supabase (provide SQL to user):
id, user_id, creem_subscription_id, creem_customer_id, status, product_id, current_period_start, current_period_endConfigure ESLint based on https://github.com/antfu/eslint-config. The config should include:
import antfu from "@antfu/eslint-config";
export default antfu({
formatters: true,
react: true,
stylistic: false,
ignores: [
".agents/**/*",
".claude/**/*",
".cursor/**/*",
".vscode/**/*",
"components/ai-elements/**/*",
"components/ui/**/*",
],
});
After completing all configurations, present the following checklist to the user. Only include items that were actually configured based on the user's selection in Step 2:
✓ Project Setup Complete
Environment Info:
- Package manager: <detected-pm>
- Project type: <detected-type>
- TypeScript: <yes/no>
Completed Configurations:
- [x] AGENTS.md created
- [x] Prettier configured (<standalone/ESLint-integrated/already existed>)
- [x] Vitest configured (<newly installed/already existed>)
- [x] AI Skills installed (4 skills)
- [x] ESLint configured
- [x] next-intl configured (if selected)
- [x] Supabase Auth configured (if selected)
- [x] Supabase Database configured (if selected)
- [x] Creem Subscription configured (if selected)
Next Steps:
1. Run `<pm> install` to install dependencies
2. Run `<pm> run format` to format code
3. Run `<pm> run test` to verify test configuration
4. Review AGENTS.md for project conventions
5. Set up Supabase project at https://supabase.com and add env vars (if Supabase selected)
6. Configure Creem account at https://creem.io and add env vars (if Creem selected)
This skill includes the following template files in the templates/ directory:
AGENTS.md - Project development conventions templateprettier.config.md - Prettier configuration referencevitest.config.md - Vitest configuration referencenext-intl.config.md - next-intl configuration referencesupabase-auth.config.md - Supabase Auth configuration referencesupabase-db.config.md - Supabase Database configuration referencecreem-subscription.config.md - Creem payment/subscription configuration referenceRead these template files for detailed configuration content when executing setup.
If the project uses both Prettier and ESLint, ensure:
@antfu/eslint-config, the formatters option is enabledeslint-plugin-prettier, extends is configured correctly.prettierignore to avoid formatting conflictsNext.js projects require special Vitest configuration:
next() helper to handle Next.js-specific features@/ → ./src/)node or jsdom)If authentication is not working:
NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY are set correctlyproxy.ts (Next.js 16) or middleware.ts correctly refreshes the sessionIf webhooks are not being received:
CREEM_WEBHOOK_SECRET matches the secret in Creem dashboardreq.text()) before parsing for signature verificationIf npx skills add fails:
npm cache clean --forcenpm config set registry https://registry.npmjs.org/npx claudepluginhub yukiniro/skills --plugin all-skillsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.