[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M70G7JZT7JY8KNDEGSSB3G9T":3,"skill-same:01M70G7JZT7JY8KNDEGSSB3G9T":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M70G7JZT7JY8KNDEGSSB3G9T","auth-implementation-patterns",null,"Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues.","shengdabai\u002FTony-Claude-Code-Skills","shengdabai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F116417419?v=4","01M70F6D2WY5PQV5A92BKYJQEW","Tony Sheng","01M70F6D3GAAAYZ5H4CC1G8VXM",3,"MIT","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002F_collections\u002Fplugins\u002Fdeveloper-essentials\u002Fskills\u002Fauth-implementation-patterns\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"patterns","auth implementation patterns","implementation","auth","use","session","Access Control","security","master","control systems","Scalable","secure","rbac","when","debugging","access","implementing","issues","authentication","session management","2026-11-10 10:12:30",false,"---\nname: auth-implementation-patterns\ndescription: Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues.\n---\n\n# Authentication & Authorization Implementation Patterns\n\nBuild secure, scalable authentication and authorization systems using industry-standard patterns and modern best practices.\n\n## When to Use This Skill\n\n- Implementing user authentication systems\n- Securing REST or GraphQL APIs\n- Adding OAuth2\u002Fsocial login\n- Implementing role-based access control (RBAC)\n- Designing session management\n- Migrating authentication systems\n- Debugging auth issues\n- Implementing SSO or multi-tenancy\n\n## Core Concepts\n\n### 1. Authentication vs Authorization\n\n**Authentication (AuthN)**: Who are you?\n- Verifying identity (username\u002Fpassword, OAuth, biometrics)\n- Issuing credentials (sessions, tokens)\n- Managing login\u002Flogout\n\n**Authorization (AuthZ)**: What can you do?\n- Permission checking\n- Role-based access control (RBAC)\n- Resource ownership validation\n- Policy enforcement\n\n### 2. Authentication Strategies\n\n**Session-Based:**\n- Server stores session state\n- Session ID in cookie\n- Traditional, simple, stateful\n\n**Token-Based (JWT):**\n- Stateless, self-contained\n- Scales horizontally\n- Can store claims\n\n**OAuth2\u002FOpenID Connect:**\n- Delegate authentication\n- Social login (Google, GitHub)\n- Enterprise SSO\n\n## JWT Authentication\n\n### Pattern 1: JWT Implementation\n\n```typescript\n\u002F\u002F JWT structure: header.payload.signature\nimport jwt from 'jsonwebtoken';\nimport { Request, Response, NextFunction } from 'express';\n\ninterface JWTPayload {\n    userId: string;\n    email: string;\n    role: string;\n    iat: number;\n    exp: number;\n}\n\n\u002F\u002F Generate JWT\nfunction generateTokens(userId: string, email: string, role: string) {\n    const accessToken = jwt.sign(\n        { userId, email, role },\n        process.env.JWT_SECRET!,\n        { expiresIn: '15m' }  \u002F\u002F Short-lived\n    );\n\n    const refreshToken = jwt.sign(\n        { userId },\n        process.env.JWT_REFRESH_SECRET!,\n        { expiresIn: '7d' }  \u002F\u002F Long-lived\n    );\n\n    return { accessToken, refreshToken };\n}\n\n\u002F\u002F Verify JWT\nfunction verifyToken(token: string): JWTPayload {\n    try {\n        return jwt.verify(token, process.env.JWT_SECRET!) as JWTPayload;\n    } catch (error) {\n        if (error instanceof jwt.TokenExpiredError) {\n            throw new Error('Token expired');\n        }\n        if (error instanceof jwt.JsonWebTokenError) {\n            throw new Error('Invalid token');\n        }\n        throw error;\n    }\n}\n\n\u002F\u002F Middleware\nfunction authenticate(req: Request, res: Response, next: NextFunction) {\n    const authHeader = req.headers.authorization;\n    if (!authHeader?.startsWith('Bearer ')) {\n        return res.status(401).json({ error: 'No token provided' });\n    }\n\n    const token = authHeader.substring(7);\n    try {\n        const payload = verifyToken(token);\n        req.user = payload;  \u002F\u002F Attach user to request\n        next();\n    } catch (error) {\n        return res.status(401).json({ error: 'Invalid token' });\n    }\n}\n\n\u002F\u002F Usage\napp.get('\u002Fapi\u002Fprofile', authenticate, (req, res) => {\n    res.json({ user: req.user });\n});\n```\n\n### Pattern 2: Refresh Token Flow\n\n```typescript\ninterface StoredRefreshToken {\n    token: string;\n    userId: string;\n    expiresAt: Date;\n    createdAt: Date;\n}\n\nclass RefreshTokenService {\n    \u002F\u002F Store refresh token in database\n    async storeRefreshToken(userId: string, refreshToken: string) {\n        const expiresAt = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000);\n        await db.refreshTokens.create({\n            token: await hash(refreshToken),  \u002F\u002F Hash before storing\n            userId,\n            expiresAt,\n        });\n    }\n\n    \u002F\u002F Refresh access token\n    async refreshAccessToken(refreshToken: string) {\n        \u002F\u002F Verify refresh token\n        let payload;\n        try {\n            payload = jwt.verify(\n                refreshToken,\n                process.env.JWT_REFRESH_SECRET!\n            ) as { userId: string };\n        } catch {\n            throw new Error('Invalid refresh token');\n        }\n\n        \u002F\u002F Check if token exists in database\n        const storedToken = await db.refreshTokens.findOne({\n            where: {\n                token: await hash(refreshToken),\n                userId: payload.userId,\n                expiresAt: { $gt: new Date() },\n            },\n        });\n\n        if (!storedToken) {\n            throw new Error('Refresh token not found or expired');\n        }\n\n        \u002F\u002F Get user\n        const user = await db.users.findById(payload.userId);\n        if (!user) {\n            throw new Error('User not found');\n        }\n\n        \u002F\u002F Generate new access token\n        const accessToken = jwt.sign(\n            { userId: user.id, email: user.email, role: user.role },\n            process.env.JWT_SECRET!,\n            { expiresIn: '15m' }\n        );\n\n        return { accessToken };\n    }\n\n    \u002F\u002F Revoke refresh token (logout)\n    async revokeRefreshToken(refreshToken: string) {\n        await db.refreshTokens.deleteOne({\n            token: await hash(refreshToken),\n        });\n    }\n\n    \u002F\u002F Revoke all user tokens (logout all devices)\n    async revokeAllUserTokens(userId: string) {\n        await db.refreshTokens.deleteMany({ userId });\n    }\n}\n\n\u002F\u002F API endpoints\napp.post('\u002Fapi\u002Fauth\u002Frefresh', async (req, res) => {\n    const { refreshToken } = req.body;\n    try {\n        const { accessToken } = await refreshTokenService\n            .refreshAccessToken(refreshToken);\n        res.json({ accessToken });\n    } catch (error) {\n        res.status(401).json({ error: 'Invalid refresh token' });\n    }\n});\n\napp.post('\u002Fapi\u002Fauth\u002Flogout', authenticate, async (req, res) => {\n    const { refreshToken } = req.body;\n    await refreshTokenService.revokeRefreshToken(refreshToken);\n    res.json({ message: 'Logged out successfully' });\n});\n```\n\n## Session-Based Authentication\n\n### Pattern 1: Express Session\n\n```typescript\nimport session from 'express-session';\nimport RedisStore from 'connect-redis';\nimport { createClient } from 'redis';\n\n\u002F\u002F Setup Redis for session storage\nconst redisClient = createClient({\n    url: process.env.REDIS_URL,\n});\nawait redisClient.connect();\n\napp.use(\n    session({\n        store: new RedisStore({ client: redisClient }),\n        secret: process.env.SESSION_SECRET!,\n        resave: false,\n        saveUninitialized: false,\n        cookie: {\n            secure: process.env.NODE_ENV === 'production',  \u002F\u002F HTTPS only\n            httpOnly: true,  \u002F\u002F No JavaScript access\n            maxAge: 24 * 60 * 60 * 1000,  \u002F\u002F 24 hours\n            sameSite: 'strict',  \u002F\u002F CSRF protection\n        },\n    })\n);\n\n\u002F\u002F Login\napp.post('\u002Fapi\u002Fauth\u002Flogin', async (req, res) => {\n    const { email, password } = req.body;\n\n    const user = await db.users.findOne({ email });\n    if (!user || !(await verifyPassword(password, user.passwordHash))) {\n        return res.status(401).json({ error: 'Invalid credentials' });\n    }\n\n    \u002F\u002F Store user in session\n    req.session.userId = user.id;\n    req.session.role = user.role;\n\n    res.json({ user: { id: user.id, email: user.email, role: user.role } });\n});\n\n\u002F\u002F Session middleware\nfunction requireAuth(req: Request, res: Response, next: NextFunction) {\n    if (!req.session.userId) {\n        return res.status(401).json({ error: 'Not authenticated' });\n    }\n    next();\n}\n\n\u002F\u002F Protected route\napp.get('\u002Fapi\u002Fprofile', requireAuth, async (req, res) => {\n    const user = await db.users.findById(req.session.userId);\n    res.json({ user });\n});\n\n\u002F\u002F Logout\napp.post('\u002Fapi\u002Fauth\u002Flogout', (req, res) => {\n    req.session.destroy((err) => {\n        if (err) {\n            return res.status(500).json({ error: 'Logout failed' });\n        }\n        res.clearCookie('connect.sid');\n        res.json({ message: 'Logged out successfully' });\n    });\n});\n```\n\n## OAuth2 \u002F Social Login\n\n### Pattern 1: OAuth2 with Passport.js\n\n```typescript\nimport passport from 'passport';\nimport { Strategy as GoogleStrategy } from 'passport-google-oauth20';\nimport { Strategy as GitHubStrategy } from 'passport-github2';\n\n\u002F\u002F Google OAuth\npassport.use(\n    new GoogleStrategy(\n        {\n            clientID: process.env.GOOGLE_CLIENT_ID!,\n            clientSecret: process.env.GOOGLE_CLIENT_SECRET!,\n            callbackURL: '\u002Fapi\u002Fauth\u002Fgoogle\u002Fcallback',\n        },\n        async (accessToken, refreshToken, profile, done) => {\n            try {\n                \u002F\u002F Find or create user\n                let user = await db.users.findOne({\n                    googleId: profile.id,\n                });\n\n                if (!user) {\n                    user = await db.users.create({\n                        googleId: profile.id,\n                        email: profile.emails?.[0]?.value,\n                        name: profile.displayName,\n                        avatar: profile.photos?.[0]?.value,\n                    });\n                }\n\n                return done(null, user);\n            } catch (error) {\n                return done(error, undefined);\n            }\n        }\n    )\n);\n\n\u002F\u002F Routes\napp.get('\u002Fapi\u002Fauth\u002Fgoogle', passport.authenticate('google', {\n    scope: ['profile', 'email'],\n}));\n\napp.get(\n    '\u002Fapi\u002Fauth\u002Fgoogle\u002Fcallback',\n    passport.authenticate('google', { session: false }),\n    (req, res) => {\n        \u002F\u002F Generate JWT\n        const tokens = generateTokens(req.user.id, req.user.email, req.user.role);\n        \u002F\u002F Redirect to frontend with token\n        res.redirect(`${process.env.FRONTEND_URL}\u002Fauth\u002Fcallback?token=${tokens.accessToken}`);\n    }\n);\n```\n\n## Authorization Patterns\n\n### Pattern 1: Role-Based Access Control (RBAC)\n\n```typescript\nenum Role {\n    USER = 'user',\n    MODERATOR = 'moderator',\n    ADMIN = 'admin',\n}\n\nconst roleHierarchy: Record\u003CRole, Role[]> = {\n    [Role.ADMIN]: [Role.ADMIN, Role.MODERATOR, Role.USER],\n    [Role.MODERATOR]: [Role.MODERATOR, Role.USER],\n    [Role.USER]: [Role.USER],\n};\n\nfunction hasRole(userRole: Role, requiredRole: Role): boolean {\n    return roleHierarchy[userRole].includes(requiredRole);\n}\n\n\u002F\u002F Middleware\nfunction requireRole(...roles: Role[]) {\n    return (req: Request, res: Response, next: NextFunction) => {\n        if (!req.user) {\n            return res.status(401).json({ error: 'Not authenticated' });\n        }\n\n        if (!roles.some(role => hasRole(req.user.role, role))) {\n            return res.status(403).json({ error: 'Insufficient permissions' });\n        }\n\n        next();\n    };\n}\n\n\u002F\u002F Usage\napp.delete('\u002Fapi\u002Fusers\u002F:id',\n    authenticate,\n    requireRole(Role.ADMIN),\n    async (req, res) => {\n        \u002F\u002F Only admins can delete users\n        await db.users.delete(req.params.id);\n        res.json({ message: 'User deleted' });\n    }\n);\n```\n\n### Pattern 2: Permission-Based Access Control\n\n```typescript\nenum Permission {\n    READ_USERS = 'read:users',\n    WRITE_USERS = 'write:users',\n    DELETE_USERS = 'delete:users',\n    READ_POSTS = 'read:posts',\n    WRITE_POSTS = 'write:posts',\n}\n\nconst rolePermissions: Record\u003CRole, Permission[]> = {\n    [Role.USER]: [Permission.READ_POSTS, Permission.WRITE_POSTS],\n    [Role.MODERATOR]: [\n        Permission.READ_POSTS,\n        Permission.WRITE_POSTS,\n        Permission.READ_USERS,\n    ],\n    [Role.ADMIN]: Object.values(Permission),\n};\n\nfunction hasPermission(userRole: Role, permission: Permission): boolean {\n    return rolePermissions[userRole]?.includes(permission) ?? false;\n}\n\nfunction requirePermission(...permissions: Permission[]) {\n    return (req: Request, res: Response, next: NextFunction) => {\n        if (!req.user) {\n            return res.status(401).json({ error: 'Not authenticated' });\n        }\n\n        const hasAllPermissions = permissions.every(permission =>\n            hasPermission(req.user.role, permission)\n        );\n\n        if (!hasAllPermissions) {\n            return res.status(403).json({ error: 'Insufficient permissions' });\n        }\n\n        next();\n    };\n}\n\n\u002F\u002F Usage\napp.get('\u002Fapi\u002Fusers',\n    authenticate,\n    requirePermission(Permission.READ_USERS),\n    async (req, res) => {\n        const users = await db.users.findAll();\n        res.json({ users });\n    }\n);\n```\n\n### Pattern 3: Resource Ownership\n\n```typescript\n\u002F\u002F Check if user owns resource\nasync function requireOwnership(\n    resourceType: 'post' | 'comment',\n    resourceIdParam: string = 'id'\n) {\n    return async (req: Request, res: Response, next: NextFunction) => {\n        if (!req.user) {\n            return res.status(401).json({ error: 'Not authenticated' });\n        }\n\n        const resourceId = req.params[resourceIdParam];\n\n        \u002F\u002F Admins can access anything\n        if (req.user.role === Role.ADMIN) {\n            return next();\n        }\n\n        \u002F\u002F Check ownership\n        let resource;\n        if (resourceType === 'post') {\n            resource = await db.posts.findById(resourceId);\n        } else if (resourceType === 'comment') {\n            resource = await db.comments.findById(resourceId);\n        }\n\n        if (!resource) {\n            return res.status(404).json({ error: 'Resource not found' });\n        }\n\n        if (resource.userId !== req.user.userId) {\n            return res.status(403).json({ error: 'Not authorized' });\n        }\n\n        next();\n    };\n}\n\n\u002F\u002F Usage\napp.put('\u002Fapi\u002Fposts\u002F:id',\n    authenticate,\n    requireOwnership('post'),\n    async (req, res) => {\n        \u002F\u002F User can only update their own posts\n        const post = await db.posts.update(req.params.id, req.body);\n        res.json({ post });\n    }\n);\n```\n\n## Security Best Practices\n\n### Pattern 1: Password Security\n\n```typescript\nimport bcrypt from 'bcrypt';\nimport { z } from 'zod';\n\n\u002F\u002F Password validation schema\nconst passwordSchema = z.string()\n    .min(12, 'Password must be at least 12 characters')\n    .regex(\u002F[A-Z]\u002F, 'Password must contain uppercase letter')\n    .regex(\u002F[a-z]\u002F, 'Password must contain lowercase letter')\n    .regex(\u002F[0-9]\u002F, 'Password must contain number')\n    .regex(\u002F[^A-Za-z0-9]\u002F, 'Password must contain special character');\n\n\u002F\u002F Hash password\nasync function hashPassword(password: string): Promise\u003Cstring> {\n    const saltRounds = 12;  \u002F\u002F 2^12 iterations\n    return bcrypt.hash(password, saltRounds);\n}\n\n\u002F\u002F Verify password\nasync function verifyPassword(\n    password: string,\n    hash: string\n): Promise\u003Cboolean> {\n    return bcrypt.compare(password, hash);\n}\n\n\u002F\u002F Registration with password validation\napp.post('\u002Fapi\u002Fauth\u002Fregister', async (req, res) => {\n    try {\n        const { email, password } = req.body;\n\n        \u002F\u002F Validate password\n        passwordSchema.parse(password);\n\n        \u002F\u002F Check if user exists\n        const existingUser = await db.users.findOne({ email });\n        if (existingUser) {\n            return res.status(400).json({ error: 'Email already registered' });\n        }\n\n        \u002F\u002F Hash password\n        const passwordHash = await hashPassword(password);\n\n        \u002F\u002F Create user\n        const user = await db.users.create({\n            email,\n            passwordHash,\n        });\n\n        \u002F\u002F Generate tokens\n        const tokens = generateTokens(user.id, user.email, user.role);\n\n        res.status(201).json({\n            user: { id: user.id, email: user.email },\n            ...tokens,\n        });\n    } catch (error) {\n        if (error instanceof z.ZodError) {\n            return res.status(400).json({ error: error.errors[0].message });\n        }\n        res.status(500).json({ error: 'Registration failed' });\n    }\n});\n```\n\n### Pattern 2: Rate Limiting\n\n```typescript\nimport rateLimit from 'express-rate-limit';\nimport RedisStore from 'rate-limit-redis';\n\n\u002F\u002F Login rate limiter\nconst loginLimiter = rateLimit({\n    store: new RedisStore({ client: redisClient }),\n    windowMs: 15 * 60 * 1000,  \u002F\u002F 15 minutes\n    max: 5,  \u002F\u002F 5 attempts\n    message: 'Too many login attempts, please try again later',\n    standardHeaders: true,\n    legacyHeaders: false,\n});\n\n\u002F\u002F API rate limiter\nconst apiLimiter = rateLimit({\n    windowMs: 60 * 1000,  \u002F\u002F 1 minute\n    max: 100,  \u002F\u002F 100 requests per minute\n    standardHeaders: true,\n});\n\n\u002F\u002F Apply to routes\napp.post('\u002Fapi\u002Fauth\u002Flogin', loginLimiter, async (req, res) => {\n    \u002F\u002F Login logic\n});\n\napp.use('\u002Fapi\u002F', apiLimiter);\n```\n\n## Best Practices\n\n1. **Never Store Plain Passwords**: Always hash with bcrypt\u002Fargon2\n2. **Use HTTPS**: Encrypt data in transit\n3. **Short-Lived Access Tokens**: 15-30 minutes max\n4. **Secure Cookies**: httpOnly, secure, sameSite flags\n5. **Validate All Input**: Email format, password strength\n6. **Rate Limit Auth Endpoints**: Prevent brute force attacks\n7. **Implement CSRF Protection**: For session-based auth\n8. **Rotate Secrets Regularly**: JWT secrets, session secrets\n9. **Log Security Events**: Login attempts, failed auth\n10. **Use MFA When Possible**: Extra security layer\n\n## Common Pitfalls\n\n- **Weak Passwords**: Enforce strong password policies\n- **JWT in localStorage**: Vulnerable to XSS, use httpOnly cookies\n- **No Token Expiration**: Tokens should expire\n- **Client-Side Auth Checks Only**: Always validate server-side\n- **Insecure Password Reset**: Use secure tokens with expiration\n- **No Rate Limiting**: Vulnerable to brute force\n- **Trusting Client Data**: Always validate on server\n\n## Resources\n\n- **references\u002Fjwt-best-practices.md**: JWT implementation guide\n- **references\u002Foauth2-flows.md**: OAuth2 flow diagrams and examples\n- **references\u002Fsession-security.md**: Secure session management\n- **assets\u002Fauth-security-checklist.md**: Security review checklist\n- **assets\u002Fpassword-policy-template.md**: Password requirements template\n- **scripts\u002Ftoken-validator.ts**: JWT validation utility\n","# Authentication & Authorization Implementation Patterns\n\nBuild secure, scalable authentication and authorization systems using industry-standard patterns and modern best practices.\n\n## When to Use This Skill\n\n- Implementing user authentication systems\n- Securing REST or GraphQL APIs\n- Adding OAuth2\u002Fsocial login\n- Implementing role-based access control (RBAC)\n- Designing session management\n- Migrating authentication systems\n- Debugging auth issues\n- Implementing SSO or multi-tenancy\n\n## Core Concepts\n\n### 1. Authentication vs Authorization\n\n**Authentication (AuthN)**: Who are you?\n- Verifying identity (username\u002Fpassword, OAuth, biometrics)\n- Issuing credentials (sessions, tokens)\n- Managing login\u002Flogout\n\n**Authorization (AuthZ)**: What can you do?\n- Permission checking\n- Role-based access control (RBAC)\n- Resource ownership validation\n- Policy enforcement\n\n### 2. Authentication Strategies\n\n**Session-Based:**\n- Server stores session state\n- Session ID in cookie\n- Traditional, simple, stateful\n\n**Token-Based (JWT):**\n- Stateless, self-contained\n- Scales horizontally\n- Can store claims\n\n**OAuth2\u002FOpenID Connect:**\n- Delegate authentication\n- Social login (Google, GitHub)\n- Enterprise SSO\n\n## JWT Authentication\n\n### Pattern 1: JWT Implementation\n\n```typescript\n\u002F\u002F JWT structure: header.payload.signature\nimport jwt from 'jsonwebtoken';\nimport { Request, Response, NextFunction } from 'express';\n\ninterface JWTPayload {\n    userId: string;\n    email: string;\n    role: string;\n    iat: number;\n    exp: number;\n}\n\n\u002F\u002F Generate JWT\nfunction generateTokens(userId: string, email: string, role: string) {\n    const accessToken = jwt.sign(\n        { userId, email, role },\n        process.env.JWT_SECRET!,\n        { expiresIn: '15m' }  \u002F\u002F Short-lived\n    );\n\n    const refreshToken = jwt.sign(\n        { userId },\n        process.env.JWT_REFRESH_SECRET!,\n        { expiresIn: '7d' }  \u002F\u002F Long-lived\n    );\n\n    return { accessToken, refreshToken };\n}\n\n\u002F\u002F Verify JWT\nfunction verifyToken(token: string): JWTPayload {\n    try {\n        return jwt.verify(token, process.env.JWT_SECRET!) as JWTPayload;\n    } catch (error) {\n        if (error instanceof jwt.TokenExpiredError) {\n            throw new Error('Token expired');\n        }\n        if (error instanceof jwt.JsonWebTokenError) {\n            throw new Error('Invalid token');\n        }\n        throw error;\n    }\n}\n\n\u002F\u002F Middleware\nfunction authenticate(req: Request, res: Response, next: NextFunction) {\n    const authHeader = req.headers.authorization;\n    if (!authHeader?.startsWith('Bearer ')) {\n        return res.status(401).json({ error: 'No token provided' });\n    }\n\n    const token = authHeader.substring(7);\n    try {\n        const payload = verifyToken(token);\n        req.user = payload;  \u002F\u002F Attach user to request\n        next();\n    } catch (error) {\n        return res.status(401).json({ error: 'Invalid token' });\n    }\n}\n\n\u002F\u002F Usage\napp.get('\u002Fapi\u002Fprofile', authenticate, (req, res) => {\n    res.json({ user: req.user });\n});\n```\n\n### Pattern 2: Refresh Token Flow\n\n```typescript\ninterface StoredRefreshToken {\n    token: string;\n    userId: string;\n    expiresAt: Date;\n    createdAt: Date;\n}\n\nclass RefreshTokenService {\n    \u002F\u002F Store refresh token in database\n    async storeRefreshToken(userId: string, refreshToken: string) {\n        const expiresAt = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000);\n        await db.refreshTokens.create({\n            token: await hash(refreshToken),  \u002F\u002F Hash before storing\n            userId,\n            expiresAt,\n        });\n    }\n\n    \u002F\u002F Refresh access token\n    async refreshAccessToken(refreshToken: string) {\n        \u002F\u002F Verify refresh token\n        let payload;\n        try {\n            payload = jwt.verify(\n                refreshToken,\n                process.env.JWT_REFRESH_SECRET!\n            ) as { userId: string };\n        } catch {\n            throw new Error('Invalid refresh token');\n        }\n\n        \u002F\u002F Check if token exists in database\n        const storedToken = await db.refreshTokens.findOne({\n            where: {\n                token: await hash(refreshToken),\n                userId: payload.userId,\n                expiresAt: { $gt: new Date() },\n            },\n        });\n\n        if (!storedToken) {\n            throw new Error('Refresh token not found or expired');\n        }\n\n        \u002F\u002F Get user\n        const user = await db.users.findById(payload.userId);\n        if (!user) {\n            throw new Error('User not found');\n        }\n\n        \u002F\u002F Generate new access token\n        const accessToken = jwt.sign(\n            { userId: user.id, email: user.email, role: user.role },\n            process.env.JWT_SECRET!,\n            { expiresIn: '15m' }\n        );\n\n        return { accessToken };\n    }\n\n    \u002F\u002F Revoke refresh token (logout)\n    async revokeRefreshToken(refreshToken: string) {\n        await db.refreshTokens.deleteOne({\n            token: await hash(refreshToken),\n        });\n    }\n\n    \u002F\u002F Revoke all user tokens (logout all devices)\n    async revokeAllUserTokens(userId: string) {\n        await db.refreshTokens.deleteMany({ userId });\n    }\n}\n\n\u002F\u002F API endpoints\napp.post('\u002Fapi\u002Fauth\u002Frefresh', async (req, res) => {\n    const { refreshToken } = req.body;\n    try {\n        const { accessToken } = await refreshTokenService\n            .refreshAccessToken(refreshToken);\n        res.json({ accessToken });\n    } catch (error) {\n        res.status(401).json({ error: 'Invalid refresh token' });\n    }\n});\n\napp.post('\u002Fapi\u002Fauth\u002Flogout', authenticate, async (req, res) => {\n    const { refreshToken } = req.body;\n    await refreshTokenService.revokeRefreshToken(refreshToken);\n    res.json({ message: 'Logged out successfully' });\n});\n```\n\n## Session-Based Authentication\n\n### Pattern 1: Express Session\n\n```typescript\nimport session from 'express-session';\nimport RedisStore from 'connect-redis';\nimport { createClient } from 'redis';\n\n\u002F\u002F Setup Redis for session storage\nconst redisClient = createClient({\n    url: process.env.REDIS_URL,\n});\nawait redisClient.connect();\n\napp.use(\n    session({\n        store: new RedisStore({ client: redisClient }),\n        secret: process.env.SESSION_SECRET!,\n        resave: false,\n        saveUninitialized: false,\n        cookie: {\n            secure: process.env.NODE_ENV === 'production',  \u002F\u002F HTTPS only\n            httpOnly: true,  \u002F\u002F No JavaScript access\n            maxAge: 24 * 60 * 60 * 1000,  \u002F\u002F 24 hours\n            sameSite: 'strict',  \u002F\u002F CSRF protection\n        },\n    })\n);\n\n\u002F\u002F Login\napp.post('\u002Fapi\u002Fauth\u002Flogin', async (req, res) => {\n    const { email, password } = req.body;\n\n    const user = await db.users.findOne({ email });\n    if (!user || !(await verifyPassword(password, user.passwordHash))) {\n        return res.status(401).json({ error: 'Invalid credentials' });\n    }\n\n    \u002F\u002F Store user in session\n    req.session.userId = user.id;\n    req.session.role = user.role;\n\n    res.json({ user: { id: user.id, email: user.email, role: user.role } });\n});\n\n\u002F\u002F Session middleware\nfunction requireAuth(req: Request, res: Response, next: NextFunction) {\n    if (!req.session.userId) {\n        return res.status(401).json({ error: 'Not authenticated' });\n    }\n    next();\n}\n\n\u002F\u002F Protected route\napp.get('\u002Fapi\u002Fprofile', requireAuth, async (req, res) => {\n    const user = await db.users.findById(req.session.userId);\n    res.json({ user });\n});\n\n\u002F\u002F Logout\napp.post('\u002Fapi\u002Fauth\u002Flogout', (req, res) => {\n    req.session.destroy((err) => {\n        if (err) {\n            return res.status(500).json({ error: 'Logout failed' });\n        }\n        res.clearCookie('connect.sid');\n        res.json({ message: 'Logged out successfully' });\n    });\n});\n```\n\n## OAuth2 \u002F Social Login\n\n### Pattern 1: OAuth2 with Passport.js\n\n```typescript\nimport passport from 'passport';\nimport { Strategy as GoogleStrategy } from 'passport-google-oauth20';\nimport { Strategy as GitHubStrategy } from 'passport-github2';\n\n\u002F\u002F Google OAuth\npassport.use(\n    new GoogleStrategy(\n        {\n            clientID: process.env.GOOGLE_CLIENT_ID!,\n            clientSecret: process.env.GOOGLE_CLIENT_SECRET!,\n            callbackURL: '\u002Fapi\u002Fauth\u002Fgoogle\u002Fcallback',\n        },\n        async (accessToken, refreshToken, profile, done) => {\n            try {\n                \u002F\u002F Find or create user\n                let user = await db.users.findOne({\n                    googleId: profile.id,\n                });\n\n                if (!user) {\n                    user = await db.users.create({\n                        googleId: profile.id,\n                        email: profile.emails?.[0]?.value,\n                        name: profile.displayName,\n                        avatar: profile.photos?.[0]?.value,\n                    });\n                }\n\n                return done(null, user);\n            } catch (error) {\n                return done(error, undefined);\n            }\n        }\n    )\n);\n\n\u002F\u002F Routes\napp.get('\u002Fapi\u002Fauth\u002Fgoogle', passport.authenticate('google', {\n    scope: ['profile', 'email'],\n}));\n\napp.get(\n    '\u002Fapi\u002Fauth\u002Fgoogle\u002Fcallback',\n    passport.authenticate('google', { session: false }),\n    (req, res) => {\n        \u002F\u002F Generate JWT\n        const tokens = generateTokens(req.user.id, req.user.email, req.user.role);\n        \u002F\u002F Redirect to frontend with token\n        res.redirect(`${process.env.FRONTEND_URL}\u002Fauth\u002Fcallback?token=${tokens.accessToken}`);\n    }\n);\n```\n\n## Authorization Patterns\n\n### Pattern 1: Role-Based Access Control (RBAC)\n\n```typescript\nenum Role {\n    USER = 'user',\n    MODERATOR = 'moderator',\n    ADMIN = 'admin',\n}\n\nconst roleHierarchy: Record\u003CRole, Role[]> = {\n    [Role.ADMIN]: [Role.ADMIN, Role.MODERATOR, Role.USER],\n    [Role.MODERATOR]: [Role.MODERATOR, Role.USER],\n    [Role.USER]: [Role.USER],\n};\n\nfunction hasRole(userRole: Role, requiredRole: Role): boolean {\n    return roleHierarchy[userRole].includes(requiredRole);\n}\n\n\u002F\u002F Middleware\nfunction requireRole(...roles: Role[]) {\n    return (req: Request, res: Response, next: NextFunction) => {\n        if (!req.user) {\n            return res.status(401).json({ error: 'Not authenticated' });\n        }\n\n        if (!roles.some(role => hasRole(req.user.role, role))) {\n            return res.status(403).json({ error: 'Insufficient permissions' });\n        }\n\n        next();\n    };\n}\n\n\u002F\u002F Usage\napp.delete('\u002Fapi\u002Fusers\u002F:id',\n    authenticate,\n    requireRole(Role.ADMIN),\n    async (req, res) => {\n        \u002F\u002F Only admins can delete users\n        await db.users.delete(req.params.id);\n        res.json({ message: 'User deleted' });\n    }\n);\n```\n\n### Pattern 2: Permission-Based Access Control\n\n```typescript\nenum Permission {\n    READ_USERS = 'read:users',\n    WRITE_USERS = 'write:users',\n    DELETE_USERS = 'delete:users',\n    READ_POSTS = 'read:posts',\n    WRITE_POSTS = 'write:posts',\n}\n\nconst rolePermissions: Record\u003CRole, Permission[]> = {\n    [Role.USER]: [Permission.READ_POSTS, Permission.WRITE_POSTS],\n    [Role.MODERATOR]: [\n        Permission.READ_POSTS,\n        Permission.WRITE_POSTS,\n        Permission.READ_USERS,\n    ],\n    [Role.ADMIN]: Object.values(Permission),\n};\n\nfunction hasPermission(userRole: Role, permission: Permission): boolean {\n    return rolePermissions[userRole]?.includes(permission) ?? false;\n}\n\nfunction requirePermission(...permissions: Permission[]) {\n    return (req: Request, res: Response, next: NextFunction) => {\n        if (!req.user) {\n            return res.status(401).json({ error: 'Not authenticated' });\n        }\n\n        const hasAllPermissions = permissions.every(permission =>\n            hasPermission(req.user.role, permission)\n        );\n\n        if (!hasAllPermissions) {\n            return res.status(403).json({ error: 'Insufficient permissions' });\n        }\n\n        next();\n    };\n}\n\n\u002F\u002F Usage\napp.get('\u002Fapi\u002Fusers',\n    authenticate,\n    requirePermission(Permission.READ_USERS),\n    async (req, res) => {\n        const users = await db.users.findAll();\n        res.json({ users });\n    }\n);\n```\n\n### Pattern 3: Resource Ownership\n\n```typescript\n\u002F\u002F Check if user owns resource\nasync function requireOwnership(\n    resourceType: 'post' | 'comment',\n    resourceIdParam: string = 'id'\n) {\n    return async (req: Request, res: Response, next: NextFunction) => {\n        if (!req.user) {\n            return res.status(401).json({ error: 'Not authenticated' });\n        }\n\n        const resourceId = req.params[resourceIdParam];\n\n        \u002F\u002F Admins can access anything\n        if (req.user.role === Role.ADMIN) {\n            return next();\n        }\n\n        \u002F\u002F Check ownership\n        let resource;\n        if (resourceType === 'post') {\n            resource = await db.posts.findById(resourceId);\n        } else if (resourceType === 'comment') {\n            resource = await db.comments.findById(resourceId);\n        }\n\n        if (!resource) {\n            return res.status(404).json({ error: 'Resource not found' });\n        }\n\n        if (resource.userId !== req.user.userId) {\n            return res.status(403).json({ error: 'Not authorized' });\n        }\n\n        next();\n    };\n}\n\n\u002F\u002F Usage\napp.put('\u002Fapi\u002Fposts\u002F:id',\n    authenticate,\n    requireOwnership('post'),\n    async (req, res) => {\n        \u002F\u002F User can only update their own posts\n        const post = await db.posts.update(req.params.id, req.body);\n        res.json({ post });\n    }\n);\n```\n\n## Security Best Practices\n\n### Pattern 1: Password Security\n\n```typescript\nimport bcrypt from 'bcrypt';\nimport { z } from 'zod';\n\n\u002F\u002F Password validation schema\nconst passwordSchema = z.string()\n    .min(12, 'Password must be at least 12 characters')\n    .regex(\u002F[A-Z]\u002F, 'Password must contain uppercase letter')\n    .regex(\u002F[a-z]\u002F, 'Password must contain lowercase letter')\n    .regex(\u002F[0-9]\u002F, 'Password must contain number')\n    .regex(\u002F[^A-Za-z0-9]\u002F, 'Password must contain special character');\n\n\u002F\u002F Hash password\nasync function hashPassword(password: string): Promise\u003Cstring> {\n    const saltRounds = 12;  \u002F\u002F 2^12 iterations\n    return bcrypt.hash(password, saltRounds);\n}\n\n\u002F\u002F Verify password\nasync function verifyPassword(\n    password: string,\n    hash: string\n): Promise\u003Cboolean> {\n    return bcrypt.compare(password, hash);\n}\n\n\u002F\u002F Registration with password validation\napp.post('\u002Fapi\u002Fauth\u002Fregister', async (req, res) => {\n    try {\n        const { email, password } = req.body;\n\n        \u002F\u002F Validate password\n        passwordSchema.parse(password);\n\n        \u002F\u002F Check if user exists\n        const existingUser = await db.users.findOne({ email });\n        if (existingUser) {\n            return res.status(400).json({ error: 'Email already registered' });\n        }\n\n        \u002F\u002F Hash password\n        const passwordHash = await hashPassword(password);\n\n        \u002F\u002F Create user\n        const user = await db.users.create({\n            email,\n            passwordHash,\n        });\n\n        \u002F\u002F Generate tokens\n        const tokens = generateTokens(user.id, user.email, user.role);\n\n        res.status(201).json({\n            user: { id: user.id, email: user.email },\n            ...tokens,\n        });\n    } catch (error) {\n        if (error instanceof z.ZodError) {\n            return res.status(400).json({ error: error.errors[0].message });\n        }\n        res.status(500).json({ error: 'Registration failed' });\n    }\n});\n```\n\n### Pattern 2: Rate Limiting\n\n```typescript\nimport rateLimit from 'express-rate-limit';\nimport RedisStore from 'rate-limit-redis';\n\n\u002F\u002F Login rate limiter\nconst loginLimiter = rateLimit({\n    store: new RedisStore({ client: redisClient }),\n    windowMs: 15 * 60 * 1000,  \u002F\u002F 15 minutes\n    max: 5,  \u002F\u002F 5 attempts\n    message: 'Too many login attempts, please try again later',\n    standardHeaders: true,\n    legacyHeaders: false,\n});\n\n\u002F\u002F API rate limiter\nconst apiLimiter = rateLimit({\n    windowMs: 60 * 1000,  \u002F\u002F 1 minute\n    max: 100,  \u002F\u002F 100 requests per minute\n    standardHeaders: true,\n});\n\n\u002F\u002F Apply to routes\napp.post('\u002Fapi\u002Fauth\u002Flogin', loginLimiter, async (req, res) => {\n    \u002F\u002F Login logic\n});\n\napp.use('\u002Fapi\u002F', apiLimiter);\n```\n\n## Best Practices\n\n1. **Never Store Plain Passwords**: Always hash with bcrypt\u002Fargon2\n2. **Use HTTPS**: Encrypt data in transit\n3. **Short-Lived Access Tokens**: 15-30 minutes max\n4. **Secure Cookies**: httpOnly, secure, sameSite flags\n5. **Validate All Input**: Email format, password strength\n6. **Rate Limit Auth Endpoints**: Prevent brute force attacks\n7. **Implement CSRF Protection**: For session-based auth\n8. **Rotate Secrets Regularly**: JWT secrets, session secrets\n9. **Log Security Events**: Login attempts, failed auth\n10. **Use MFA When Possible**: Extra security layer\n\n## Common Pitfalls\n\n- **Weak Passwords**: Enforce strong password policies\n- **JWT in localStorage**: Vulnerable to XSS, use httpOnly cookies\n- **No Token Expiration**: Tokens should expire\n- **Client-Side Auth Checks Only**: Always validate server-side\n- **Insecure Password Reset**: Use secure tokens with expiration\n- **No Rate Limiting**: Vulnerable to brute force\n- **Trusting Client Data**: Always validate on server\n\n## Resources\n\n- **references\u002Fjwt-best-practices.md**: JWT implementation guide\n- **references\u002Foauth2-flows.md**: OAuth2 flow diagrams and examples\n- **references\u002Fsession-security.md**: Secure session management\n- **assets\u002Fauth-security-checklist.md**: Security review checklist\n- **assets\u002Fpassword-policy-template.md**: Password requirements template\n- **scripts\u002Ftoken-validator.ts**: JWT validation utility\n",{"name":5,"description":7},"main","7850740bd837adb32f0a109ab2af82482196c6f2","skills\u002F_collections\u002Fplugins\u002Fdeveloper-essentials\u002Fskills\u002Fauth-implementation-patterns",1,"https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills","https:\u002F\u002Fzturnsgo.com","https:\u002F\u002Fgithub.com\u002Fshengdabai","https:\u002F\u002Fzturnsgo.com\u002F","AI × education creator — producer, not consumer. Taught 6,000+ learners; shipping learning tools & daily essays with Claude Code, practicing @xiaolai's way 🥋","2026-11-01 21:28:23",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add shengdabai\u002FTony-Claude-Code-Skills --skill auth-implementation-patterns",{"tool":60,"command":61},"bunx","bunx skills add shengdabai\u002FTony-Claude-Code-Skills --skill auth-implementation-patterns",{"tool":63,"command":64},"pnpm","pnpm dlx skills add shengdabai\u002FTony-Claude-Code-Skills --skill auth-implementation-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002F_collections\u002Fplugins\u002Fdeveloper-essentials\u002Fskills\u002Fauth-implementation-patterns\u002FSKILL.md",true,[],[69,78,86,94,102,110],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":73,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":77},"01M73H7XKBHE1ETQDZT94MF9HH","seedance-prompt-en","Write effective prompts for Jimeng Seedance 2.0 multimodal AI video generation. Use when users want to create video prompts using text, images, videos, and audio inputs with the @ reference system. Covers camera movements, effects replication, video extension, editing, music beat-matching, e-commerce ads, short dramas, and educational content.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fseedance-prompt-en\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fseedance-prompt-en\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":82,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":77},"01M73GRE9998Q1DZWC71N41JWG","onepage-pdf","Convert an HTML page into a single continuous-page PDF (one tall page, no pagination breaks), preserving desktop layout, backgrounds and selectable text. Use when the user asks to turn an HTML file\u002Freport\u002Fproposal into a \"single-page PDF\", \"long PDF\", \"不分页 PDF\", \"单页 PDF\", \"长图式 PDF\", or complains that an HTML-to-PDF export breaks into pages or cuts content. Supports optional string redaction with leak verification.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fonepage-pdf\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fonepage-pdf\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":90,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":77},"01M73GQG1KZDADVPV3MHAT1J5A","native-feel-cross-platform-desktop","Use when the user is designing, prototyping, or rewriting a desktop app that must run on multiple OSes (macOS + Windows, optionally Linux) AND feel indistinguishable from a native app to its users — fast launch, native windowing, native input handling, native materials. Trigger words include \"cross-platform desktop\", \"Electron alternative\", \"Tauri vs native\", \"WebView wrapper\", \"near-native performance\", \"Raycast architecture\", \"WebKit\u002FWebView2 quirks\", \"WKWebView\", \"system tray app\", \"global hotkey app\", \"launcher app\". Do NOT trigger this skill for pure web apps, pure mobile apps, or for greenfield projects that have no native-feel requirement.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnative-feel-cross-platform-desktop\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnative-feel-cross-platform-desktop\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":98,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":77},"01M73G87PDNSMKG2FHWCYER6N8","gstack","Router for the gstack skill suite. (gstack)","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fgstack\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fgstack\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":106,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":77},"01M73G3EAQWKCM8DB8D0N0QSVG","fireworks-tech-graph","Use when the user wants to create any technical diagram - architecture, data flow, flowchart, sequence, agent\u002Fmemory, or concept map - and export as SVG+PNG. Trigger on: \"画图\" \"帮我画\" \"生成图\" \"做个图\" \"架构图\" \"流程图\" \"可视化一下\" \"出图\" \"generate diagram\" \"draw diagram\" \"visualize\" or any system\u002Fflow description the user wants illustrated.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ffireworks-tech-graph\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ffireworks-tech-graph\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":77},"01M73G086AXAH9DW1H5G5N3CPB","dbs-video-extract","接收抖音、小红书、微信视频号等短视频链接或分享文案，查询作品／账号数据并提取语音文字稿，按作者和标题归档为 Markdown。用户希望完整解析短视频、取得数据或文字稿时使用；运行前检查 TikHub 与轻抖使用凭证，缺少时用新手能理解的方式引导购买和安全配置。","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdbs-video-extract\u002FSKILL.md",[],[]]