Communitygithub.com

ComeOnOliver/skillshub

Bypass SiteGround caching (SG CachePress + LiteSpeed) for WordPress development. Adds cache-busting code to child themes for real-time development testing.

What is skillshub?

skillshub is a Claude Code agent skill that bypass SiteGround caching (SG CachePress + LiteSpeed) for WordPress development. Adds cache-busting code to child themes for real-time development testing.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/crazyswami/siteground-cache

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

SiteGround Cache Buster Skill

Bypass SiteGround caching (SG CachePress + LiteSpeed) for WordPress development. Adds cache-busting code to child themes for real-time development testing.


⛔ CRITICAL: STAGING ONLY - NEVER PRODUCTION

Claude is FORBIDDEN from deploying to production sites.

ActionAllowed?
Deploy to staging✅ YES
Deploy to production❌ ABSOLUTELY NEVER
Read from production✅ YES (read-only)
Write to production❌ ABSOLUTELY NEVER

If user asks to deploy to production:

  1. REFUSE the request
  2. Explain that production deployments must be done manually by the user
  3. Offer to deploy to staging instead

Production paths are BLOCKED. Any path that does NOT contain "staging" is off-limits for writes.


Required Information

Before using this skill, Claude will ask for:

  1. FTP/SFTP Credentials

    • Hostname (e.g., ftp.example.com)
    • Username
    • Password
    • Port (usually 21 for FTP, 22 for SFTP)
  2. Site URLs

    • Staging URL (e.g., https://staging.example.com)
    • Production URL (NOT needed - Claude won't deploy there)
  3. Theme Path

    • Child theme folder name (e.g., theme-child)

Store credentials in project's CLAUDE.local.md (gitignored) for future sessions.


Staging-Only Workflow

Local Development → Staging Site → [USER MANUALLY] → Production
        ↑              ↑                   ↑
    Claude edits   Claude deploys     USER deploys

Claude handles: Local editing + Staging deployment User handles: Production deployment (via SiteGround, FTP client, or manually)


What It Does

  1. Disables server-side caching for admins - LiteSpeed Cache + SG CachePress
  2. Adds no-cache headers - Prevents CDN/proxy caching
  3. Busts browser cache - Adds timestamp to CSS/JS URLs
  4. Shows version banner - Visual confirmation theme is loading (admin only)

The Code

PHP Snippet (add to functions.php)

/**
 * SiteGround Cache Buster for Development
 * Disables caching for logged-in administrators
 * REMOVE OR DISABLE IN PRODUCTION when done testing
 */

// Development mode banner (shows version to confirm theme is active)
add_action('wp_head', 'sg_dev_mode_banner');
function sg_dev_mode_banner() {
    if (current_user_can('administrator')) {
        $theme = wp_get_theme();
        $version = $theme->get('Version');
        $name = $theme->get('Name');
        echo '<style>
            .sg-dev-banner {
                position: fixed;
                bottom: 20px;
                right: 20px;
                background: #34889A;
                color: white;
                padding: 10px 20px;
                border-radius: 8px;
                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
                font-size: 12px;
                z-index: 999999;
                box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            }
        </style>
        <div class="sg-dev-banner">
            ' . esc_html($name) . ' v' . esc_html($version) . ' - ' . date('M j, H:i') . '
        </div>';
    }
}

// Disable all caching for administrators
add_action('init', 'sg_disable_cache_for_dev');
function sg_disable_cache_for_dev() {
    if (current_user_can('administrator')) {
        // Disable LiteSpeed Cache
        if (!defined('LSCACHE_NO_CACHE')) {
            define('LSCACHE_NO_CACHE', true);
        }

        // Disable SG Optimizer/CachePress
        if (!defined('SG_CACHEPRESS_NO_CACHE')) {
            define('SG_CACHEPRESS_NO_CACHE', true);
        }

        // Send no-cache headers
        nocache_headers();

        // Additional headers for CDN bypass
        header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
        header('Pragma: no-cache');
        header('Expires: Thu, 01 Jan 1970 00:00:00 GMT');
    }
}

// Bust browser cache by adding timestamp to theme CSS/JS
add_filter('style_loader_src', 'sg_bust_asset_cache', 999);
add_filter('script_loader_src', 'sg_bust_asset_cache', 999);
function sg_bust_asset_cache($src) {
    if (current_user_can('administrator')) {
        // Only bust cache for theme assets
        $theme_uri = get_stylesheet_directory_uri();
        $parent_uri = get_template_directory_uri();

        if (strpos($src, $theme_uri) !== false || strpos($src, $parent_uri) !== false) {
            $src = add_query_arg('v', time(), $src);
        }
    }
    return $src;
}

Usage

Method 1: Auto-inject via Script

# Navigate to your project
cd /path/to/wordpress-project

# Run the injector script
/root/.claude/skills/siteground-cache/add-cache-buster.sh ./wp-content/themes/your-child-theme

Method 2: Manual Copy

  1. Copy the PHP code above
  2. Paste at the end of your child theme's functions.php
  3. Upload via FTP TO STAGING ONLY
  4. Visit staging site as admin - you should see the version banner

Method 3: Via Claude

Just ask:

  • "Add SiteGround cache busting to this theme"
  • "Enable dev mode for SiteGround"
  • "Add cache buster to functions.php"

Claude will only deploy to staging.


Deployment Workflow (STAGING ONLY)

Step 1: Get Credentials (Ask User)

Before deploying, ask the user:

I need FTP credentials to deploy to STAGING. Please provide:
1. FTP Host (e.g., ftp.yourdomain.com)
2. FTP Username
3. FTP Password
4. Staging site path (e.g., staging.yourdomain.com/public_html)

Step 2: Deploy to Staging

# STAGING ONLY - Never production!
lftp -u "user,password" -e "
    set ssl:verify-certificate no
    mirror -R ./child-theme staging.example.com/public_html/wp-content/themes/child-theme
    bye
" ftp://ftp.example.com

Step 3: Verify on Staging

  1. Visit staging site as admin
  2. Confirm dev banner appears (bottom-right)
  3. Test CSS/JS changes are visible
  4. Check for PHP errors

Step 4: User Deploys to Production

Claude does NOT do this step. Tell the user:

The changes are ready on staging. To deploy to production:

Option 1: SiteGround Site Tools
  - Go to Site Tools > WordPress > Staging
  - Click "Push to Live"

Option 2: FTP Client (FileZilla, Cyberduck, etc.)
  - Download from staging
  - Upload to production

Option 3: Manual file copy via FTP

How Each Part Works

1. LiteSpeed Cache Bypass

define('LSCACHE_NO_CACHE', true);

LiteSpeed Cache plugin checks for this constant and skips caching when set.

2. SG CachePress Bypass

define('SG_CACHEPRESS_NO_CACHE', true);

SiteGround's caching plugin respects this constant.

3. HTTP Headers

nocache_headers();
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');

Tells browsers and CDNs not to cache the response.

4. Asset Cache Busting

add_query_arg('v', time(), $src);

Adds ?v=1704567890 to CSS/JS URLs. Since the timestamp changes every second, browsers always fetch fresh files.


Troubleshooting

Banner not showing?

  • Make sure you're logged in as Administrator
  • Check if child theme is activated (Appearance > Themes)
  • Check for PHP errors in the error log

Still seeing cached content?

  1. Try incognito/private browser window
  2. Clear browser cache manually
  3. Check SiteGround Site Tools > Speed > Caching > Purge Cache
  4. Check if Cloudflare is in front (need to purge there too)

CSS changes not appearing?

  • View page source and check if ?v= timestamp is on CSS URLs
  • Hard refresh: Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac)

Files in This Skill

/root/.claude/skills/siteground-cache/
├── SKILL.md                 # This documentation
├── add-cache-buster.sh      # Auto-inject script
├── cache-buster.php         # Standalone PHP snippet
└── remove-cache-buster.sh   # Removal script

Example CLAUDE.local.md Template

Store this in your project (gitignored):

# SiteGround Credentials (DO NOT COMMIT)

## FTP Access
- Host: ftp.example.com
- User: [email protected]
- Pass: your-password
- Port: 21

## Site URLs
- Staging: https://staging.example.com
- Production: https://example.com (READ-ONLY for Claude)

## Theme Paths
- Staging: staging.example.com/public_html/wp-content/themes/theme-child
- Production: OFF-LIMITS (user deploys manually)

Related

  • wp-docker - Local WordPress development
  • wp-performance - Production caching optimization
  • visual-qa - Screenshot testing after changes

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Next.js 16+ uses App Router with Server Components by default. Client Components are only used when interactivity is needed (hooks, event handlers, browser APIs).

ComeOnOliver/skillshub

All TypeScript types are defined in `frontend/types/index.ts`. Types match backend API response structure and provide type safety across the frontend application.

ComeOnOliver/skillshub

Use when working with Next.js App Router tasks - creating pages in /app/, setting up dynamic routes ([id]/page.tsx), implementing nested layouts/templates (layout.tsx), optimizing Server/Client components, or building ERP role-based pages (admin/teacher/student dashboards). Auto-use for all /app/ directory operations, dynamic routing, and App Router-specific features.

ComeOnOliver/skillshub

Apple-inspired clean, minimal, premium UI design. Use when building modern interfaces requiring exceptional UX, clean aesthetics, or Apple-like polish. Triggers on: clean UI, modern design, Apple style, minimal, premium, user-friendly, UX.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

Related Skills