Skip to content

gabelul/stitch-kit / skills/stitch-react-components

stitch-react-components

Verified

Converts a Stitch screen, a local HTML file, or a URL into modular Vite + React components — TypeScript, theme-mapped Tailwind, dark mode via CSS variables, and clean component architecture. Use this for Vite/React apps without App Router. For Next.js 15 App Router, use stitch-nextjs-components instead. Only the Stitch route needs an API key.

scripts/fetch-stitch.sh

View on GitHub
#!/usr/bin/env bash
# fetch-stitch.sh
# Reliably downloads Stitch HTML from Google Cloud Storage URLs.
# GCS URLs require redirect handling and specific security handshakes that
# AI fetch tools often fail on. This script handles both.
#
# Usage:
#   bash scripts/fetch-stitch.sh "<url>" "<output-path>"
#
# Example:
#   bash scripts/fetch-stitch.sh "$htmlCode_downloadUrl" "temp/source.html"

set -euo pipefail

URL="${1:?Usage: fetch-stitch.sh <url> <output-path>}"
OUTPUT="${2:?Usage: fetch-stitch.sh <url> <output-path>}"

# Create output directory if it doesn't exist
mkdir -p "$(dirname "$OUTPUT")"

# Use curl with:
#   -L  : follow redirects (GCS uses multiple redirect hops)
#   -A  : set User-Agent to avoid bot blocking
#   --compressed : handle gzip responses
#   --retry 3   : retry on transient failures
#   --retry-delay 1 : wait 1s between retries
#   --max-time 30   : don't hang forever
curl -L \
  -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36" \
  --compressed \
  --retry 3 \
  --retry-delay 1 \
  --max-time 30 \
  --silent \
  --show-error \
  --output "$OUTPUT" \
  "$URL"

# Verify the download succeeded and is not empty
if [ ! -s "$OUTPUT" ]; then
  echo "Error: Downloaded file is empty. URL may be expired or invalid." >&2
  exit 1
fi

echo "Downloaded to: $OUTPUT ($(wc -c < "$OUTPUT") bytes)"
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 319kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 196kUpdated Claude CodeCodexVerifiedInstall