Skip to content

secondsky/claude-skills / plugins/nuxt-studio/skills/nuxt-studio

nuxt-studio

Verified

This skill should be used when the user asks to "set up Nuxt Studio", "configure Studio OAuth", "deploy Studio to Cloudflare", "add visual editor to Nuxt", "configure studio.domain.com subdomain", "Studio authentication", "Nuxt CMS", or mentions visual content editing, Nuxt Studio module, TipTap editor, Monaco editor, or content management for Nuxt websites.

templates/studio-auth-github.ts

View on GitHub
// GitHub OAuth Configuration for Nuxt Studio
// This is a reference template - Studio handles OAuth automatically
// Use this for understanding the OAuth flow or custom implementations

/**
 * AUTOMATIC SETUP (Recommended):
 *
 * Studio automatically configures GitHub OAuth when you set environment variables:
 *
 * 1. Create GitHub OAuth App:
 *    - Go to: https://github.com/settings/developers
 *    - Click "New OAuth App"
 *    - Application name: "Your Site - Studio CMS"
 *    - Homepage URL: https://yourdomain.com
 *    - Authorization callback URL: https://studio.yourdomain.com/api/auth/callback/github
 *
 * 2. Set environment variables:
 *    NUXT_OAUTH_GITHUB_CLIENT_ID=your_client_id
 *    NUXT_OAUTH_GITHUB_CLIENT_SECRET=your_client_secret
 *
 * 3. Studio automatically handles the rest!
 */

// ============================================
// MANUAL CONFIGURATION (Advanced Use Cases)
// ============================================

import type { OAuthConfig } from 'nuxt-auth-utils'

export const githubOAuthConfig: OAuthConfig = {
  // Provider name
  provider: 'github',

  // OAuth credentials from environment variables
  clientId: process.env.NUXT_OAUTH_GITHUB_CLIENT_ID!,
  clientSecret: process.env.NUXT_OAUTH_GITHUB_CLIENT_SECRET!,

  // GitHub OAuth endpoints
  authorize: {
    url: 'https://github.com/login/oauth/authorize',
    params: {
      scope: 'read:user repo'  // Required scopes for Studio
    }
  },

  token: {
    url: 'https://github.com/login/oauth/access_token',
    params: {
      grant_type: 'authorization_code'
    }
  },

  // User info endpoint
  userinfo: {
    url: 'https://api.github.com/user'
  },

  // Callback URL (automatically constructed)
  redirectUri: `${process.env.NUXT_PUBLIC_STUDIO_URL}/api/auth/callback/github`,

  // Response type
  responseType: 'code',

  // Response mode
  responseMode: 'query'
}

// ============================================
// OAUTH SCOPES EXPLAINED
// ============================================

/**
 * Required scopes for Nuxt Studio with GitHub:
 *
 * - read:user
 *   Grants access to user profile information
 *   Used to identify the user in Studio
 *
 * - repo (for private repos) OR public_repo (for public repos only)
 *   Grants access to repository content
 *   Required for reading/writing content files
 *   Required for committing changes from Studio
 *
 * Optional scopes:
 *
 * - workflow (if you need to trigger GitHub Actions)
 *   Allows Studio to trigger workflows on commit
 */

// ============================================
// ENVIRONMENT SETUP
// ============================================

/**
 * Local Development (.env.local):
 *
 * NUXT_OAUTH_GITHUB_CLIENT_ID=your_dev_client_id
 * NUXT_OAUTH_GITHUB_CLIENT_SECRET=your_dev_secret
 * NUXT_PUBLIC_STUDIO_URL=http://localhost:3000
 *
 * Important: Use a separate OAuth app for development with callback:
 * http://localhost:3000/api/auth/callback/github
 */

/**
 * Cloudflare Pages Production:
 *
 * Set in Workers & Pages → Settings → Environment variables:
 *
 * NUXT_OAUTH_GITHUB_CLIENT_ID=your_prod_client_id
 * NUXT_OAUTH_GITHUB_CLIENT_SECRET=your_prod_secret
 * NUXT_PUBLIC_STUDIO_URL=https://studio.yourdomain.com
 *
 * Important: Use production OAuth app with callback:
 * https://studio.yourdomain.com/api/auth/callback/github
 */

/**
 * Cloudflare Workers (via wrangler):
 *
 * Set secrets via CLI:
 * wrangler secret put NUXT_OAUTH_GITHUB_CLIENT_ID
 * wrangler secret put NUXT_OAUTH_GITHUB_CLIENT_SECRET
 *
 * Set public vars in wrangler.toml:
 * [vars]
 * NUXT_PUBLIC_STUDIO_URL = "https://studio.yourdomain.com"
 */

// ============================================
// TROUBLESHOOTING
// ============================================

/**
 * Common GitHub OAuth Issues:
 *
 * 1. redirect_uri_mismatch
 *    - Verify callback URL in OAuth app matches deployment URL exactly
 *    - Check HTTPS vs HTTP
 *    - Check subdomain matches (studio.domain.com vs domain.com)
 *
 * 2. invalid_client
 *    - Verify CLIENT_ID and CLIENT_SECRET are correct
 *    - Check environment variables are set
 *    - Regenerate secret if lost
 *
 * 3. insufficient_scope
 *    - Ensure OAuth app has 'repo' scope (or 'public_repo')
 *    - Re-authorize the application
 *
 * 4. access_denied
 *    - User denied authorization
 *    - Check OAuth app is not suspended
 *    - Verify app has required permissions
 */

// ============================================
// TESTING OAUTH FLOW
// ============================================

/**
 * Test GitHub OAuth locally:
 *
 * 1. Set up local environment variables
 * 2. Start dev server: npm run dev
 * 3. Visit: http://localhost:3000/_studio
 * 4. Click "Sign in with GitHub"
 * 5. Authorize the application
 * 6. Should redirect back to Studio
 *
 * Check browser console and network tab for errors.
 */

// ============================================
// SECURITY BEST PRACTICES
// ============================================

/**
 * 1. NEVER commit CLIENT_SECRET to Git
 *    - Use .env files (add to .gitignore)
 *    - Use environment variables on deployment platforms
 *
 * 2. Use different OAuth apps per environment
 *    - Development: localhost callback
 *    - Staging: staging.domain.com callback
 *    - Production: studio.domain.com callback
 *
 * 3. Rotate secrets regularly
 *    - Every 3-6 months minimum
 *    - Immediately if compromised
 *
 * 4. Limit OAuth app permissions
 *    - Use 'public_repo' instead of 'repo' if possible
 *    - Only request scopes you need
 *
 * 5. Monitor OAuth app usage
 *    - Check GitHub OAuth app settings for unusual activity
 *    - Review authorized users periodically
 */

// ============================================
// REFERENCE
// ============================================

/**
 * GitHub OAuth Documentation:
 * https://docs.github.com/en/developers/apps/building-oauth-apps
 *
 * Nuxt Studio OAuth Guide:
 * https://content.nuxt.com/docs/studio/authentication
 *
 * Available Scopes:
 * https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps
 */

export default githubOAuthConfig
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall