project-setup
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.
- License 许可
- MIT
- 所属仓库
- Yukiniro/skills
- 最近更新
- 2026-10-17
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- project-setup
- description
- 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.
02 资源文件 8
- 许可证LICENSE.txt1.0 KB
- 参考文档templates/AGENTS.md7.5 KB
- 参考文档templates/creem-subscription.config.md15.0 KB
- 参考文档templates/next-intl.config.md11.4 KB
- 参考文档templates/prettier.config.md6.5 KB
- 参考文档templates/supabase-auth.config.md14.3 KB
- 参考文档templates/supabase-db.config.md11.4 KB
- 参考文档templates/vitest.config.md11.2 KB
03 SKILL.md 正文
Project Setup
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.
Use Cases
- Initialize development environment for new projects
- Add standardized toolchain to existing projects
- Configure code formatting, test framework, and AI skills
- Configure internationalization for Next.js projects
- Configure Supabase Auth, Database, and Creem subscription for Next.js SaaS projects
Workflow
When executing the following steps, always detect the environment first, then adjust configuration based on the actual setup.
Step 1: Environment Detection
Before performing any operations, gather host project information:
Check package manager (determine by lockfile):
pnpm-lock.yaml→ usepnpm add -Dyarn.lock→ useyarn add -Dpackage-lock.json→ usenpm install -Dbun.lockb→ usebun add -D
Check project type (read package.json dependencies):
- Contains
next→ Next.js project - Contains
vite→ Vite project - Other → Generic Node.js project
Check TypeScript:
tsconfig.jsonexists → TypeScript project (config files use.ts)- Does not exist → JavaScript project (config files use
.jsor.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 exists
Check build tools:
- Vite project: check for
vite.config.ts/vite.config.js
Check SaaS dependencies (read package.json dependencies):
@supabase/supabase-jsor@supabase/ssr→ Supabase project (auth and/or database)- Check for
.env.localor.env.examplecontainingCREEM_API_KEY→ Creem payment configured
Check SaaS file structure:
lib/supabase/directory exists → Supabase client layer already set upapp/api/webhooks/creem/directory exists → Creem webhook handler already presentlib/products.tsorlib/plans.tsexists → Payment/subscription product config present
Step 2: Feature Selection
After 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.
Step 3: Create AGENTS.md
Read the template from templates/AGENTS.md and adjust based on detection results:
- Replace package manager commands (
pnpm/yarn/npm/bun) - Adjust build commands and file structure descriptions based on project type
- If TypeScript project, ensure
type-checkcommand is included - Write the adjusted content to
AGENTS.mdin the project root
Step 4: Configure Prettier
Refer to templates/prettier.config.md.
If Prettier is already integrated via ESLint (@antfu/eslint-config or eslint-plugin-prettier):
- Skip installation and config file creation
- Only verify
package.jsonhasformatandformat:checkscripts - If missing, add scripts suitable for the ESLint integration approach
If no Prettier:
- Install using the detected package manager:
<pm> add -D prettier - Create
.prettierrcconfig file - Create
.prettierignorefile - Add scripts to
package.json:{ "format": "prettier --write .", "format:check": "prettier --check ." }
If Prettier already exists:
- Check for config file, create one if missing
- Check for scripts, add them if missing
Step 5: Configure Vitest
Refer to templates/vitest.config.md.
If Vitest already exists:
- Check for config file, create one if missing
- Check for test scripts, add them if missing
If no Vitest:
-
Install using the detected package manager:
<pm> add -D vitest @vitest/coverage-v8 -
Create config file:
- Vite project: Add test config to
vite.config.ts, or create standalonevitest.config.ts - Next.js / other projects: Create standalone
vitest.config.tsorvitest.config.mjs - Use
.tsextension (TypeScript project) or.mjsextension (JavaScript project)
- Vite project: Add test config to
-
Add scripts to
package.json:{ "test": "vitest", "test:run": "vitest run", "test:coverage": "vitest run --coverage", "test:ui": "vitest --ui" } -
Optional: Create
vitest.setup.tsfor global test configuration
Step 6: Install AI Agent Skills
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:
- These commands will automatically create
.cursor/skills/,.claude/skills/, and.agents/skills/directories - If a command fails, check network connectivity and npm configuration
- Once installed, these skills will be available in all supported AI agents
Step 7: Configure next-intl (User selected)
Refer 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 components
-
Create
languages/directory and translation files:languages/en.json- English translationslanguages/zh-CN.json- Simplified Chinese translations- Add other languages as needed
-
Use
proxy.tsinstead ofmiddleware.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.mdto add internationalization-related instructions
Step 8: Configure Supabase Auth (User selected)
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):
- Verify all three client variants exist (browser, server, middleware)
- Check for auth callback route
- Check for auth middleware/proxy configuration
- Skip to the next step
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 (usescreateBrowserClient)lib/supabase/server.ts- Server client (usescreateServerClientwith 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:
- Next.js 16+: Add auth logic to
proxy.ts(notmiddleware.ts) - Next.js 15 and earlier: Add auth logic to
middleware.ts - Protect authenticated routes (e.g.,
/work,/dashboard) - Redirect unauthenticated users to login page
- Next.js 16+: Add auth logic to
-
Add environment variables to
.env.example:NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEY
-
Optional: Create
hooks/use-auth.tscustom hook for client-side auth state
Step 9: Configure Supabase Database (User selected)
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/):
- Verify server client is configured for database operations
- Check for admin client if webhook handlers exist
- Skip to the next step
If no Supabase Database setup:
-
Ensure
@supabase/supabase-jsis installed (should be done in Step 8) -
Verify server client in
lib/supabase/server.tssupports database queries -
Create admin client for server-side operations requiring elevated privileges:
lib/supabase/admin.ts- UsesSUPABASE_SERVICE_ROLE_KEY(server-only, never exposed to client)
-
Create database type definitions:
- Define TypeScript types for your database tables
- Or use
npx supabase gen types typescriptto auto-generate from schema
-
Add environment variables to
.env.example:SUPABASE_SERVICE_ROLE_KEY(server-only)
-
Document Row-Level Security (RLS) conventions:
- All tables should have RLS enabled
- Filter by
user_idfor user-scoped data - Use service role key only in trusted server-side contexts
Step 10: Configure Creem Subscription (User selected)
Refer 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):
- Verify webhook handler, product config, and checkout flow
- Skip to the next step
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 whitelist
-
Create checkout server action:
app/actions/subscription.ts-createCheckout()andgetSubscriptionStatus()server actions- Calls Creem API to create checkout session
- Returns checkout URL for client-side redirect
-
Create webhook handler:
app/api/webhooks/creem/route.ts- POST handler for Creem webhook events- Implement HMAC-SHA256 signature verification
- Handle events:
checkout.completed,subscription.active,subscription.paid,subscription.canceled,subscription.expired,subscription.paused,subscription.past_due,subscription.scheduled_cancel - Update subscription status in Supabase database using admin client
-
Create subscription utilities:
hooks/use-subscription.ts- Client-side hook for subscription status (uses SWR)- Implement tier-based feature gating (free vs pro limits)
-
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 ID
-
Create
subscriptionstable in Supabase (provide SQL to user):- Columns:
id,user_id,creem_subscription_id,creem_customer_id,status,product_id,current_period_start,current_period_end - Enable RLS with user-scoped read policy
- Columns:
Step 11: Configure Lint
Configure 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/**/*",
],
});
Step 12: Verification Checklist
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)
Template Files
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 reference
Read these template files for detailed configuration content when executing setup.
Troubleshooting
Prettier and ESLint Conflicts
If the project uses both Prettier and ESLint, ensure:
- When using
@antfu/eslint-config, the formatters option is enabled - When using
eslint-plugin-prettier, extends is configured correctly - When using standalone Prettier, add
.prettierignoreto avoid formatting conflicts
Vitest Configuration in Next.js
Next.js projects require special Vitest configuration:
- Use the
next()helper to handle Next.js-specific features - Configure path alias mapping (
@/→./src/) - Set the correct test environment (usually
nodeorjsdom)
Supabase Auth Issues
If authentication is not working:
- Verify
NEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_ANON_KEYare set correctly - Check that the auth callback route matches the redirect URL in Supabase dashboard
- Ensure
proxy.ts(Next.js 16) ormiddleware.tscorrectly refreshes the session - For OAuth providers, verify the callback URL is registered in Supabase Auth settings
Creem Webhook Issues
If webhooks are not being received:
- Verify
CREEM_WEBHOOK_SECRETmatches the secret in Creem dashboard - Ensure the webhook URL is publicly accessible (use ngrok for local development)
- Read the request body as raw text (
req.text()) before parsing for signature verification - Check HMAC-SHA256 signature verification logic
- Review webhook event payload structure against Creem API documentation
Skills Installation Failure
If npx skills add fails:
- Check network connectivity
- Try clearing npm cache:
npm cache clean --force - Manually set npm registry:
npm config set registry https://registry.npmjs.org/ - Review detailed error messages and follow the instructions
Best Practices
- Environment detection first: Always detect the environment first to avoid assumptions about project configuration
- Avoid overwriting: Check for existing configurations; only create new files when missing
- Adapt to package manager: Use the project's existing package manager for consistency
- Incremental configuration: Configure basic tools first, then add advanced features
- Verify configuration: After setup, suggest users run relevant commands to verify
04 同仓库更多 Skills
template-skill
Replace with description of the skill and when to use it.
work-weekly-report
Generate structured weekly work summaries from daily work logs. Use when: user provides daily work logs/notes and asks to create a weekly report/summary (周报/周工作总结), or when user pastes fragmented daily entries and wants them consolidated into a categorized summary. Triggers on keywords: 周报, 周工作总结, weekly summary, weekly report, 工作日志整理, 每日日志汇总.
squash-commits
Squash all commits on the current branch (relative to the main branch) into a single commit while preserving the branch name. Use when: user wants to squash commits, clean up branch history, compress multiple commits into one, or tidy up before merging. Triggers on: squash commits, 压缩提交, 合并提交, clean up commits, compress commits, squash branch, 整理提交记录, 合并为一个提交. Make sure to use this skill whenever the user mentions squashing, compressing, or cleaning up commit history on a branch, even if they don't use the exact term "squash".
smart-commit
Automated Git commit with Conventional Commits format. Analyzes staged changes, determines commit type and scope, detects description language from commit history (defaults to English), and generates a complete commit message. Use when the user says "commit", "smart commit", "提交代码", "帮我提交", or any variation of requesting a git commit with an auto-generated message.
setup-agents-md
创建、初始化或更新 AGENTS.md 通用工程原则文档时使用。触发词包括“创建 AGENTS.md”、“更新 AGENTS.md”、“初始化 AGENTS.md”、“setup AGENTS.md”、“create AGENTS.md”、“update AGENTS.md”。
resume-screener
Evaluate and grade resumes against job requirements using a 10-level grading system (C, B-, B, B+, A-, A, A+, S, SS, SSS). Provides multi-dimensional scoring with evidence-based reasoning and hiring recommendations. Use when screening candidates, comparing applicants, assessing resume-job fit, or filtering resumes. Supports Chinese and English resumes in any format (PDF, DOCX, text, image).