Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.
Python aianthropicautomationclaude-codeclaude-skillscloudflaredevtoolsproductivityreactskillstailwindvite
Add research standards and version checking
Jez1bcb3a474f88
diff --git a/planning/claude-code-skill-standards.md b/planning/claude-code-skill-standards.mdnew file mode 100644index 00000000..7949a181--- /dev/null+++ b/planning/claude-code-skill-standards.md@@ -0,0 +1,326 @@+# Claude Code Skill Standards++**Last Updated**: 2025-10-20+**Source**: https://docs.claude.com/en/docs/claude-code/skills+**Reference Skill**: ~/.claude/skills/tailwind-v4-shadcn/++---++## What Are Claude Code Skills?++Skills are modular capabilities stored in `~/.claude/skills/` that Claude Code automatically discovers and uses based on user requests.++### Key Characteristics:+- **Model-invoked** - Claude autonomously decides when to use them+- **Description-based discovery** - Claude matches skills based on YAML frontmatter description+- **Templates and documentation** - Help users set up projects quickly+- **No executable code** - Skills provide instructions and templates, not running code++---++## Required Structure++```+~/.claude/skills/skill-name/+├── SKILL.md # REQUIRED - Instructions with YAML frontmatter+├── README.md # OPTIONAL - Quick reference (our addition)+├── templates/ # OPTIONAL - File templates+└── reference/ # OPTIONAL - Additional documentation+```++---++## SKILL.md Format (REQUIRED)++### YAML Frontmatter (Top of File)++```yaml+---+name: Skill Display Name+description: |+ What the skill does and when Claude should use it.++ Use when: specific scenarios where this skill applies.++ Keywords: keyword1, keyword2, error messages, technology names+---+```++**Critical**: The `description` field determines when Claude uses the skill. It MUST include:+- What the skill does+- When Claude should use it+- Keywords for discovery++### Markdown Content (After Frontmatter)++```markdown+# Skill Title++Detailed instructions for Claude to follow when using this skill.++## Section 1: Setup+Step-by-step instructions...++## Section 2: Configuration+Examples and code snippets...++## Common Issues+Known problems and solutions...+```++---++## Example: Tailwind v4 Skill++**SKILL.md Frontmatter**:+```yaml+---+name: Tailwind v4 + shadcn/ui Stack+description: |+ Production-tested setup for Tailwind CSS v4 with shadcn/ui, Vite, and React.++ Use when: initializing React projects with Tailwind v4, setting up shadcn/ui,+ implementing dark mode, debugging CSS variable issues, fixing theme switching,+ migrating from Tailwind v3, or encountering color/theming problems.++ Keywords: Tailwind v4, shadcn/ui, @tailwindcss/vite, @theme inline, dark mode,+ CSS variables, hsl() wrapper, components.json, React theming, theme switching,+ colors not working, variables broken, theme not applying+---+```++**Directory Structure**:+```+tailwind-v4-shadcn/+├── SKILL.md # Full instructions+├── README.md # Quick reference (our addition)+├── templates/ # Ready-to-copy files+│ ├── vite.config.ts+│ ├── index.css+│ ├── components.json+│ └── ...+└── reference/ # Deep-dive docs+ ├── architecture.md+ ├── common-gotchas.md+ └── ...+```++---++## Our Additions (Beyond Minimum)++We're adding these for better quality:++### 1. README.md+**Purpose**: Quick reference with explicit trigger keywords++**Format**:+```markdown+# Skill Name++**Status**: Production Ready ✅+**Last Updated**: 2025-10-20++## Auto-Trigger Keywords+- keyword1+- keyword2+- error message++## What This Skill Does+Brief description...++## Known Issues Prevented+Table of errors this skill fixes...+```++### 2. templates/+**Purpose**: Working file templates users can copy++**Requirements**:+- Complete, tested files+- Latest package versions+- No hardcoded secrets+- Well-commented++### 3. reference/+**Purpose**: Additional documentation for complex topics++**Examples**:+- architecture.md - Deep dive into patterns+- common-gotchas.md - Troubleshooting guide+- migration-guide.md - Upgrading from old versions++---++## Discovery Mechanism++### How Claude Finds Skills++1. User makes a request+2. Claude checks `~/.claude/skills/` directory+3. Reads `SKILL.md` frontmatter from each skill+4. Matches `description` field against user's request+5. If match > threshold, proposes using the skill++### Trigger Keywords++**In frontmatter description**, include:+- **Technology names**: "Tailwind v4", "Cloudflare Workers"+- **Use cases**: "dark mode setup", "JWT verification"+- **Error messages**: "colors not working", "build fails"+- **Related terms**: "shadcn/ui", "theme switching"++**Example**:+```yaml+description: |+ Use when: setting up Cloudflare Workers, configuring Hono routing,+ deploying with wrangler, or encountering "Static Assets not found" errors.++ Keywords: Cloudflare Workers, Hono, wrangler, Static Assets, CF Workers,+ deployment, serverless+```++---++## Quality Standards++### Before Committing a Skill++- [ ] **SKILL.md has valid YAML frontmatter**+- [ ] **Description includes "Use when" scenarios**+- [ ] **Keywords cover common searches and errors**+- [ ] **Instructions are clear and complete**+- [ ] **Templates are tested and working**+- [ ] **Versions are documented**+- [ ] **Official docs are referenced**+- [ ] **No hardcoded secrets**++### Documentation Requirements++**Must Include**:+- Version numbers for all packages+- Links to official documentation+- Known issues with sources (GitHub issues, etc.)+- Last updated date+- Production testing evidence++**Must Not Include**:+- Outdated patterns+- Deprecated approaches+- Unverified information+- Hardcoded credentials+- Untested templates++---++## File Naming Conventions++- **SKILL.md** - Must be exactly this name (case-sensitive)+- **README.md** - Optional, our addition+- **templates/** - Lowercase, plural+- **reference/** - Lowercase, plural+- **examples/** - Lowercase, plural (if used)++---++## Best Practices++### Description Field+✅ **Good**:+```yaml+description: |+ Sets up Cloudflare Workers with Vite, Hono routing, and Static Assets.++ Use when: creating new CF Workers projects, adding Vite to existing Workers,+ or encountering "Static Assets 404" errors.++ Keywords: Cloudflare Workers, CF Workers, Hono, wrangler, Vite, Static Assets+```++❌ **Bad**:+```yaml+description: "Cloudflare Workers skill"+```++### Instructions+✅ **Good**: Step-by-step with code examples+❌ **Bad**: Vague descriptions without specifics++### Templates+✅ **Good**: Complete, working files with comments+❌ **Bad**: Code snippets or incomplete examples++---++## Maintenance++### When to Update+- New major version of key dependency+- Security vulnerability reported+- Breaking change announced+- Official docs updated+- Users report skill doesn't work++### Update Process+1. Re-verify official documentation+2. Test with new versions+3. Update templates+4. Update SKILL.md+5. Update "Last Updated" date+6. Commit with detailed changelog++---++## Examples from Real Skills++### Tailwind v4 Skill+**What it teaches us**:+- ✅ Comprehensive frontmatter with keywords+- ✅ Templates directory with working files+- ✅ Reference docs for deep dives+- ✅ Production-tested evidence++### Firecrawl Scraper Skill+**What it teaches us**:+- ✅ Clear use cases in description+- ✅ API key configuration documented+- ✅ Python and TypeScript templates+- ✅ Error handling patterns++---++## Official Documentation++**Primary Source**: https://docs.claude.com/en/docs/claude-code/skills++**Key Points from Official Docs**:+- Skills are model-invoked (Claude decides when to use them)+- Description field is critical for discovery+- SKILL.md with YAML frontmatter is required+- Supporting files are optional+- Can be personal (~/.claude/skills/) or project-level (.claude/skills/)++---++## Summary++### Minimum Required+```+skill-name/+└── SKILL.md (with YAML frontmatter + instructions)+```++### Our Standard+```+skill-name/+├── SKILL.md # Required: Full instructions+├── README.md # Our addition: Quick reference+├── templates/ # Our addition: Working files+└── reference/ # Optional: Deep-dive docs+```++**Why we add more**: Better discoverability, proven templates, comprehensive documentation leads to higher quality skills that actually help users.++---++**Next**: Use this standard when building all our skills.diff --git a/planning/research-protocol.md b/planning/research-protocol.mdnew file mode 100644index 00000000..03c097fb--- /dev/null+++ b/planning/research-protocol.md@@ -0,0 +1,368 @@+# Research Protocol for Building Claude Skills++**Purpose**: Ensure every skill is built on accurate, current, official documentation+**Last Updated**: 2025-10-20++---++## 🎯 Core Principle++**Bad skills are worse than no skills.** They perpetuate errors, waste tokens, and damage trust.++Every skill MUST be:+- ✅ Based on official documentation+- ✅ Tested in real environments+- ✅ Using current package versions+- ✅ Preventing known, verified errors+- ✅ Documented with evidence++---++## 📋 Pre-Build Research Checklist++**Before writing ANY skill files, complete this checklist:**++### Step 1: Identify Official Sources (30 min)++- [ ] **Find official documentation** (not blog posts or tutorials)+ - Package docs (e.g., https://tailwindcss.com/docs)+ - GitHub repositories (official repos only)+ - API documentation (latest version)++- [ ] **Check Context7 MCP** for library documentation+ ```+ Use: mcp__context7__resolve-library-id+ Then: mcp__context7__get-library-docs+ ```++- [ ] **Use Cloudflare Docs MCP** (if Cloudflare-related)+ ```+ Use: mcp__cloudflare-docs__search_cloudflare_documentation+ ```++- [ ] **Verify documentation is current**+ - Check "Last Updated" dates+ - Verify version numbers match latest stable+ - Read changelog/release notes++### Step 2: Verify Package Versions (15 min)++- [ ] **Check npm for latest versions**+ ```bash+ npm view <package-name> version+ npm view <package-name> versions --json | tail -20+ ```++- [ ] **Document versions explicitly**+ ```markdown+ ## Tested Versions+ - @cloudflare/vite-plugin: 1.2.3 (latest stable as of 2025-10-20)+ - hono: 4.5.1+ - wrangler: 3.72.0+ ```++- [ ] **Check for breaking changes**+ - Read migration guides+ - Check GitHub issues for "breaking"+ - Note any deprecation warnings++### Step 3: Research Known Issues (30 min)++- [ ] **Search GitHub issues** for common problems+ ```+ Search: "[package-name] error" or "[package-name] doesn't work"+ Filter: Open issues, recently updated+ ```++- [ ] **Check community discussions**+ - Official Discord/Slack if available+ - Stack Overflow for common errors+ - Reddit r/[technology] discussions++- [ ] **Document actual errors encountered**+ ```markdown+ ## Known Issues This Skill Prevents+ | Error | Why It Happens | Source | Fix |+ |-------|---------------|---------|-----|+ | "tw-animate-css not found" | shadcn init adds non-existent import | Issue #123 | Remove line 4 in index.css |+ ```++### Step 4: Build Working Example (1-3 hours)++- [ ] **Create test project from scratch**+ ```bash+ mkdir test-skill-example+ cd test-skill-example+ # Follow your own skill instructions+ ```++- [ ] **Test in target environment**+ - Local development (npm run dev)+ - Production build (npm run build)+ - Deployment (if applicable)++- [ ] **Document actual errors you hit**+ - Screenshot error messages+ - Note console warnings+ - Record fix steps++- [ ] **Verify the fix works**+ - Test multiple times+ - Try different scenarios+ - Confirm no regressions++### Step 5: Cross-Reference Sources (15 min)++- [ ] **Compare official docs to examples**+ - Do official examples work?+ - Are there conflicting patterns?+ - Which is more current?++- [ ] **Check for version-specific issues**+ - Does v4 work like v3?+ - Are there deprecated patterns?+ - What changed recently?++- [ ] **Verify with multiple sources**+ - Official docs+ - Official GitHub repo examples+ - Community-verified solutions++---++## 🔍 Research Documentation Template++For each skill, create a research log:++```markdown+## Research Log: [Skill Name]++### Official Sources Consulted++1. **Primary Documentation**+ - URL: https://...+ - Version: X.Y.Z+ - Last Checked: 2025-10-20+ - Key Pages: [list relevant pages]++2. **GitHub Repository**+ - URL: https://github.com/...+ - Latest Release: vX.Y.Z (date)+ - Issues Reviewed: [list key issues]++3. **Context7 Libraries**+ - Library ID: /org/project+ - Documentation Version: latest+ - Topic Focused: [specific area]++### Version Information++| Package | Current | Latest | Tested | Notes |+|---------|---------|--------|--------|-------|+| @cloudflare/vite-plugin | 1.2.3 | 1.2.3 | ✅ | Stable |+| hono | 4.5.0 | 4.5.1 | ⚠️ | Update available |++### Known Issues Discovered++1. **Issue**: [Description]+ - **Source**: GitHub Issue #123+ - **Cause**: [Root cause]+ - **Fix**: [Solution]+ - **Verified**: ✅ Tested in production++2. **Issue**: [Description]+ - ...++### Working Example++- **Built**: 2025-10-20+- **Location**: /path/to/example+- **Deployed**: https://example.com (if applicable)+- **Status**: ✅ Working+- **Errors Encountered**: [list any]+- **Time to Build**: ~2 hours++### Community Verification++- **Discussions Reviewed**: [links]+- **Stack Overflow**: [relevant questions]+- **Discord/Slack**: [key threads]+- **Consensus**: [what the community confirms works]++### Uncertainties / Questions++- [ ] [Any unclear points]+- [ ] [Conflicting information]+- [ ] [Need to verify X]++### Sign-Off++- [x] All official docs reviewed+- [x] Latest versions verified+- [x] Example project working+- [x] Known issues documented+- [x] Ready to build skill++**Researcher**: [Your Name]+**Date**: 2025-10-20+```++---++## 🚨 Red Flags - Stop and Investigate++If you encounter any of these, STOP and investigate further:++### Documentation Red Flags+- ❌ Examples in docs don't work when tested+- ❌ Multiple conflicting approaches in same docs+- ❌ Documentation last updated >1 year ago+- ❌ "This feature is experimental" warnings+- ❌ No version information provided++### Community Red Flags+- ❌ Many recent issues about same problem+- ❌ Official team not responding to issues+- ❌ Community says "docs are wrong"+- ❌ Workarounds instead of official solutions+- ❌ Deprecated warnings in console++### Technical Red Flags+- ❌ Package has known security vulnerabilities+- ❌ Last npm publish >2 years ago+- ❌ Breaking changes not documented+- ❌ Dependencies conflict with each other+- ❌ Tests failing in official repo++**Action**: Document the red flag, investigate root cause, decide if skill is viable.++---++## 🛠️ Tools We Have++### Context7 MCP+```typescript+// Find library ID+mcp__context7__resolve-library-id({ libraryName: "tailwindcss" })++// Get documentation+mcp__context7__get-library-docs({+ context7CompatibleLibraryID: "/websites/tailwindcss",+ topic: "configuration"+})+```++### Cloudflare Docs MCP+```typescript+mcp__cloudflare-docs__search_cloudflare_documentation({+ query: "workers static assets"+})+```++### WebFetch+```typescript+WebFetch({+ url: "https://docs.example.com/latest",+ prompt: "What are the setup instructions?"+})+```++### WebSearch+```typescript+WebSearch({+ query: "tailwind v4 css variables not working 2025"+})+```++---++## ✅ Quality Gates++A skill can only proceed to implementation if:++### Research Complete+- [x] Official documentation reviewed thoroughly+- [x] Context7 MCP checked for library docs+- [x] Latest package versions verified on npm+- [x] Known issues researched on GitHub+- [x] Community discussions reviewed++### Example Working+- [x] Test project built from scratch+- [x] Local development tested+- [x] Production build succeeds+- [x] Deployed (if applicable)+- [x] All errors documented and fixed++### Documentation Accurate+- [x] Official docs linked (specific pages)+- [x] Version numbers documented+- [x] Known issues have sources+- [x] Breaking changes noted+- [x] Last verified date recorded++---++## 📝 After Building the Skill++### Verification Checklist++- [ ] **Templates match research**+ - Versions in templates match tested versions+ - Configuration follows official docs+ - No deprecated patterns used++- [ ] **Documentation is accurate**+ - Links to official docs work+ - Version numbers are current+ - Known issues are real (not theoretical)++- [ ] **Example project proves it works**+ - Can be built from templates+ - Runs without errors+ - Deployed successfully++- [ ] **Research log is complete**+ - All sources documented+ - All tests recorded+ - Sign-off completed++---++## 🔄 Maintenance Protocol++Skills need periodic updates when:++### Trigger Events+- New major version of key dependency+- Security vulnerability reported+- Breaking change announced+- Official docs updated significantly+- Community reports skill doesn't work++### Update Process+1. Re-run research checklist+2. Update version numbers+3. Test with new versions+4. Update templates+5. Update documentation+6. Mark "Last Updated" date+7. Commit with changelog++### Update Schedule+- **Quarterly**: Check for version updates+- **Monthly**: Review GitHub issues+- **On-demand**: When users report problems++---++## 📖 Reference Standards++This protocol ensures skills meet these standards:+- [Official Standards Analysis](official-standards-analysis.md)+- [Skills Roadmap](skills-roadmap.md)+- [CONTRIBUTING.md](../CONTRIBUTING.md)++---++**Remember**: 15 minutes of research saves hours of debugging. Always verify before building.diff --git a/scripts/check-versions.sh b/scripts/check-versions.shnew file mode 100644index 00000000..3033ea44--- /dev/null+++ b/scripts/check-versions.sh@@ -0,0 +1,144 @@+#!/usr/bin/env bash++# check-versions.sh - Check if skill dependencies are up-to-date+# Usage: ./scripts/check-versions.sh [skill-name]+#+# If skill-name is provided, checks that skill only+# Otherwise, checks all skills+#+# Exit code: Always 0 (info only, no failures)++set -e++# Colors+RED='\033[0;31m'+GREEN='\033[0;32m'+YELLOW='\033[1;33m'+BLUE='\033[0;34m'+NC='\033[0m' # No Color++# Paths+REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"+SKILLS_DIR="$REPO_ROOT/skills"++echo -e "${BLUE}=====================================${NC}"+echo -e "${BLUE} Dependency Version Checker${NC}"+echo -e "${BLUE}=====================================${NC}"+echo ""++# Function to check a single package.json file+check_package_json() {+ local file="$1"+ local skill_name="$2"+ local warnings=0++ echo -e "${BLUE}Checking: $skill_name${NC}"++ # Extract dependencies+ local deps=$(cat "$file" | grep -A 999 '"dependencies"' | grep -B 999 '}' | head -n -1 | tail -n +2 || true)+ local devDeps=$(cat "$file" | grep -A 999 '"devDependencies"' | grep -B 999 '}' | head -n -1 | tail -n +2 || true)++ # Combine all deps+ local all_deps="$deps"$'\n'"$devDeps"++ # Check each dependency+ while IFS= read -r line; do+ if [[ $line =~ \"([^\"]+)\":[[:space:]]*\"([^^~]*)([0-9]+\.[0-9]+\.[0-9]+) ]]; then+ local pkg="${BASH_MATCHES[1]}"+ local current="${BASH_MATCHES[3]}"++ # Skip @types and internal packages+ if [[ $pkg == @types/* ]] || [[ $pkg == file:* ]]; then+ continue+ fi++ # Get latest version from npm (with timeout)+ local latest=$(timeout 5 npm view "$pkg" version 2>/dev/null || echo "error")++ if [ "$latest" == "error" ]; then+ echo -e " ${YELLOW}⚠${NC} $pkg@$current (couldn't fetch latest)"+ continue+ fi++ # Compare versions (simple string comparison)+ if [ "$current" != "$latest" ]; then+ echo -e " ${YELLOW}⚠${NC} $pkg@$current → $latest available"+ ((warnings++))+ else+ echo -e " ${GREEN}✓${NC} $pkg@$current (up-to-date)"+ fi+ fi+ done <<< "$all_deps"++ if [ $warnings -eq 0 ]; then+ echo -e "${GREEN} All dependencies up-to-date!${NC}"+ else+ echo -e "${YELLOW} $warnings update(s) available${NC}"+ fi++ echo ""+ return 0+}++# Check if specific skill provided+if [ -n "$1" ]; then+ SKILL_NAME="$1"+ SKILL_DIR="$SKILLS_DIR/$SKILL_NAME"++ if [ ! -d "$SKILL_DIR" ]; then+ echo -e "${RED}Error: Skill '$SKILL_NAME' not found${NC}"+ echo ""+ echo "Available skills:"+ ls -1 "$SKILLS_DIR" 2>/dev/null || echo " (none found)"+ exit 0 # Still exit 0 (info only)+ fi++ # Check for package.json in templates+ if [ -f "$SKILL_DIR/templates/package.json" ]; then+ check_package_json "$SKILL_DIR/templates/package.json" "$SKILL_NAME"+ elif [ -f "$SKILL_DIR/package.json" ]; then+ check_package_json "$SKILL_DIR/package.json" "$SKILL_NAME"+ else+ echo -e "${YELLOW}No package.json found for $SKILL_NAME${NC}"+ echo ""+ fi++ exit 0+fi++# Check all skills+TOTAL_SKILLS=0+SKILLS_WITH_DEPS=0++for skill_dir in "$SKILLS_DIR"/*/ ; do+ if [ ! -d "$skill_dir" ]; then+ continue+ fi++ skill_name=$(basename "$skill_dir")+ ((TOTAL_SKILLS++))++ # Look for package.json in templates/ or root+ if [ -f "$skill_dir/templates/package.json" ]; then+ check_package_json "$skill_dir/templates/package.json" "$skill_name"+ ((SKILLS_WITH_DEPS++))+ elif [ -f "$skill_dir/package.json" ]; then+ check_package_json "$skill_dir/package.json" "$skill_name"+ ((SKILLS_WITH_DEPS++))+ fi+done++# Summary+echo -e "${BLUE}=====================================${NC}"+echo -e "${BLUE} Summary${NC}"+echo -e "${BLUE}=====================================${NC}"+echo ""+echo "Total skills: $TOTAL_SKILLS"+echo "Skills with dependencies: $SKILLS_WITH_DEPS"+echo ""+echo -e "${GREEN}ℹ${NC} This is informational only - no automatic updates performed"+echo -e "${GREEN}ℹ${NC} Review warnings and update skills manually as needed"+echo ""++# Always exit 0 (informational only, never fail builds)+exit 0