Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

team-saasSaaS 团队

Agent Skill

team-saas 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,164

周安装

49

GitHub Stars

公开资料未说明

下载量

408
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:team-saas(SaaS 团队)
来源仓库:https://github.com/blink-new/claude
仓库路径:skills/team-saas
安装命令:
npx skills add https://github.com/blink-new/claude --skill team-saas
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/blink-new/claude --skill team-saas

简介

team-saas 用于处理 GitHub 仓库、Issue、Pull Request 等协作信息。

  • 适用于前端设计类任务,兼容 Codex、Claude、Cursor、Gemini CLI 等平台。
  • 通过 npx skills add 命令安装,具体行为以原始项目文档为准。
  • 部署前应评估权限需求、项目维护状态及是否涉及文件读写或命令执行。
  • team-saas 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Team SaaS Architecture Skill

Build production-grade multi-tenant SaaS applications with team workspaces, member invitation, authentication, and modern UI. Based on a proven architecture powering real production applications.

When to Use This Skill

Use when:

  • Building a new SaaS product with team/workspace functionality
  • Setting up multi-tenant authentication and authorization
  • Implementing team member invitation flows
  • Creating Linear/Vercel-style modern UI with light/dark mode
  • Setting up background job processing for SaaS
  • Deploying full-stack Next.js apps to Railway

Tech Stack Overview

LayerTechnologyVersion
FrameworkNext.js (App Router)16.x
ReactReact19.x
RuntimeBunLatest
DatabasePostgreSQL (Railway)-
ORMPrisma7.x
AuthNextAuth v5 (Auth.js)5.0.0-beta
UIshadcn/ui (new-york)Latest
StylingTailwind CSSv4
Themingnext-themesLatest
IconsLucide ReactLatest
StateTanStack React Query5.x
ValidationZod4.x
EmailResend6.x
StorageRailway S3-compatible-
Jobspg-boss12.x
HostingRailway-

Architecture Diagram

┌─────────────────────────────────────────────────────────────────────┐
│                        Next.js Application                          │
├─────────────────────────────────────────────────────────────────────┤
│  Landing Page     │    Auth Pages    │     Dashboard (Protected)    │
│  /                │    /login        │     /teams/[teamId]/*        │
│  /pricing         │    /register     │     /dashboard               │
│                   │    /invite/[t]   │     /settings                │
├─────────────────────────────────────────────────────────────────────┤
│                          API Routes                                 │
│  /api/auth/*      │  /api/teams/*    │  /api/uploads/*              │
│  /api/cron/*      │  /api/webhooks/* │  /api/invitations/*          │
├─────────────────────────────────────────────────────────────────────┤
│  proxy.ts (Security Headers)  │  layout.tsx (Auth Protection)       │
├─────────────────────────────────────────────────────────────────────┤
│                         Services Layer                              │
│  Prisma (DB)  │  Resend (Email)  │  S3 (Storage)  │  pg-boss (Jobs) │
└─────────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────────┐
│                      Railway Infrastructure                         │
│   PostgreSQL   │   S3 Bucket   │   Redis (optional)                 │
└─────────────────────────────────────────────────────────────────────┘

Core Patterns

1. Multi-Tenant Team Structure

Every data entity belongs to a team. Users can be members of multiple teams with roles.

User ─┬─> TeamMember ─> Team ─┬─> Creator
      │                       ├─> Campaign
      └─> TeamMember ─> Team  ├─> Content
                              └─> ... (all team resources)

2. Route Groups

src/app/
├── (auth)/              # Public auth pages (login, register)
│   └── layout.tsx       # Client component, styling only
├── (dashboard)/         # Protected authenticated routes
│   ├── layout.tsx       # Server component with auth() check + redirect
│   └── teams/[teamId]/  # Team-scoped pages
├── (marketing)/         # Public marketing pages
├── invite/[token]/      # Team invitation acceptance
└── api/                 # API routes

3. Route Protection Pattern (Layout-based, NOT middleware)

IMPORTANT: Auth protection is done via Server Component layout checks, NOT Edge middleware.

// src/app/(dashboard)/layout.tsx
import { auth } from "@/lib/auth";
import { redirect } from "next/navigation";

export default async function DashboardLayout({ children }) {
  const session = await auth();

  if (!session?.user) {
    redirect("/login");
  }

  return <DashboardShell session={session}>{children}</DashboardShell>;
}

4. API Route Permission Pattern

// Use api-helpers for clean, consistent patterns
import { requireTeamMember, parseJsonBody, withErrorHandler, ApiError } from "@/lib/api-helpers";

type RouteParams = {
  params: Promise<{ teamId: string }>;  // Next.js 15+ async params
};

export const POST = withErrorHandler(async (req: NextRequest, { params }: RouteParams) => {
  const { teamId } = await params;  // MUST await params

  const { userId, role } = await requireTeamMember(teamId);  // Throws 401/403

  if (role !== "ADMIN") {
    throw new ApiError("Admin access required", 403);
  }

  const data = await parseJsonBody(req, mySchema);  // Validates with Zod

  // ... business logic

  return NextResponse.json(result);
});

File Structure

src/
├── app/
│   ├── (auth)/                    # Auth pages (public)
│   │   ├── login/page.tsx
│   │   ├── register/page.tsx
│   │   └── layout.tsx             # Client component, no auth
│   ├── (dashboard)/               # Protected pages
│   │   ├── layout.tsx             # Server component, auth check
│   │   ├── dashboard-shell.tsx    # Sidebar + nav
│   │   └── teams/[teamId]/
│   ├── invite/[token]/page.tsx    # Invitation acceptance
│   ├── api/
│   │   ├── auth/[...nextauth]/route.ts
│   │   ├── teams/
│   │   │   ├── route.ts           # List/create teams
│   │   │   └── [teamId]/
│   │   │       ├── route.ts       # Team CRUD
│   │   │       ├── members/
│   │   │       └── invitations/
│   │   ├── invitations/
│   │   │   └── [token]/accept/route.ts
│   │   └── uploads/[...path]/route.ts  # S3 proxy
│   ├── globals.css                # Design system
│   ├── layout.tsx                 # Root layout with Providers
│   └── page.tsx                   # Landing page
├── components/
│   ├── ui/                        # shadcn components
│   ├── teams/                     # Team management
│   ├── invitations/               # Invitation UI
│   ├── shared/                    # Reusable patterns
│   ├── providers.tsx              # App providers
│   └── theme-toggle.tsx           # Theme switcher
├── hooks/
│   ├── use-teams.ts               # Team hooks
│   └── ...
├── lib/
│   ├── auth.ts                    # NextAuth config (Node.js runtime)
│   ├── auth.config.ts             # Auth config (callbacks, pages)
│   ├── api-helpers.ts             # withErrorHandler, requireTeamMember, etc.
│   ├── prisma.ts                  # Prisma client (lazy proxy)
│   ├── s3.ts                      # S3 utilities
│   ├── resend.ts                  # Email client
│   ├── query-client.ts            # React Query
│   ├── utils.ts                   # cn(), getInitials(), etc.
│   └── jobs/                      # pg-boss setup
├── proxy.ts                       # Security headers (NOT auth)
├── types/
│   └── next-auth.d.ts             # Auth type extensions
└── generated/
    └── prisma/                    # Prisma client output

Related Asset Files

This skill includes ready-to-use templates:

AssetDescription
assets/lib/auth.tsNextAuth v5 with Credentials provider
assets/lib/auth.config.tsAuth config (callbacks, custom pages)
assets/lib/api-helpers.tswithErrorHandler, requireTeamMember, ApiError
assets/lib/prisma.tsLazy-loaded Prisma client with pg adapter
assets/lib/s3.tsS3 utilities with presigned URLs
assets/lib/resend.tsResend email client + templates
assets/lib/query-client.tsReact Query setup
assets/lib/boss.tspg-boss job queue
assets/lib/utils.tsUtility functions
assets/components/providers.tsxApp providers
assets/components/theme-toggle.tsxLight/dark/system toggle
assets/components/team-switcher.tsxTeam dropdown
assets/config/globals.cssLinear-style design system
assets/config/DockerfileProduction Docker build
assets/config/railway.tomlRailway deployment
assets/config/next.config.tsNext.js configuration
assets/config/proxy.tsSecurity headers
assets/config/.env.exampleEnvironment variables
assets/config/components.jsonshadcn configuration
assets/prisma/schema.prismaBase team schema
assets/api/teams-route.tsTeam API template
assets/api/invitations-route.tsInvitations API template
assets/hooks/use-teams.tsReact Query hooks
assets/types/next-auth.d.tsType extensions

Setup Instructions

1. Initialize Project

bunx create-next-app@latest my-saas --typescript --tailwind --eslint --app --src-dir
cd my-saas

2. Install Dependencies

# Core
bun add next-auth@beta @auth/prisma-adapter bcryptjs
bun add @prisma/client @prisma/adapter-pg pg
bun add -D prisma @types/bcryptjs

# UI
bun add lucide-react
bun add next-themes class-variance-authority clsx tailwind-merge
bun add @tanstack/react-query

# Validation
bun add zod

# Email
bun add resend

# Storage
bun add @aws-sdk/client-s3 @aws-sdk/s3-request-presigner

# Jobs
bun add pg-boss

# shadcn
bunx shadcn@latest init
bunx shadcn@latest add button card dialog input label sonner tooltip dropdown-menu avatar badge form command popover

3. Configure Environment

Copy .env.example and fill in values:

# Required
DATABASE_URL="postgresql://..."
AUTH_SECRET="openssl rand -base64 32"
NEXTAUTH_URL="http://localhost:3000"
RESEND_API_KEY="re_..."
EMAIL_FROM="onboarding@resend.dev"

# S3 Storage (Railway)
AWS_ENDPOINT_URL="https://..."
AWS_ACCESS_KEY_ID="..."
AWS_SECRET_ACCESS_KEY="..."
AWS_S3_BUCKET_NAME="..."
AWS_DEFAULT_REGION="auto"

4. Setup Prisma

# Initialize
bunx prisma init

# Copy the schema from assets/prisma/schema.prisma
# Ensure generator uses "prisma-client" (not "prisma-client-js")
# Ensure output is "../src/generated/prisma"

# Push to database
bunx prisma db push
bunx prisma generate

5. Copy Asset Files

Copy the template files from assets/ to your project, adjusting imports as needed.

Design System

Brand Colors

Primary purple: #8b5cf6 (HSL: 262 83% 58%)

Light Mode

  • Background: #ffffff
  • Foreground: hsl(240 10% 10%)
  • Border: hsl(240 6% 90%)

Dark Mode (Linear-style)

  • Background: #0A0A0B (hsl 240 5% 4%)
  • Foreground: hsl(0 0% 95%)
  • Border: rgba(255,255,255,0.06)

Theme Toggle

Three-option segmented control with icons only:

  • Sun icon → Light
  • Moon icon → Dark
  • Monitor icon → System

Located in sidebar footer or header. Uses next-themes with attribute="class".

Typography

  • Font: Geist Sans / Geist Mono
  • Tight letter-spacing: -0.011em body, -0.02em headings
  • Font smoothing: antialiased

API Route Patterns

Route Handler Signature (Next.js 15+)

CRITICAL: In Next.js 15+, params is a Promise and MUST be awaited:

type RouteParams = {
  params: Promise<{ teamId: string }>;
};

export async function GET(req: NextRequest, { params }: RouteParams) {
  const { teamId } = await params;  // MUST await!
  // ...
}

Using withErrorHandler (Recommended)

import { NextRequest, NextResponse } from "next/server";
import { requireTeamMember, parseJsonBody, withErrorHandler, ApiError } from "@/lib/api-helpers";
import { prisma } from "@/lib/prisma";
import { z } from "zod";

const createSchema = z.object({
  name: z.string().min(1),
});

type RouteParams = {
  params: Promise<{ teamId: string }>;
};

export const POST = withErrorHandler(async (req: NextRequest, { params }: RouteParams) => {
  const { teamId } = await params;

  // Auth check - throws 401/403
  await requireTeamMember(teamId);

  // Parse and validate body - throws 400
  const { name } = await parseJsonBody(req, createSchema);

  // Business logic
  const result = await prisma.someModel.create({
    data: { name, teamId },
  });

  return NextResponse.json(result, { status: 201 });
});

React Query Keys

// Factory pattern for query keys
export const teamKeys = {
  all: ["teams"] as const,
  lists: () => [...teamKeys.all, "list"] as const,
  details: () => [...teamKeys.all, "detail"] as const,
  detail: (id: string) => [...teamKeys.details(), id] as const,
  members: (id: string) => [...teamKeys.detail(id), "members"] as const,
};

Mutation Pattern (Simple Invalidation)

export function useCreateTeam() {
  const queryClient = useQueryClient();

  return useMutation({
    mutationFn: createTeam,
    onSuccess: (newTeam) => {
      queryClient.invalidateQueries({ queryKey: teamKeys.lists() });
      queryClient.setQueryData(teamKeys.detail(newTeam.id), newTeam);
    },
  });
}

Background Jobs

pg-boss Setup

Jobs run alongside Next.js in the same container via startup script.

Queue pattern:

// Create job
await boss.send(QUEUES.SEND_EMAIL, payload, DEFAULT_JOB_OPTIONS);

// Worker handles job
boss.work(QUEUES.SEND_EMAIL, { batchSize: 1 }, async (job) => {
  await handleSendEmail(job.data);
});

Scheduled Jobs

// Schedule recurring jobs on worker startup
await boss.schedule(QUEUES.CLEANUP, "0 6 * * *", {}); // Daily at 6 AM UTC

Deployment

Dockerfile

Single container running both Next.js server and pg-boss worker:

FROM node:22-alpine
RUN npm install -g bun
# ... build steps ...
CMD ["/app/start.sh"]  # Runs both processes

Railway Config

[build]
builder = "dockerfile"

[deploy]
healthcheckPath = "/"
healthcheckTimeout = 300
restartPolicyType = "on_failure"

next.config.ts Rewrites

async rewrites() {
  return [
    {
      source: "/uploads/:path*",
      destination: "/api/uploads/:path*",
    },
  ];
}

Checklist

  • Project initialized with Next.js + TypeScript
  • Dependencies installed (see list above)
  • Environment variables configured
  • Prisma schema with User, Team, TeamMember, Invitation
  • NextAuth v5 with Credentials provider
  • Dashboard layout with server-side auth check
  • API helpers (withErrorHandler, requireTeamMember, etc.)
  • proxy.ts for security headers
  • Team creation and switching
  • Member invitation flow
  • Light/dark mode toggle
  • React Query configured
  • Resend email service
  • S3 storage with /uploads proxy
  • pg-boss for background jobs
  • Dockerfile for Railway deployment

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.73%
按下载量换算150

Claude

30.23%
按下载量换算123

Cursor

16.32%
按下载量换算67

Gemini CLI

9.66%
按下载量换算39

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills