소스 정보
- 저장소
- miles990/claude-software-skills
- 최근 소스 활동
- 2026년 1월 8일 02:34
- 감지된 SKILL.md 언어
- 영어
- 스타
- 20
- 포크
- 5
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/miles990/claude-software-skills --skill saas-platforms명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | saas-platforms |
| description | SaaS architecture, multi-tenancy, and subscription management |
| domain | domain-applications |
| version | 1.0.0 |
| tags | ["saas","multi-tenancy","subscriptions","billing","onboarding"] |
| triggers | {"keywords":{"primary":["saas","multi-tenant","subscription","billing","tenant"],"secondary":["onboarding","feature flag","usage billing","plan","pricing tier"]},"context_boost":["platform","b2b","enterprise","organization"],"context_penalty":["mobile","game","desktop"],"priority":"high"} |
Building Software-as-a-Service applications with multi-tenancy, subscription billing, and user management.
// Strategy 1: Shared database with tenant_id column
interface TenantEntity {
tenantId: string;
// ... other fields
}
// Middleware to inject tenant context
function tenantMiddleware(req: Request, res: Response, next: NextFunction) {
const tenantId = req.headers['x-tenant-id'] || req.user?.tenantId;
if (!tenantId) {
return res.status(400).json({ error: 'Tenant ID required' });
}
req.tenantId = tenantId;
next();
}
// Prisma middleware for automatic tenant filtering
prisma.$use(async (params, next) => {
const tenantId = getCurrentTenantId();
if (params.model && hasTenantId(params.model)) {
// Add tenant filter to queries
if (params.action === 'findMany' || params.action === 'findFirst') {
params.args.where = {
...params.args.where,
tenantId,
};
}
// Add tenant ID to creates
if (params.action === 'create') {
params.args.data.tenantId = tenantId;
}
}
return next(params);
});
// Strategy 2: Schema per tenant (PostgreSQL)
async function createTenantSchema(tenantId: string) {
await prisma.$executeRaw`CREATE SCHEMA IF NOT EXISTS ${tenantId}`;
// Run migrations for new schema
await runMigrations(tenantId);
}
function getTenantConnection(tenantId: string) {
return new PrismaClient({
datasources: {
db: {
url: `${process.env.DATABASE_URL}?schema=${tenantId}`,
},
},
});
}
// Strategy 3: Database per tenant
async function createTenantDatabase(tenantId: string) {
const dbName = `tenant_${tenantId}`;
await adminDb.$executeRaw`CREATE DATABASE ${dbName}`;
return new PrismaClient({
datasources: {
db: {
url: `postgresql://user:pass@host:5432/${dbName}`,
},
},
});
}
// Row-level security with Prisma
const prisma = new PrismaClient().$extends({
query: {
$allModels: {
async findMany({ model, operation, args, query }) {
const tenantId = getCurrentTenantId();
args.where = { ...args.where, tenantId };
return query(args);
},
async create({ model, operation, args, query }) {
const tenantId = getCurrentTenantId();
args.data = { ...args.data, tenantId };
return query(args);
},
},
},
});
// PostgreSQL Row Level Security
/*
CREATE POLICY tenant_isolation ON projects
USING (tenant_id = current_setting('app.tenant_id')::uuid);
ALTER TABLE projects ENABLE ROW LEVEL SECURITY;
*/
// Set tenant context for RLS
async function withTenantContext<T>(
tenantId: string,
fn: () => Promise<T>
): Promise<T> {
await prisma.$executeRaw`SET app.tenant_id = ${tenantId}`;
try {
return await fn();
} finally {
await prisma.;
}
}
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
// Create subscription
async function createSubscription(
customerId: string,
priceId: string,
trialDays?: number
) {
const subscription = await stripe.subscriptions.create({
customer: customerId,
items: [{ price: priceId }],
trial_period_days: trialDays,
payment_behavior: 'default_incomplete',
payment_settings: { save_default_payment_method: 'on_subscription' },
expand: ['latest_invoice.payment_intent'],
});
return subscription;
}
// Update subscription
async function updateSubscription(subscriptionId: string, newPriceId: string) {
const subscription = await stripe.subscriptions.retrieve(subscriptionId);
return stripe.subscriptions.(subscriptionId, {
: [
{
: subscription..[].,
: newPriceId,
},
],
: ,
});
}
() {
(immediate) {
stripe..(subscriptionId);
}
stripe..(subscriptionId, {
: ,
});
}
() {
(event.) {
:
: {
subscription = event.. .;
(subscription);
;
}
: {
subscription = event.. .;
(subscription.);
;
}
: {
invoice = event.. .;
(invoice);
;
}
: {
invoice = event.. .;
(invoice);
;
}
}
}
() {
: <, > = {
: ,
: ,
: ,
};
prisma..({
: { : subscription. },
: {
: subscription.,
: subscription.,
: planMapping[subscription..[]..] || ,
: (subscription. * ),
},
});
}
// Track usage
async function recordUsage(
subscriptionItemId: string,
quantity: number,
timestamp?: number
) {
await stripe.subscriptionItems.createUsageRecord(subscriptionItemId, {
quantity,
timestamp: timestamp || Math.floor(Date.now() / 1000),
action: 'increment',
});
}
// Usage tracking service
class UsageTracker {
private buffer: Map<string, number> = new Map();
private flushInterval: NodeJS.Timeout;
constructor(private flushIntervalMs = 60000) {
this.flushInterval = setInterval(() => this.flush(), flushIntervalMs);
}
track(orgId: string, metric: string, amount = ) {
key = ;
..(key, (..(key) || ) + amount);
}
() {
entries = .(..());
..();
( [key, amount] entries) {
[orgId, metric] = key.();
prisma..({
: {
: orgId,
metric,
amount,
: (),
},
});
org = prisma..({
: { : orgId },
: { : },
});
(org?.) {
(org., amount);
}
}
}
}
interface Plan {
id: string;
name: string;
features: {
[key: string]: boolean | number;
};
limits: {
[key: string]: number;
};
}
const plans: Record<string, Plan> = {
free: {
id: 'free',
name: 'Free',
features: {
basicAnalytics: true,
advancedAnalytics: false,
apiAccess: false,
customBranding: false,
},
limits: {
projects: 3,
teamMembers: 1,
storage: 100, // MB
apiCalls: 1000,
},
},
pro: {
id: 'pro',
name: 'Pro',
features: {
basicAnalytics: true,
advancedAnalytics: true,
apiAccess: ,
: ,
},
: {
: ,
: ,
: ,
: ,
},
},
: {
: ,
: ,
: {
: ,
: ,
: ,
: ,
},
: {
: -,
: -,
: -,
: -,
},
},
};
(): {
plan = plans[org.];
plan?.[feature] ?? ;
}
(): {
plan = plans[org.];
limit = plan?.[resource] ?? ;
limit === - || current < limit;
}
() {
(: , : , : ) => {
org = (req.);
(!(org, feature)) {
res.().({
: ,
: ,
: (feature),
});
}
();
};
}
interface OnboardingStep {
id: string;
title: string;
completed: boolean;
skippable: boolean;
}
async function getOnboardingProgress(userId: string) {
const user = await prisma.user.findUnique({
where: { id: userId },
include: { organization: true },
});
const steps: OnboardingStep[] = [
{
id: 'profile',
title: 'Complete your profile',
completed: !!user.name && !!user.avatar,
skippable: true,
},
{
id: 'invite_team',
title: 'Invite team members',
completed: user.organization.memberCount > 1,
skippable: true,
},
{
id: 'create_project',
title: 'Create your first project',
completed: user.. > ,
: ,
},
{
: ,
: ,
: user.. > ,
: ,
},
];
completedCount = steps.( s.).;
{
steps,
: .((completedCount / steps.) * ),
: steps.( s. || s.),
};
}
Enterprise-grade repository analysis with arc42/C4 architecture documentation, technical debt quantification, security assessment, and multi-stakeholder reporting
Claude Code Plugin 開發、發布、安裝、更新與 Marketplace 管理完整指南
Flame Engine core fundamentals - components, input, collision, camera, animation, scenes
SOC 직업 분류 기준