This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a prompt library for Webflow MCP tools, built with Astro and deployed to Cloudflare Workers. The application provides an interactive searchable interface for reusable prompts, designed to be embedded as an iFrame in Webflow documentation. This repository is a subpackage of the openapi repo and stays in sync with it.
# Install dependencies
npm install
# Start local dev server at localhost:4321
npm run dev
# Build production site to ./dist/
npm run build
# Preview build locally (builds first, then runs wrangler dev)
npm run preview
# Build and deploy to Cloudflare Workers
npm run deploy
# Generate Cloudflare Worker types
npm run cf-typegen- Framework: Astro 5 with React integration
- Styling: Tailwind CSS v4 with @tailwindcss/vite
- UI Components: Radix UI primitives, shadcn-style components in
src/components/ui/ - Deployment: Cloudflare Workers with SSR adapter
- Content: YAML + JSON for prompt definitions
Prompts are stored in src/prompts/{prompt-id}/ with two files:
-
prompt.json- Metadata for the UI:id: Unique identifier (kebab-case)icon: URL to icon imagedescription: Brief description shown on the cardtags: Array of tags for search/filteringhref: Link destination (typically to Webflow docs)variables: Optional variable definitions for dynamic promptsmetadata: Additional metadatacontentFile: Optional reference to external content
-
prompt.yml- Actual prompt content:- Structured YAML with sections:
role,context,task,instructions - Supports variable interpolation using
{{variableName}}syntax - Parsed and formatted by
src/lib/promptFormatter.ts
- Structured YAML with sections:
SearchBar(src/components/SearchBar/): Main search and filter interface, client-side React componentPromptCard(src/components/PromptCard/): Individual prompt card displayPromptWithVariables(src/components/PromptWithVariables/): Handles prompts with variable substitutionCodeBlock(src/components/CodeBlock/): Code display with syntax highlightingVariableInput(src/components/VariableInput/): Input fields for prompt variables
src/pages/index.astro uses Astro's import.meta.glob() to load all prompt.json files at build time. The prompts array is passed to the Search component which handles filtering and display.
src/lib/promptFormatter.ts contains the core logic for converting YAML prompts into readable text:
- Parses YAML structure
- Formats sections (role, context, task, instructions) with Markdown headers
- Handles variable substitution with
{{variable}}syntax - Supports nested structures (operating_principles, tool_flow, etc.)
Create a new directory in src/prompts/{prompt-id}/ with both prompt.json and prompt.yml files. The prompt will automatically appear in the library on the next build.
Prompts must be tested thoroughly before adding:
- Verify the prompt works with intended MCP tools
- Test variable interpolation if applicable
- Verify UI display (icon, description, tags, links)
- Test search discoverability
- Test in iFrame context within Webflow docs
The site deploys to Cloudflare Workers. Configuration:
wrangler.jsonc: Worker configuration (name, compatibility flags, assets binding)astro.config.mjs: Astro config with Cloudflare adapter and image service- Build output:
./dist/directory with_worker.js/index.jsas the entry point
This repository syncs with the openapi repo. Coordinate changes with the main repository to ensure consistency across the Webflow ecosystem.