Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

feat: Add marketplace sync verification and cleanup old planning docs

Jez667dd1a5fc1e
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index 93292a8f..3c05d957 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -6,12 +6,13 @@
},
"metadata": {
"description": "Production-tested skills for Claude Code - Cloudflare, AI, React, Tailwind v4, and modern web development",
- "version": "2.0.0"
+ "version": "2.1.0",
+ "updated": "2025-12-15"
},
"plugins": [
{
"name": "cloudflare-skills",
- "description": "Complete Cloudflare platform skills - Workers, D1, R2, KV, AI, Queues, Durable Objects, and more. 22 production-tested skills for edge computing.",
+ "description": "Complete Cloudflare platform skills - Workers, D1, R2, KV, AI, Queues, Durable Objects, and more. 16 production-tested skills for edge computing.",
"source": "./",
"skills": [
"./skills/cloudflare-worker-base",
@@ -25,22 +26,16 @@
"./skills/cloudflare-durable-objects",
"./skills/cloudflare-agents",
"./skills/cloudflare-mcp-server",
- "./skills/cloudflare-nextjs",
- "./skills/cloudflare-cron-triggers",
- "./skills/cloudflare-email-routing",
"./skills/cloudflare-hyperdrive",
"./skills/cloudflare-images",
"./skills/cloudflare-browser-rendering",
"./skills/cloudflare-turnstile",
- "./skills/cloudflare-zero-trust-access",
- "./skills/cloudflare-full-stack-scaffold",
- "./skills/cloudflare-full-stack-integration",
- "./skills/cloudflare-sandbox"
+ "./skills/cloudflare-python-workers"
]
},
{
"name": "ai-skills",
- "description": "AI and LLM integration skills - Vercel AI SDK, OpenAI, Google Gemini, Claude API, ElevenLabs, and chatbot patterns. 14 skills for building AI applications.",
+ "description": "AI and LLM integration skills - Vercel AI SDK, OpenAI, Google Gemini, Claude API, ElevenLabs. 14 skills for building AI applications.",
"source": "./",
"skills": [
"./skills/ai-sdk-core",
@@ -49,29 +44,34 @@
"./skills/openai-agents",
"./skills/openai-assistants",
"./skills/openai-responses",
+ "./skills/openai-apps-mcp",
"./skills/google-gemini-api",
"./skills/google-gemini-embeddings",
"./skills/google-gemini-file-search",
+ "./skills/google-chat-api",
"./skills/claude-api",
"./skills/claude-agent-sdk",
- "./skills/thesys-generative-ui",
- "./skills/elevenlabs-agents",
- "./skills/better-chatbot",
- "./skills/better-chatbot-patterns"
+ "./skills/elevenlabs-agents"
]
},
{
"name": "frontend-skills",
- "description": "Frontend and UI skills - Tailwind v4, shadcn/ui, React Hook Form, TanStack Query, Zustand, Next.js, and Hono. 7 skills for modern web UIs.",
+ "description": "Frontend and UI skills - Tailwind v4, shadcn/ui, TanStack suite, animations, and React Native. 13 skills for modern web and mobile UIs.",
"source": "./",
"skills": [
"./skills/tailwind-v4-shadcn",
"./skills/react-hook-form-zod",
"./skills/tanstack-query",
+ "./skills/tanstack-router",
+ "./skills/tanstack-start",
+ "./skills/tanstack-table",
"./skills/zustand-state-management",
"./skills/nextjs",
"./skills/hono-routing",
- "./skills/firecrawl-scraper"
+ "./skills/auto-animate",
+ "./skills/motion",
+ "./skills/tiptap",
+ "./skills/react-native-expo"
]
},
{
@@ -104,19 +104,28 @@
"./skills/vercel-blob"
]
},
+ {
+ "name": "backend-skills",
+ "description": "Backend framework skills - FastAPI and Flask for Python web services.",
+ "source": "./",
+ "skills": [
+ "./skills/fastapi",
+ "./skills/flask"
+ ]
+ },
{
"name": "tooling-skills",
- "description": "Development tooling skills - MCP servers, project planning, session management, workflow automation, and more.",
+ "description": "Development tooling skills - MCP servers, project planning, session management, workflow automation, and skill development.",
"source": "./",
"skills": [
"./skills/typescript-mcp",
"./skills/fastmcp",
+ "./skills/ts-agent-sdk",
"./skills/project-planning",
"./skills/project-session-management",
"./skills/project-workflow",
- "./skills/gemini-cli",
- "./skills/hugo",
- "./skills/github-project-automation",
+ "./skills/skill-creator",
+ "./skills/skill-review",
"./skills/open-source-contributions"
]
}
diff --git a/.gitignore b/.gitignore
index c6af4e33..fc2a9c6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,5 +56,6 @@ Thumbs.db
# Claude Skills Repository - Working Files
SESSION.md # Working session tracking (constantly changing)
*_REPORT.md # Auto-generated version/optimization reports
+SKILLS_CATALOG.md # Generated catalog (regenerate with scripts)
archive/session-logs/ # Working audit logs (archived when needed)
.claude/settings.local.json # Local Claude Code settings
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0cb87021..4c9e4da7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,124 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Added - Marketplace Sync Verification πŸ”„
+
+**Date**: 2025-12-15
+
+**Change**: Added `check-marketplace-sync.sh` script to verify marketplace.json matches actual skills
+
+**What Changed**:
+- New script: `scripts/check-marketplace-sync.sh`
+- Integrated into `check-all-versions.sh` (now runs 5 checks instead of 4)
+- Fixed marketplace.json: removed 14 phantom skills, added 15 missing skills
+- Removed symlinks from `~/.claude/skills/` - users should install via plugin marketplace
+
+**Usage**:
+```bash
+./scripts/check-marketplace-sync.sh # Check for mismatches
+./scripts/check-marketplace-sync.sh --fix # Auto-regenerate marketplace.json
+```
+
+**Installation** (official method):
+```bash
+/plugin marketplace add jezweb/claude-skills
+/plugin install cloudflare-skills@claude-skills
+```
+
+---
+
+### Added - contextbricks NPM Package πŸ“¦
+
+**Date**: 2025-12-13
+
+**Change**: Published `contextbricks` v2.1.0 to NPM for context usage monitoring
+
+**Features**:
+- Native `context_window` API support (v2.0.0)
+- Accurate context usage after compaction (v2.1.0)
+- Standalone NPM package: `npm install -g contextbricks`
+
+---
+
+### Added - /reflect Command πŸͺž
+
+**Date**: 2025-12-10
+
+**Change**: New `/reflect` command for capturing session knowledge
+
+**What It Does**:
+- Extracts operational learnings from current session
+- Suggests updates to CLAUDE.md (Avoidable Errors section)
+- Proposes new skills based on patterns discovered
+- Integrates with `/wrap-session` for end-of-session workflow
+
+---
+
+### Added - Claude Rules Pattern πŸ“‹
+
+**Date**: 2025-12-06
+
+**Change**: Added portable correction rules for 32 skills
+
+**What Changed**:
+- New `rules/` directory pattern for skills
+- Rules are copied to projects (`.claude/rules/`) for portable context
+- Bridge Claude's training cutoff with current syntax/patterns
+- 6 high-priority skills + 26 additional skills now have rules
+
+**Skills with Rules**:
+- tailwind-v4-shadcn, cloudflare-worker-base, project-session-management
+- All AI skills (ai-sdk-core, openai-*, claude-*, google-gemini-*)
+- All Cloudflare skills
+- Frontend skills (tanstack-*, zustand, hono-routing, etc.)
+
+---
+
+### Added - New Skills πŸ†•
+
+**Date**: 2025-11-28 to 2025-12-08
+
+**New Skills**:
+- **cloudflare-python-workers** - Python Workers with Pyodide runtime
+- **fastapi** - Python FastAPI framework patterns
+- **flask** - Python Flask web application patterns
+
+**Total Skills**: 63 (up from 59)
+
+---
+
+### Added - New Commands πŸ› οΈ
+
+**Date**: 2025-11-21 to 2025-12-02
+
+**New Commands**:
+- `/brief` - Context preservation for session handoffs
+- `/create-skill` - Interactive wizard for creating new skills
+- `/update-docs` - Documentation audit and maintenance
+
+---
+
+### Enhanced - google-chat-api Skill πŸ’¬
+
+**Date**: 2025-11-21
+
+**Change**: Added Markdown support (September 2025 GA feature)
+
+---
+
+### Fixed - Skill Maintenance πŸ”§
+
+**Date**: 2025-11-17 to 2025-12-15
+
+**Fixes**:
+- Fixed marketplace.json structure to match Anthropic plugin format
+- Fixed ts-agent-sdk: added templates, removed hardcoded paths
+- Fixed missing YAML frontmatter in project-workflow skill
+- Removed non-standard frontmatter fields from all skills
+- Added MCP server compatibility warning to elevenlabs-agents
+
+---
+
### Archived - 13 Low-Priority Skills πŸ“¦
**Date**: 2025-11-17
diff --git a/CLAUDE.md b/CLAUDE.md
index 847cfaf1..9f60d154 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -3,8 +3,8 @@
**Repository**: https://github.com/jezweb/claude-skills
**Purpose**: Production-ready skills for Claude Code CLI
**Owner**: Jeremy Dawes (Jez) | Jezweb
-**Status**: Active Development | 58 Skills Complete (13 archived)
-**Last Updated**: 2025-11-29
+**Status**: Active Development | 63 Skills Complete (13 archived)
+**Last Updated**: 2025-12-15
---
@@ -126,6 +126,7 @@ claude-skills/
β”‚ β”œβ”€β”€ check-metadata.sh # YAML metadata validator
β”‚ β”œβ”€β”€ check-ai-models.sh # AI model reference checker
β”‚ β”œβ”€β”€ check-all-versions.sh # Comprehensive checker (runs all)
+β”‚ β”œβ”€β”€ check-marketplace-sync.sh # Verify marketplace.json matches skills/
β”‚ β”œβ”€β”€ generate-plugin-manifests.sh # Generate marketplace manifests
β”‚ β”œβ”€β”€ release-check.sh # Pre-release safety checks
β”‚ β”œβ”€β”€ review-skill.sh # Skill audit/review automation
@@ -234,11 +235,11 @@ This repository has three types of files:
---
-## Current Status (2025-11-29)
+## Current Status (2025-12-15)
-### βœ… Active Skills (58)
+### βœ… Active Skills (63)
-All 58 skills are production-ready and organized by domain:
+All 63 skills are production-ready and organized by domain:
**Cloudflare Platform** (20 skills):
- cloudflare-worker-base, cloudflare-d1, cloudflare-r2, cloudflare-kv
@@ -288,7 +289,6 @@ All 58 skills are production-ready and organized by domain:
```
1. RESEARCH
β€’ Read planning/research-protocol.md
- β€’ Check Context7 MCP for library docs
β€’ Verify latest package versions (npm view)
β€’ Document in planning/research-logs/
@@ -467,7 +467,7 @@ ls -la ~/.claude/skills/
### Development
```bash
-# Check all versions (npm, GitHub, metadata, AI models)
+# Check all versions (npm, GitHub, metadata, AI models, marketplace sync)
./scripts/check-all-versions.sh # All skills
./scripts/check-all-versions.sh cloudflare-worker-base # Specific skill
@@ -476,6 +476,8 @@ ls -la ~/.claude/skills/
./scripts/check-github-releases.sh [skill-name] # GitHub releases only
./scripts/check-metadata.sh [skill-name] # Metadata only
./scripts/check-ai-models.sh [skill-name] # AI models only
+./scripts/check-marketplace-sync.sh # Marketplace sync only
+./scripts/check-marketplace-sync.sh --fix # Auto-fix marketplace.json
# Create new skill from template
cp -r templates/skill-skeleton/ skills/new-skill-name/
@@ -708,6 +710,6 @@ See [planning/COMMON_MISTAKES.md](planning/COMMON_MISTAKES.md) for detailed exam
---
-**Last Updated**: 2025-11-07
-**Next Review**: 2026-01-29 (Quarterly)
+**Last Updated**: 2025-12-15
+**Next Review**: 2026-03-15 (Quarterly)
**Maintainer**: Jeremy Dawes | [email protected] | https://jezweb.com.au
diff --git a/archive/planning/2025-12-DOCUMENTATION_AUDIT_2025-10-24.md b/archive/planning/2025-12-DOCUMENTATION_AUDIT_2025-10-24.md
deleted file mode 100644
index 08fed14f..00000000
--- a/archive/planning/2025-12-DOCUMENTATION_AUDIT_2025-10-24.md
+++ /dev/null
@@ -1,305 +0,0 @@
-# Documentation Audit - October 24, 2025
-
-**Auditor**: Claude Code
-**Scope**: Verify status of skills in roadmap vs actual existence
-**Findings**: 3 documentation discrepancies found
-
----
-
-## πŸ” Summary of Findings
-
-**Total Skills Audited**: 28
-**Documentation Errors Found**: 3
-**Skills Verified Complete**: 27 (96%)
-
----
-
-## ❌ Critical Issues Found
-
-### 1. tailwind-v4-shadcn - Missing from Repository
-
-**Status**: βœ… EXISTS in `~/.claude/skills/` | ❌ MISSING from repo
-**Location**: `/home/jez/.claude/skills/tailwind-v4-shadcn/`
-**Issue**: Skill is production-ready and installed, but never committed to the repository
-
-**Evidence:**
-```bash
-$ ls -la ~/.claude/skills/tailwind-v4-shadcn/
-total 40
-drwxrwxr-x 4 jez jez 4096 Oct 20 22:34 .
--rw-rw-r-- 1 jez jez 5542 Oct 20 12:41 README.md
--rw-rw-r-- 1 jez jez 12892 Oct 20 22:34 SKILL.md
-drwxrwxr-x 2 jez jez 4096 Oct 20 11:21 reference
-drwxrwxr-x 2 jez jez 4096 Oct 20 09:33 templates
-```
-
-**Referenced By**: 5 other skills
-- cloudflare-full-stack-scaffold
-- cloudflare-turnstile
-- react-hook-form-zod
-- And 2 others
-
-**Impact**: HIGH
-- Other skills expect this to exist
-- Production-tested and working
-- Referenced in CLAUDE.md as complete
-
-**Resolution**:
-```bash
-cp -r ~/.claude/skills/tailwind-v4-shadcn /home/jez/Documents/claude-skills/skills/
-git add skills/tailwind-v4-shadcn
-git commit -m "Add tailwind-v4-shadcn skill (production-tested)
-
-Production-tested: WordPress Auditor
-Token savings: ~70%
-Errors prevented: 3
-Complete with templates, references, and examples"
-```
-
----
-
-### 2. cloudflare-full-stack-scaffold - Incorrect Status
-
-**Roadmap Says**: 40% complete
-**Actual Status**: βœ… 100% complete
-
-**Evidence:**
-```
-File: skills/cloudflare-full-stack-scaffold/IMPLEMENTATION_STATUS.md
-Line 4: Status: 100% Complete + Code Review Fixes Applied βœ…
-Line 6: Context: All phases complete + critical issues fixed. Production-ready!
-```
-
-**Files Verified**:
-- βœ… All 10 phases complete
-- βœ… Backend routes (8/8 complete)
-- βœ… Frontend components (4/4 complete)
-- βœ… Helper scripts (2/2 complete)
-- βœ… All documentation complete
-
-**Impact**: MEDIUM
-- Misleading roadmap status
-- Users may think it's incomplete
-- Work is actually done
-
-**Resolution**:
-Update `planning/skills-roadmap.md`:
-```diff
-- **Status**: 🟑 40% Complete
-+ **Status**: βœ… 100% Complete
-```
-
----
-
-### 3. tanstack-query - Incorrectly Marked as Planned
-
-**Roadmap Says**: Planned (not started)
-**Actual Status**: βœ… 100% complete
-
-**Evidence:**
-```bash
-$ ls skills/tanstack-query/
-assets/ README.md references/ scripts/ SKILL.md templates/
-
-$ wc -l skills/tanstack-query/SKILL.md
-1587 skills/tanstack-query/SKILL.md
-
-$ ls skills/tanstack-query/templates/
-custom-hooks-pattern.tsx package.json use-mutation-basic.tsx
-devtools-setup.tsx provider-setup.tsx use-mutation-optimistic.tsx
-error-boundary.tsx query-client-config.ts use-query-basic.tsx
- use-infinite-query.tsx
-```
-
-**Verified Complete**:
-- βœ… SKILL.md: 1,587 lines (complete API reference)
-- βœ… Templates: 10 files
-- βœ… References: 5 files
-- βœ… README.md: Comprehensive keywords
-- βœ… Production ready
-
-**Impact**: MEDIUM
-- Roadmap doesn't reflect completed work
-- Users may duplicate effort
-- Missing from "completed" count
-
-**Resolution**:
-Update `planning/skills-roadmap.md`:
-```diff
-- tanstack-query | Planned | 4h (est.) | ~55% | - | Medium
-+ **tanstack-query** | **βœ… Complete** | **4h** | **~55%** | **TBD** | Medium
-```
-
----
-
-## βœ… Skills Verified Complete (27 total)
-
-**Cloudflare Services (9):**
-1. cloudflare-worker-base
-2. cloudflare-d1
-3. cloudflare-r2
-4. cloudflare-kv
-5. cloudflare-workers-ai
-6. cloudflare-vectorize
-7. cloudflare-queues
-8. cloudflare-cron-triggers
-9. cloudflare-agents
-
-**Cloudflare Advanced (5):**
-10. cloudflare-nextjs
-11. cloudflare-durable-objects
-12. cloudflare-workflows
-13. cloudflare-hyperdrive
-14. cloudflare-browser-rendering
-
-**Cloudflare Integrations (4):**
-15. cloudflare-email-routing
-16. cloudflare-turnstile
-17. cloudflare-full-stack-integration
-18. cloudflare-full-stack-scaffold *(status correction needed)*
-
-**AI SDK (2):**
-19. ai-sdk-core
-20. ai-sdk-ui
-
-**Auth & Frameworks (4):**
-21. clerk-auth
-22. hono-routing
-23. react-hook-form-zod
-24. tanstack-query *(status correction needed)*
-
-**CMS & Content (2):**
-25. tinacms
-26. sveltia-cms
-
-**Other (2):**
-27. firecrawl-scraper
-28. session-handoff-protocol
-
----
-
-## πŸ“Š Audit Statistics
-
-**Skills in Repo**: 28
-**Skills Installed**: 28 (all symlinked in ~/.claude/skills/)
-**Documentation Accuracy**: 89% (25/28 correct)
-
-**Issues by Type**:
-- Missing from repo: 1 (tailwind-v4-shadcn)
-- Incorrect status: 2 (cloudflare-full-stack-scaffold, tanstack-query)
-
-**Severity**:
-- HIGH: 1 (missing skill referenced by others)
-- MEDIUM: 2 (status inaccuracies)
-
----
-
-## πŸ“ Recommendations
-
-### Immediate Actions (Today)
-1. βœ… Move tailwind-v4-shadcn to repo and commit
-2. βœ… Update cloudflare-full-stack-scaffold status to 100%
-3. βœ… Update tanstack-query status to βœ… Complete
-4. βœ… Update CHANGELOG.md with corrections
-5. βœ… Update README.md skill count (27 β†’ 28 with tailwind)
-
-### Process Improvements
-1. **Skill Completion Checklist**:
- - [ ] SKILL.md complete
- - [ ] Templates created
- - [ ] README.md keywords added
- - [ ] Added to repo (not just ~/.claude/skills/)
- - [ ] Roadmap updated
- - [ ] Git committed
- - [ ] Production tested
-
-2. **Regular Audits**:
- - Run quarterly audits (Jan, Apr, Jul, Oct)
- - Compare ~/.claude/skills/ vs repo
- - Verify roadmap statuses
- - Update package versions
-
-3. **Documentation Standard**:
- - Roadmap is source of truth
- - Update roadmap BEFORE marking skill complete
- - Commit to repo BEFORE installing to ~/.claude/skills/
- - Use IMPLEMENTATION_STATUS.md for WIP tracking
-
----
-
-## πŸ“‹ Action Items
-
-**For Jez (or Claude in next session):**
-
-- [ ] Execute tailwind-v4-shadcn repo addition
-- [ ] Update skills-roadmap.md (2 status corrections)
-- [ ] Update README.md (skill count: 27 β†’ 28)
-- [ ] Update CHANGELOG.md with audit findings
-- [ ] Commit all documentation fixes
-- [ ] Verify all symlinks working
-
-**Commands to Run:**
-```bash
-# 1. Move tailwind skill to repo
-cp -r ~/.claude/skills/tailwind-v4-shadcn /home/jez/Documents/claude-skills/skills/
-
-# 2. Update roadmap (manual edit)
-# - Line for cloudflare-full-stack-scaffold: Status = 100%
-# - Line for tanstack-query: Status = βœ… Complete
-
-# 3. Git commit
-git add skills/tailwind-v4-shadcn planning/skills-roadmap.md
-git commit -m "Fix: Add tailwind-v4-shadcn and correct skill statuses
-
-- Add tailwind-v4-shadcn skill (production-tested)
-- Update cloudflare-full-stack-scaffold: 40% β†’ 100%
-- Update tanstack-query: Planned β†’ βœ… Complete
-
-Documentation audit 2025-10-24 revealed 3 discrepancies.
-All corrected. Total skills: 28 complete."
-
-# 4. Verify
-ls skills/ | wc -l # Should show 28 (or 29 with tailwind)
-```
-
----
-
-## 🎯 Impact Assessment
-
-**Before Audit**:
-- Documented complete skills: 25
-- Actually complete skills: 27
-- Missing from repo: 1
-- Accuracy: 89%
-
-**After Corrections**:
-- Documented complete skills: 28
-- Actually complete skills: 28
-- Missing from repo: 0
-- Accuracy: 100%
-
-**Benefits**:
-- Accurate skill inventory
-- No missing dependencies
-- Correct planning for new skills
-- Reliable documentation
-
----
-
-## πŸ“š Related Documents
-
-**Created from this audit**:
-1. `planning/skill-build-plan-2025.md` - Complete plan for 12 new skills
-2. `planning/SKILLS_TO_BUILD_NEXT.md` - Quick reference build schedule
-3. `planning/DOCUMENTATION_AUDIT_2025-10-24.md` - This document
-
-**To Update**:
-1. `planning/skills-roadmap.md` - Fix 2 status entries
-2. `README.md` - Update skill count
-3. `CHANGELOG.md` - Add audit entry
-
----
-
-**Audit Completed**: 2025-10-24
-**Next Audit**: 2026-01-24 (Quarterly)
-**Auditor**: Claude Code (Sonnet 4.5)
diff --git a/archive/planning/2025-12-NEXT-SESSION-google-gemini-embeddings.md b/archive/planning/2025-12-NEXT-SESSION-google-gemini-embeddings.md
deleted file mode 100644
index 7be34544..00000000
--- a/archive/planning/2025-12-NEXT-SESSION-google-gemini-embeddings.md
+++ /dev/null
@@ -1,525 +0,0 @@
-# Session Handoff: google-gemini-embeddings Skill
-
-**Date**: 2025-10-25
-**Status**: Ready to Start
-**Priority**: High (completes Gemini API coverage)
-**Estimated Time**: 3-4 hours
-
----
-
-## What Was Just Completed
-
-βœ… **google-gemini-api Phase 2 Expansion**
-- Context Caching (cost optimization)
-- Code Execution (Python sandbox)
-- Grounding with Google Search (real-time info)
-- 4 new templates, 3 new reference docs
-- 7 new errors documented
-- Committed: 1b9537a
-
----
-
-## What's Next: google-gemini-embeddings Skill
-
-### Overview
-
-Create a **separate atomic skill** for Google Gemini embeddings API (text-embedding-004). This is a distinct use case from the main API, so it deserves its own skill.
-
-### Why Separate Skill?
-
-1. **Atomic Skills Philosophy**: Embeddings is a distinct domain (vector search, RAG, semantic search)
-2. **Composability**: Users can combine with cloudflare-vectorize skill
-3. **Token Efficiency**: Only loads when needed for embeddings use cases
-4. **Maintainability**: Easier to update embeddings-specific content
-
-### Target Metrics
-
-- **Token Savings**: ~60% (vs building RAG from scratch)
-- **Errors Prevented**: 8+ embedding-specific issues
-- **Development Time**: 3-4 hours
-- **Package**: @google/[email protected] (same SDK)
-
----
-
-## Research Required
-
-### 1. Context7 Lookup
-
-```typescript
-// Use Context7 to get latest embeddings API docs
-mcp__context7__get-library-docs({
- context7CompatibleLibraryID: '/websites/ai_google_dev_gemini-api',
- topic: 'embeddings text-embedding-004 embed content batch embeddings',
- tokens: 8000
-})
-```
-
-### 2. Official Documentation
-
-- **Embeddings Guide**: https://ai.google.dev/gemini-api/docs/embeddings
-- **Model**: text-embedding-004 (768 dimensions)
-- **API endpoint**: `/v1beta/models/text-embedding-004:embedContent`
-
-### 3. Key Questions to Answer
-
-- [ ] How to generate embeddings (single text)
-- [ ] How to batch embed multiple texts
-- [ ] What are the dimension options? (768 default)
-- [ ] Task types: RETRIEVAL_QUERY vs RETRIEVAL_DOCUMENT
-- [ ] Rate limits and quotas
-- [ ] Integration with Vectorize
-- [ ] Cost per token
-
----
-
-## Skill Structure to Create
-
-```
-skills/google-gemini-embeddings/
-β”œβ”€β”€ README.md # Auto-trigger keywords
-β”œβ”€β”€ SKILL.md # Complete guide (600-800 lines)
-β”œβ”€β”€ templates/
-β”‚ β”œβ”€β”€ package.json
-β”‚ β”œβ”€β”€ basic-embeddings.ts # Single text embedding
-β”‚ β”œβ”€β”€ embeddings-fetch.ts # Cloudflare Workers fetch
-β”‚ β”œβ”€β”€ batch-embeddings.ts # Bulk processing
-β”‚ β”œβ”€β”€ rag-with-vectorize.ts # Complete RAG pattern
-β”‚ β”œβ”€β”€ semantic-search.ts # Similarity search
-β”‚ β”œβ”€β”€ clustering.ts # Document clustering
-β”‚ └── dimension-comparison.ts # 768 vs other models
-β”œβ”€β”€ references/
-β”‚ β”œβ”€β”€ model-comparison.md # text-embedding-004 vs others
-β”‚ β”œβ”€β”€ vectorize-integration.md # Cloudflare Vectorize patterns
-β”‚ β”œβ”€β”€ rag-patterns.md # Retrieval augmented generation
-β”‚ β”œβ”€β”€ dimension-guide.md # When to use 768d
-β”‚ └── top-errors.md # 8 embedding errors
-└── scripts/
- └── check-versions.sh # Package version checker
-```
-
----
-
-## SKILL.md Structure (600-800 lines)
-
-### Table of Contents
-
-1. **Quick Start**
- - Installation (@google/[email protected])
- - Environment setup (GEMINI_API_KEY)
- - First embedding example
-
-2. **text-embedding-004 Model**
- - Dimensions: 768 (fixed)
- - Task types (RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT)
- - Context window
- - Output format
-
-3. **Basic Embeddings**
- - Single text (SDK)
- - Single text (fetch - Cloudflare Workers)
- - Response structure
-
-4. **Batch Embeddings**
- - Multiple texts in one request
- - Rate limits and chunking
- - Performance optimization
-
-5. **Task Types**
- - RETRIEVAL_QUERY: User queries
- - RETRIEVAL_DOCUMENT: Document indexing
- - When to use which
-
-6. **RAG Patterns**
- - Complete RAG workflow
- - Integration with Cloudflare Vectorize
- - Query flow (embed query β†’ search β†’ retrieve β†’ generate)
- - Document ingestion pipeline
-
-7. **Semantic Search**
- - Cosine similarity calculation
- - Vector normalization
- - Search algorithms
-
-8. **Document Clustering**
- - K-means clustering with embeddings
- - Similarity thresholds
- - Use cases
-
-9. **Error Handling**
- - Common errors
- - Rate limiting
- - Token limits
-
-10. **Best Practices**
- - Always do / never do
- - Cost optimization
- - Performance tips
-
----
-
-## Templates to Create (7 total)
-
-### 1. package.json
-```json
-{
- "dependencies": {
- "@google/genai": "^1.27.0"
- },
- "devDependencies": {
- "typescript": "^5.0.0"
- }
-}
-```
-
-### 2. basic-embeddings.ts
-- Single text embedding
-- SDK approach
-- Response parsing
-
-### 3. embeddings-fetch.ts
-- Fetch-based for Cloudflare Workers
-- No SDK dependencies
-- REST API direct
-
-### 4. batch-embeddings.ts
-- Process multiple texts
-- Chunking for rate limits
-- Progress tracking
-
-### 5. rag-with-vectorize.ts (CRITICAL - integration pattern)
-- Complete RAG implementation
-- Vectorize index creation
-- Document ingestion
-- Query flow with streaming response
-- Shows how to combine with cloudflare-vectorize skill
-
-### 6. semantic-search.ts
-- Cosine similarity
-- Vector normalization
-- Top-k search
-
-### 7. clustering.ts
-- K-means clustering
-- Similarity grouping
-- Visualization
-
----
-
-## Reference Docs to Create (5 total)
-
-### 1. model-comparison.md
-- text-embedding-004 (768d) - Gemini
-- text-embedding-3-small (1536d) - OpenAI
-- text-embedding-3-large (3072d) - OpenAI
-- BGE-base-en-v1.5 (768d) - Workers AI
-- When to use which
-
-### 2. vectorize-integration.md
-- Cloudflare Vectorize setup
-- Index creation (768 dimensions for Gemini)
-- Insert embeddings
-- Query patterns
-- Metadata filtering
-
-### 3. rag-patterns.md
-- Document chunking strategies
-- Embedding generation workflow
-- Storage in Vectorize
-- Retrieval with similarity search
-- Response generation with context
-- Complete end-to-end examples
-
-### 4. dimension-guide.md
-- Why 768 dimensions?
-- Trade-offs (accuracy vs storage/compute)
-- Comparison with other embedding models
-- Use case recommendations
-
-### 5. top-errors.md (8 errors)
-1. Dimension mismatch (768 vs 1536 vs 3072)
-2. Batch size limits exceeded
-3. Rate limiting errors
-4. Text truncation (input length limits)
-5. Cosine similarity calculation errors
-6. Vector normalization mistakes
-7. Incorrect task type (RETRIEVAL_QUERY vs RETRIEVAL_DOCUMENT)
-8. Embedding model version confusion
-
----
-
-## README.md Keywords (Comprehensive List)
-
-### Primary Keywords
-- `gemini embeddings`
-- `text-embedding-004`
-- `google embeddings`
-- `gemini embed`
-- `@google/genai embeddings`
-
-### Use Cases
-- `semantic search gemini`
-- `rag gemini`
-- `vector search gemini`
-- `document clustering gemini`
-- `similarity search gemini`
-- `retrieval augmented generation gemini`
-
-### Technical
-- `768 dimensions`
-- `embed content gemini`
-- `batch embeddings gemini`
-- `embeddings api gemini`
-- `cosine similarity gemini`
-- `vector normalization`
-
-### Integration
-- `vectorize gemini`
-- `cloudflare vectorize embeddings`
-- `rag vectorize`
-- `gemini embeddings workers`
-
-### Task Types
-- `retrieval query gemini`
-- `retrieval document gemini`
-- `embedding task types`
-
-### Errors
-- `dimension mismatch embeddings`
-- `embeddings rate limit`
-- `text truncation embeddings`
-- `batch size limit embeddings`
-
----
-
-## Known Issues to Document
-
-### From Research/Experience
-
-1. **Dimension Mismatch**
- - Gemini: 768d (fixed)
- - OpenAI small: 1536d
- - OpenAI large: 3072d
- - **Error**: Vectorize index created with wrong dimensions
-
-2. **Batch Size Limits**
- - Max texts per request: [Need to research]
- - Rate limits: [Need to research]
-
-3. **Task Type Confusion**
- - RETRIEVAL_QUERY: For user questions
- - RETRIEVAL_DOCUMENT: For documents to index
- - **Error**: Using wrong type reduces search quality
-
-4. **Text Truncation**
- - Max input length: [Need to research]
- - No warning if truncated
- - **Error**: Incomplete embeddings
-
-5. **Cosine Similarity Errors**
- - Not normalizing vectors
- - Incorrect formula
- - **Error**: Wrong similarity scores
-
-6. **Vector Storage**
- - Storing raw floats vs normalized
- - Precision loss
- - **Error**: Search quality degradation
-
-7. **Chunking Strategy**
- - Chunk size too large/small
- - No overlap
- - **Error**: Missing context in search
-
-8. **Model Version**
- - Using old embedding models
- - Mixing model outputs
- - **Error**: Incompatible vectors
-
----
-
-## Integration Points
-
-### With Other Skills
-
-**cloudflare-vectorize**:
-```typescript
-// 1. Generate embeddings with Gemini
-const embedding = await ai.models.embedContent({
- model: 'text-embedding-004',
- content: documentText
-});
-
-// 2. Store in Vectorize (from cloudflare-vectorize skill)
-await env.VECTORIZE.insert([{
- id: 'doc-1',
- values: embedding.values,
- metadata: { text: documentText }
-}]);
-
-// 3. Query
-const queryEmbedding = await ai.models.embedContent({
- model: 'text-embedding-004',
- content: userQuery
-});
-
-const results = await env.VECTORIZE.query(queryEmbedding.values, { topK: 5 });
-```
-
-**google-gemini-api** (for generation):
-```typescript
-// 1. Embed query
-// 2. Search Vectorize
-// 3. Generate response with context
-const response = await ai.models.generateContent({
- model: 'gemini-2.5-flash',
- contents: `Context: ${retrievedDocs}\n\nQuestion: ${userQuery}`
-});
-```
-
----
-
-## Quick Start Checklist
-
-When you resume, follow this order:
-
-### Phase 1: Research (30 min)
-- [ ] Use Context7 to fetch embeddings API docs
-- [ ] Read official Google embeddings guide
-- [ ] Identify API endpoints and parameters
-- [ ] Document task types (RETRIEVAL_QUERY vs RETRIEVAL_DOCUMENT)
-- [ ] Find rate limits, token limits, dimensions
-
-### Phase 2: Structure (15 min)
-- [ ] Copy skill skeleton template
-- [ ] Create directory structure
-- [ ] Set up package.json
-
-### Phase 3: SKILL.md (90 min)
-- [ ] Write Quick Start section
-- [ ] Document text-embedding-004 model
-- [ ] Add basic embeddings (SDK + fetch)
-- [ ] Add batch embeddings
-- [ ] Add task types explanation
-- [ ] Add RAG patterns
-- [ ] Add semantic search
-- [ ] Add clustering
-- [ ] Add error handling
-- [ ] Add best practices
-
-### Phase 4: Templates (60 min)
-- [ ] Create package.json
-- [ ] Create basic-embeddings.ts
-- [ ] Create embeddings-fetch.ts
-- [ ] Create batch-embeddings.ts
-- [ ] Create rag-with-vectorize.ts (IMPORTANT!)
-- [ ] Create semantic-search.ts
-- [ ] Create clustering.ts
-
-### Phase 5: References (45 min)
-- [ ] Create model-comparison.md
-- [ ] Create vectorize-integration.md
-- [ ] Create rag-patterns.md
-- [ ] Create dimension-guide.md
-- [ ] Create top-errors.md
-
-### Phase 6: README.md (20 min)
-- [ ] Write skill description
-- [ ] Add all auto-trigger keywords
-- [ ] Add when to use / when not to use
-- [ ] Add quick example
-- [ ] Add known issues table
-- [ ] Add token efficiency metrics
-
-### Phase 7: Testing & Verification (20 min)
-- [ ] Install skill: `./scripts/install-skill.sh google-gemini-embeddings`
-- [ ] Verify auto-discovery works
-- [ ] Check all templates compile
-- [ ] Verify integration with Vectorize examples
-
-### Phase 8: Finalize (10 min)
-- [ ] Update planning/skills-roadmap.md
-- [ ] Commit with detailed message
-- [ ] Push to GitHub
-
-**Total Estimated Time**: 3-4 hours
-
----
-
-## Context7 Library ID
-
-```
-/websites/ai_google_dev_gemini-api
-```
-
-**Topics to search**:
-- embeddings
-- text-embedding-004
-- embed content
-- batch embeddings
-- retrieval query
-- retrieval document
-
----
-
-## Example Queries for Research
-
-When you start, ask these to Context7:
-
-1. "How do I generate embeddings with text-embedding-004?"
-2. "What are the task types for Gemini embeddings?"
-3. "How do I batch embed multiple texts?"
-4. "What are the rate limits for Gemini embeddings API?"
-5. "How do I integrate Gemini embeddings with vector search?"
-
----
-
-## Success Criteria
-
-Skill is complete when:
-
-βœ… SKILL.md has 600-800 lines with all 10 sections
-βœ… 7 templates created and tested
-βœ… 5 reference docs created
-βœ… README.md has 50+ auto-trigger keywords
-βœ… 8+ errors documented with solutions
-βœ… RAG pattern with Vectorize integration works
-βœ… Token savings >= 60%
-βœ… Auto-discovery works in Claude Code
-βœ… Committed and pushed to GitHub
-
----
-
-## Notes
-
-- **Same SDK**: Uses @google/[email protected] (same as main API skill)
-- **Fixed Dimensions**: text-embedding-004 always outputs 768 dimensions
-- **Atomic Design**: Should NOT duplicate content from google-gemini-api skill
-- **Integration Focus**: Strong emphasis on Vectorize + RAG patterns
-- **Production Value**: Complete RAG implementation is the killer feature
-
----
-
-## Resources
-
-**Official Docs**:
-- https://ai.google.dev/gemini-api/docs/embeddings
-- https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding-004
-
-**Related Skills**:
-- google-gemini-api (main API - already complete)
-- cloudflare-vectorize (vector database - already complete)
-
-**Templates Reference**:
-- Use google-gemini-api templates as style guide
-- Use cloudflare-vectorize for Vectorize integration patterns
-
----
-
-## Ready to Start?
-
-1. Open fresh Claude Code session
-2. Read this document
-3. Start with Phase 1 (Research)
-4. Follow the checklist
-
-**Good luck! This will complete the Gemini API coverage and provide a production-ready RAG skill.**
diff --git a/archive/planning/2025-12-SKILLS_TO_BUILD_NEXT.md b/archive/planning/2025-12-SKILLS_TO_BUILD_NEXT.md
deleted file mode 100644
index f34e95fe..00000000
--- a/archive/planning/2025-12-SKILLS_TO_BUILD_NEXT.md
+++ /dev/null
@@ -1,175 +0,0 @@
-# Skills to Build Next - Quick Reference
-
-**Date**: 2025-10-24
-**Full Plan**: See `skill-build-plan-2025.md` for complete details
-
----
-
-## 🚨 URGENT: Documentation Fixes First
-
-**Before building any new skills, fix these documentation issues:**
-
-1. βœ… **tailwind-v4-shadcn** - EXISTS in `~/.claude/skills/` but NOT in repo
- ```bash
- cp -r ~/.claude/skills/tailwind-v4-shadcn /home/jez/Documents/claude-skills/skills/
- git add skills/tailwind-v4-shadcn
- git commit -m "Add tailwind-v4-shadcn skill (production-tested)"
- ```
-
-2. βœ… **cloudflare-full-stack-scaffold** - Actually 100% complete (roadmap says 40%)
- - Update `planning/skills-roadmap.md` line with correct status
-
-3. βœ… **tanstack-query** - Actually 100% complete (roadmap says planned)
- - Update `planning/skills-roadmap.md` to mark as βœ… Complete
-
----
-
-## πŸ“… Build Schedule (11 Weeks)
-
-### Sprint 1 (Next 2 weeks)
-**Focus:** Quick wins, frequently used
-
-1. **zustand** (3-4 hours)
- - Client state management
- - Complements tanstack-query
- - Token savings: ~50%
- - Priority: HIGH
-
-2. **drizzle-orm-d1** (5-6 hours)
- - Type-safe SQL for D1
- - Migration management
- - Token savings: ~60%
- - Priority: HIGH
-
----
-
-### Sprint 2 (Weeks 3-4)
-**Focus:** SaaS monetization essentials
-
-3. **stripe-payments** (6-8 hours)
- - Subscriptions, webhooks, checkout
- - Critical for revenue
- - Token savings: ~65%
- - Priority: CRITICAL
-
-4. **resend-email** (3-4 hours)
- - Transactional emails
- - Pairs with Stripe
- - Token savings: ~55%
- - Priority: HIGH
-
----
-
-### Sprint 3 (Weeks 5-6)
-**Focus:** AI tooling & testing foundation
-
-5. **vitest** (4-5 hours)
- - Vite-native testing
- - Cloudflare Workers support
- - Token savings: ~50%
- - Priority: HIGH
-
-6. **mastra-ai** (6-7 hours)
- - AI agent framework
- - Cloudflare integration
- - Token savings: ~60%
- - Priority: MEDIUM-HIGH
-
-7. **openrouter** (3-4 hours)
- - Multi-provider LLM access
- - Cost optimization
- - Token savings: ~45%
- - Priority: MEDIUM
-
----
-
-### Sprint 4 (Weeks 7-8)
-**Focus:** Alternative auth & E2E testing
-
-8. **authjs** (6-7 hours)
- - Clerk alternative (self-hosted)
- - D1 adapter support
- - Token savings: ~60%
- - Priority: MEDIUM
-
-9. **playwright** (5-6 hours)
- - E2E testing
- - Auth flow testing
- - Token savings: ~55%
- - Priority: MEDIUM
-
----
-
-### Sprint 5 (Weeks 9-10)
-**Focus:** Production monitoring & media
-
-10. **sentry** (4-5 hours)
- - Error monitoring
- - Performance tracking
- - Token savings: ~50%
- - Priority: MEDIUM
-
-11. **cloudflare-images** (4-5 hours)
- - Image optimization
- - Complements R2
- - Token savings: ~55%
- - Priority: MEDIUM
-
----
-
-### Sprint 6 (Week 11)
-**Focus:** Email templates
-
-12. **react-email** (3-4 hours)
- - Email templates as React
- - Works with Resend
- - Token savings: ~50%
- - Priority: MEDIUM-LOW
-
----
-
-## πŸ“Š Quick Stats
-
-**Total Skills**: 13 (1 exists, 12 to build)
-**Total Estimated Time**: 56-68 hours
-**Timeline**: ~11 weeks at 5-6 hours/week
-**Average Token Savings**: ~55%
-**Total Errors Prevented**: ~100+
-
----
-
-## 🎯 Immediate Next Steps
-
-1. **Today** (30 minutes):
- - [ ] Move tailwind-v4-shadcn to repo
- - [ ] Update roadmap statuses
- - [ ] Commit documentation fixes
-
-2. **This Week**:
- - [ ] Build **zustand** skill (3-4 hours)
- - [ ] Build **drizzle-orm-d1** skill (5-6 hours)
-
-3. **Next Week**:
- - [ ] Start **stripe-payments** skill
-
----
-
-## πŸ“– Detailed Planning
-
-**For complete details on each skill, see:**
-`planning/skill-build-plan-2025.md`
-
-Each skill includes:
-- Complete scope definition
-- Templates to create (with file list)
-- References to create (with file list)
-- Known errors to document (with sources)
-- Package versions (verified)
-- Auto-trigger keywords
-- Dependencies
-- Production test requirements
-
----
-
-**Last Updated**: 2025-10-24
-**Status**: Ready for Implementation
diff --git a/archive/planning/2025-12-ai-sdk-NEXT-SESSION.md b/archive/planning/2025-12-ai-sdk-NEXT-SESSION.md
deleted file mode 100644
index cb3f80f7..00000000
--- a/archive/planning/2025-12-ai-sdk-NEXT-SESSION.md
+++ /dev/null
@@ -1,284 +0,0 @@
-# AI SDK Skills - Ready to Build
-
-**Created**: 2025-10-21
-**Status**: Planning Complete βœ… - Ready for Execution
-
----
-
-## πŸ“‹ What We Did (This Session)
-
-βœ… **Research Complete**
-- Comprehensive research on Vercel AI SDK v5
-- Documented 24 known issues (12 Core + 12 UI)
-- Catalogued 15+ v4β†’v5 breaking changes
-- Verified package versions ([email protected], [email protected]+)
-- Analyzed 25+ providers (focusing on top 4)
-- Tested integration patterns (Cloudflare Workers, Next.js)
-
-βœ… **Specifications Created**
-- **ai-sdk-core-spec.md** (970 lines) - Complete blueprint for backend skill
-- **ai-sdk-ui-spec.md** (968 lines) - Complete blueprint for frontend skill
-- **research-logs/ai-sdk.md** (592 lines) - All research findings
-
-βœ… **Roadmap Updated**
-- Added both skills to Batch 2
-- Updated progress tracking
-- Defined priorities (ai-sdk-core first, then ai-sdk-ui)
-
----
-
-## πŸš€ Next Steps (Fresh Context)
-
-### Session 1: Build ai-sdk-core (6-8 hours)
-
-**What to Do:**
-1. Read `/home/jez/Documents/claude-skills/planning/ai-sdk-core-spec.md`
-2. Follow the specification exactly
-3. Create skill structure
-4. Write SKILL.md (800-1000 lines)
-5. Create 13 templates
-6. Create 5 reference docs
-7. Test all templates
-8. Verify auto-discovery
-
-**File Locations:**
-- Skill directory: `/home/jez/Documents/claude-skills/skills/ai-sdk-core/`
-- Specification: `/home/jez/Documents/claude-skills/planning/ai-sdk-core-spec.md`
-- Research log: `/home/jez/Documents/claude-skills/planning/research-logs/ai-sdk.md`
-
-**Key Points:**
-- Focus on v5 (stable), NOT v6 beta
-- Top 4 providers: OpenAI, Anthropic, Google, Cloudflare (in that order)
-- Don't prioritize workers-ai-provider (it's one option among many)
-- Document top 12 errors, link to docs for rest
-- Include v4β†’v5 migration guide
-- Link to advanced topics (don't replicate)
-
-### Session 2: Build ai-sdk-ui (5-7 hours)
-
-**What to Do:**
-1. Read `/home/jez/Documents/claude-skills/planning/ai-sdk-ui-spec.md`
-2. Follow the specification exactly
-3. Create skill structure
-4. Write SKILL.md (700-900 lines)
-5. Create 11 templates
-6. Create 5 reference docs
-7. Test all templates
-8. Verify auto-discovery
-
-**File Locations:**
-- Skill directory: `/home/jez/Documents/claude-skills/skills/ai-sdk-ui/`
-- Specification: `/home/jez/Documents/claude-skills/planning/ai-sdk-ui-spec.md`
-- Research log: `/home/jez/Documents/claude-skills/planning/research-logs/ai-sdk.md`
-
-**Key Points:**
-- Focus on v5 breaking changes (especially useChat input management)
-- Next.js App Router + Pages Router examples
-- Document top 12 UI errors
-- Message rendering patterns
-- Link to Generative UI / RSC (don't replicate)
-
----
-
-## πŸ“¦ Specifications Overview
-
-### ai-sdk-core
-
-**Scope:**
-- generateText, streamText, generateObject, streamObject
-- Tool calling & Agent class
-- Multi-step execution (stopWhen)
-- OpenAI, Anthropic, Google, Cloudflare providers
-- v4β†’v5 migration guide
-- Top 12 errors with solutions
-
-**Files to Create:**
-```
-skills/ai-sdk-core/
-β”œβ”€β”€ SKILL.md
-β”œβ”€β”€ README.md
-β”œβ”€β”€ templates/ (13 files)
-β”‚ β”œβ”€β”€ generate-text-basic.ts
-β”‚ β”œβ”€β”€ stream-text-chat.ts
-β”‚ β”œβ”€β”€ generate-object-zod.ts
-β”‚ β”œβ”€β”€ stream-object-zod.ts
-β”‚ β”œβ”€β”€ tools-basic.ts
-β”‚ β”œβ”€β”€ agent-with-tools.ts
-β”‚ β”œβ”€β”€ multi-step-execution.ts
-β”‚ β”œβ”€β”€ openai-setup.ts
-β”‚ β”œβ”€β”€ anthropic-setup.ts
-β”‚ β”œβ”€β”€ google-setup.ts
-β”‚ β”œβ”€β”€ cloudflare-worker-integration.ts
-β”‚ β”œβ”€β”€ nextjs-server-action.ts
-β”‚ └── package.json
-β”œβ”€β”€ references/ (5 files)
-β”‚ β”œβ”€β”€ providers-quickstart.md
-β”‚ β”œβ”€β”€ v5-breaking-changes.md
-β”‚ β”œβ”€β”€ top-errors.md
-β”‚ β”œβ”€β”€ production-patterns.md
-β”‚ └── links-to-official-docs.md
-└── scripts/
- └── check-versions.sh
-```
-
-### ai-sdk-ui
-
-**Scope:**
-- useChat, useCompletion, useObject hooks
-- v4β†’v5 migration (useChat input management)
-- Next.js App Router & Pages Router
-- Message rendering, persistence, tool calling UI
-- Top 12 UI errors with solutions
-
-**Files to Create:**
-```
-skills/ai-sdk-ui/
-β”œβ”€β”€ SKILL.md
-β”œβ”€β”€ README.md
-β”œβ”€β”€ templates/ (11 files)
-β”‚ β”œβ”€β”€ use-chat-basic.tsx
-β”‚ β”œβ”€β”€ use-chat-tools.tsx
-β”‚ β”œβ”€β”€ use-chat-attachments.tsx
-β”‚ β”œβ”€β”€ use-completion-basic.tsx
-β”‚ β”œβ”€β”€ use-object-streaming.tsx
-β”‚ β”œβ”€β”€ nextjs-chat-app-router.tsx
-β”‚ β”œβ”€β”€ nextjs-chat-pages-router.tsx
-β”‚ β”œβ”€β”€ nextjs-api-route.ts
-β”‚ β”œβ”€β”€ message-persistence.tsx
-β”‚ β”œβ”€β”€ custom-message-renderer.tsx
-β”‚ └── package.json
-β”œβ”€β”€ references/ (5 files)
-β”‚ β”œβ”€β”€ use-chat-migration.md
-β”‚ β”œβ”€β”€ streaming-patterns.md
-β”‚ β”œβ”€β”€ top-ui-errors.md
-β”‚ β”œβ”€β”€ nextjs-integration.md
-β”‚ └── links-to-official-docs.md
-└── scripts/
- └── check-versions.sh
-```
-
----
-
-## 🎯 Success Criteria
-
-**ai-sdk-core:**
-- [x] SKILL.md 800-1000 lines
-- [x] 13 working templates
-- [x] Top 12 errors documented
-- [x] v5 breaking changes guide
-- [x] 4 providers covered
-- [x] Token savings β‰₯ 55%
-
-**ai-sdk-ui:**
-- [x] SKILL.md 700-900 lines
-- [x] 11 working templates
-- [x] Top 12 UI errors documented
-- [x] v5 migration (useChat)
-- [x] Next.js examples (both routers)
-- [x] Token savings β‰₯ 50%
-
----
-
-## πŸ“Š Quick Reference
-
-**Package Versions:**
-- ai: 5.0.76+
-- @ai-sdk/openai: 2.0.53+
-- @ai-sdk/anthropic: 2.0.x
-- @ai-sdk/google: 2.0.x
-- workers-ai-provider: 2.0.0
-- zod: 3.23.8+
-- react: 18.2.0+ or 19.0.0-rc
-- next: 14.0.0+ or 15.x.x
-
-**Official Docs:**
-- https://ai-sdk.dev/docs
-- https://ai-sdk.dev/docs/ai-sdk-core/overview
-- https://ai-sdk.dev/docs/ai-sdk-ui/overview
-- https://ai-sdk.dev/docs/migration-guides/migration-guide-5-0
-- https://ai-sdk.dev/docs/troubleshooting
-- https://ai-sdk.dev/docs/reference/ai-sdk-errors
-
-**Research Log:**
-- `/home/jez/Documents/claude-skills/planning/research-logs/ai-sdk.md`
-
----
-
-## πŸ”‘ Key Decisions Made
-
-1. **Split into two skills** - Core (backend) + UI (frontend) for context management
-2. **Focus on v5 stable** - NOT v6 beta
-3. **Top 4 providers** - OpenAI, Anthropic, Google, Cloudflare (in order)
-4. **Don't prioritize workers-ai-provider** - One option among many
-5. **Link to advanced topics** - Embeddings, image gen, Generative UI (don't replicate)
-6. **Document top 12 errors** - Link to official docs for full catalog
-7. **Include v4β†’v5 migration** - Major breaking changes (15+)
-8. **Next.js examples** - App Router + Pages Router (not full CI/CD)
-
----
-
-## πŸ’‘ Important Notes
-
-### Do's:
-βœ… Follow specifications exactly
-βœ… Test all templates
-βœ… Copy-paste must work
-βœ… Link to official docs for advanced topics
-βœ… Emphasize v5 breaking changes
-βœ… Include practical examples
-
-### Don'ts:
-❌ Don't replicate all 28 error types
-❌ Don't cover v6 beta
-❌ Don't replicate full provider catalog
-❌ Don't include full CI/CD
-❌ Don't prioritize workers-ai-provider
-❌ Don't replicate Generative UI docs
-
----
-
-## 🚦 Execution Checklist
-
-### Before Starting ai-sdk-core:
-- [ ] Clear context window
-- [ ] Read ai-sdk-core-spec.md
-- [ ] Read research-logs/ai-sdk.md
-- [ ] Verify package versions (npm view)
-- [ ] Start fresh TodoWrite
-
-### After Completing ai-sdk-core:
-- [ ] Test all 13 templates
-- [ ] Verify auto-discovery
-- [ ] Install to ~/.claude/skills/
-- [ ] Test with Claude Code
-- [ ] Measure token savings
-- [ ] Commit to git
-- [ ] Clear context for ai-sdk-ui
-
-### After Completing ai-sdk-ui:
-- [ ] Test all 11 templates
-- [ ] Verify auto-discovery
-- [ ] Install to ~/.claude/skills/
-- [ ] Test with Claude Code
-- [ ] Test full-stack scenario (Core + UI)
-- [ ] Measure token savings
-- [ ] Commit to git
-- [ ] Update roadmap with completion
-
----
-
-## πŸ“ File Summary
-
-**Planning Files Created:**
-- `planning/ai-sdk-core-spec.md` (970 lines)
-- `planning/ai-sdk-ui-spec.md` (968 lines)
-- `planning/research-logs/ai-sdk.md` (592 lines)
-- `planning/ai-sdk-NEXT-SESSION.md` (this file)
-
-**Total Lines**: 2,530+ lines of planning
-
-**Roadmap Updated**: βœ…
-
----
-
-**Ready to build! Clear context and start with ai-sdk-core.** πŸš€
diff --git a/archive/planning/2025-12-ai-sdk-core-spec.md b/archive/planning/2025-12-ai-sdk-core-spec.md
deleted file mode 100644
index f70f9304..00000000
--- a/archive/planning/2025-12-ai-sdk-core-spec.md
+++ /dev/null
@@ -1,970 +0,0 @@
-# AI SDK Core - Skill Specification
-
-**Created**: 2025-10-21
-**Status**: Planning Phase
-**Priority**: High (Batch 2 - Do First)
-**Estimated Dev Time**: 6-8 hours
-**Token Savings**: ~55-60%
-**Errors Prevented**: 10-12 documented issues
-
----
-
-## Overview
-
-**Purpose**: Backend/server-side AI functionality using Vercel AI SDK v5 - text generation, structured output, tool calling, and agents.
-
-**Target Platforms**:
-- Node.js (primary)
-- Cloudflare Workers (workers-ai-provider as one option)
-- Next.js Server Components & Server Actions (Vercel focus)
-- Any JavaScript runtime
-
-**Focus Providers** (in order of priority):
-1. OpenAI (GPT-4, GPT-3.5, gpt-5)
-2. Anthropic (Claude 3.5 Sonnet, Claude 3 Opus/Haiku)
-3. Google (Gemini 2.5 Pro/Flash)
-4. Cloudflare Workers AI (workers-ai-provider)
-5. Others mentioned but not detailed (xAI, Mistral, Azure, Bedrock)
-
-**Version**: AI SDK v5 (stable) - Focus on v5.0.76+
-
----
-
-## Skill Structure
-
-```
-skills/ai-sdk-core/
-β”œβ”€β”€ SKILL.md # ~800-1000 lines
-β”œβ”€β”€ README.md # Auto-trigger keywords
-β”œβ”€β”€ templates/
-β”‚ β”œβ”€β”€ generate-text-basic.ts # Simple text generation
-β”‚ β”œβ”€β”€ stream-text-chat.ts # Streaming chat with messages
-β”‚ β”œβ”€β”€ generate-object-zod.ts # Structured output with Zod
-β”‚ β”œβ”€β”€ stream-object-zod.ts # Streaming structured output
-β”‚ β”œβ”€β”€ tools-basic.ts # Tool calling basics
-β”‚ β”œβ”€β”€ agent-with-tools.ts # Agent class usage
-β”‚ β”œβ”€β”€ multi-step-execution.ts # stopWhen patterns
-β”‚ β”œβ”€β”€ openai-setup.ts # OpenAI provider config
-β”‚ β”œβ”€β”€ anthropic-setup.ts # Anthropic provider config
-β”‚ β”œβ”€β”€ google-setup.ts # Google provider config
-β”‚ β”œβ”€β”€ cloudflare-worker-integration.ts # CF Workers with workers-ai-provider
-β”‚ β”œβ”€β”€ nextjs-server-action.ts # Next.js Server Action example
-β”‚ └── package.json # Dependencies template
-β”œβ”€β”€ references/
-β”‚ β”œβ”€β”€ providers-quickstart.md # Top 4 providers setup
-β”‚ β”œβ”€β”€ v5-breaking-changes.md # Critical v4β†’v5 migrations
-β”‚ β”œβ”€β”€ top-errors.md # 10-12 most common errors
-β”‚ β”œβ”€β”€ production-patterns.md # Best practices
-β”‚ └── links-to-official-docs.md # Where to find advanced topics
-└── scripts/
- └── check-versions.sh # Package version checker
-```
-
----
-
-## SKILL.md Outline
-
-### 1. Frontmatter (YAML)
-```yaml
----
-name: AI SDK Core
-description: |
- Backend AI functionality with Vercel AI SDK v5 - text generation, structured output with Zod,
- tool calling, and agents. Multi-provider support for OpenAI, Anthropic, Google, and Cloudflare Workers AI.
-
- Use when: implementing server-side AI features, generating text/chat completions, creating structured
- AI outputs with Zod schemas, building AI agents with tools, streaming AI responses, integrating
- OpenAI/Anthropic/Google/Cloudflare providers, or encountering AI SDK errors like AI_APICallError,
- AI_NoObjectGeneratedError, streaming failures, or worker startup limits.
-
- Keywords: ai sdk core, vercel ai sdk, generateText, streamText, generateObject, streamObject,
- ai sdk node, ai sdk server, zod ai schema, ai tools calling, ai agent class, openai sdk, anthropic sdk,
- google gemini sdk, workers-ai-provider, ai streaming backend, multi-provider ai, ai sdk errors,
- AI_APICallError, AI_NoObjectGeneratedError, streamText fails, worker startup limit ai
-license: MIT
----
-```
-
-### 2. Quick Start (5-10 minutes)
-- Installation (ai + provider packages)
-- Environment variables setup
-- First generateText example (OpenAI)
-- First streamText example (streaming chat)
-- First generateObject example (Zod schema)
-
-### 3. Core Functions Deep Dive
-
-#### generateText()
-- Signature and parameters
-- Basic usage
-- With messages (chat format)
-- With tools
-- Multi-step execution
-- Error handling
-- When to use vs streamText
-
-#### streamText()
-- Signature and parameters
-- Basic streaming
-- Streaming with tools
-- Handling the stream
-- Error handling
-- Production patterns
-
-#### generateObject()
-- Signature and parameters
-- Zod schema definition
-- Basic usage
-- Nested schemas
-- Arrays and unions
-- Error handling (AI_NoObjectGeneratedError)
-- When to use vs streamObject
-
-#### streamObject()
-- Signature and parameters
-- Streaming structured data
-- Partial updates
-- UI integration patterns
-- Error handling
-
-### 4. Provider Setup & Configuration
-
-#### OpenAI
-```typescript
-import { openai } from '@ai-sdk/openai';
-
-const model = openai('gpt-4-turbo');
-const result = await generateText({
- model,
- prompt: 'Hello',
-});
-```
-- API key setup
-- Model selection (gpt-4, gpt-3.5-turbo, gpt-5)
-- Common errors
-- Rate limiting
-
-#### Anthropic
-```typescript
-import { anthropic } from '@ai-sdk/anthropic';
-
-const model = anthropic('claude-3-5-sonnet-20241022');
-```
-- API key setup
-- Model selection (Claude 3.5 Sonnet, Opus, Haiku)
-- Common errors
-
-#### Google
-```typescript
-import { google } from '@ai-sdk/google';
-
-const model = google('gemini-2.5-pro');
-```
-- API key setup
-- Model selection (Gemini 2.5 Pro/Flash)
-- Common errors
-
-#### Cloudflare Workers AI
-```typescript
-import { createWorkersAI } from 'workers-ai-provider';
-
-const workersai = createWorkersAI({ binding: env.AI });
-const model = workersai('@cf/meta/llama-3.1-8b-instruct');
-```
-- Workers AI binding setup
-- wrangler.jsonc configuration
-- Worker startup optimization (avoid 270ms+ init)
-- Model selection
-- Link to cloudflare-workers-ai skill for native binding
-
-### 5. Tool Calling & Agents
-
-#### Basic Tool Definition
-```typescript
-const tools = {
- weather: tool({
- description: 'Get weather',
- inputSchema: z.object({
- location: z.string(),
- }),
- execute: async ({ location }) => {
- // Implementation
- },
- }),
-};
-```
-
-#### Agent Class
-- When to use Agent vs raw generateText
-- Basic agent setup
-- Multi-tool agents
-- Dynamic tools (new in v5)
-- Agent error handling
-
-#### Multi-Step Execution
-- stopWhen conditions
-- stepCountIs() usage
-- hasToolCall() usage
-- Max steps vs stopWhen (v5 change)
-
-### 6. Critical v4β†’v5 Migration
-
-**Breaking Changes Developers Hit:**
-1. `maxTokens` β†’ `maxOutputTokens`
-2. `providerMetadata` β†’ `providerOptions`
-3. Tool definitions: `parameters` β†’ `inputSchema`
-4. Tool properties: `args` β†’ `input`, `result` β†’ `output`
-5. `ToolExecutionError` removed (now tool-error parts)
-6. `maxSteps` β†’ `stopWhen`
-7. Message types: `CoreMessage` β†’ `ModelMessage`
-8. Streaming architecture changed
-9. Package imports changed (ai/rsc β†’ @ai-sdk/rsc)
-
-**Migration Checklist:**
-- [ ] Update parameter names
-- [ ] Update tool definitions
-- [ ] Replace maxSteps with stopWhen
-- [ ] Update error handling (no ToolExecutionError)
-- [ ] Update imports (@ai-sdk packages)
-- [ ] Test streaming behavior
-- [ ] Update TypeScript types
-
-### 7. Top 10-12 Errors & Solutions
-
-**Priority Errors to Document:**
-
-1. **AI_APICallError**
- - Cause: API request failed (network, auth, rate limit)
- - Solution: Check API key, handle retries, check rate limits
- - Example code
-
-2. **AI_NoObjectGeneratedError**
- - Cause: Model didn't generate valid object matching schema
- - Solution: Simplify schema, add examples, retry with different model
- - Example code
-
-3. **Worker Startup Limit (270ms+)**
- - Cause: AI SDK v5 + Zod initialization overhead
- - Solution: Move imports inside handler, reduce Zod schemas at top level
- - Example code
- - Link to GitHub issue
-
-4. **streamText Fails Silently**
- - Cause: Stream errors swallowed by createDataStreamResponse
- - Solution: Add explicit error handling, check logs
- - Example code
- - Link to GitHub issue
-
-5. **AI_LoadAPIKeyError**
- - Cause: Missing or invalid API key
- - Solution: Check .env file, verify key format
- - Example code
-
-6. **AI_InvalidArgumentError**
- - Cause: Invalid parameters passed to function
- - Solution: Check types, validate inputs
- - Example code
-
-7. **AI_NoContentGeneratedError**
- - Cause: Model generated no content
- - Solution: Check prompt, retry, handle gracefully
- - Example code
-
-8. **AI_TypeValidationError**
- - Cause: Zod schema validation failed
- - Solution: Check schema matches expected output
- - Example code
-
-9. **AI_RetryError**
- - Cause: All retry attempts failed
- - Solution: Check root cause, adjust retry config
- - Example code
-
-10. **Rate Limiting Errors**
- - Cause: Exceeded provider rate limits
- - Solution: Implement backoff, queue requests
- - Example code
-
-**For Other Errors**: Link to https://ai-sdk.dev/docs/reference/ai-sdk-errors
-
-### 8. Production Best Practices
-
-**Performance:**
-- Always use streaming for long-form content
-- Implement proper error boundaries
-- Use appropriate maxOutputTokens limits
-- Cache provider instances
-- Optimize Zod schemas (avoid complex nesting at startup)
-
-**Error Handling:**
-- Wrap all AI calls in try-catch
-- Handle specific error types
-- Implement retry logic
-- Log errors properly
-- Return user-friendly messages
-
-**Cost Optimization:**
-- Choose appropriate models (gpt-3.5 vs gpt-4)
-- Set maxOutputTokens appropriately
-- Cache results when possible
-- Use streaming to reduce buffering
-
-**Cloudflare Workers Specific:**
-- Move AI SDK imports inside handlers (not top-level)
-- Use workers-ai-provider for Workers AI
-- Monitor startup time (must be <400ms)
-- Handle streaming properly (ReadableStream)
-
-**Vercel/Next.js Specific:**
-- Use Server Actions for mutations
-- Use Server Components for initial loads
-- Implement proper loading states
-- Handle errors in Server Actions
-- Link to Vercel deployment docs
-
-### 9. When to Use This Skill
-
-**Use ai-sdk-core when:**
-- Building backend AI features
-- Implementing server-side text generation
-- Creating structured AI outputs (JSON, forms, etc.)
-- Building AI agents with tools
-- Integrating multiple AI providers
-- Migrating from v4 to v5
-- Encountering AI SDK errors
-- Building Node.js AI applications
-- Using AI in Cloudflare Workers
-- Using AI in Next.js Server Components/Actions
-
-**Don't use when:**
-- Building React chat UIs (use ai-sdk-ui instead)
-- Need frontend hooks (use ai-sdk-ui instead)
-- Need advanced topics like embeddings (check official docs)
-- Building native Workers AI apps (use cloudflare-workers-ai skill)
-
-### 10. Dependencies & Versions
-
-**Required Packages:**
-```json
-{
- "dependencies": {
- "ai": "^5.0.76",
- "@ai-sdk/openai": "^2.0.53",
- "@ai-sdk/anthropic": "^2.0.x",
- "@ai-sdk/google": "^2.0.x",
- "workers-ai-provider": "^2.0.0",
- "zod": "^3.23.8"
- },
- "devDependencies": {
- "@types/node": "^20.x.x",
- "typescript": "^5.x.x"
- }
-}
-```
-
-**Version Notes:**
-- AI SDK v5.0.76+ (stable, released recently with breaking changes)
-- Zod 3.23.8+ (required for schemas)
-- Provider packages at 2.0+ (v5 compatible)
-
-### 11. Links to Official Documentation
-
-**Core Docs:**
-- AI SDK Introduction: https://ai-sdk.dev/docs/introduction
-- AI SDK Core: https://ai-sdk.dev/docs/ai-sdk-core/overview
-- Generating Text: https://ai-sdk.dev/docs/ai-sdk-core/generating-text
-- Generating Objects: https://ai-sdk.dev/docs/ai-sdk-core/generating-structured-data
-- Tool Calling: https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling
-- Agents: https://ai-sdk.dev/docs/agents/overview
-
-**Advanced Topics (Link Only):**
-- Embeddings: https://ai-sdk.dev/docs/ai-sdk-core/embeddings
-- Image Generation: https://ai-sdk.dev/docs/ai-sdk-core/generating-images
-- Transcription: https://ai-sdk.dev/docs/ai-sdk-core/generating-transcriptions
-- Speech: https://ai-sdk.dev/docs/ai-sdk-core/generating-speech
-- MCP Tools: https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools
-- Telemetry: https://ai-sdk.dev/docs/ai-sdk-core/telemetry
-
-**Migration & Troubleshooting:**
-- v4β†’v5 Migration: https://ai-sdk.dev/docs/migration-guides/migration-guide-5-0
-- All Errors Reference: https://ai-sdk.dev/docs/reference/ai-sdk-errors
-- Full Troubleshooting: https://ai-sdk.dev/docs/troubleshooting
-
-**Provider Docs:**
-- OpenAI Provider: https://ai-sdk.dev/providers/ai-sdk-providers/openai
-- Anthropic Provider: https://ai-sdk.dev/providers/ai-sdk-providers/anthropic
-- Google Provider: https://ai-sdk.dev/providers/ai-sdk-providers/google
-- All Providers: https://ai-sdk.dev/providers/overview
-
-**Cloudflare Integration:**
-- Workers AI Provider (Community): https://ai-sdk.dev/providers/community-providers/cloudflare-workers-ai
-- Cloudflare Workers AI Docs: https://developers.cloudflare.com/workers-ai/
-- workers-ai-provider GitHub: https://github.com/cloudflare/ai
-
-**Vercel Deployment:**
-- Vercel AI SDK Blog: https://vercel.com/blog/ai-sdk-5
-- Next.js Integration: https://ai-sdk.dev/docs/getting-started/nextjs-app-router
-- Vercel Functions: https://vercel.com/docs/functions
-
----
-
-## README.md Keywords
-
-### Primary Keywords (High Weight)
-- `ai sdk core`, `vercel ai sdk`, `ai sdk v5`
-- `generateText`, `streamText`, `generate text ai`
-- `generateObject`, `streamObject`, `structured ai output`
-- `ai sdk node`, `ai sdk server`, `ai sdk backend`
-- `zod ai schema`, `zod ai validation`
-- `ai tools calling`, `ai agent class`, `agent with tools`
-- `openai sdk`, `anthropic sdk`, `google gemini sdk`
-- `multi-provider ai`, `ai provider switching`
-
-### Secondary Keywords (Medium Weight)
-- `ai streaming backend`, `stream ai responses`
-- `ai server actions`, `nextjs ai server`
-- `cloudflare workers ai sdk`, `workers-ai-provider`
-- `ai sdk migration`, `v4 to v5 migration`
-- `ai chat completion`, `llm text generation`
-- `ai sdk typescript`, `typed ai responses`
-- `stopWhen ai sdk`, `multi-step ai execution`
-- `dynamic tools ai`, `runtime tools ai`
-
-### Error Keywords (Trigger on Errors)
-- `AI_APICallError`, `ai api call error`
-- `AI_NoObjectGeneratedError`, `no object generated`
-- `AI_LoadAPIKeyError`, `ai api key error`
-- `AI_InvalidArgumentError`, `invalid argument ai`
-- `AI_TypeValidationError`, `zod validation failed`
-- `AI_RetryError`, `ai retry failed`
-- `streamText fails silently`, `stream error swallowed`
-- `worker startup limit ai sdk`, `270ms startup`
-- `ai rate limit`, `rate limiting ai`
-- `maxTokens maxOutputTokens`, `v5 breaking changes`
-- `providerMetadata providerOptions`, `tool inputSchema`
-- `ToolExecutionError removed`, `tool-error parts`
-
-### Framework Keywords
-- `nextjs ai sdk`, `next.js server actions ai`
-- `cloudflare workers ai integration`
-- `node.js ai sdk`, `nodejs llm`
-- `vercel ai deployment`, `serverless ai`
-
-### Provider Keywords
-- `openai integration`, `gpt-4 api`, `chatgpt api`
-- `anthropic claude`, `claude api integration`
-- `google gemini api`, `gemini integration`
-- `cloudflare llama`, `workers ai llm`
-
----
-
-## Templates to Create
-
-### 1. generate-text-basic.ts
-```typescript
-// Simple text generation with OpenAI
-import { generateText } from 'ai';
-import { openai } from '@ai-sdk/openai';
-
-const result = await generateText({
- model: openai('gpt-4-turbo'),
- prompt: 'What is TypeScript?',
-});
-
-console.log(result.text);
-```
-
-### 2. stream-text-chat.ts
-```typescript
-// Streaming chat with messages
-import { streamText } from 'ai';
-import { anthropic } from '@ai-sdk/anthropic';
-
-const stream = streamText({
- model: anthropic('claude-3-5-sonnet-20241022'),
- messages: [
- { role: 'user', content: 'Tell me a story' },
- ],
-});
-
-for await (const chunk of stream.textStream) {
- process.stdout.write(chunk);
-}
-```
-
-### 3. generate-object-zod.ts
-```typescript
-// Structured output with Zod
-import { generateObject } from 'ai';
-import { openai } from '@ai-sdk/openai';
-import { z } from 'zod';
-
-const result = await generateObject({
- model: openai('gpt-4'),
- schema: z.object({
- name: z.string(),
- age: z.number(),
- skills: z.array(z.string()),
- }),
- prompt: 'Generate a person profile for a software engineer',
-});
-
-console.log(result.object);
-// { name: "Alice", age: 28, skills: ["TypeScript", "React"] }
-```
-
-### 4. stream-object-zod.ts
-```typescript
-// Streaming structured output
-import { streamObject } from 'ai';
-import { google } from '@ai-sdk/google';
-import { z } from 'zod';
-
-const stream = streamObject({
- model: google('gemini-2.5-pro'),
- schema: z.object({
- items: z.array(z.object({
- name: z.string(),
- price: z.number(),
- })),
- }),
- prompt: 'Generate a shopping list',
-});
-
-for await (const partialObject of stream.partialObjectStream) {
- console.log(partialObject);
-}
-```
-
-### 5. tools-basic.ts
-```typescript
-// Basic tool calling
-import { generateText, tool } from 'ai';
-import { openai } from '@ai-sdk/openai';
-import { z } from 'zod';
-
-const result = await generateText({
- model: openai('gpt-4'),
- tools: {
- weather: tool({
- description: 'Get the weather for a location',
- inputSchema: z.object({
- location: z.string().describe('The city name'),
- }),
- execute: async ({ location }) => {
- // Simulate API call
- return { temperature: 72, condition: 'sunny' };
- },
- }),
- },
- prompt: 'What is the weather in San Francisco?',
-});
-
-console.log(result.text);
-```
-
-### 6. agent-with-tools.ts
-```typescript
-// Agent class with tools
-import { Agent, tool } from 'ai';
-import { anthropic } from '@ai-sdk/anthropic';
-import { z } from 'zod';
-
-const weatherAgent = new Agent({
- model: anthropic('claude-3-5-sonnet-20241022'),
- tools: {
- getWeather: tool({
- description: 'Get weather for a location',
- inputSchema: z.object({
- location: z.string(),
- }),
- execute: async ({ location }) => {
- return { temp: 72, condition: 'sunny' };
- },
- }),
- convertTemp: tool({
- description: 'Convert Fahrenheit to Celsius',
- inputSchema: z.object({
- fahrenheit: z.number(),
- }),
- execute: async ({ fahrenheit }) => {
- return { celsius: (fahrenheit - 32) * 5/9 };
- },
- }),
- },
- system: 'You are a weather assistant.',
-});
-
-const result = await weatherAgent.run({
- messages: [
- { role: 'user', content: 'What is the weather in SF in Celsius?' },
- ],
-});
-
-console.log(result.text);
-```
-
-### 7. multi-step-execution.ts
-```typescript
-// Multi-step execution with stopWhen
-import { generateText, stopWhen, stepCountIs } from 'ai';
-import { openai } from '@ai-sdk/openai';
-
-const result = await generateText({
- model: openai('gpt-4'),
- tools: { /* tools here */ },
- prompt: 'Research TypeScript and create a summary',
- stopWhen: stepCountIs(5), // Stop after 5 steps
- // Or: stopWhen: hasToolCall('finalizeReport')
-});
-```
-
-### 8. openai-setup.ts
-```typescript
-// OpenAI provider configuration
-import { openai } from '@ai-sdk/openai';
-import { generateText } from 'ai';
-
-// Using environment variable (recommended)
-// OPENAI_API_KEY=sk-...
-const model = openai('gpt-4-turbo');
-
-// Or explicit API key
-const model = openai('gpt-4', {
- apiKey: process.env.OPENAI_API_KEY,
-});
-
-// Available models
-const gpt4 = openai('gpt-4-turbo');
-const gpt35 = openai('gpt-3.5-turbo');
-const gpt5 = openai('gpt-5'); // If available
-
-const result = await generateText({
- model: gpt4,
- prompt: 'Hello',
-});
-```
-
-### 9. anthropic-setup.ts
-```typescript
-// Anthropic provider configuration
-import { anthropic } from '@ai-sdk/anthropic';
-
-// ANTHROPIC_API_KEY=sk-ant-...
-const claude = anthropic('claude-3-5-sonnet-20241022');
-
-// Available models
-const sonnet = anthropic('claude-3-5-sonnet-20241022');
-const opus = anthropic('claude-3-opus-20240229');
-const haiku = anthropic('claude-3-haiku-20240307');
-
-const result = await generateText({
- model: sonnet,
- prompt: 'Hello',
-});
-```
-
-### 10. google-setup.ts
-```typescript
-// Google provider configuration
-import { google } from '@ai-sdk/google';
-
-// GOOGLE_GENERATIVE_AI_API_KEY=...
-const gemini = google('gemini-2.5-pro');
-
-// Available models
-const pro = google('gemini-2.5-pro');
-const flash = google('gemini-2.5-flash');
-
-const result = await generateText({
- model: pro,
- prompt: 'Hello',
-});
-```
-
-### 11. cloudflare-worker-integration.ts
-```typescript
-// Cloudflare Workers with workers-ai-provider
-import { Hono } from 'hono';
-import { generateText } from 'ai';
-import { createWorkersAI } from 'workers-ai-provider';
-
-interface Env {
- AI: Ai;
-}
-
-const app = new Hono<{ Bindings: Env }>();
-
-app.post('/chat', async (c) => {
- // Create provider inside handler (avoid startup overhead)
- const workersai = createWorkersAI({ binding: c.env.AI });
-
- const result = await generateText({
- model: workersai('@cf/meta/llama-3.1-8b-instruct'),
- prompt: 'What is Cloudflare?',
- });
-
- return c.json({ response: result.text });
-});
-
-export default app;
-```
-
-**wrangler.jsonc:**
-```jsonc
-{
- "name": "ai-sdk-worker",
- "compatibility_date": "2025-10-21",
- "ai": {
- "binding": "AI"
- }
-}
-```
-
-**Important Notes:**
-- Move `createWorkersAI` inside handler to avoid startup overhead
-- Don't import heavy dependencies at top level
-- Monitor startup time (must be <400ms)
-- For pure Workers AI usage without multi-provider, use cloudflare-workers-ai skill instead
-
-### 12. nextjs-server-action.ts
-```typescript
-// Next.js Server Action with AI SDK
-'use server';
-
-import { generateObject } from 'ai';
-import { openai } from '@ai-sdk/openai';
-import { z } from 'zod';
-
-export async function generateRecipe(ingredients: string[]) {
- const result = await generateObject({
- model: openai('gpt-4'),
- schema: z.object({
- name: z.string(),
- ingredients: z.array(z.string()),
- instructions: z.array(z.string()),
- }),
- prompt: `Create a recipe using: ${ingredients.join(', ')}`,
- });
-
- return result.object;
-}
-```
-
-**Usage in component:**
-```typescript
-'use client';
-
-import { generateRecipe } from './actions';
-import { useState } from 'react';
-
-export default function RecipeGenerator() {
- const [recipe, setRecipe] = useState(null);
-
- async function handleSubmit(formData: FormData) {
- const ingredients = formData.get('ingredients')?.toString().split(',') || [];
- const result = await generateRecipe(ingredients);
- setRecipe(result);
- }
-
- return (
- <form action={handleSubmit}>
- <input name="ingredients" placeholder="flour, eggs, sugar" />
- <button type="submit">Generate Recipe</button>
- {recipe && <pre>{JSON.stringify(recipe, null, 2)}</pre>}
- </form>
- );
-}
-```
-
-### 13. package.json
-```json
-{
- "name": "ai-sdk-core-example",
- "version": "1.0.0",
- "type": "module",
- "scripts": {
- "dev": "tsx watch src/index.ts",
- "build": "tsc"
- },
- "dependencies": {
- "ai": "^5.0.76",
- "@ai-sdk/openai": "^2.0.53",
- "@ai-sdk/anthropic": "^2.0.0",
- "@ai-sdk/google": "^2.0.0",
- "workers-ai-provider": "^2.0.0",
- "zod": "^3.23.8"
- },
- "devDependencies": {
- "@types/node": "^20.11.0",
- "tsx": "^4.7.0",
- "typescript": "^5.3.3"
- }
-}
-```
-
----
-
-## References to Create
-
-### 1. providers-quickstart.md
-- OpenAI setup (API key, models, common errors)
-- Anthropic setup (API key, models, common errors)
-- Google setup (API key, models, common errors)
-- Cloudflare Workers AI setup (binding, models, startup optimization)
-- Quick comparison table
-- Link to full providers list in official docs
-
-### 2. v5-breaking-changes.md
-- All critical breaking changes (15+ items)
-- Before/after code examples
-- Migration checklist
-- Common migration errors
-- Link to official migration guide
-
-### 3. top-errors.md
-- Top 10-12 errors with:
- - Error name and type
- - What causes it
- - How to fix it
- - Example code
- - Link to official docs (if available)
- - GitHub issue (if available)
-
-### 4. production-patterns.md
-- Performance optimization
-- Error handling strategies
-- Cost optimization
-- Cloudflare Workers best practices
-- Vercel/Next.js best practices
-- Monitoring and logging
-- Rate limiting handling
-
-### 5. links-to-official-docs.md
-- Organized list of all official docs links
-- What each link covers
-- When to use each resource
-- Advanced topics (embeddings, image gen, etc.)
-
----
-
-## Scripts to Create
-
-### check-versions.sh
-```bash
-#!/bin/bash
-# Check installed versions against latest
-
-echo "Checking AI SDK Core package versions..."
-echo ""
-
-packages=(
- "ai"
- "@ai-sdk/openai"
- "@ai-sdk/anthropic"
- "@ai-sdk/google"
- "workers-ai-provider"
- "zod"
-)
-
-for package in "${packages[@]}"; do
- echo "πŸ“¦ $package"
- echo " Installed: $(npm list $package --depth=0 2>/dev/null | grep $package | awk '{print $2}')"
- echo " Latest: $(npm view $package version)"
- echo ""
-done
-```
-
----
-
-## Known Issues to Document (Top 10-12)
-
-Based on research, these are the highest-priority errors to cover:
-
-1. **AI_APICallError** - API call failed (auth, network, rate limits)
-2. **AI_NoObjectGeneratedError** - Model didn't generate valid object
-3. **Worker Startup Limit** - Cloudflare Workers >270ms initialization
-4. **streamText Fails Silently** - Errors swallowed by stream
-5. **AI_LoadAPIKeyError** - Missing/invalid API key
-6. **AI_InvalidArgumentError** - Invalid function parameters
-7. **AI_NoContentGeneratedError** - Model generated no content
-8. **AI_TypeValidationError** - Zod schema validation failed
-9. **AI_RetryError** - All retry attempts failed
-10. **Rate Limiting** - Exceeded provider rate limits
-11. **TypeScript Performance with Zod** - Slow type checking with complex schemas
-12. **Unclosed Streams** - Stream not properly closed
-
-For all other errors, link to: https://ai-sdk.dev/docs/reference/ai-sdk-errors
-
----
-
-## Token Savings Calculation
-
-**Manual Setup (No Skill):**
-- Research AI SDK v5: ~3000 tokens
-- Find breaking changes: ~2000 tokens
-- Setup providers: ~2000 tokens
-- Implement generateText/streamText: ~2000 tokens
-- Implement generateObject: ~2000 tokens
-- Tool calling research: ~2000 tokens
-- Error handling research: ~2000 tokens
-- Fix common errors: ~3000 tokens
-- Total: ~18,000 tokens
-
-**With Skill:**
-- Skill discovery: ~500 tokens
-- Read relevant sections: ~3000 tokens
-- Copy templates: ~2000 tokens
-- Customize: ~2000 tokens
-- Total: ~7,500 tokens
-
-**Savings: ~58% (10,500 tokens saved)**
-
----
-
-## Success Criteria
-
-A skill is complete when:
-
-- [x] SKILL.md has valid YAML frontmatter
-- [x] All 4 core functions covered (generateText, streamText, generateObject, streamObject)
-- [x] Top 4 providers documented (OpenAI, Anthropic, Google, Cloudflare)
-- [x] 13 working templates
-- [x] Top 10-12 errors documented
-- [x] v5 breaking changes documented
-- [x] Cloudflare Workers integration included
-- [x] Next.js Server Actions example included
-- [x] Links to advanced topics (not replicated)
-- [x] README.md has comprehensive keywords
-- [x] Production-tested examples
-- [x] Token savings >= 50%
-
----
-
-## Notes for Implementation
-
-**What to Emphasize:**
-- v5 stability and breaking changes from v4
-- Multi-provider flexibility (OpenAI, Anthropic, Google as top 3)
-- Cloudflare Workers as one option (not the focus)
-- Vercel/Next.js patterns (Server Actions)
-- Practical examples over theory
-- Links to docs for deep-dives
-
-**What to De-Emphasize:**
-- workers-ai-provider (one option among many)
-- Advanced topics (embeddings, image gen) - link only
-- Full error catalog (top 10-12 only, link to rest)
-- CI/CD (mention Vercel docs, don't replicate)
-- v6 beta (stick to v5 stable)
-
-**Critical Success Factors:**
-- Templates must work copy-paste
-- Error solutions must be actionable
-- Provider setup must be clear
-- Migration guide must prevent common mistakes
-- Links to official docs must be accurate
-
----
-
-**Ready for execution with fresh context!**
diff --git a/archive/planning/2025-12-ai-sdk-ui-spec.md b/archive/planning/2025-12-ai-sdk-ui-spec.md
deleted file mode 100644
index d56223ca..00000000
--- a/archive/planning/2025-12-ai-sdk-ui-spec.md
+++ /dev/null
@@ -1,968 +0,0 @@
-# AI SDK UI - Skill Specification
-
-**Created**: 2025-10-21
-**Status**: Planning Phase
-**Priority**: High (Batch 2 - Do After ai-sdk-core)
-**Estimated Dev Time**: 5-7 hours
-**Token Savings**: ~50-55%
-**Errors Prevented**: 10-12 documented issues
-
----
-
-## Overview
-
-**Purpose**: Frontend React hooks for building chat interfaces, completions, and streaming UI with Vercel AI SDK v5.
-
-**Target Frameworks**:
-- React (primary)
-- Next.js App Router (Vercel focus)
-- Next.js Pages Router
-- Other React frameworks (Remix, Gatsby, Vite)
-
-**Core Hooks**:
-1. `useChat` - Chat interfaces with streaming
-2. `useCompletion` - Text completions
-3. `useObject` - Streaming structured data
-
-**Version**: AI SDK v5 (stable) - Focus on v5.0.76+
-
----
-
-## Skill Structure
-
-```
-skills/ai-sdk-ui/
-β”œβ”€β”€ SKILL.md # ~700-900 lines
-β”œβ”€β”€ README.md # Auto-trigger keywords
-β”œβ”€β”€ templates/
-β”‚ β”œβ”€β”€ use-chat-basic.tsx # Basic chat with useChat
-β”‚ β”œβ”€β”€ use-chat-tools.tsx # Chat with tool calling UI
-β”‚ β”œβ”€β”€ use-chat-attachments.tsx # File attachments support
-β”‚ β”œβ”€β”€ use-completion-basic.tsx # Basic text completion
-β”‚ β”œβ”€β”€ use-object-streaming.tsx # Streaming structured data
-β”‚ β”œβ”€β”€ nextjs-chat-app-router.tsx # Next.js App Router full example
-β”‚ β”œβ”€β”€ nextjs-chat-pages-router.tsx # Next.js Pages Router full example
-β”‚ β”œβ”€β”€ nextjs-api-route.ts # API route for useChat
-β”‚ β”œβ”€β”€ message-persistence.tsx # Save/load chat history
-β”‚ β”œβ”€β”€ custom-message-renderer.tsx # Custom message components
-β”‚ └── package.json # Dependencies template
-β”œβ”€β”€ references/
-β”‚ β”œβ”€β”€ use-chat-migration.md # v4β†’v5 useChat changes
-β”‚ β”œβ”€β”€ streaming-patterns.md # UI streaming best practices
-β”‚ β”œβ”€β”€ top-ui-errors.md # 10-12 most common UI errors
-β”‚ β”œβ”€β”€ nextjs-integration.md # Next.js setup patterns
-β”‚ └── links-to-official-docs.md # Advanced topics
-└── scripts/
- └── check-versions.sh # Package version checker
-```
-
----
-
-## SKILL.md Outline
-
-### 1. Frontmatter (YAML)
-```yaml
----
-name: AI SDK UI
-description: |
- Frontend React hooks for AI-powered chat interfaces, completions, and streaming UIs with Vercel AI SDK v5.
- Includes useChat, useCompletion, and useObject hooks for building interactive AI applications.
-
- Use when: building React chat interfaces, implementing AI completions in UI, streaming AI responses to frontend,
- handling chat message state, building Next.js AI apps, managing file attachments with AI, or encountering
- errors like "useChat failed to parse stream", "useChat no response", unclosed streams, or streaming issues.
-
- Keywords: ai sdk ui, useChat hook, useCompletion hook, useObject hook, react ai chat, ai chat interface,
- streaming ai ui, nextjs ai chat, vercel ai ui, react streaming, ai sdk react, chat message state,
- ai file attachments, message persistence, useChat error, streaming failed ui, parse stream error,
- useChat no response, react ai hooks, nextjs app router ai, nextjs pages router ai
-license: MIT
----
-```
-
-### 2. Quick Start (5-10 minutes)
-
-**Installation:**
-```bash
-npm install ai @ai-sdk/openai
-```
-
-**Basic Chat Component:**
-```tsx
-'use client';
-import { useChat } from 'ai/react';
-
-export default function Chat() {
- const { messages, input, handleInputChange, handleSubmit } = useChat();
-
- return (
- <div>
- {messages.map(m => (
- <div key={m.id}>{m.role}: {m.content}</div>
- ))}
- <form onSubmit={handleSubmit}>
- <input value={input} onChange={handleInputChange} />
- </form>
- </div>
- );
-}
-```
-
-**API Route (Next.js App Router):**
-```typescript
-import { openai } from '@ai-sdk/openai';
-import { streamText } from 'ai';
-
-export async function POST(req: Request) {
- const { messages } = await req.json();
-
- const result = streamText({
- model: openai('gpt-4-turbo'),
- messages,
- });
-
- return result.toDataStreamResponse();
-}
-```
-
-### 3. useChat Hook Deep Dive
-
-#### Basic Usage
-```tsx
-const { messages, input, handleInputChange, handleSubmit } = useChat();
-```
-
-#### Full API Reference
-```typescript
-const {
- // Messages
- messages, // Chat messages array
- setMessages, // Update messages
-
- // Input (NO LONGER MANAGED - v5 change)
- input, // Deprecated in v5
- handleInputChange, // Deprecated in v5
- handleSubmit, // Deprecated in v5
-
- // v5 Way (Manual Input Management)
- sendMessage, // Send a message
-
- // State
- isLoading, // Is AI responding?
- error, // Error if any
-
- // Actions
- reload, // Reload last response
- stop, // Stop current generation
- append, // Deprecated β†’ use sendMessage
-
- // Data
- data, // Custom data from stream
-} = useChat({
- api: '/api/chat',
- id: 'chat-1',
- initialMessages: [],
-
- // Callbacks
- onResponse: (response) => {}, // REMOVED in v5
- onFinish: (message) => {},
- onError: (error) => {},
-});
-```
-
-#### v4 β†’ v5 Breaking Changes
-**OLD (v4):**
-```tsx
-const { input, handleInputChange, handleSubmit, append } = useChat();
-
-<form onSubmit={handleSubmit}>
- <input value={input} onChange={handleInputChange} />
-</form>
-```
-
-**NEW (v5):**
-```tsx
-const { messages, sendMessage } = useChat();
-const [input, setInput] = useState('');
-
-<form onSubmit={(e) => {
- e.preventDefault();
- sendMessage({ content: input });
- setInput('');
-}}>
- <input value={input} onChange={(e) => setInput(e.target.value)} />
-</form>
-```
-
-**Key Changes:**
-- Input state NO LONGER managed by useChat
-- `append()` β†’ `sendMessage()`
-- `handleSubmit` removed (use sendMessage)
-- `onResponse` callback removed
-- `initialMessages` β†’ `messages` prop
-- `maxSteps` removed (handle server-side)
-
-#### Tool Calling in UI
-```tsx
-const { messages } = useChat({
- api: '/api/chat',
-});
-
-// Messages include tool calls
-messages.map(message => {
- if (message.toolInvocations) {
- return message.toolInvocations.map(tool => (
- <div key={tool.toolCallId}>
- Tool: {tool.toolName}
- Args: {JSON.stringify(tool.args)}
- Result: {JSON.stringify(tool.result)}
- </div>
- ));
- }
- return <div>{message.content}</div>;
-});
-```
-
-#### File Attachments
-```tsx
-const { messages, sendMessage } = useChat();
-const [files, setFiles] = useState<FileList | null>(null);
-
-const handleSubmit = async (e: FormEvent) => {
- e.preventDefault();
-
- sendMessage({
- content: input,
- experimental_attachments: files ? Array.from(files).map(file => ({
- name: file.name,
- contentType: file.type,
- url: URL.createObjectURL(file),
- })) : undefined,
- });
-
- setInput('');
- setFiles(null);
-};
-```
-
-#### Message Persistence
-```tsx
-const { messages, setMessages, sendMessage } = useChat({
- id: 'chat-1',
- initialMessages: loadMessagesFromStorage('chat-1'),
-});
-
-// Save on change
-useEffect(() => {
- saveMessagesToStorage('chat-1', messages);
-}, [messages]);
-```
-
-### 4. useCompletion Hook Deep Dive
-
-#### Basic Usage
-```tsx
-'use client';
-import { useCompletion } from 'ai/react';
-
-export default function Completion() {
- const { completion, input, handleInputChange, handleSubmit } = useCompletion();
-
- return (
- <div>
- <form onSubmit={handleSubmit}>
- <input value={input} onChange={handleInputChange} />
- </form>
- <div>{completion}</div>
- </div>
- );
-}
-```
-
-#### Full API Reference
-```typescript
-const {
- completion, // Current completion text
- complete, // Trigger completion
- setCompletion, // Update completion
- input, // Input value (deprecated in v5)
- handleInputChange, // Handle input (deprecated in v5)
- handleSubmit, // Submit (deprecated in v5)
- isLoading, // Is generating?
- error, // Error if any
- stop, // Stop generation
-} = useCompletion({
- api: '/api/completion',
- id: 'completion-1',
-
- onFinish: (prompt, completion) => {},
- onError: (error) => {},
-});
-```
-
-#### API Route
-```typescript
-// app/api/completion/route.ts
-import { streamText } from 'ai';
-import { openai } from '@ai-sdk/openai';
-
-export async function POST(req: Request) {
- const { prompt } = await req.json();
-
- const result = streamText({
- model: openai('gpt-3.5-turbo'),
- prompt,
- });
-
- return result.toDataStreamResponse();
-}
-```
-
-### 5. useObject Hook Deep Dive
-
-#### Basic Usage
-```tsx
-'use client';
-import { useObject } from 'ai/react';
-import { z } from 'zod';
-
-const schema = z.object({
- recipe: z.object({
- name: z.string(),
- ingredients: z.array(z.string()),
- }),
-});
-
-export default function Recipe() {
- const { object, submit, isLoading } = useObject({
- api: '/api/recipe',
- schema,
- });
-
- return (
- <div>
- <button onClick={() => submit('pasta')}>Generate</button>
- {isLoading && <div>Loading...</div>}
- {object && (
- <div>
- <h2>{object.recipe?.name}</h2>
- <ul>
- {object.recipe?.ingredients?.map((i, idx) => (
- <li key={idx}>{i}</li>
- ))}
- </ul>
- </div>
- )}
- </div>
- );
-}
-```
-
-#### API Route
-```typescript
-// app/api/recipe/route.ts
-import { streamObject } from 'ai';
-import { openai } from '@ai-sdk/openai';
-import { z } from 'zod';
-
-export async function POST(req: Request) {
- const { prompt } = await req.json();
-
- const result = streamObject({
- model: openai('gpt-4'),
- schema: z.object({
- recipe: z.object({
- name: z.string(),
- ingredients: z.array(z.string()),
- instructions: z.array(z.string()),
- }),
- }),
- prompt: `Generate a recipe for ${prompt}`,
- });
-
- return result.toTextStreamResponse();
-}
-```
-
-### 6. Next.js Integration
-
-#### App Router Setup
-
-**Directory Structure:**
-```
-app/
-β”œβ”€β”€ api/
-β”‚ └── chat/
-β”‚ └── route.ts # Chat API endpoint
-β”œβ”€β”€ chat/
-β”‚ └── page.tsx # Chat page
-└── layout.tsx
-```
-
-**Complete Example:**
-```tsx
-// app/chat/page.tsx
-'use client';
-import { useChat } from 'ai/react';
-import { useState } from 'react';
-
-export default function ChatPage() {
- const { messages, sendMessage, isLoading } = useChat({
- api: '/api/chat',
- });
- const [input, setInput] = useState('');
-
- const handleSubmit = (e: FormEvent) => {
- e.preventDefault();
- sendMessage({ content: input });
- setInput('');
- };
-
- return (
- <div className="flex flex-col h-screen">
- <div className="flex-1 overflow-y-auto p-4">
- {messages.map(m => (
- <div key={m.id} className={m.role === 'user' ? 'text-right' : 'text-left'}>
- <div className="inline-block p-2 rounded bg-gray-100">
- {m.content}
- </div>
- </div>
- ))}
- </div>
- <form onSubmit={handleSubmit} className="p-4 border-t">
- <input
- value={input}
- onChange={(e) => setInput(e.target.value)}
- className="w-full p-2 border rounded"
- placeholder="Type a message..."
- disabled={isLoading}
- />
- </form>
- </div>
- );
-}
-```
-
-```tsx
-// app/api/chat/route.ts
-import { streamText } from 'ai';
-import { openai } from '@ai-sdk/openai';
-
-export async function POST(req: Request) {
- const { messages } = await req.json();
-
- const result = streamText({
- model: openai('gpt-4-turbo'),
- messages,
- system: 'You are a helpful assistant.',
- });
-
- return result.toDataStreamResponse();
-}
-```
-
-#### Pages Router Setup
-
-**Directory Structure:**
-```
-pages/
-β”œβ”€β”€ api/
-β”‚ └── chat.ts # Chat API endpoint
-└── chat.tsx # Chat page
-```
-
-**Complete Example:**
-```tsx
-// pages/chat.tsx
-import { useChat } from 'ai/react';
-import { useState, FormEvent } from 'react';
-
-export default function ChatPage() {
- const { messages, sendMessage, isLoading } = useChat({
- api: '/api/chat',
- });
- const [input, setInput] = useState('');
-
- const handleSubmit = (e: FormEvent) => {
- e.preventDefault();
- sendMessage({ content: input });
- setInput('');
- };
-
- return (
- <div>
- {messages.map(m => (
- <div key={m.id}>{m.role}: {m.content}</div>
- ))}
- <form onSubmit={handleSubmit}>
- <input
- value={input}
- onChange={(e) => setInput(e.target.value)}
- disabled={isLoading}
- />
- </form>
- </div>
- );
-}
-```
-
-```typescript
-// pages/api/chat.ts
-import type { NextApiRequest, NextApiResponse } from 'next';
-import { streamText } from 'ai';
-import { openai } from '@ai-sdk/openai';
-
-export default async function handler(
- req: NextApiRequest,
- res: NextApiResponse
-) {
- const { messages } = req.body;
-
- const result = streamText({
- model: openai('gpt-4-turbo'),
- messages,
- });
-
- return result.pipeDataStreamToResponse(res);
-}
-```
-
-### 7. Critical v4β†’v5 Migration (UI-Specific)
-
-**useChat Breaking Changes:**
-
-1. **Managed Input State Removed**
- - **v4**: `input`, `handleInputChange`, `handleSubmit` managed by hook
- - **v5**: Manage input manually with `useState`
-
-2. **append β†’ sendMessage**
- - **v4**: `append({ role: 'user', content: 'hi' })`
- - **v5**: `sendMessage({ content: 'hi' })`
-
-3. **initialMessages β†’ messages**
- - **v4**: `initialMessages` prop
- - **v5**: `messages` prop for controlled mode
-
-4. **onResponse Removed**
- - **v4**: `onResponse` callback existed
- - **v5**: Removed, use `onFinish` instead
-
-5. **maxSteps Removed**
- - **v4**: Could set `maxSteps` in useChat
- - **v5**: Handle on server-side only
-
-6. **Message Structure Changed**
- - **v4**: Simple content string
- - **v5**: Parts array (text, tool-call, tool-result parts)
-
-**Migration Checklist:**
-- [ ] Remove `input`, `handleInputChange`, `handleSubmit` from useChat
-- [ ] Add manual input state with `useState`
-- [ ] Replace `append()` with `sendMessage()`
-- [ ] Replace `onResponse` with `onFinish`
-- [ ] Move `maxSteps` to server-side
-- [ ] Update message rendering for parts structure
-- [ ] Test streaming behavior
-
-### 8. Top 10-12 UI Errors & Solutions
-
-**Priority Errors to Document:**
-
-1. **useChat Failed to Parse Stream**
- - Cause: Invalid JSON in stream response
- - Solution: Check API route returns proper stream format
- - Code example
-
-2. **useChat No Response**
- - Cause: API route not returning stream correctly
- - Solution: Use `toDataStreamResponse()` or `pipeDataStreamToResponse()`
- - Code example
-
-3. **Unclosed Streams**
- - Cause: Stream not properly closed in API
- - Solution: Ensure stream completes properly
- - Code example
- - GitHub issue link
-
-4. **Streaming Not Working When Deployed**
- - Cause: Deployment platform buffering responses
- - Solution: Configure platform for streaming (Vercel auto-detects)
- - Link to Vercel docs
-
-5. **Streaming Not Working When Proxied**
- - Cause: Proxy buffering responses
- - Solution: Configure proxy to disable buffering
- - Nginx/Cloudflare examples
-
-6. **Strange Stream Output (0:... characters)**
- - Cause: Seeing raw stream protocol
- - Solution: Ensure using correct hook/stream format
- - Code example
-
-7. **Stale Body Values with useChat**
- - Cause: Body captured at first render only
- - Solution: Use callbacks or controlled messages
- - Code example
-
-8. **Custom Headers Not Working with useChat**
- - Cause: Incorrect headers configuration
- - Solution: Use `headers` or `body` options correctly
- - Code example
-
-9. **React Maximum Update Depth**
- - Cause: Infinite loop in useEffect with messages
- - Solution: Proper dependency array
- - Code example
-
-10. **Repeated Assistant Messages**
- - Cause: Duplicate message handling
- - Solution: Check message deduplication
- - Code example
-
-11. **onFinish Not Called When Stream Aborted**
- - Cause: Stream abort doesn't trigger callback
- - Solution: Handle abort separately
- - Code example
-
-12. **Type Error with Message Parts**
- - Cause: v5 message structure change
- - Solution: Update TypeScript types
- - Code example
-
-**For Other Errors**: Link to https://ai-sdk.dev/docs/troubleshooting
-
-### 9. Streaming Patterns & Best Practices
-
-**Performance:**
-- Always use streaming for better UX
-- Show loading states
-- Handle partial messages
-- Debounce input for completions
-
-**Error Handling:**
-- Display errors to users
-- Provide retry functionality
-- Handle network failures gracefully
-- Log errors for debugging
-
-**UX Patterns:**
-- Show typing indicators
-- Scroll to latest message
-- Disable input while loading
-- Handle empty states
-- Provide stop button for long responses
-
-**Message Rendering:**
-- Support markdown rendering
-- Handle code blocks
-- Display tool calls visually
-- Show timestamps
-- Group messages by role
-
-**State Management:**
-- Persist chat history
-- Clear chat functionality
-- Export/import conversations
-- Handle multiple chats (routing)
-
-### 10. When to Use This Skill
-
-**Use ai-sdk-ui when:**
-- Building React chat interfaces
-- Implementing AI completions in UI
-- Streaming AI responses to frontend
-- Building Next.js AI applications
-- Handling chat message state
-- Displaying tool calls in UI
-- Managing file attachments with AI
-- Migrating from v4 to v5 (UI hooks)
-- Encountering useChat/useCompletion errors
-
-**Don't use when:**
-- Need backend AI functionality (use ai-sdk-core instead)
-- Building non-React frontends (check official docs for Svelte/Vue)
-- Need advanced topics like Generative UI (link to docs)
-- Building native apps (different SDK)
-
-**Related Skills:**
-- Use **ai-sdk-core** for backend/server-side AI
-- Compose both for full-stack AI apps
-
-### 11. Dependencies & Versions
-
-**Required Packages:**
-```json
-{
- "dependencies": {
- "ai": "^5.0.76",
- "@ai-sdk/openai": "^2.0.53",
- "react": "^18.2.0 || ^19.0.0",
- "zod": "^3.23.8"
- },
- "devDependencies": {
- "@types/react": "^18.2.0",
- "typescript": "^5.3.3"
- }
-}
-```
-
-**Next.js:**
-```json
-{
- "dependencies": {
- "next": "^14.0.0 || ^15.0.0",
- "react": "^18.2.0 || ^19.0.0",
- "react-dom": "^18.2.0 || ^19.0.0"
- }
-}
-```
-
-**Version Notes:**
-- AI SDK v5.0.76+ (stable)
-- React 18+ or React 19 RC
-- Next.js 14+ (App Router) or 13+ (Pages Router)
-
-### 12. Links to Official Documentation
-
-**Core UI Docs:**
-- AI SDK UI Overview: https://ai-sdk.dev/docs/ai-sdk-ui/overview
-- useChat: https://ai-sdk.dev/docs/ai-sdk-ui/chatbot
-- useCompletion: https://ai-sdk.dev/docs/ai-sdk-ui/completion
-- useObject: https://ai-sdk.dev/docs/ai-sdk-ui/object-generation
-
-**Advanced Topics (Link Only):**
-- Generative UI (RSC): https://ai-sdk.dev/docs/ai-sdk-rsc/overview
-- Stream Protocols: https://ai-sdk.dev/docs/ai-sdk-ui/stream-protocols
-- Message Metadata: https://ai-sdk.dev/docs/ai-sdk-ui/message-metadata
-- Custom Transports: https://ai-sdk.dev/docs/ai-sdk-ui/transports
-
-**Next.js Integration:**
-- Next.js App Router: https://ai-sdk.dev/docs/getting-started/nextjs-app-router
-- Next.js Pages Router: https://ai-sdk.dev/docs/getting-started/nextjs-pages-router
-
-**Migration & Troubleshooting:**
-- v4β†’v5 Migration: https://ai-sdk.dev/docs/migration-guides/migration-guide-5-0
-- Troubleshooting: https://ai-sdk.dev/docs/troubleshooting
-- Common Issues: https://ai-sdk.dev/docs/troubleshooting/common-issues
-
-**Vercel Deployment:**
-- Vercel Functions: https://vercel.com/docs/functions
-- Streaming on Vercel: https://vercel.com/docs/functions/streaming
-- AI SDK Blog: https://vercel.com/blog/ai-sdk-5
-
----
-
-## README.md Keywords
-
-### Primary Keywords (High Weight)
-- `ai sdk ui`, `useChat`, `useCompletion`, `useObject`
-- `react ai chat`, `ai chat interface`, `chat ui react`
-- `ai sdk react`, `vercel ai ui`, `ai react hooks`
-- `streaming ai ui`, `react streaming chat`
-- `nextjs ai chat`, `nextjs ai`, `next.js chat`
-- `ai chat component`, `react ai components`
-
-### Secondary Keywords (Medium Weight)
-- `nextjs app router ai`, `nextjs pages router ai`
-- `chat message state`, `message persistence ai`
-- `ai file attachments`, `file upload ai chat`
-- `streaming chat react`, `real-time ai chat`
-- `tool calling ui`, `ai tools react`
-- `ai completion react`, `text completion ui`
-- `structured data streaming`, `useObject streaming`
-
-### Error Keywords (Trigger on Errors)
-- `useChat failed to parse stream`, `parse stream error`
-- `useChat no response`, `chat hook no response`
-- `unclosed streams ai`, `stream not closing`
-- `streaming not working deployed`, `vercel streaming issue`
-- `streaming not working proxied`, `proxy buffering`
-- `strange stream output`, `0: characters stream`
-- `stale body values useChat`, `body not updating`
-- `custom headers not working useChat`
-- `react maximum update depth`, `infinite loop useChat`
-- `repeated assistant messages`, `duplicate messages`
-- `onFinish not called`, `stream aborted`
-- `v5 migration useChat`, `useChat breaking changes`
-- `input handleInputChange removed`, `sendMessage v5`
-
-### Framework Keywords
-- `nextjs ai integration`, `next.js ai sdk`
-- `react chat app`, `react ai application`
-- `vite react ai`, `remix ai chat`
-- `vercel ai deployment`
-
----
-
-## Templates to Create
-
-### 1. use-chat-basic.tsx
-Basic chat implementation with manual input management (v5 style).
-
-### 2. use-chat-tools.tsx
-Chat with tool calling and UI rendering of tool results.
-
-### 3. use-chat-attachments.tsx
-File attachments support with experimental_attachments.
-
-### 4. use-completion-basic.tsx
-Basic text completion with streaming.
-
-### 5. use-object-streaming.tsx
-Streaming structured data with Zod schema.
-
-### 6. nextjs-chat-app-router.tsx
-Complete Next.js App Router chat example.
-
-### 7. nextjs-chat-pages-router.tsx
-Complete Next.js Pages Router chat example.
-
-### 8. nextjs-api-route.ts
-API route handler for chat (both App Router and Pages Router).
-
-### 9. message-persistence.tsx
-Save/load chat history to localStorage.
-
-### 10. custom-message-renderer.tsx
-Custom message components with markdown, code highlighting, etc.
-
-### 11. package.json
-Dependencies template for AI SDK UI projects.
-
----
-
-## References to Create
-
-### 1. use-chat-migration.md
-- Complete v4β†’v5 useChat migration guide
-- Before/after code examples
-- Breaking changes checklist
-- Common migration errors
-
-### 2. streaming-patterns.md
-- UI streaming best practices
-- Performance optimization
-- Error handling
-- UX patterns
-- Message rendering
-
-### 3. top-ui-errors.md
-- Top 10-12 errors with solutions
-- Each error includes:
- - Error description
- - Cause
- - Solution
- - Code example
- - Links to GitHub issues/docs
-
-### 4. nextjs-integration.md
-- App Router setup
-- Pages Router setup
-- API routes
-- Deployment considerations
-- Environment variables
-- Link to Vercel docs for CI/CD
-
-### 5. links-to-official-docs.md
-- Organized list of official docs
-- When to use each resource
-- Advanced topics links
-
----
-
-## Scripts to Create
-
-### check-versions.sh
-```bash
-#!/bin/bash
-echo "Checking AI SDK UI package versions..."
-echo ""
-
-packages=(
- "ai"
- "@ai-sdk/openai"
- "react"
- "next"
- "zod"
-)
-
-for package in "${packages[@]}"; do
- echo "πŸ“¦ $package"
- echo " Installed: $(npm list $package --depth=0 2>/dev/null | grep $package | awk '{print $2}')"
- echo " Latest: $(npm view $package version)"
- echo ""
-done
-```
-
----
-
-## Token Savings Calculation
-
-**Manual Setup (No Skill):**
-- Research AI SDK UI: ~2500 tokens
-- Find v5 useChat changes: ~2000 tokens
-- Implement useChat: ~2000 tokens
-- Setup Next.js routes: ~2000 tokens
-- Message rendering: ~1500 tokens
-- Tool calling UI: ~1500 tokens
-- Error handling: ~1500 tokens
-- Fix common errors: ~2500 tokens
-- Total: ~15,500 tokens
-
-**With Skill:**
-- Skill discovery: ~500 tokens
-- Read relevant sections: ~2500 tokens
-- Copy templates: ~2000 tokens
-- Customize: ~2000 tokens
-- Total: ~7,000 tokens
-
-**Savings: ~55% (8,500 tokens saved)**
-
----
-
-## Success Criteria
-
-A skill is complete when:
-
-- [x] SKILL.md has valid YAML frontmatter
-- [x] All 3 hooks covered (useChat, useCompletion, useObject)
-- [x] v5 breaking changes documented
-- [x] 11 working templates
-- [x] Top 10-12 UI errors documented
-- [x] Next.js App Router example
-- [x] Next.js Pages Router example
-- [x] Message persistence example
-- [x] Tool calling UI example
-- [x] Links to advanced topics
-- [x] README.md has comprehensive keywords
-- [x] Production-tested examples
-- [x] Token savings >= 50%
-
----
-
-## Notes for Implementation
-
-**What to Emphasize:**
-- v5 breaking changes (especially useChat input management)
-- Practical Next.js examples (App Router + Pages Router)
-- Common UI errors and solutions
-- Streaming best practices
-- Message rendering patterns
-
-**What to De-Emphasize:**
-- Generative UI / RSC (link only, advanced topic)
-- Other frameworks (Svelte, Vue) - mention but don't detail
-- Stream protocols internals (link to docs)
-- Advanced transport customization
-- CI/CD (link to Vercel docs)
-
-**Critical Success Factors:**
-- Templates must work copy-paste in Next.js projects
-- v5 migration must be crystal clear (biggest pain point)
-- Error solutions must be actionable
-- Examples must show modern React patterns
-- Links to official docs must be accurate
-
----
-
-**Ready for execution with fresh context!**
diff --git a/archive/planning/2025-12-claude-code-maps.md b/archive/planning/2025-12-claude-code-maps.md
deleted file mode 100644
index 8923557c..00000000
--- a/archive/planning/2025-12-claude-code-maps.md
+++ /dev/null
@@ -1,480 +0,0 @@
-# Code Maps for Claude Code CLI: Research Briefing
-
-## Executive Summary
-
-This briefing explores how Windsurf's "Codemaps" concept could be adapted as a skill/guidance system for Claude Code CLI to improve code navigation, context management, and decision-making. The research reveals that Claude Code already has a sophisticated memory system (CLAUDE.md files), and the opportunity lies in extending this with structured mapping approaches that help Claude maintain better awareness of "what files do what" across complex codebases.
-
-## 1. Understanding Windsurf Codemaps
-
-### What Are Codemaps?
-
-Codemaps are "first-of-its-kind AI-annotated structured maps of your code" that help engineers understand code before modifying it, embodying the philosophy of "turning your brain ON, not OFF". They address a fundamental problem: modern codebases are sprawling, and even top engineers spend much of their time finding and remembering what matters.
-
-### Key Features of Windsurf Codemaps:
-
-1. **Interactive Navigation**: Results are grouped and nested parts of code that link to exact lines, with visual diagrams where nodes send you to specific codebase locations
-
-2. **Trace Guides**: Expandable sections provide descriptive explanations of what groups discovered lines together
-
-3. **Agent Integration**: Codemaps can be referenced in Cascade agent prompts via @{codemap} to provide specific context and dramatically improve agent performance
-
-4. **Accountability Focus**: The goal is to keep humans accountable for code they ship - "you might not write every line, but you're still responsible for what ships"
-
-### The Problem They Solve:
-
-Standard approaches by Copilot, Claude Code, and others involve asking questions of a generalist agent in a typical chat experience, but these don't solve "focused onboarding and strongly grounded navigation"
-
-## 2. Claude Code's Existing Memory System
-
-### CLAUDE.md Files: The Core Context System
-
-Claude Code automatically creates CLAUDE.md files to serve as memory for project structure, guidelines, conventions, and common commands
-
-### Hierarchical Memory Architecture:
-
-Starting from your working directory, Claude searches upward toward the root, loading every CLAUDE.md and CLAUDE.local.md file it finds - subdirectory memory files are only loaded when Claude actually accesses files in those directories
-
-This creates:
-- **Project Memory** (./CLAUDE.md) - Team's shared brain
-- **Component Memory** (subdirectories) - Component-specific patterns
-- **Personal Memory** (CLAUDE.local.md) - Private developer notes
-
-### Best Practices from the Community
-
-**Token Efficiency is Critical:**
-CLAUDE.md contents are prepended to prompts, consuming part of your token budget with every interaction - keep it concise using "short, declarative bullet points" not "long, narrative paragraphs"
-
-**File Organization:**
-Your CLAUDE.md doesn't need to be one massive file - reference other files using @ref/other/files.md syntax, with structure like /claude/testing-guide.md, /claude/deployment.md, /claude/current-sprint.md
-
-**Dynamic Updates:**
-At the end of productive sessions, especially after deep debugging or architectural discussions, prompt Claude to update CLAUDE files with relevant knowledge to prevent "knowledge loss"
-
-**Component-Specific Information:**
-When specific information belongs to a particular subcomponent, place it in the CLAUDE file for that component (e.g., apps/heatsense-ui/CLAUDE.md for UI-specific info)
-
-## 3. Common Pitfalls to Avoid
-
-### Constraint Formulation:
-Avoid negative-only constraints like "Never use the --foo-bar flag" because the agent gets stuck when it thinks it must use that flag - always provide an alternative
-
-### Context Window Management:
-During long sessions, Claude's context window can fill with irrelevant conversation, file contents, and commands - use /clear command frequently between tasks to reset the context window
-
-### Documentation vs Implementation:
-If your CLI commands are complex and verbose, don't write paragraphs of documentation - instead write a simple bash wrapper with a clear API and document that, as keeping CLAUDE.md short is a "forcing function for simplifying your codebase"
-
-### Over-Engineering Subagents:
-Custom subagents are a brittle solution - give your main agent the context in CLAUDE.md and let it use its own Task/Explore feature to manage delegation (the "Master-Clone" architecture)
-
-## 4. The Power of Visual Diagrams
-
-### Mermaid Integration Benefits:
-
-Mermaid diagrams provide "unambiguous context" where "a single sequence diagram was worth hundreds of words of explanation" - visual diagrams eliminated ambiguity in requirements and enabled more precise implementations
-
-### AI-Generated Architecture Understanding:
-
-You can rapidly iterate on architecture by asking AI to adjust Mermaid diagrams: "add a database to that login flow" or "include an error path for invalid credentials" and get updated diagrams immediately
-
-### Integration with Claude Code:
-Claude excels with images and diagrams - you can paste screenshots, drag and drop images, or use design mocks as reference points for development
-
-## 5. Proposed Implementation: Code Maps Skill for Claude Code
-
-### Concept: Hybrid Approach
-
-Combine three elements:
-1. **Static Documentation** (CLAUDE.md) - High-level architecture and conventions
-2. **Dynamic Mapping** (generated on-demand) - Current task-specific code maps
-3. **Visual Context** (Mermaid diagrams) - Architecture and data flow visualization
-
-### Structure:
-
-```markdown
-# Code Map Skill Architecture
-
-## When to Generate Code Maps
-- Before any task involving >3 files
-- When encountering unfamiliar code sections
-- Before architectural changes
-- When debugging complex cross-file issues
-- At the start of new feature development
-
-## Map Storage Convention
-.codemaps/
- β”œβ”€β”€ [feature-name].md # Task-specific maps
- β”œβ”€β”€ [component-name]-arch.mmd # Mermaid architecture diagrams
- └── active-context.md # Current session context
-
-## Map Format Template
-
-### [Feature/Component Name]
-**Purpose**: Brief description of what this does
-**Last Updated**: [Date] by [Who/What]
-
-#### Key Files and Responsibilities
-- `path/to/file.ts` (lines X-Y)
- - Purpose: Handles...
- - Key functions: functionA(), functionB()
- - Dependencies: imports from...
- - Used by: referenced in...
-
-#### Data Flow
-[Mermaid diagram or text description]
-1. Entry point: ...
-2. Processing: ...
-3. Exit/Return: ...
-
-#### Critical Dependencies
-- Internal: [other components]
-- External: [packages/APIs]
-- Configuration: [env vars, config files]
-
-#### Known Issues & Gotchas
-- [Warning about edge cases]
-- [Performance considerations]
-- [Technical debt notes]
-
-#### Related Maps
-- See also: [link to related map]
-```
-
-### Integration Patterns:
-
-**Pattern 1: Pre-Task Mapping**
-```
-User: "I need to add authentication to the API"
-Claude:
-1. Reads existing CLAUDE.md for architecture conventions
-2. Generates code map: authentication-flow.md
-3. Creates Mermaid diagram: api-auth-sequence.mmd
-4. Plans implementation using map as reference
-5. Updates maps after completion
-```
-
-**Pattern 2: Exploration Mode**
-```
-User: "How does the payment system work?"
-Claude:
-1. Searches for existing .codemaps/payment-*.md
-2. If not found, generates new map by:
- - Identifying entry points (API routes, UI triggers)
- - Tracing through related files
- - Documenting data flow
- - Creating visual diagram
-3. Saves map for future reference
-4. Presents findings with map link
-```
-
-**Pattern 3: Maintenance Workflow**
-```
-After significant changes:
-1. Check if affected components have maps
-2. Update maps with new file locations/patterns
-3. Regenerate or update Mermaid diagrams
-4. Flag outdated maps for review
-```
-
-## 6. Skill Instructions Draft
-
-### Core Principles:
-
-**Understanding Before Action:**
-- Never modify code in >2 files without first understanding or creating a code map
-- Maps are living documents - update them as code evolves
-- Token efficiency: reference maps don't embed them
-
-**Map Generation Protocol:**
-
-```markdown
-# WHEN TO CREATE/UPDATE CODE MAPS:
-
-## Triggers for New Maps:
-- Task involves files you haven't worked with in this codebase
-- User asks "how does X work?" for non-trivial X
-- About to refactor or significantly modify existing code
-- Debugging issues that span multiple files
-- Onboarding to new section of codebase
-
-## Map Update Triggers:
-- After completing multi-file changes
-- After discovering new patterns or gotchas
-- When fixing bugs that reveal misconceptions
-- When adding new files to existing feature
-
-## Map Content Rules:
-1. **File Purpose**: One-line description of what each file does
-2. **Key Functions/Classes**: List main exports/entry points
-3. **Data Flow**: How information moves through the system
-4. **Dependencies**: What this depends on and what depends on it
-5. **Gotchas**: Non-obvious behavior, edge cases, technical debt
-
-## Mermaid Usage:
-- Generate sequence diagrams for request/response flows
-- Use flowcharts for decision logic
-- Create architecture diagrams for component relationships
-- Store in .codemaps/ directory with .mmd extension
-```
-
-**Reference vs Embed Strategy:**
-
-```markdown
-# CONTEXT MANAGEMENT:
-
-## In CLAUDE.md (embedded - always loaded):
-- Project conventions and standards
-- Critical commands and workflows
-- Top-level architecture overview
-- Common gotchas and patterns
-
-## In .codemaps/ (referenced - loaded on demand):
-- Detailed feature implementations
-- Component-specific flows
-- Task-specific mappings
-- Historical context and decisions
-
-## How to Reference:
-Instead of: [embedding entire map in conversation]
-Do: "See .codemaps/authentication-flow.md for details on auth implementation"
-Then: Only read the map when actually needed for current task
-```
-
-### Custom Commands Integration:
-
-Leverage Claude Code's custom command system:
-
-```markdown
-# .claude/commands/map-feature.md
-Generate a comprehensive code map for $ARGUMENTS:
-
-1. Identify all files related to this feature
-2. Document each file's purpose and key exports
-3. Create data flow diagram (Mermaid)
-4. List dependencies and dependents
-5. Note any gotchas or technical debt
-6. Save to .codemaps/$ARGUMENTS.md
-
-# .claude/commands/update-maps.md
-Review and update code maps affected by recent changes:
-
-1. Check git diff to see what changed
-2. Identify related code maps in .codemaps/
-3. Update affected sections
-4. Regenerate diagrams if architecture changed
-5. Note what was updated in map changelog
-
-# .claude/commands/explain-architecture.md
-Explain the architecture of $ARGUMENTS using existing maps:
-
-1. Check for existing map in .codemaps/
-2. If found, summarize with diagram
-3. If not found, offer to generate map first
-4. Provide high-level overview from CLAUDE.md context
-```
-
-## 7. Implementation Roadmap
-
-### Phase 1: Foundation (Start Here)
-1. Create `.codemaps/` directory structure in your projects
-2. Define map template format
-3. Add code map conventions to CLAUDE.md
-4. Create 2-3 example maps for key features
-
-### Phase 2: Workflow Integration
-1. Create custom `/map-feature` command
-2. Establish map update protocol
-3. Train yourself to request maps before complex tasks
-4. Build habit of updating maps after changes
-
-### Phase 3: Enhancement
-1. Develop Mermaid diagram standards
-2. Create automated map validation
-3. Link maps to ARCHITECTURE.md
-4. Establish map review process
-
-### Phase 4: Optimization
-1. Implement map staleness detection
-2. Create map dependency tracking
-3. Add automated diagram generation
-4. Integrate with Roo Commander workflow
-
-## 8. Specific Use Cases for Your Context
-
-### For MDTM/Roo Commander Development:
-```markdown
-# .codemaps/roo-commander-v8.md
-Purpose: VS Code extension for MDTM workflow management
-
-Key Components:
-- src/extension.ts (lines 1-150): Extension activation and command registration
-- src/mdtm-parser.ts (lines 1-200): Parses markdown task format
-- src/ai-modes.ts (lines 1-180): Custom agent mode definitions
-- src/tree-provider.ts (lines 1-220): VS Code tree view for tasks
-
-Data Flow:
-[Mermaid sequence diagram showing: File Save β†’ Parser β†’ Task Tree β†’ UI Update]
-
-Integration Points:
-- VS Code Extension API
-- Claude Code CLI (via custom agents)
-- File system watchers
-- MCP protocol (planned)
-```
-
-### For Construction Safety Analysis:
-```markdown
-# .codemaps/swms-analysis.md
-Purpose: n8n workflow for analyzing SWMS documents
-
-Key Files:
-- workflows/swms-parser.json: Main n8n workflow definition
-- agents/checkbox-analyzer.ts: Specialized agent for checkbox interpretation
-- agents/hrcw-detector.ts: High Risk Construction Work identification
-
-Critical Dependencies:
-- Anthropic API (Claude Sonnet 4.5)
-- PDF.js for document parsing
-- Custom prompt templates in /prompts/
-
-Gotchas:
-- Checkbox interpretation is safety-critical - no assumptions
-- Must preserve exact terminology from Australian standards
-- False negatives in HRCW detection are unacceptable
-```
-
-### For Client Projects (jezweb):
-```markdown
-# .codemaps/cloudflare-worker-template.md
-Purpose: Standard template for small business web apps
-
-Architecture Overview:
-[Mermaid diagram: Cloudflare Pages β†’ Worker β†’ Durable Objects β†’ KV]
-
-Key Patterns:
-- Route handling in src/routes/
-- Durable Objects for state in src/do/
-- KV for configuration
-- React frontend in src/ui/
-
-Australian SME Specific:
-- ABN validation patterns
-- AU timezone handling
-- GST calculation utilities
-```
-
-## 9. Key Differences from Windsurf Approach
-
-### What Windsurf Does:
-- Automatic generation from codebase analysis
-- Visual interactive interface with click-to-navigate
-- Real-time generation with SWE-1.5 or Sonnet 4.5
-- Built into IDE as first-class feature
-
-### What Claude Code Can Do (via skill):
-- Manual/semi-automated generation via prompts
-- Markdown-based maps stored in repo
-- Generated on-demand when needed
-- Uses existing file system and commands
-
-### Advantages of Claude Code Approach:
-- Maps are version-controlled with code
-- Team shares same maps (not per-developer)
-- Maps can include human annotations
-- Integrates with existing CLAUDE.md system
-- Works across all editors/terminals
-
-### Limitations:
-- Requires discipline to maintain
-- Not automatically updated
-- No visual interface (but can use Mermaid)
-- More manual than Windsurf
-
-## 10. Measuring Success
-
-### Quantitative Metrics:
-- Reduction in "read file" operations before code changes
-- Fewer context resets needed (/clear commands)
-- Decrease in bugs from misunderstanding architecture
-- Time to onboard to unfamiliar code sections
-
-### Qualitative Indicators:
-- Claude makes correct file choice on first attempt
-- Fewer "I need to check X file" loops
-- Better preservation of context across sessions
-- Improved accuracy in multi-file refactors
-
-## 11. Next Steps
-
-### Immediate Actions:
-1. **Create the skill file** for Claude Code to follow
-2. **Set up .codemaps/** structure in Roo Commander repo
-3. **Generate 1-2 example maps** for key features
-4. **Test the workflow** with a small feature addition
-5. **Iterate on template** based on what works
-
-### Questions to Explore:
-- Should maps be auto-generated via MCP server?
-- Integration with existing ARCHITECTURE.md docs?
-- Best way to handle map staleness detection?
-- Can we leverage git hooks to prompt for map updates?
-
-## 12. References and Resources
-
-### Primary Sources:
-- Windsurf Codemaps announcement: https://cognition.ai/blog/codemaps
-- Claude Code Best Practices: https://anthropic.com/engineering/claude-code-best-practices
-- Claude Code Documentation: https://docs.claude.com/en/docs/claude-code/
-
-### Community Resources:
-- CLAUDE.md best practices: https://shipyard.build/blog/your-claude-md-file-developer-guide/
-- Memory management guide: https://medium.com/@tl_99311/claude-codes-memory-working-with-ai-in-large-codebases-a948f66c2d7e
-- Mermaid + AI workflows: https://www.awesome-testing.com/2025/09/mermaid-diagrams
-
-### Key Takeaways for Implementation:
-1. Keep core CLAUDE.md lean - put details in maps
-2. Use Mermaid diagrams for complex flows
-3. Update maps after significant changes
-4. Reference maps, don't embed them
-5. Make map creation a habit, not a chore
-
----
-
-## Appendix: Example Skill File Structure
-
-```markdown
-# /mnt/skills/user/codemaps/SKILL.md
-
-# Code Maps Skill for Claude Code CLI
-
-## Purpose
-Help Claude maintain structured understanding of codebase architecture
-and file relationships to make better decisions about what to modify.
-
-## When to Use
-- Multi-file features
-- Unfamiliar code
-- Complex debugging
-- Architecture changes
-- Feature additions
-
-## Map Format
-[Template structure from Section 5]
-
-## Commands
-- /map-feature <name>: Generate new map
-- /update-maps: Refresh maps after changes
-- /explain-architecture <component>: Use maps to explain
-
-## Best Practices
-[Key principles from research]
-
-## Integration with CLAUDE.md
-[How maps complement main context file]
-```
-
----
-
-**End of Briefing**
-
-This document synthesizes research on Windsurf Codemaps, Claude Code best practices, and community insights to propose a practical code mapping system for Claude Code CLI that helps maintain context and improve decision-making in complex codebases.
diff --git a/archive/planning/2025-12-github-projects-poc-findings.md b/archive/planning/2025-12-github-projects-poc-findings.md
deleted file mode 100644
index af6090be..00000000
--- a/archive/planning/2025-12-github-projects-poc-findings.md
+++ /dev/null
@@ -1,856 +0,0 @@
-# GitHub Projects v2 - Proof of Concept Findings
-
-**Date**: 2025-11-05
-**Test Repository**: https://github.com/jezweb/test-github-projects
-**Test Project**: https://github.com/users/jezweb/projects/7
-**Purpose**: Validate GitHub Projects v2 capabilities for claude-skills project-planning integration
-
----
-
-## Executive Summary
-
-βœ… **SUCCESS**: GitHub Projects v2 fully supports the workflows we need for project-planning skill integration.
-
-**Key Findings**:
-- Custom fields work perfectly (single-select, number, date)
-- CLI automation is possible but requires GraphQL for complex operations
-- Bidirectional sync is feasible (issues ↔ project)
-- ID management is the biggest challenge (opaque IDs, requires lookups)
-- Visual kanban boards provide excellent progress tracking
-
-**Recommendation**: Build optional integration as separate `github-project-management` skill.
-
----
-
-## What Was Tested
-
-### 1. Project & Field Creation βœ…
-
-**Test**: Create project with custom fields via CLI
-
-**Commands**:
-```bash
-# Create project
-gh project create --owner "@me" --title "Test Planning Integration"
-
-# Create custom fields
-gh project field-create 7 --owner "@me" \
- --name "Phase Status" \
- --data-type "SINGLE_SELECT" \
- --single-select-options "Todo,In Progress,Verification,Blocked,Done"
-
-gh project field-create 7 --owner "@me" \
- --name "Phase Type" \
- --data-type "SINGLE_SELECT" \
- --single-select-options "Infrastructure,Database,API,UI,Integration,Testing"
-
-gh project field-create 7 --owner "@me" \
- --name "Estimated Hours" \
- --data-type "NUMBER"
-
-gh project field-create 7 --owner "@me" \
- --name "Target Date" \
- --data-type "DATE"
-```
-
-**Result**: βœ… All custom fields created successfully
-
-**Notes**:
-- "Status" is a reserved field name (use "Phase Status" instead)
-- Built-in "Status" field auto-updates when issue closed/reopened
-- Commands complete silently (no output = success)
-
----
-
-### 2. Issue Creation & Project Linking βœ…
-
-**Test**: Create issues and add them to project
-
-**Commands**:
-```bash
-# Create issues
-gh issue create --repo jezweb/test-github-projects \
- --title "Phase 1: Project Setup" \
- --body "Tasks: Scaffold Vite, Configure Tailwind v4..." \
- --assignee "@me"
-
-# Add to project
-gh project item-add 7 --owner "@me" \
- --url https://github.com/jezweb/test-github-projects/issues/1
-```
-
-**Result**: βœ… Issues created and added to project successfully
-
-**Notes**:
-- Can't add labels during creation if they don't exist (create labels first or omit)
-- Issues get auto-assigned an item ID when added to project
-- Multiple issues can be added to same project
-
----
-
-### 3. Setting Custom Field Values βœ…
-
-**Test**: Set custom field values for project items
-
-**Challenge**: Need to know field IDs and option IDs (opaque, not user-friendly)
-
-**Solution**: Query project structure with GraphQL first
-
-**GraphQL Query** (get field IDs and option IDs):
-```graphql
-query {
- node(id: "PROJECT_ID") {
- ... on ProjectV2 {
- fields(first: 20) {
- nodes {
- ... on ProjectV2SingleSelectField {
- id
- name
- options { id name }
- }
- ... on ProjectV2Field {
- id
- name
- }
- }
- }
- }
- }
-}
-```
-
-**CLI Commands** (set field values):
-```bash
-# Set Phase Type to "Infrastructure"
-gh project item-edit \
- --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \
- --project-id "PVT_kwHOAMoqHs4BHQxw" \
- --field-id "PVTSSF_lAHOAMoqHs4BHQxwzg4EXuI" \
- --single-select-option-id "7335d8e8"
-
-# Set Estimated Hours to 2
-gh project item-edit \
- --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \
- --project-id "PVT_kwHOAMoqHs4BHQxw" \
- --field-id "PVTF_lAHOAMoqHs4BHQxwzg4EXuM" \
- --number 2
-
-# Set Target Date
-gh project item-edit \
- --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \
- --project-id "PVT_kwHOAMoqHs4BHQxw" \
- --field-id "PVTF_lAHOAMoqHs4BHQxwzg4EXuQ" \
- --date "2025-11-06"
-```
-
-**Result**: βœ… All field values set successfully
-
-**Notes**:
-- **CRITICAL**: Must maintain ID mappings (project ID, field IDs, option IDs, item IDs)
-- Item IDs are unique per issue-project combination (not the issue number)
-- Commands complete silently
-- No validation errors (bad IDs fail silently)
-
----
-
-### 4. Querying Project Data βœ…
-
-**Test**: Query project items with custom field values
-
-**GraphQL Query**:
-```graphql
-query {
- node(id: "PVT_kwHOAMoqHs4BHQxw") {
- ... on ProjectV2 {
- title
- items(first: 10) {
- nodes {
- content {
- ... on Issue {
- number
- title
- state
- }
- }
- fieldValues(first: 20) {
- nodes {
- ... on ProjectV2ItemFieldSingleSelectValue {
- name
- field { ... on ProjectV2FieldCommon { name } }
- }
- ... on ProjectV2ItemFieldNumberValue {
- number
- field { ... on ProjectV2FieldCommon { name } }
- }
- ... on ProjectV2ItemFieldDateValue {
- date
- field { ... on ProjectV2FieldCommon { name } }
- }
- }
- }
- }
- }
- }
- }
-}
-```
-
-**Result**: βœ… Successfully retrieved all items with custom fields
-
-**Sample Output**:
-```json
-{
- "content": {
- "number": 1,
- "title": "Phase 1: Project Setup",
- "state": "CLOSED"
- },
- "fieldValues": [
- {"name": "Infrastructure", "field": {"name": "Phase Type"}},
- {"name": "Verification", "field": {"name": "Phase Status"}},
- {"number": 2.5, "field": {"name": "Estimated Hours"}},
- {"date": "2025-11-06", "field": {"name": "Target Date"}}
- ]
-}
-```
-
-**Notes**:
-- GraphQL provides rich querying (filter, sort, paginate)
-- CLI `gh project item-list` returns basic info only (use GraphQL for fields)
-- Can query by project ID or item ID
-
----
-
-### 5. Updating Status During Workflow βœ…
-
-**Test**: Simulate phase progress by updating status
-
-**Commands**:
-```bash
-# Update Phase Status from "In Progress" to "Verification"
-gh project item-edit \
- --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \
- --project-id "PVT_kwHOAMoqHs4BHQxw" \
- --field-id "PVTSSF_lAHOAMoqHs4BHQxwzg4EXdk" \
- --single-select-option-id "409c039f"
-
-# Update Estimated Hours
-gh project item-edit \
- --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \
- --project-id "PVT_kwHOAMoqHs4BHQxw" \
- --field-id "PVTF_lAHOAMoqHs4BHQxwzg4EXuM" \
- --number 2.5
-```
-
-**Result**: βœ… Status and hours updated successfully
-
-**Notes**:
-- Updates are instant (no delay)
-- Can update multiple fields independently
-- No built-in validation (can set any number, any date)
-
----
-
-### 6. Issue Closure & Auto-Status Update βœ…
-
-**Test**: Close issue and verify project status auto-updates
-
-**Commands**:
-```bash
-# Close issue
-gh issue close 1 --repo jezweb/test-github-projects --reason completed
-```
-
-**Result**: βœ… Issue closed, built-in "Status" field auto-set to "Done"
-
-**Observations**:
-- Built-in "Status" field (separate from custom "Phase Status"):
- - Auto-updates to "Done" when issue closed
- - Auto-updates to "In Progress" when issue reopened
- - Cannot be manually edited
-- Custom "Phase Status" field:
- - Does NOT auto-update (remains "Verification")
- - Must be updated manually via CLI
-
-**Implication**: Use custom "Phase Status" for workflow tracking, ignore built-in "Status"
-
----
-
-### 7. Listing Open Issues (Resume Workflow) βœ…
-
-**Test**: Simulate resuming work by querying open issues
-
-**Commands**:
-```bash
-gh issue list --repo jezweb/test-github-projects \
- --state open \
- --json number,title,state
-```
-
-**Result**: βœ… Lists all open issues in JSON format
-
-**Output**:
-```json
-[
- {"number": 3, "state": "OPEN", "title": "Phase 3: API Routes"},
- {"number": 2, "state": "OPEN", "title": "Phase 2: Database Schema"}
-]
-```
-
-**Notes**:
-- Can filter by: state, label, milestone, assignee, author
-- JSON output perfect for scripting
-- Combine with GraphQL query to get project-specific fields
-
----
-
-### 8. Branch Linking (Attempted) ⚠️
-
-**Test**: Create branch linked to issue
-
-**Commands**:
-```bash
-gh issue develop 2 \
- --repo jezweb/test-github-projects \
- --name "phase-2-database" \
- --checkout
-```
-
-**Result**: ❌ Failed (repo has no commits yet)
-
-**Error**:
-```
-GraphQL: Variable $input of type CreateLinkedBranchInput! was provided
-invalid value for oid (Could not coerce value "" to GitObjectID)
-```
-
-**Conclusion**: Branch linking works only after repo has at least one commit. Feature confirmed to exist and be useful.
-
----
-
-## Challenges Discovered
-
-### 1. **ID Management** (Biggest Challenge)
-
-**Problem**: GitHub Projects use opaque IDs everywhere:
-- Project ID: `PVT_kwHOAMoqHs4BHQxw`
-- Field IDs: `PVTSSF_lAHOAMoqHs4BHQxwzg4EXdk`
-- Option IDs: `409c039f`
-- Item IDs: `PVTI_lAHOAMoqHs4BHQxwzggvBg8`
-
-**Impact**: Can't hardcode commands, must query and store IDs
-
-**Solution**: Script workflow:
-1. Query project structure (GraphQL) β†’ save IDs to file
-2. Use IDs from file for all subsequent commands
-3. Update ID mapping when new items added
-
-**Example ID Mapping File** (`.github-project-ids.json`):
-```json
-{
- "project_id": "PVT_kwHOAMoqHs4BHQxw",
- "project_number": 7,
- "fields": {
- "phase_status": {
- "id": "PVTSSF_lAHOAMoqHs4BHQxwzg4EXdk",
- "options": {
- "Todo": "e22aa119",
- "In Progress": "8a46b1d1",
- "Verification": "409c039f",
- "Blocked": "b4047c57",
- "Done": "302e0864"
- }
- },
- "phase_type": {
- "id": "PVTSSF_lAHOAMoqHs4BHQxwzg4EXuI",
- "options": {
- "Infrastructure": "7335d8e8",
- "Database": "9b12a73a",
- "API": "70d007cb",
- "UI": "70e11be8",
- "Integration": "d0f20d0f",
- "Testing": "0b85201f"
- }
- },
- "estimated_hours": "PVTF_lAHOAMoqHs4BHQxwzg4EXuM",
- "target_date": "PVTF_lAHOAMoqHs4BHQxwzg4EXuQ"
- },
- "items": {
- "1": "PVTI_lAHOAMoqHs4BHQxwzggvBg8",
- "2": "PVTI_lAHOAMoqHs4BHQxwzggvBhc",
- "3": "PVTI_lAHOAMoqHs4BHQxwzggvBhk"
- }
-}
-```
-
----
-
-### 2. **CLI Limitations**
-
-**Problems**:
-- `gh project view` doesn't return detailed field info (just counts)
-- `gh project item-list` doesn't include custom field values
-- No way to create project views (kanban, roadmap) via CLI
-- Silent failures (bad IDs don't produce errors)
-
-**Solution**: Use GraphQL API for complex queries
-
-**When to use CLI vs GraphQL**:
-| Operation | Use |
-|-----------|-----|
-| Create project/fields | CLI (simpler) |
-| Create/close issues | CLI (simpler) |
-| Add items to project | CLI (simpler) |
-| Query project structure | GraphQL (only option) |
-| Query field values | GraphQL (CLI doesn't support) |
-| Set field values | CLI (works, but need GraphQL to get IDs first) |
-| Batch operations | GraphQL (more efficient) |
-
----
-
-### 3. **Reserved Field Names**
-
-**Problem**: Can't use "Status" as custom field name (reserved)
-
-**Workaround**: Use "Phase Status", "Task Status", etc.
-
-**Implication**: Built-in "Status" field will exist alongside custom "Phase Status"
-- Built-in "Status" auto-updates (ignore it)
-- Custom "Phase Status" for workflow tracking
-
----
-
-### 4. **No Offline Mode**
-
-**Problem**: All operations require network (GitHub API calls)
-
-**Impact**: Can't update project when offline
-
-**Mitigation**: SESSION.md remains source of truth (works offline), GitHub is optional visual layer
-
----
-
-## Workflows That Work
-
-### Workflow 1: Create Project from IMPLEMENTATION_PHASES.md
-
-```bash
-#!/bin/bash
-# scripts/create-github-project.sh
-
-PROJECT_TITLE="$1"
-PHASES_FILE="docs/IMPLEMENTATION_PHASES.md"
-REPO_NAME="jezweb/my-app"
-
-# 1. Create project
-PROJECT_JSON=$(gh project create --owner "@me" --title "$PROJECT_TITLE" --format json)
-PROJECT_ID=$(echo "$PROJECT_JSON" | jq -r '.id')
-PROJECT_NUMBER=$(echo "$PROJECT_JSON" | jq -r '.number')
-
-# 2. Create custom fields
-gh project field-create "$PROJECT_NUMBER" --owner "@me" \
- --name "Phase Status" --data-type "SINGLE_SELECT" \
- --single-select-options "Todo,In Progress,Verification,Blocked,Done"
-
-gh project field-create "$PROJECT_NUMBER" --owner "@me" \
- --name "Phase Type" --data-type "SINGLE_SELECT" \
- --single-select-options "Infrastructure,Database,API,UI,Integration,Testing"
-
-gh project field-create "$PROJECT_NUMBER" --owner "@me" \
- --name "Estimated Hours" --data-type "NUMBER"
-
-gh project field-create "$PROJECT_NUMBER" --owner "@me" \
- --name "Target Date" --data-type "DATE"
-
-# 3. Query and save field IDs (GraphQL)
-gh api graphql -f query="..." > .github-project-ids.json
-
-# 4. Parse IMPLEMENTATION_PHASES.md and create issues
-# (parse markdown, extract phase titles/descriptions)
-for phase in phases; do
- ISSUE_URL=$(gh issue create \
- --repo "$REPO_NAME" \
- --title "Phase X: $TITLE" \
- --body "$BODY" \
- --assignee "@me" \
- --format json | jq -r '.url')
-
- # Add issue to project
- ITEM_JSON=$(gh project item-add "$PROJECT_NUMBER" --owner "@me" --url "$ISSUE_URL" --format json)
- ITEM_ID=$(echo "$ITEM_JSON" | jq -r '.id')
-
- # Set custom fields
- gh project item-edit --id "$ITEM_ID" --project-id "$PROJECT_ID" \
- --field-id "$PHASE_TYPE_FIELD_ID" \
- --single-select-option-id "$TYPE_OPTION_ID"
-
- # ... set other fields
-done
-
-# 5. Output project URL
-echo "Project created: https://github.com/users/jezweb/projects/$PROJECT_NUMBER"
-```
-
-**Outcome**: Fully automated project creation from planning docs
-
----
-
-### Workflow 2: Update Status During Session
-
-```bash
-#!/bin/bash
-# scripts/update-phase-status.sh
-
-ISSUE_NUMBER="$1"
-NEW_STATUS="$2" # "In Progress", "Verification", "Done", etc.
-
-# Load ID mappings
-source .github-project-ids.sh
-
-# Get item ID for issue
-ITEM_ID="${ITEMS[$ISSUE_NUMBER]}"
-
-# Get option ID for status
-OPTION_ID="${PHASE_STATUS_OPTIONS[$NEW_STATUS]}"
-
-# Update project field
-gh project item-edit \
- --id "$ITEM_ID" \
- --project-id "$PROJECT_ID" \
- --field-id "$PHASE_STATUS_FIELD_ID" \
- --single-select-option-id "$OPTION_ID"
-
-echo "Phase $ISSUE_NUMBER status updated to: $NEW_STATUS"
-```
-
-**Usage**:
-```bash
-./scripts/update-phase-status.sh 2 "In Progress"
-./scripts/update-phase-status.sh 2 "Verification"
-./scripts/update-phase-status.sh 2 "Done"
-```
-
----
-
-### Workflow 3: Resume Work (Query Current State)
-
-```bash
-#!/bin/bash
-# scripts/query-project-status.sh
-
-# Query project items with status
-gh api graphql -f query='
-query {
- node(id: "PROJECT_ID") {
- ... on ProjectV2 {
- items(first: 20) {
- nodes {
- content {
- ... on Issue {
- number
- title
- state
- }
- }
- fieldValues(first: 20) {
- nodes {
- ... on ProjectV2ItemFieldSingleSelectValue {
- name
- field { ... on ProjectV2FieldCommon { name } }
- }
- }
- }
- }
- }
- }
- }
-}' | jq -r '.data.node.items.nodes[] |
- "Issue #\(.content.number): \(.content.title) - " +
- ([.fieldValues.nodes[] | select(.field.name == "Phase Status") | .name][0] // "No status")'
-```
-
-**Output**:
-```
-Issue #1: Phase 1: Project Setup - Done
-Issue #2: Phase 2: Database Schema - In Progress
-Issue #3: Phase 3: API Routes - Todo
-```
-
----
-
-## Recommendations
-
-### βœ… Build GitHub Integration as Separate Skill
-
-**Skill Name**: `github-project-management`
-
-**Purpose**: Optional integration layer between planning docs and GitHub Projects
-
-**When to Use**:
-- Team collaboration
-- Client visibility
-- Long-running projects (audit trail)
-- Visual progress tracking preferred
-
-**When NOT to Use**:
-- Solo developer, simple project
-- Prefer lightweight markdown-only
-- Working offline frequently
-- Don't have GitHub repo
-
----
-
-### Core Features for Skill
-
-**Phase 1: Basic Integration**
-1. `create-project.sh`: Parse IMPLEMENTATION_PHASES.md β†’ create GitHub project
-2. `update-status.sh`: Update phase status in project
-3. `query-status.sh`: Query current state for resume workflow
-
-**Phase 2: Enhanced Features**
-4. `sync-session.sh`: Sync SESSION.md changes β†’ GitHub (one-way)
-5. `close-phase.sh`: Close issue when phase verified complete
-6. Template improvements (better issue body formatting)
-
-**Phase 3: Advanced (Optional)**
-7. Bidirectional sync (GitHub β†’ SESSION.md via webhooks)
-8. Milestone creation from phases
-9. Label automation
-10. Branch linking automation
-
----
-
-### Skill Structure
-
-```
-skills/github-project-management/
-β”œβ”€β”€ SKILL.md # Skill prompt
-β”œβ”€β”€ README.md # User documentation
-β”œβ”€β”€ scripts/
-β”‚ β”œβ”€β”€ create-project.sh # Main creation script
-β”‚ β”œβ”€β”€ update-status.sh # Update phase status
-β”‚ β”œβ”€β”€ query-status.sh # Query current state
-β”‚ β”œβ”€β”€ sync-session.sh # Sync SESSION.md β†’ GitHub
-β”‚ └── lib/
-β”‚ β”œβ”€β”€ parse-phases.py # Parse IMPLEMENTATION_PHASES.md
-β”‚ β”œβ”€β”€ query-fields.sh # GraphQL field queries
-β”‚ └── id-manager.sh # Manage ID mappings
-β”œβ”€β”€ references/
-β”‚ β”œβ”€β”€ github-projects-api.md # GraphQL reference
-β”‚ └── field-mappings.md # Standard field configs
-└── templates/
- β”œβ”€β”€ project-config.json # Default field setup
- └── issue-template.md # Phase issue template
-```
-
----
-
-### Integration with project-planning Skill
-
-**Option A**: project-planning skill asks at end:
-```
-Planning docs created in /docs:
-- IMPLEMENTATION_PHASES.md (8 phases)
-- DATABASE_SCHEMA.md
-
-Would you like to create a GitHub Project for tracking? [y/N]
-
-β†’ If yes, invoke github-project-management skill
-```
-
-**Option B**: User invokes separately:
-```
-User: "Use project-planning to generate docs"
-Claude: [generates docs]
-
-User: "Now create a GitHub project from those docs"
-Claude: [discovers github-project-management skill, creates project]
-```
-
-**Recommendation**: Start with Option B (manual invocation), add Option A later if usage justifies automation
-
----
-
-### ID Management Strategy
-
-**Create `.github/` directory** in project with:
-
-```
-.github/
-β”œβ”€β”€ project-ids.json # ID mappings (gitignored)
-└── project-config.json # Project settings (committed)
-```
-
-**project-config.json** (committed, version controlled):
-```json
-{
- "project_title": "My App Development",
- "field_configs": {
- "phase_status": {
- "name": "Phase Status",
- "type": "SINGLE_SELECT",
- "options": ["Todo", "In Progress", "Verification", "Blocked", "Done"]
- },
- "phase_type": {
- "name": "Phase Type",
- "type": "SINGLE_SELECT",
- "options": ["Infrastructure", "Database", "API", "UI", "Integration", "Testing"]
- },
- "estimated_hours": {
- "name": "Estimated Hours",
- "type": "NUMBER"
- },
- "target_date": {
- "name": "Target Date",
- "type": "DATE"
- }
- }
-}
-```
-
-**project-ids.json** (gitignored, generated):
-```json
-{
- "project_id": "PVT_kwHOAMoqHs4BHQxw",
- "project_number": 7,
- "project_url": "https://github.com/users/jezweb/projects/7",
- "fields": { ... },
- "items": { ... }
-}
-```
-
-**Rationale**: Config is portable (can recreate project), IDs are instance-specific (don't commit)
-
----
-
-## Visual Examples
-
-### Project Board View (Web UI)
-
-After running `create-project.sh`, users can view:
-
-**Table View** (spreadsheet-like):
-| Title | Status | Phase Type | Estimated Hours | Target Date | Assignee |
-|-------|--------|------------|-----------------|-------------|----------|
-| Phase 1: Project Setup | Done | Infrastructure | 2.5 | 2025-11-06 | @jezweb |
-| Phase 2: Database Schema | In Progress | Database | 3 | 2025-11-08 | @jezweb |
-| Phase 3: API Routes | Todo | API | 4 | 2025-11-10 | @jezweb |
-
-**Board View** (kanban, grouped by Phase Status):
-```
-β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
-β”‚ Todo β”‚ In Progress β”‚ Verification β”‚ Done β”‚
-β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
-β”‚ Phase 3: β”‚ Phase 2: β”‚ β”‚ Phase 1:β”‚
-β”‚ API Routes β”‚ Database Schema β”‚ β”‚ Setup β”‚
-β”‚ API β€’ 4h β”‚ Database β€’ 3h β”‚ β”‚ Infra β”‚
-β”‚ 2025-11-10 β”‚ 2025-11-08 β”‚ β”‚ β”‚
-β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
-```
-
-**Roadmap View** (timeline by Target Date):
-```
-Nov 6 ──●── Phase 1: Setup (Done)
- β”‚
-Nov 8 ──●── Phase 2: Database (In Progress)
- β”‚
-Nov 10 ──○── Phase 3: API (Todo)
-```
-
----
-
-## Performance & Limitations
-
-### API Rate Limits
-
-**GitHub API**: 5000 requests/hour for authenticated users
-
-**Implications**:
-- Creating project with 10 phases β‰ˆ 50-60 API calls
-- Well within limits for normal usage
-- Batch operations via GraphQL more efficient
-
----
-
-### Scalability
-
-**Tested**: 3 phases/issues
-
-**Expected to handle**: 50+ phases without issues
-
-**Considerations**:
-- Projects support 1200 items max (way more than needed)
-- Custom fields: 50 max (we use 4)
-- GraphQL queries paginate (first: N, after: cursor)
-
----
-
-## Conclusion
-
-### What Works βœ…
-
-1. **Project creation** - Fully automated via CLI
-2. **Custom fields** - All types work (single-select, number, date, text)
-3. **Issue β†’ Project linking** - Seamless
-4. **Field value updates** - Works, requires ID management
-5. **Querying** - GraphQL provides rich data access
-6. **Issue closure sync** - Built-in Status auto-updates
-7. **Collaboration** - Assignees, comments, notifications all work
-8. **Visual tracking** - Kanban/table/roadmap views excellent
-
-### What's Awkward ⚠️
-
-1. **ID management** - Opaque IDs require mapping file
-2. **CLI limitations** - Some operations require GraphQL
-3. **Silent failures** - Bad IDs don't error
-4. **Reserved names** - "Status" conflicts
-5. **No offline mode** - Requires network
-
-### What Doesn't Work ❌
-
-1. **Branch linking** - Only works after first commit (minor)
-2. **View creation** - Must use web UI (minor, one-time)
-
----
-
-### Final Verdict
-
-**BUILD IT** as a separate `github-project-management` skill.
-
-**Benefits outweigh drawbacks** for team collaboration and client-facing projects.
-
-**Keep it optional** - markdown-first workflow remains default, GitHub is opt-in visual layer.
-
-**Implementation effort**: ~8-10 hours for Phase 1 (basic integration) = ~8-10 min human time
-
----
-
-## Next Steps
-
-1. **Review findings** with user (this document)
-2. **Decide**: Build now or defer?
-3. **If building**:
- - Create skill directory structure
- - Implement `create-project.sh` (MVP)
- - Test with real project
- - Document workflows
- - Update project-planning skill to mention optional integration
-
-4. **If deferring**:
- - Archive findings in `planning/research-logs/`
- - Add to roadmap for future
- - Keep test repo/project as reference
-
----
-
-**Test Artifacts**:
-- Repository: https://github.com/jezweb/test-github-projects
-- Project: https://github.com/users/jezweb/projects/7
-- Keep or delete: User decides
-
----
-
-**Author**: Claude Code
-**Session**: 2025-11-05
-**Duration**: 45 minutes
-**Verdict**: βœ… Feasible and valuable
diff --git a/archive/planning/2025-12-multi-ai-consultant-cli-reference.md b/archive/planning/2025-12-multi-ai-consultant-cli-reference.md
deleted file mode 100644
index 92c929eb..00000000
--- a/archive/planning/2025-12-multi-ai-consultant-cli-reference.md
+++ /dev/null
@@ -1,579 +0,0 @@
-# Multi-AI Consultant - CLI Integration Reference
-
-**Created**: 2025-11-07
-**Purpose**: Quick reference for Gemini and Codex CLI syntax
-
----
-
-## Gemini CLI (@google/generative-ai-cli)
-
-### Installation
-```bash
-npm install -g @google/generative-ai-cli
-```
-
-### Authentication
-```bash
-# Set API key
-export GEMINI_API_KEY="your-api-key-here"
-
-# Or use gemini auth (interactive)
-gemini auth
-```
-
-### Basic Usage
-
-**Simple prompt**:
-```bash
-gemini -p "What is the capital of France?"
-```
-
-**With file context**:
-```bash
-gemini -p "Explain this file: @src/main.ts"
-```
-
-**With directory context**:
-```bash
-gemini -p "Review the architecture: @src/"
-```
-
-**Current directory**:
-```bash
-gemini -p "Analyze the entire codebase: @."
-```
-
-**Multiple paths**:
-```bash
-gemini -p "Compare @src/old.ts and @src/new.ts"
-```
-
-### Advanced Flags
-
-**Model selection**:
-```bash
-gemini -p "..." -m gemini-1.5-flash # Fast/cheap
-gemini -p "..." -m gemini-1.5-pro # Powerful
-gemini -p "..." -m gemini-2.5-pro # Latest (locked for our use)
-```
-
-**Thinking mode**:
-```bash
-gemini -p "..." --thinking # Enable extended reasoning
-```
-
-**Google Search**:
-```bash
-gemini -p "..." --google-search # Enable web search
-```
-
-**Context grounding**:
-```bash
-gemini -p "..." --grounding # Verify against sources
-```
-
-**JSON output**:
-```bash
-gemini -p "..." --output-format json # Structured output for parsing
-```
-
-**Combined** (our default):
-```bash
-gemini -p "..." \
- -m gemini-2.5-pro \
- --thinking \
- --google-search \
- --grounding \
- --output-format json
-```
-
-### Piping Prompts (For Scripts)
-
-```bash
-# Simple pipe
-echo "What is 5+5?" | gemini
-
-# Multi-line prompt
-PROMPT=$(cat <<'EOF'
-Problem: Authentication failing
-Question: Is the JWT validation correct?
-Context: @src/auth/
-EOF
-)
-
-echo "$PROMPT" | gemini -m gemini-2.5-pro --output-format json
-```
-
-### Parsing JSON Output
-
-```bash
-# Get full response
-RESPONSE=$(gemini -p "test" --output-format json)
-
-# Extract text only
-TEXT=$(echo "$RESPONSE" | jq -r '.response.text')
-
-# Extract tokens
-INPUT_TOKENS=$(echo "$RESPONSE" | jq -r '.stats.inputTokens')
-OUTPUT_TOKENS=$(echo "$RESPONSE" | jq -r '.stats.outputTokens')
-```
-
-### Privacy & Filtering
-
-**Automatic** (respects `.gitignore`):
-```bash
-# If .gitignore contains node_modules/, it's automatically excluded
-gemini -p "Analyze: @."
-```
-
-**Additional exclusions** (`.geminiignore`):
-```gitignore
-# Create .geminiignore in project root
-*.env*
-*secret*
-*credentials*
-dist/
-build/
-```
-
-### System Instructions (GEMINI.md)
-
-**Auto-loaded from project root**:
-```bash
-# Create GEMINI.md in project root
-# Contents are prepended to every prompt automatically
-```
-
-Example `GEMINI.md`:
-```markdown
-# AI Synthesis Protocol
-You are providing a second opinion to Claude Code.
-Always compare approaches and highlight differences.
-```
-
-### Pre-flight Check
-
-```bash
-# Test if CLI works
-if ! gemini -p "test" &>/dev/null 2>&1; then
- echo "Gemini CLI not working"
- echo "Check: GEMINI_API_KEY set? CLI installed?"
- exit 1
-fi
-```
-
----
-
-## OpenAI Codex CLI (codex npm package)
-
-### Installation
-```bash
-npm install -g codex
-```
-
-### Authentication
-
-**Option 1: API Key** (recommended for scripts):
-```bash
-export OPENAI_API_KEY="sk-..."
-```
-
-**Option 2: ChatGPT subscription** (interactive):
-```bash
-codex login # Opens browser for OAuth
-```
-
-**Pre-flight check**:
-```bash
-# Test API key
-if ! openai api models.list &>/dev/null 2>&1; then
- echo "OpenAI API key invalid"
- exit 1
-fi
-```
-
-### Basic Usage
-
-**Important**: Use `codex exec` for non-interactive scripts
-
-**Simple prompt**:
-```bash
-codex exec "What is the capital of France?"
-```
-
-**From stdin**:
-```bash
-echo "Explain this code" | codex exec -
-```
-
-**Repo-aware** (automatically reads directory):
-```bash
-cd /path/to/project
-codex exec "Review the architecture of this project"
-# No @path needed - CLI scans automatically
-```
-
-### Advanced Flags
-
-**Model selection**:
-```bash
-codex exec "..." -m gpt-4o-mini # Fast/cheap
-codex exec "..." -m gpt-4-turbo # Balanced (default)
-codex exec "..." -m gpt-4o # Most powerful
-```
-
-**Auto-approval** (CRITICAL for scripts):
-```bash
-codex exec "..." --yolo # Bypass approval prompts
-# OR
-codex exec "..." --dangerously-bypass-approvals-and-sandbox
-# OR
-codex exec "..." --full-auto # Workspace writes allowed
-```
-
-**Output to file**:
-```bash
-codex exec "..." --output-last-message /tmp/response.txt
-RESPONSE=$(cat /tmp/response.txt)
-```
-
-**JSON output**:
-```bash
-codex exec "..." --json # Newline-delimited JSON events
-```
-
-**Change directory**:
-```bash
-codex exec "..." --cd /path/to/project
-```
-
-**Skip Git check**:
-```bash
-codex exec "..." --skip-git-repo-check
-```
-
-### Piping Prompts (For Scripts)
-
-```bash
-# Multi-line prompt
-PROMPT=$(cat <<'EOF'
-Problem: Authentication failing
-Question: Is the JWT validation correct?
-
-(You have access to the codebase in this directory.)
-EOF
-)
-
-cd /path/to/project
-
-echo "$PROMPT" | codex exec - \
- -m gpt-4-turbo \
- --yolo \
- --output-last-message /tmp/codex-response.txt
-```
-
-### Privacy & Filtering
-
-**Automatic** (respects `.gitignore`):
-```bash
-# If .gitignore contains node_modules/, it's automatically excluded
-cd /path/to/project
-codex exec "Analyze this codebase"
-```
-
-**Git repo check**:
-- Codex warns if not in Git repo (safety feature)
-- Use `--skip-git-repo-check` to override
-
-### System Instructions (codex.md)
-
-**Auto-loaded from project root or ~/.codex/instructions.md**:
-```bash
-# Create codex.md in project root
-# OR create ~/.codex/instructions.md for global rules
-# Contents are prepended to every prompt automatically
-```
-
-Example `codex.md`:
-```markdown
-# AI Synthesis Protocol
-You are providing a second opinion to Claude Code.
-Reference specific files and line numbers.
-Provide concrete code examples.
-```
-
-### Pre-flight Check
-
-```bash
-# Test if CLI works (via OpenAI API check)
-if ! openai api models.list &>/dev/null 2>&1; then
- echo "Codex CLI not working"
- echo "Check: OPENAI_API_KEY set? CLI installed?"
- exit 1
-fi
-```
-
----
-
-## Comparison: Gemini vs Codex CLI
-
-| Feature | Gemini CLI | Codex CLI |
-|---------|-----------|-----------|
-| **Context method** | `@<path>` syntax | Repo-aware (auto-scans) |
-| **Auth** | `GEMINI_API_KEY` | `OPENAI_API_KEY` or OAuth |
-| **System instructions** | `GEMINI.md` in project root | `codex.md` in root or `~/.codex/instructions.md` |
-| **Privacy** | `.gitignore` + `.geminiignore` | `.gitignore` (auto) |
-| **JSON output** | `--output-format json` | `--json` or `--output-last-message` |
-| **Model selection** | `-m gemini-2.5-pro` | `-m gpt-4-turbo` |
-| **Special features** | `--thinking --google-search --grounding` | `--yolo` (auto-approve) |
-| **Pre-flight check** | `gemini -p "test"` | `openai api models.list` |
-| **Best for** | Web research, format validation | General reasoning, code analysis |
-
----
-
-## Common Patterns
-
-### Pattern 1: Consultation with JSON Parsing
-
-**Gemini**:
-```bash
-PROMPT="Question: Is this secure? Context: @src/auth/"
-RESPONSE=$(echo "$PROMPT" | gemini -m gemini-2.5-pro --output-format json 2>/dev/null)
-ANALYSIS=$(echo "$RESPONSE" | jq -r '.response.text')
-echo "$ANALYSIS"
-```
-
-**Codex**:
-```bash
-PROMPT="Question: Is this secure?"
-cd /path/to/project
-echo "$PROMPT" | codex exec - -m gpt-4-turbo --yolo --output-last-message /tmp/out.txt
-ANALYSIS=$(cat /tmp/out.txt)
-echo "$ANALYSIS"
-```
-
-### Pattern 2: Error Handling
-
-```bash
-# Gemini
-if ! gemini -p "test" &>/dev/null 2>&1; then
- echo "❌ Gemini CLI not working"
- exit 1
-fi
-
-# Codex
-if ! openai api models.list &>/dev/null 2>&1; then
- echo "❌ OpenAI API key invalid"
- exit 1
-fi
-```
-
-### Pattern 3: Smart Context Selection
-
-**Gemini** (manual context):
-```bash
-case "$PROBLEM_TYPE" in
- bug)
- CONTEXT="@src/buggy-file.ts"
- ;;
- architecture)
- CONTEXT="@src/ @docs/"
- ;;
- *)
- CONTEXT="@."
- ;;
-esac
-
-gemini -p "Analyze: $CONTEXT"
-```
-
-**Codex** (auto context):
-```bash
-# Just cd to relevant directory
-case "$PROBLEM_TYPE" in
- bug)
- cd src/
- ;;
- *)
- cd .
- ;;
-esac
-
-codex exec "Analyze this code"
-```
-
-### Pattern 4: Cost Tracking
-
-```bash
-# Gemini
-RESPONSE=$(gemini -p "..." --output-format json)
-INPUT_TOKENS=$(echo "$RESPONSE" | jq -r '.stats.inputTokens')
-OUTPUT_TOKENS=$(echo "$RESPONSE" | jq -r '.stats.outputTokens')
-
-# Calculate cost (example rates)
-COST=$(echo "scale=4; ($INPUT_TOKENS * 0.000015) + ($OUTPUT_TOKENS * 0.00006)" | bc)
-
-# Log
-echo "$(date -Iseconds),gemini,gemini-2.5-pro,$INPUT_TOKENS,$OUTPUT_TOKENS,$COST" \
- >> ~/.claude/consultations.log
-```
-
----
-
-## Troubleshooting
-
-### Gemini CLI Issues
-
-**Problem**: "API key invalid"
-```bash
-# Check if set
-echo $GEMINI_API_KEY
-
-# Set it
-export GEMINI_API_KEY="your-key"
-
-# Or add to ~/.bashrc
-echo 'export GEMINI_API_KEY="your-key"' >> ~/.bashrc
-source ~/.bashrc
-```
-
-**Problem**: "File not found" with `@<path>`
-```bash
-# Use absolute paths or relative from current dir
-gemini -p "@./src/file.ts" # Explicit relative
-gemini -p "@$PWD/src/file.ts" # Absolute
-```
-
-**Problem**: JSON parsing fails
-```bash
-# Check for errors in response
-RESPONSE=$(gemini -p "test" --output-format json 2>&1)
-echo "$RESPONSE" # Look for error messages
-
-# Check jq works
-echo "$RESPONSE" | jq . || echo "Invalid JSON"
-```
-
-### Codex CLI Issues
-
-**Problem**: CLI hangs (waiting for approval)
-```bash
-# ALWAYS use --yolo for scripts
-codex exec "..." --yolo
-```
-
-**Problem**: "Not in Git repo" warning
-```bash
-# Skip the check
-codex exec "..." --skip-git-repo-check
-```
-
-**Problem**: "openai command not found"
-```bash
-# Install OpenAI Python package for pre-flight checks
-pip install openai
-
-# Or skip pre-flight check (risky)
-```
-
-**Problem**: Response file empty
-```bash
-# Check exit code
-echo "$PROMPT" | codex exec - --output-last-message /tmp/out.txt
-if [ $? -ne 0 ]; then
- echo "Codex failed"
- exit 1
-fi
-```
-
----
-
-## Security Notes
-
-### API Key Storage
-
-**Do NOT**:
-- ❌ Hardcode API keys in scripts
-- ❌ Commit API keys to Git
-- ❌ Share API keys in logs
-
-**DO**:
-- βœ… Use environment variables
-- βœ… Store in `.env` (add to `.gitignore`)
-- βœ… Use secret managers in CI/CD
-- βœ… Rotate keys regularly
-
-### Privacy Protection
-
-**Automatic filtering**:
-```bash
-# Both CLIs respect .gitignore
-# Add sensitive patterns:
-echo "*.env*" >> .gitignore
-echo "*secret*" >> .gitignore
-echo "*credentials*" >> .gitignore
-```
-
-**Manual check before sending**:
-```bash
-# List what will be sent to Gemini
-ls -la @src/ # Check directory contents
-
-# Review context
-echo "$PROMPT" # Check prompt content
-```
-
----
-
-## Performance Tips
-
-### Reduce Token Usage
-
-**Gemini** (selective context):
-```bash
-# Instead of: @.
-# Use specific paths: @src/relevant/ @docs/specific.md
-```
-
-**Codex** (narrow directory):
-```bash
-# Instead of: cd /project/root
-# Use: cd /project/root/src/specific-feature
-```
-
-### Faster Responses
-
-**Use faster models for simple tasks**:
-```bash
-# Gemini
-gemini -p "..." -m gemini-1.5-flash # ~2x faster
-
-# Codex
-codex exec "..." -m gpt-4o-mini # ~3x faster
-```
-
-### Caching (if supported)
-
-**Check CLI docs** for caching flags:
-```bash
-# Gemini (check if supported)
-gemini -p "..." --cache-context
-
-# Codex (check if supported)
-codex exec "..." --cache
-```
-
----
-
-## References
-
-- **Gemini CLI**: https://ai.google.dev/gemini-api/docs/cli
-- **OpenAI Codex**: https://www.npmjs.com/package/codex
-- **OpenAI API**: https://platform.openai.com/docs
-- **Gemini API Pricing**: https://ai.google.dev/pricing
-- **OpenAI API Pricing**: https://openai.com/pricing
-
----
-
-**Last Updated**: 2025-11-07
-**Status**: Planning phase
diff --git a/archive/planning/2025-12-multi-ai-consultant-spec.md b/archive/planning/2025-12-multi-ai-consultant-spec.md
deleted file mode 100644
index 28b480c7..00000000
--- a/archive/planning/2025-12-multi-ai-consultant-spec.md
+++ /dev/null
@@ -1,626 +0,0 @@
-# Multi-AI Consultant Skill - Implementation Specification
-
-**Created**: 2025-11-07
-**Status**: Planning
-**Target**: skills/multi-ai-consultant/
-
----
-
-## Overview
-
-A skill enabling Claude Code to consult external AIs (Gemini 2.5 Pro, OpenAI Codex, fresh Claude) when stuck on bugs or making critical architecture decisions.
-
-**Key Insight**: Use existing CLI tools (no MCP servers needed) + per-project conversation history for speed.
-
----
-
-## Core Requirements
-
-### 1. AI Providers
-
-| Provider | CLI Tool | Model | Special Flags | Context Method |
-|----------|----------|-------|---------------|----------------|
-| **Gemini** | `gemini` | `gemini-2.5-pro` (locked) | `--thinking --google-search --grounding` | `@<path>` syntax |
-| **OpenAI Codex** | `codex` | `gpt-4-turbo` or `gpt-4o` | `--yolo --output-last-message` | Repo-aware (auto-scans directory) |
-| **Claude** | Task tool (subagent) | N/A (uses Claude Code's model) | `subagent_type="general-purpose"` | Inherits full context |
-
-### 2. Conversation Tracking
-
-**Per-project conversation threads**:
-- Each consultation starts a new conversation
-- Conversation ID = project directory hash + timestamp
-- Subsequent consultations in same session reference previous ID
-- Purpose: Speed up follow-ups ("As I mentioned before...")
-
-**Storage**: `~/.claude/ai-consultations/<project-hash>/<session-id>.json`
-
-### 3. Automatic Triggers
-
-Claude should **proactively suggest** consultation when:
-
-1. **Bug/fix attempted once without success** β†’ Suggest consultation
-2. **Architecture decisions** β†’ Auto-consult (no ask)
-3. **Security-sensitive changes** β†’ Auto-consult
-4. **Uncertain about trade-offs** β†’ Suggest consultation
-
-### 4. Synthesis Protocol
-
-Every consultation MUST produce:
-1. **Your Analysis** - Claude's original reasoning
-2. **Other AI's Analysis** - External AI's response (with thinking/reasoning)
-3. **Key Differences** - Agreement/disagreement points
-4. **Synthesis** - Combined insights
-5. **Recommended Action** - Clear next step
-
-**Enforcement**: Via `GEMINI.md` and `codex.md` in project root (auto-loaded by CLIs)
-
----
-
-## CLI Integration Details
-
-### Gemini CLI (Google)
-
-**Authentication**:
-```bash
-export GEMINI_API_KEY="your-key"
-```
-
-**Pre-flight Check**:
-```bash
-if ! gemini -p "test" &>/dev/null 2>&1; then
- echo "❌ Gemini API key invalid"
- exit 1
-fi
-```
-
-**Execution Pattern**:
-```bash
-PROMPT=$(cat <<'EOF'
-Problem: {{PROBLEM}}
-Question: {{QUESTION}}
-
-Analyze: @{{CONTEXT_PATHS}}
-EOF
-)
-
-RESPONSE=$(echo "$PROMPT" | gemini \
- -m gemini-2.5-pro \
- --thinking \
- --google-search \
- --grounding \
- --output-format json 2>/dev/null)
-
-ANALYSIS=$(echo "$RESPONSE" | jq -r '.response.text')
-```
-
-**Context Packaging**:
-- Bug/error: `@src/buggy-file.ts @src/related-import.ts`
-- Architecture: `@src/ @docs/ARCHITECTURE.md`
-- Security: `@src/auth/ @src/middleware/`
-- Default: `@.` (current directory)
-
-**Privacy**:
-- Automatically respects `.gitignore`
-- Optional `.geminiignore` for extra rules
-- Never sends: `.env*`, `*secret*`, `*credentials*`, `*key*`
-
-**System Instructions**:
-- File: `GEMINI.md` in project root
-- Auto-loaded by CLI
-- Contains synthesis protocol
-
-**Conversation Tracking** (TODO: Research if Gemini supports session IDs):
-```bash
-# If supported:
-gemini -p "First question" --session-id "bug-2025-11-07-abc123"
-gemini -p "Follow-up" --session-id "bug-2025-11-07-abc123"
-```
-
----
-
-### OpenAI Codex CLI
-
-**Authentication**:
-```bash
-export OPENAI_API_KEY="sk-..."
-```
-
-**Pre-flight Check**:
-```bash
-if ! openai api models.list &>/dev/null 2>&1; then
- echo "❌ OpenAI API key invalid"
- exit 1
-fi
-```
-
-**Execution Pattern**:
-```bash
-PROMPT=$(cat <<'EOF'
-Problem: {{PROBLEM}}
-Question: {{QUESTION}}
-
-(You have access to the codebase in this directory.)
-EOF
-)
-
-cd {{PROJECT_DIR}}
-
-echo "$PROMPT" | codex exec - \
- -m gpt-4-turbo \
- --yolo \
- --output-last-message /tmp/codex-response.txt
-
-ANALYSIS=$(cat /tmp/codex-response.txt)
-```
-
-**Context Packaging**:
-- **Repo-aware**: Automatically scans current directory
-- No manual `@path` needed (just `cd` to project)
-- Respects `.gitignore` automatically
-- Warns if not in Git repo (use `--skip-git-repo-check` to override)
-
-**Privacy**:
-- Git-aware by default
-- Same exclusions as Gemini (`.env*`, secrets, etc.)
-
-**System Instructions**:
-- File: `codex.md` in project root
-- Auto-loaded by CLI
-- Contains synthesis protocol (same as `GEMINI.md` but for Codex)
-
-**Critical Flag**:
-- `--yolo` (or `--dangerously-bypass-approvals-and-sandbox`)
-- Required for non-interactive scripts
-- Without this, CLI hangs waiting for approval
-
-**Conversation Tracking** (TODO: Research if Codex supports conversation history):
-```bash
-# If supported, likely similar to Gemini
-```
-
----
-
-### Claude Subagent (Fresh Perspective)
-
-**Execution Pattern**:
-```markdown
-Use Task tool with:
-- subagent_type: "general-purpose"
-- prompt: Detailed context + question
-- model: "haiku" (fast) or "sonnet" (thorough)
-```
-
-**Context Packaging**:
-- Subagent inherits full conversation context
-- Provide specific files via Read tool first
-- Reference them in subagent prompt
-
-**Why This Works**:
-- Fresh Claude has no conversation history bias
-- Can challenge assumptions without "remembering" previous failed approaches
-- Uses same model family (consistent quality)
-
-**No Authentication Needed**: Built-in to Claude Code
-
----
-
-## Slash Command Specifications
-
-### `/consult-gemini [question]`
-
-**Purpose**: Get Gemini 2.5 Pro's perspective with full reasoning, Google Search, and grounding.
-
-**Workflow**:
-1. Pre-flight check (API key valid)
-2. Determine context scope (bug vs architecture)
-3. Build prompt with `@<path>` references
-4. Execute with locked flags (thinking + search + grounding)
-5. Parse JSON response
-6. Synthesize with Claude's analysis
-7. Log consultation (cost tracking)
-8. Present synthesis + recommendation
-
-**Smart Context Selection**:
-```bash
-case "$PROBLEM_TYPE" in
- bug|error|fix)
- CONTEXT="@src/affected-file.ts"
- ;;
- architecture|design)
- CONTEXT="@src/ @docs/ARCHITECTURE.md"
- ;;
- security|auth)
- CONTEXT="@src/auth/ @src/middleware/"
- ;;
- *)
- CONTEXT="@."
- ;;
-esac
-```
-
----
-
-### `/consult-codex [question]`
-
-**Purpose**: Get OpenAI GPT-4's perspective via Codex CLI (repo-aware, agentic).
-
-**Workflow**:
-1. Pre-flight check (API key valid)
-2. `cd` to project directory (Codex auto-scans)
-3. Build prompt (no manual context needed)
-4. Execute with `--yolo` flag
-5. Parse response from output file
-6. Synthesize with Claude's analysis
-7. Log consultation
-8. Present synthesis + recommendation
-
-**Model Selection**:
-- Default: `gpt-4-turbo` (best balance)
-- Fast: `gpt-4o-mini` (quick checks)
-- Powerful: `gpt-4o` (complex reasoning)
-
----
-
-### `/consult-claude [question]`
-
-**Purpose**: Get fresh Claude perspective via subagent (no conversation history bias).
-
-**Workflow**:
-1. Use Read tool to gather relevant files
-2. Build detailed prompt with context
-3. Launch Task tool (general-purpose subagent)
-4. Wait for subagent response
-5. Compare with own reasoning
-6. Synthesize insights
-7. Present recommendation
-
-**When to Use**:
-- Want Claude's reasoning but need "fresh eyes"
-- No external API keys available
-- Free (no additional cost)
-
----
-
-### `/consult-ai [question]`
-
-**Purpose**: Router - asks user which AI to consult.
-
-**Workflow**:
-1. Prompt user: "Which AI should I consult?"
- - Gemini 2.5 Pro (best for: structure, format, web research)
- - OpenAI GPT-4 (best for: general reasoning, documentation)
- - Fresh Claude (best for: fresh perspective, free)
-2. Route to appropriate command
-3. Execute consultation
-4. Return result
-
----
-
-## File Templates
-
-### `GEMINI.md` (Project Root)
-
-```markdown
-# AI Synthesis Protocol for Multi-AI Consultation
-
-You are Google Gemini 2.5 Pro, providing a second opinion in collaboration with Claude Code.
-
-## Your Role
-- **Independent analysis**: Challenge assumptions if warranted
-- **Critical evaluation**: Don't just agree with Claude
-- **Complementary perspective**: Focus on structure, format, rapid prototyping
-- **Cite sources**: Use Google Search for latest docs (2024-2025)
-
-## Required Format
-
-1. **Direct Answer**: Clear answer to the question
-2. **Reasoning**: Evidence from code/docs
-3. **Trade-offs**: Pros/cons of approaches
-4. **Risks**: Security, performance, maintainability issues
-5. **Alternatives**: 1-2 alternative approaches
-6. **Latest Practices**: Search and cite recent documentation
-
-## Comparison Protocol
-
-1. **Agreement**: Where analysis aligns with Claude
-2. **Divergence**: Where you disagree (explain why)
-3. **Missed Aspects**: What Claude overlooked
-4. **Additional Context**: New info from Google Search
-
-## Do NOT:
-- ❌ Parrot Claude's response
-- ❌ Be overly agreeable
-- ❌ Ignore obvious issues
-
-## DO:
-- βœ… Challenge approaches with better alternatives
-- βœ… Use Google Search for latest docs
-- βœ… Focus on your strengths (structure, format, patterns)
-- βœ… Be specific with code examples
-```
-
----
-
-### `codex.md` (Project Root)
-
-```markdown
-# AI Synthesis Protocol for Multi-AI Consultation
-
-You are OpenAI Codex (GPT-4), providing a second opinion in collaboration with Claude Code.
-
-## Your Role
-- **Independent analysis**: Provide unbiased technical assessment
-- **Critical evaluation**: Challenge assumptions when warranted
-- **Complementary perspective**: Focus on general reasoning, best practices
-- **Code-first**: Reference specific files and line numbers
-
-## Required Format
-
-1. **Direct Answer**: Clear answer to the question
-2. **Code Analysis**: Specific files/functions with issues
-3. **Reasoning**: Why current approach is/isn't optimal
-4. **Trade-offs**: Pros/cons comparison
-5. **Alternatives**: Better approaches with code examples
-6. **Best Practices**: Industry standards and patterns
-
-## Comparison Protocol
-
-1. **Agreement**: Where you align with Claude's analysis
-2. **Divergence**: Where you see things differently
-3. **Code Issues**: Specific problems Claude might have missed
-4. **Improvements**: Concrete code suggestions
-
-## Do NOT:
-- ❌ Simply validate Claude's approach without analysis
-- ❌ Provide vague suggestions without code examples
-- ❌ Ignore edge cases or error handling
-
-## DO:
-- βœ… Reference specific files and line numbers
-- βœ… Provide concrete code examples
-- βœ… Highlight potential bugs or edge cases
-- βœ… Suggest tested patterns from your training data
-```
-
----
-
-### `.geminiignore` (Project Root)
-
-```gitignore
-# .geminiignore - Additional privacy rules beyond .gitignore
-
-# Secrets
-*.env*
-*secret*
-*credentials*
-*key*
-.env.local
-
-# Large generated files
-package-lock.json
-pnpm-lock.yaml
-yarn.lock
-dist/
-build/
-.next/
-.cache/
-
-# Test fixtures with fake data
-__fixtures__/
-__mocks__/
-
-# Logs
-*.log
-logs/
-
-# OS files
-.DS_Store
-Thumbs.db
-```
-
----
-
-## Cost Tracking
-
-**Log File**: `~/.claude/ai-consultations/consultations.log`
-
-**Format** (CSV):
-```csv
-timestamp,project,ai,model,question_preview,input_tokens,output_tokens,cost_usd
-2025-11-07T10:30:00,my-app,gemini,gemini-2.5-pro,"Is auth secure?",15420,850,0.23
-2025-11-07T11:45:00,my-app,codex,gpt-4-turbo,"Review API",8320,645,0.18
-2025-11-07T12:15:00,my-app,claude,sonnet-4.5,"Fresh perspective",0,0,0.00
-```
-
-**Viewing**:
-```bash
-# Recent consultations
-tail -n 10 ~/.claude/ai-consultations/consultations.log | column -t -s','
-
-# Total cost per project
-awk -F',' '{sum[$2] += $8} END {for (p in sum) print p": $"sum[p]}' \
- ~/.claude/ai-consultations/consultations.log
-```
-
----
-
-## Conversation Tracking Structure
-
-**Directory**: `~/.claude/ai-consultations/<project-hash>/`
-
-**Files**:
-- `session-<timestamp>.json` - Full conversation history
-- `metadata.json` - Project info, cumulative costs
-
-**Session File Structure**:
-```json
-{
- "session_id": "bug-2025-11-07-abc123",
- "project": "my-app",
- "project_hash": "a1b2c3d4",
- "started_at": "2025-11-07T10:30:00Z",
- "consultations": [
- {
- "id": 1,
- "timestamp": "2025-11-07T10:30:00Z",
- "ai": "gemini",
- "model": "gemini-2.5-pro",
- "question": "Is this auth pattern secure?",
- "context_paths": ["@src/auth/", "@src/middleware/"],
- "response": "...",
- "input_tokens": 15420,
- "output_tokens": 850,
- "cost_usd": 0.23
- },
- {
- "id": 2,
- "timestamp": "2025-11-07T10:35:00Z",
- "ai": "gemini",
- "model": "gemini-2.5-pro",
- "question": "What about the JWT expiry logic?",
- "context_paths": ["@src/auth/jwt.ts"],
- "response": "...",
- "input_tokens": 3200,
- "output_tokens": 420,
- "cost_usd": 0.08,
- "references_consultation_id": 1
- }
- ]
-}
-```
-
----
-
-## CLAUDE.md Integration
-
-**Add to user's `~/.claude/CLAUDE.md`**:
-
-```markdown
-## Multi-AI Consultation Protocol
-
-**Automatically suggest consultation when**:
-1. **Bug/fix attempted once without success** β†’ Suggest: "Should I consult [Gemini/Codex]?"
-2. **Architecture decisions** β†’ Auto-consult proactively (don't ask)
-3. **Security-sensitive changes** β†’ Auto-consult proactively
-4. **Uncertain about trade-offs** β†’ Suggest consultation
-
-**Format suggestion**:
-"I've tried [approach] without success. Should I consult Gemini for a fresh perspective?"
-
-**Manual commands**:
-- `/consult-gemini [question]` - Gemini 2.5 Pro (thinking + search + grounding)
-- `/consult-codex [question]` - OpenAI GPT-4 (repo-aware)
-- `/consult-claude [question]` - Fresh Claude (subagent)
-- `/consult-ai [question]` - Choose which AI
-
-**Synthesis requirements**:
-1. Your analysis
-2. Other AI's analysis
-3. Key differences
-4. Synthesis
-5. Recommended action
-```
-
----
-
-## Known Issues & Prevention
-
-### 1. CLI Not Installed
-**Issue**: User doesn't have `gemini` or `codex` CLI installed
-**Prevention**: Pre-flight checks in every command
-**Fix**: Clear error message with installation instructions
-
-### 2. API Keys Invalid
-**Issue**: `GEMINI_API_KEY` or `OPENAI_API_KEY` not set or expired
-**Prevention**: Pre-flight check before consultation
-**Fix**: Guide user to set API key
-
-### 3. Context Too Large
-**Issue**: Passing `@.` (entire directory) exceeds token limits
-**Prevention**: Smart context selection (only relevant files)
-**Fix**: Fall back to specific files only
-
-### 4. Privacy Leaks
-**Issue**: Accidentally sending `.env` or secrets to external API
-**Prevention**: Git-aware filtering + `.geminiignore`
-**Fix**: Log warning if sensitive files detected
-
-### 5. Cost Overruns
-**Issue**: Too many consultations rack up API costs
-**Prevention**: Cost tracking + warn at thresholds
-**Fix**: Show running total, suggest using free Claude subagent
-
-### 6. Codex Hanging on Approval
-**Issue**: Forgot `--yolo` flag, Codex waits for approval
-**Prevention**: Always include `--yolo` in scripts
-**Fix**: Kill process, re-run with flag
-
-### 7. JSON Parsing Fails
-**Issue**: CLI output format changes or errors
-**Prevention**: Check exit code before parsing
-**Fix**: Fall back to plain text output
-
-### 8. No Git Repo Warning
-**Issue**: Codex CLI warns/fails if not in Git repo
-**Prevention**: Add `--skip-git-repo-check` for non-Git projects
-**Fix**: Guide user to init Git or use override flag
-
----
-
-## Token Efficiency Estimates
-
-**Without Skill** (manual consultation):
-- Research how to use CLI: ~2,000 tokens
-- Trial-and-error with flags: ~3,000 tokens
-- Formatting response: ~1,000 tokens
-- **Total**: ~6,000 tokens + 15-20 minutes
-
-**With Skill**:
-- Execute slash command: ~500 tokens
-- Auto-formatted synthesis: ~1,500 tokens
-- **Total**: ~2,000 tokens + 2-3 minutes
-
-**Savings**: ~67% tokens, ~80% time
-
----
-
-## Testing Checklist
-
-### Pre-Implementation
-- [ ] Verify `gemini` CLI installed and authenticated
-- [ ] Verify `codex` CLI installed and authenticated (or document as optional)
-- [ ] Test `gemini -p "test"` works
-- [ ] Test `codex exec "test"` works
-- [ ] Test JSON parsing with `jq`
-
-### Post-Implementation
-- [ ] Test `/consult-gemini` with bug scenario
-- [ ] Test `/consult-codex` with architecture question
-- [ ] Test `/consult-claude` with fresh perspective request
-- [ ] Test `/consult-ai` router
-- [ ] Verify `GEMINI.md` auto-loads
-- [ ] Verify `codex.md` auto-loads
-- [ ] Verify `.geminiignore` filters secrets
-- [ ] Verify cost tracking logs correctly
-- [ ] Test automatic suggestion triggers (after 1 failed attempt)
-- [ ] Test synthesis format (all 5 sections present)
-
----
-
-## Next Steps
-
-1. **Create skill directory structure**
-2. **Write slash commands** (4 total)
-3. **Create templates** (GEMINI.md, codex.md, .geminiignore)
-4. **Write SKILL.md** (full documentation)
-5. **Write README.md** (trigger keywords)
-6. **Create scripts** (setup, pre-flight, testing)
-7. **Test end-to-end** (real bug scenario)
-8. **Update CLAUDE.md** (add consultation protocol)
-9. **Document in roadmap** (planning/skills-roadmap.md)
-
----
-
-**Estimated Total Time**: 60-75 minutes
-**Token Efficiency**: ~67% savings vs manual
-**Errors Prevented**: 8+ (CLI auth, parsing, privacy, cost tracking, hanging)
diff --git a/archive/planning/2025-12-multi-ai-consultant-summary.md b/archive/planning/2025-12-multi-ai-consultant-summary.md
deleted file mode 100644
index 0a3c3d95..00000000
--- a/archive/planning/2025-12-multi-ai-consultant-summary.md
+++ /dev/null
@@ -1,448 +0,0 @@
-# Multi-AI Consultant Skill - Implementation Summary
-
-**Created**: 2025-11-07
-**Status**: Ready to implement
-**Estimated Time**: 60-75 minutes
-
----
-
-## What We Built (In Planning)
-
-A skill that lets **future Claude Code sessions** consult external AIs when stuck or making critical decisions.
-
-### Key Innovation
-
-**CLI-based, not MCP** - Uses existing `gemini` and `codex` CLI tools instead of building custom MCP servers. Much simpler, more maintainable.
-
----
-
-## Architecture Overview
-
-```
-User working on project
- ↓
-Claude Code encounters bug/decision
- ↓
-Claude suggests: "Should I consult Gemini?"
- ↓
-User approves (or Claude auto-consults for architecture)
- ↓
-Claude executes /consult-gemini
- ↓
-Bash command calls: gemini CLI
- ↓
-Parses JSON response
- ↓
-Synthesizes: Claude's analysis + Gemini's analysis
- ↓
-Presents: Comparison + Recommendation
- ↓
-User proceeds with synthesis
-```
-
----
-
-## The Three AIs
-
-| AI | Tool | When to Use | Special Features |
-|----|------|-------------|------------------|
-| **Gemini 2.5 Pro** | `gemini` CLI | Structure, format, web research | `--thinking --google-search --grounding` |
-| **OpenAI GPT-4** | `codex` CLI | General reasoning, code analysis | Repo-aware (auto-scans directory) |
-| **Fresh Claude** | Task tool (subagent) | Fresh perspective, free | No conversation history bias |
-
----
-
-## Key Components
-
-### 1. Slash Commands (4 total)
-
-- **`/consult-gemini [question]`** - Gemini 2.5 Pro with thinking + search
-- **`/consult-codex [question]`** - OpenAI GPT-4 via Codex CLI
-- **`/consult-claude [question]`** - Fresh Claude subagent
-- **`/consult-ai [question]`** - Router (asks which AI)
-
-### 2. Auto-loaded Instructions
-
-- **`GEMINI.md`** in project root β†’ Synthesis protocol for Gemini
-- **`codex.md`** in project root β†’ Synthesis protocol for Codex
-
-### 3. Privacy Protection
-
-- **`.geminiignore`** β†’ Extra exclusion rules beyond `.gitignore`
-- Both CLIs respect `.gitignore` automatically
-- Never send: `.env*`, `*secret*`, `*credentials*`
-
-### 4. Cost Tracking
-
-- Log file: `~/.claude/ai-consultations/consultations.log`
-- Tracks: timestamp, AI, model, tokens, cost
-- Viewable with `column` or custom parser
-
-### 5. Automatic Triggers (via CLAUDE.md)
-
-- After **1 failed attempt** on bug β†’ Suggest consultation
-- Before **architecture decisions** β†’ Auto-consult (no ask)
-- For **security changes** β†’ Auto-consult
-- When **uncertain** β†’ Suggest consultation
-
----
-
-## File Structure
-
-```
-skills/multi-ai-consultant/
-β”œβ”€β”€ SKILL.md # Full documentation
-β”œβ”€β”€ README.md # Trigger keywords + quick start
-β”‚
-β”œβ”€β”€ commands/ # 4 slash commands
-β”‚ β”œβ”€β”€ consult-gemini.md
-β”‚ β”œβ”€β”€ consult-codex.md
-β”‚ β”œβ”€β”€ consult-claude.md
-β”‚ └── consult-ai.md
-β”‚
-β”œβ”€β”€ templates/ # User copies to projects
-β”‚ β”œβ”€β”€ GEMINI.md # Synthesis protocol for Gemini
-β”‚ β”œβ”€β”€ codex.md # Synthesis protocol for Codex
-β”‚ β”œβ”€β”€ .geminiignore # Privacy exclusions
-β”‚ └── consultation-log-parser.sh # View consultation history
-β”‚
-β”œβ”€β”€ references/ # CLI documentation
-β”‚ β”œβ”€β”€ gemini-cli-guide.md
-β”‚ β”œβ”€β”€ codex-cli-guide.md
-β”‚ β”œβ”€β”€ ai-strengths.md # When to use which AI
-β”‚ └── cost-estimates.md # Pricing per AI
-β”‚
-β”œβ”€β”€ scripts/ # Setup & testing
-β”‚ β”œβ”€β”€ setup-apis.sh # Configure API keys
-β”‚ β”œβ”€β”€ preflight-check.sh # Verify CLIs work
-β”‚ └── test-consultation.sh # End-to-end test
-β”‚
-└── examples/ # Real consultation example
- └── sample-consultation.md
-```
-
----
-
-## Implementation Phases
-
-### Phase 1: Core Slash Commands (30-35 min)
-
-**Create 4 commands**:
-
-1. **`consult-gemini.md`**:
- - Pre-flight check (API key valid)
- - Smart context selection (bug vs architecture)
- - Locked config: `gemini-2.5-pro --thinking --google-search --grounding`
- - JSON parsing with `jq`
- - Synthesis format (5 sections)
- - Cost logging
-
-2. **`consult-codex.md`**:
- - Pre-flight check (OpenAI API key)
- - `cd` to project directory (repo-aware)
- - Execute with `--yolo` flag (no hanging)
- - Parse output file
- - Synthesis format
- - Cost logging
-
-3. **`consult-claude.md`**:
- - Use Read tool for context
- - Launch Task tool (general-purpose subagent)
- - Compare fresh perspective with own reasoning
- - Synthesis format
-
-4. **`consult-ai.md`**:
- - Ask user which AI to consult
- - Route to appropriate command
- - Execute and return result
-
-### Phase 2: Templates (10-15 min)
-
-1. **`GEMINI.md`** - Synthesis protocol template
-2. **`codex.md`** - Synthesis protocol template
-3. **`.geminiignore`** - Privacy exclusion template
-4. **`consultation-log-parser.sh`** - View consultation history
-
-### Phase 3: Documentation (15-20 min)
-
-1. **`SKILL.md`**:
- - When to use (automatic triggers)
- - How it works (CLI + synthesis)
- - Setup instructions
- - Examples (bug, architecture, manual)
- - Known issues (8+ documented)
- - Token efficiency metrics
-
-2. **`README.md`**:
- - Quick start
- - Trigger keywords
- - Installation
- - Basic usage
-
-3. **Reference docs**:
- - Gemini CLI guide
- - Codex CLI guide
- - AI strengths comparison
- - Cost estimates
-
-### Phase 4: Scripts & Testing (10-15 min)
-
-1. **`setup-apis.sh`**:
- - Guide user to set `GEMINI_API_KEY`
- - Guide user to set `OPENAI_API_KEY`
- - Verify CLIs installed
-
-2. **`preflight-check.sh`**:
- - Test Gemini CLI works
- - Test Codex CLI works (if installed)
- - Test JSON parsing
-
-3. **`test-consultation.sh`**:
- - End-to-end test with real bug scenario
- - Verify synthesis format
- - Check cost logging
-
----
-
-## Example: Consultation Workflow
-
-### Scenario: Authentication Bug
-
-```markdown
-User: "Fix this 401 error in src/auth/session.ts"
-
-Claude: [Tries fix #1 with token refresh logic]
-Result: Still failing (different error)
-
-Claude: "I've tried one approach without success. Should I consult
- Gemini for a fresh perspective on JWT validation?"
-
-User: "yes"
-
-Claude: [Executes /consult-gemini internally]
-
-1. Pre-flight check: βœ“ Gemini API key valid
-2. Context selection: Bug type β†’ @src/auth/session.ts @src/middleware/jwt.ts
-3. Build prompt:
- ```
- Problem: 401 error on /login route after token refresh
- Question: Is the JWT validation logic correct?
-
- I've tried: Updating token expiry check
- Still failing: Now getting "invalid signature" error
-
- Context: @src/auth/session.ts @src/middleware/jwt.ts
- ```
-4. Execute:
- ```bash
- echo "$PROMPT" | gemini -m gemini-2.5-pro \
- --thinking --google-search --grounding --output-format json
- ```
-5. Parse response: Extract thinking + analysis
-6. Synthesize:
-
----
-
-## πŸ€– My Analysis
-I attempted to fix the token expiry validation by updating the timestamp
-comparison. However, the new error suggests the signature verification
-is failing, possibly due to secret key mismatch or encoding issue.
-
-## πŸ’Ž Gemini's Analysis
-[Gemini's response with extended thinking]
-
-After analyzing the code and searching for latest JWT best practices,
-I found two issues:
-
-1. **Line 47**: `jwt.verify()` is using `process.env.JWT_SECRET` which
- is undefined in your Cloudflare Workers environment. Workers don't
- have `process.env` - you need to use `env.JWT_SECRET` from the
- context binding.
-
-2. **Line 52**: Token refresh logic is creating a new token but not
- updating the database record's `lastUsedAt` timestamp, causing
- subsequent requests to fail the replay check.
-
-Referenced: Cloudflare Workers JWT docs (2024-11-05 update)
-
-## πŸ” Key Differences
-- **Agreement**: Both identified JWT validation as the issue
-- **Divergence**: I focused on timing; Gemini found the actual bug
- (missing env binding)
-- **Gemini's catch**: Identified Cloudflare Workers-specific issue that
- I missed (no `process.env`)
-- **Web research**: Gemini found recent doc update about Workers env
- bindings
-
-## ⚑ Synthesis
-The 401 error is caused by two issues:
-1. **Root cause**: Using `process.env.JWT_SECRET` instead of `env.JWT_SECRET`
-2. **Secondary issue**: Missing database update in refresh logic
-
-Gemini's web search found a recent Cloudflare docs update (Nov 2024)
-that explicitly addresses this pattern.
-
-## βœ… Recommended Action
-1. Change line 47: `env.JWT_SECRET` instead of `process.env.JWT_SECRET`
-2. Add line 55: `await db.update(tokens).set({ lastUsedAt: new Date() })`
-3. Test with fresh token
-
-Should I implement these fixes?
-
----
-Cost: $0.18 (15,420 input + 850 output tokens)
-Consultation logged: ~/.claude/ai-consultations/consultations.log
-```
-
-User: "yes, proceed"
-
-Claude: [Implements both fixes]
-Result: βœ“ Authentication working
-```
-
-**Human time**: ~30 seconds (just "yes")
-**Total time**: ~2 minutes (consultation + fix)
-**Token savings**: ~8k tokens (avoided 2-3 more trial-and-error attempts)
-**Value**: Gemini caught Cloudflare-specific issue via web search
-
----
-
-## Why This Approach Works
-
-### 1. Leverages Existing Tools
-- βœ… `gemini` CLI already installed
-- βœ… `codex` CLI optional (for OpenAI users)
-- βœ… Task tool built-in (free Claude subagents)
-- ❌ No need to build/maintain MCP servers
-
-### 2. Simple Integration
-- βœ… Bash commands in slash command markdown files
-- βœ… Standard JSON parsing with `jq`
-- βœ… No complex Node.js/TypeScript servers
-- βœ… Easy to debug (just bash scripts)
-
-### 3. Smart Context
-- **Gemini**: Manual `@<path>` syntax (selective)
-- **Codex**: Auto-scans directory (convenient)
-- Both: Respect `.gitignore` (privacy)
-
-### 4. Forced Synthesis
-- **`GEMINI.md`** and **`codex.md`** templates enforce comparison
-- Prevents "parroting" external AI's response
-- Ensures value-add from consultation
-
-### 5. Cost Transparency
-- Every consultation logged with token counts
-- User can track spending
-- Can set budget limits (future enhancement)
-
----
-
-## Improvements Over Original MCP Plan
-
-| Aspect | MCP Server Plan | CLI Approach |
-|--------|----------------|--------------|
-| **Setup time** | 4-6 hours | 60-75 minutes |
-| **Complexity** | High (MCP protocol, server code) | Low (bash + existing CLIs) |
-| **Maintenance** | Update MCP SDK, handle protocol changes | Update CLI if needed (rare) |
-| **Flexibility** | Locked to specific AIs | Any AI with CLI |
-| **Debugging** | MCP protocol complexity | Standard bash debugging |
-| **Dependencies** | MCP SDK, npm packages, etc. | Just CLI tools |
-| **Extensibility** | Add MCP tools | Add bash commands (easier) |
-
-**Winner**: CLI approach - 80% less effort, same functionality
-
----
-
-## Known Issues & Prevention (8 Documented)
-
-1. **CLI Not Installed**
- - Prevention: Pre-flight checks
- - Fix: Error message with install instructions
-
-2. **API Keys Invalid**
- - Prevention: Test before consultation
- - Fix: Guide to set environment variables
-
-3. **Context Too Large**
- - Prevention: Smart context selection (not always `@.`)
- - Fix: Fall back to specific files only
-
-4. **Privacy Leaks**
- - Prevention: Git-aware + `.geminiignore`
- - Fix: Warn if sensitive files detected
-
-5. **Cost Overruns**
- - Prevention: Cost tracking + warnings
- - Fix: Suggest using free Claude subagent
-
-6. **Codex Hanging**
- - Prevention: Always use `--yolo` flag
- - Fix: Document in command, hard to miss
-
-7. **JSON Parsing Fails**
- - Prevention: Check exit code before parsing
- - Fix: Fall back to plain text
-
-8. **No Git Repo (Codex)**
- - Prevention: Add `--skip-git-repo-check`
- - Fix: Document flag in command
-
----
-
-## Success Metrics
-
-### Token Efficiency
-- **Without skill**: ~15k tokens (manual CLI research + trial-and-error)
-- **With skill**: ~5k tokens (execute slash command)
-- **Savings**: ~67%
-
-### Time Efficiency
-- **Without skill**: 15-20 minutes (figure out CLIs, format response)
-- **With skill**: 2-3 minutes (just execute + read synthesis)
-- **Savings**: ~85%
-
-### Error Prevention
-- **Manual approach**: 3-5 common errors (CLI flags, parsing, privacy)
-- **With skill**: 0 errors (all handled by commands)
-- **Prevention**: 100%
-
-### Quality
-- **Manual approach**: Risk of not synthesizing (just copying external AI)
-- **With skill**: Forced synthesis via `GEMINI.md`/`codex.md`
-- **Improvement**: Guaranteed value-add
-
----
-
-## Next Actions
-
-1. βœ… **Planning complete** (this document)
-2. **Ready to implement** - All 4 phases documented
-3. **Estimated time**: 60-75 minutes total
-4. **Dependencies**: `gemini` CLI (required), `codex` CLI (optional)
-5. **After implementation**: Test with real bug scenario, update roadmap
-
----
-
-## Files Created (Planning Phase)
-
-1. βœ… `planning/multi-ai-consultant-spec.md` - Full implementation spec
-2. βœ… `planning/multi-ai-consultant-cli-reference.md` - CLI syntax guide
-3. βœ… `planning/multi-ai-consultant-summary.md` - This document
-
----
-
-## Ready to Build?
-
-All planning complete. The skill is fully specified and ready for implementation.
-
-**Estimated implementation time**: 60-75 minutes
-**Confidence level**: High (CLIs validated, patterns documented)
-**Risk level**: Low (no MCP complexity, simple bash scripts)
-
-**Next step**: Create `skills/multi-ai-consultant/` directory and start Phase 1 (slash commands).
-
----
-
-**Last Updated**: 2025-11-07
-**Status**: Planning complete, ready to implement
diff --git a/archive/planning/2025-12-skill-build-plan-2025.md b/archive/planning/2025-12-skill-build-plan-2025.md
deleted file mode 100644
index e75a02a0..00000000
--- a/archive/planning/2025-12-skill-build-plan-2025.md
+++ /dev/null
@@ -1,1074 +0,0 @@
-# Comprehensive Skill Build Plan
-**Date**: 2025-10-24
-**Status**: Ready for Implementation
-**Total Skills**: 13 (1 exists, 12 to build)
-
----
-
-## πŸ” Documentation Audit Results
-
-### Critical Findings
-
-**Skills That Exist But Aren't in Repo:**
-1. βœ… **tailwind-v4-shadcn** - EXISTS in `~/.claude/skills/` but NOT in repo
- - Status: Production ready, fully complete
- - Action needed: Move to repo and commit
-
-**Skills Marked Incomplete But Are Complete:**
-2. βœ… **cloudflare-full-stack-scaffold** - 100% complete (roadmap says 40%)
-3. βœ… **tanstack-query** - 100% complete (roadmap says planned)
-
-**Skills Actually Missing:**
-- zustand, drizzle-orm-d1, stripe-payments, resend-email, mastra-ai, openrouter, vitest, authjs, playwright, sentry, cloudflare-images, react-email
-
----
-
-## πŸ“‹ Master Build Plan
-
-### Phase 1: Documentation Fixes (30 minutes)
-**Priority**: URGENT
-**Tasks**:
-1. Move tailwind-v4-shadcn from ~/.claude/skills/ to repo
-2. Update roadmap: cloudflare-full-stack-scaffold = 100%
-3. Update roadmap: tanstack-query = βœ… Complete
-4. Commit all three with proper messages
-
----
-
-### Phase 2: Quick Wins (Week 1-2)
-
-#### Skill 1: tailwind-v4-shadcn βœ… (Already Exists)
-**Status**: Complete - Just needs to be added to repo
-**Action**:
-```bash
-# Copy from ~/.claude/skills/ to repo
-cp -r ~/.claude/skills/tailwind-v4-shadcn /home/jez/Documents/claude-skills/skills/
-git add skills/tailwind-v4-shadcn
-git commit -m "Add tailwind-v4-shadcn skill (production-tested)"
-```
-
----
-
-#### Skill 2: zustand (State Management)
-**Priority**: HIGH
-**Estimated Time**: 3-4 hours
-**Token Savings**: ~50%
-**Errors Prevented**: 4-5
-
-**Why Build This:**
-- You explicitly mention using Zustand for client state
-- Complements tanstack-query (server state)
-- Simple, atomic skill
-- High frequency use in React apps
-
-**Scope:**
-- Store creation patterns
-- TypeScript setup with immer middleware
-- Persist middleware (localStorage)
-- Selectors and performance optimization
-- DevTools integration
-- Slices pattern for large stores
-- Common mistakes (mutation warnings)
-
-**Templates to Create (7 files):**
-1. `basic-store.ts` - Simple counter/toggle examples
-2. `typescript-store.ts` - Full type-safe store
-3. `immer-middleware.ts` - Nested state updates
-4. `persist-middleware.ts` - localStorage integration
-5. `slices-pattern.ts` - Large store organization
-6. `selectors-pattern.ts` - Performance optimization
-7. `package.json` - Dependencies
-
-**References to Create (5 files):**
-1. `middleware-guide.md` - All middleware options
-2. `typescript-patterns.md` - Type inference, strict mode
-3. `devtools-setup.md` - Redux DevTools integration
-4. `common-errors.md` - 5 documented errors
-5. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. Direct mutation warnings (use immer)
-2. Selector re-render issues
-3. Persist middleware hydration timing
-4. TypeScript inference errors
-5. DevTools not connecting
-
-**Package Versions:**
-- `[email protected]` (latest)
-- `[email protected]` (for immer middleware)
-
-**Auto-Trigger Keywords:**
-- `zustand`, `zustand store`, `global state`, `client state management`
-- `useStore`, `create zustand`, `zustand typescript`, `zustand middleware`
-- `zustand persist`, `zustand immer`, `zustand devtools`
-- Error keywords: `"mutation warning"`, `"zustand not updating"`, `"persist not working"`
-
-**Production Test:**
-- Build example todo app with persist + immer
-- Verify all templates work
-- Test TypeScript strict mode
-
----
-
-#### Skill 3: drizzle-orm-d1
-**Priority**: HIGH
-**Estimated Time**: 5-6 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 8-10
-
-**Why Build This:**
-- On roadmap already
-- Complements cloudflare-d1 skill
-- Type-safe SQL queries
-- Better DX than raw SQL
-- Migration management
-
-**Scope:**
-- Drizzle setup with D1 adapter
-- Schema definition (tables, relations, indexes)
-- Type-safe queries (select, insert, update, delete)
-- Drizzle Kit migrations
-- Relations and joins
-- Prepared statements
-- Transactions
-- Integration with Cloudflare Workers
-
-**Templates to Create (10 files):**
-1. `drizzle.config.ts` - Drizzle Kit configuration
-2. `schema.ts` - Complete schema example (users, posts, comments)
-3. `client.ts` - D1 + Drizzle client setup
-4. `basic-queries.ts` - CRUD operations
-5. `relations-queries.ts` - Joins and relations
-6. `migrations-example/` - Migration workflow
-7. `transactions.ts` - Transaction patterns
-8. `prepared-statements.ts` - Performance optimization
-9. `cloudflare-worker-integration.ts` - Full Worker example
-10. `package.json`
-
-**References to Create (6 files):**
-1. `wrangler-setup.md` - Local and remote D1 config
-2. `schema-patterns.md` - All column types, constraints
-3. `migration-workflow.md` - Generate, apply, verify
-4. `query-builder-api.md` - Complete API reference
-5. `common-errors.md` - 10 documented errors
-6. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. D1 binding not found
-2. Migration apply failures
-3. Schema inference errors
-4. Relations not loading
-5. Prepared statement caching issues
-6. Transaction rollback patterns
-7. TypeScript strict mode errors
-8. Drizzle Kit config not found
-9. Remote vs local D1 confusion
-10. wrangler.toml vs wrangler.jsonc
-
-**Package Versions:**
-- `[email protected]` (latest)
-- `[email protected]` (latest)
-- `@cloudflare/workers-types@latest`
-
-**Auto-Trigger Keywords:**
-- `drizzle orm`, `drizzle d1`, `drizzle cloudflare`, `type-safe sql`
-- `drizzle schema`, `drizzle migrations`, `drizzle kit`, `orm cloudflare`
-- `drizzle relations`, `drizzle typescript`, `d1 orm`
-- Error keywords: `"drizzle migration failed"`, `"schema not found"`, `"d1 binding error"`
-
-**Dependencies:**
-- cloudflare-d1 skill (binding setup)
-- cloudflare-worker-base (project structure)
-
-**Production Test:**
-- Build blog example with users, posts, comments
-- Run full migration workflow
-- Test relations and joins
-- Verify Worker integration
-
----
-
-### Phase 3: SaaS Essentials (Week 3-4)
-
-#### Skill 4: stripe-payments
-**Priority**: CRITICAL
-**Estimated Time**: 6-8 hours
-**Token Savings**: ~65%
-**Errors Prevented**: 12-15
-
-**Why Build This:**
-- Essential for monetization
-- Complex setup with many gotchas
-- Webhook verification is critical
-- High error potential
-- Huge token savings
-
-**Scope:**
-- Stripe SDK setup for Cloudflare Workers
-- Checkout Session creation
-- Subscription management (create, update, cancel)
-- Webhook signature verification
-- Customer portal
-- Payment intents (one-time payments)
-- Invoice management
-- Idempotency patterns
-- TypeScript types
-- Test mode vs production
-
-**Templates to Create (12 files):**
-1. `stripe-client.ts` - Stripe SDK initialization
-2. `checkout-session.ts` - Create checkout for products/subscriptions
-3. `subscription-create.ts` - Subscription flow
-4. `subscription-update.ts` - Plan changes, quantity
-5. `subscription-cancel.ts` - Cancel/resume patterns
-6. `webhook-handler.ts` - Signature verification + event handling
-7. `customer-portal.ts` - Self-service portal session
-8. `payment-intent.ts` - One-time payments
-9. `idempotency-patterns.ts` - Prevent duplicate charges
-10. `worker-integration.ts` - Complete Hono Worker example
-11. `wrangler-config.jsonc` - Env vars and secrets
-12. `package.json`
-
-**References to Create (8 files):**
-1. `webhook-events-reference.md` - All event types
-2. `subscription-lifecycle.md` - All subscription states
-3. `testing-guide.md` - Test mode, Stripe CLI
-4. `security-best-practices.md` - Secrets, verification
-5. `common-errors.md` - 15 documented errors
-6. `typescript-types.md` - Stripe object types
-7. `cloudflare-workers-setup.md` - Workers-specific patterns
-8. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. Webhook signature verification failures
-2. Idempotency key conflicts
-3. Customer not found errors
-4. Subscription already canceled
-5. Invalid API key errors
-6. Missing price/product ID
-7. Currency mismatch errors
-8. Payment method required
-9. Invoice already paid
-10. Webhook endpoint URL not HTTPS
-11. Metadata size limits exceeded
-12. Test mode vs live mode confusion
-13. Subscription schedule conflicts
-14. Proration issues
-15. Coupon/discount errors
-
-**Package Versions:**
-- `[email protected]` (latest)
-- `@stripe/[email protected]` (frontend, optional)
-
-**Auto-Trigger Keywords:**
-- `stripe`, `stripe payments`, `stripe subscriptions`, `stripe checkout`
-- `stripe webhooks`, `payment processing`, `subscription billing`
-- `stripe customer portal`, `payment intents`, `stripe cloudflare`
-- `stripe idempotency`, `stripe test mode`, `stripe typescript`
-- Error keywords: `"webhook verification failed"`, `"stripe customer not found"`, `"idempotency key"`, `"subscription error"`
-
-**Dependencies:**
-- cloudflare-worker-base (Hono setup)
-- clerk-auth (optional, for user->customer mapping)
-
-**Production Test:**
-- Create test subscription flow
-- Verify webhook signature locally
-- Test cancel/resume flow
-- Verify idempotency
-- Test customer portal
-
----
-
-#### Skill 5: resend-email
-**Priority**: HIGH
-**Estimated Time**: 3-4 hours
-**Token Savings**: ~55%
-**Errors Prevented**: 6-8
-
-**Why Build This:**
-- Modern email API
-- Simpler than SendGrid/Mailgun
-- Pairs well with Stripe (receipts, notifications)
-- Great DX
-
-**Scope:**
-- Resend SDK setup
-- Sending transactional emails
-- Email templates (plain text + HTML)
-- React Email integration (optional)
-- Domain verification
-- Batch sending
-- Scheduling emails
-- Attachments
-- Error handling
-- Rate limits
-
-**Templates to Create (9 files):**
-1. `resend-client.ts` - SDK initialization
-2. `send-simple-email.ts` - Basic email
-3. `send-html-email.ts` - HTML template
-4. `send-with-attachments.ts` - File attachments
-5. `batch-send.ts` - Multiple recipients
-6. `react-email-integration.ts` - React Email components
-7. `worker-integration.ts` - Hono Worker example
-8. `wrangler-config.jsonc` - API key setup
-9. `package.json`
-
-**References to Create (6 files):**
-1. `domain-verification-guide.md` - DNS records setup
-2. `email-templates.md` - Best practices, examples
-3. `react-email-setup.md` - React Email integration
-4. `rate-limits.md` - Rate limits per tier
-5. `common-errors.md` - 8 documented errors
-6. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. Domain not verified
-2. API key invalid/missing
-3. From address not allowed
-4. Rate limit exceeded
-5. Invalid email format
-6. Attachment size limit
-7. Missing required fields (to, from, subject)
-8. React Email build errors
-
-**Package Versions:**
-- `[email protected]` (latest)
-- `[email protected]` (optional)
-- `@react-email/[email protected]` (optional)
-
-**Auto-Trigger Keywords:**
-- `resend`, `resend email`, `transactional email`, `send email`
-- `resend api`, `email cloudflare`, `resend worker`, `email templates`
-- `react email resend`, `domain verification email`
-- Error keywords: `"domain not verified"`, `"resend api key"`, `"email failed"`
-
-**Dependencies:**
-- cloudflare-worker-base (optional, for Worker integration)
-- react-email skill (optional, if created separately)
-
-**Production Test:**
-- Send test email
-- Verify domain setup
-- Test HTML templates
-- Verify error handling
-
----
-
-### Phase 4: AI & Developer Tools (Week 5-6)
-
-#### Skill 6: mastra-ai
-**Priority**: MEDIUM-HIGH
-**Estimated Time**: 6-7 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 10-12
-
-**Why Build This:**
-- You explicitly mention using Mastra
-- AI agent framework
-- Cloudflare integration built-in
-- Complex setup with many moving parts
-
-**Scope:**
-- Mastra installation and setup
-- Agent creation and configuration
-- Memory management (short-term, long-term)
-- Tools and function calling
-- Workflow management
-- LLM integrations (OpenAI, Anthropic, Cloudflare)
-- Storage backends (D1, KV, Vectorize)
-- Cloudflare deployment
-- Multi-agent orchestration
-
-**Templates to Create (11 files):**
-1. `mastra.config.ts` - Main configuration
-2. `basic-agent.ts` - Simple agent example
-3. `agent-with-tools.ts` - Function calling
-4. `agent-with-memory.ts` - Memory patterns
-5. `workflow-example.ts` - Multi-step workflows
-6. `cloudflare-d1-storage.ts` - D1 storage backend
-7. `cloudflare-vectorize-memory.ts` - Vector memory
-8. `multi-agent-orchestration.ts` - Agent coordination
-9. `worker-deployment.ts` - Cloudflare Workers integration
-10. `wrangler-config.jsonc` - Complete bindings
-11. `package.json`
-
-**References to Create (7 files):**
-1. `cloudflare-integration-guide.md` - All CF services
-2. `agent-patterns.md` - Agent design patterns
-3. `memory-strategies.md` - Memory architectures
-4. `tool-creation-guide.md` - Custom tools
-5. `deployment-guide.md` - Cloudflare deployment
-6. `common-errors.md` - 12 documented errors
-7. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. Configuration file not found
-2. LLM provider API key missing
-3. Storage backend connection failures
-4. Memory serialization errors
-5. Tool execution timeouts
-6. Workflow state corruption
-7. Multi-agent deadlocks
-8. Cloudflare binding errors
-9. D1 schema mismatch
-10. Vectorize dimension errors
-11. Deployment bundle size issues
-12. TypeScript type inference errors
-
-**Package Versions:**
-- `@mastra/core@latest`
-- `@mastra/deployer-cloudflare@latest` (if exists)
-- Check official docs for current versions
-
-**Auto-Trigger Keywords:**
-- `mastra`, `mastra ai`, `mastra agent`, `mastra framework`
-- `ai agents mastra`, `mastra cloudflare`, `mastra workflow`
-- `mastra memory`, `mastra tools`, `agent orchestration`
-- Error keywords: `"mastra config"`, `"agent failed"`, `"workflow error"`
-
-**Dependencies:**
-- cloudflare-worker-base
-- cloudflare-d1 (for storage)
-- cloudflare-vectorize (for memory)
-- ai-sdk-core (optional)
-
-**Production Test:**
-- Build simple agent with memory
-- Test tool calling
-- Verify workflow execution
-- Deploy to Cloudflare Workers
-
----
-
-#### Skill 7: openrouter
-**Priority**: MEDIUM
-**Estimated Time**: 3-4 hours
-**Token Savings**: ~45%
-**Errors Prevented**: 5-7
-
-**Why Build This:**
-- You mention using it for "free API to all providers"
-- Multi-provider access
-- Cost optimization
-- Fallback patterns
-
-**Scope:**
-- OpenRouter API setup
-- Model selection and routing
-- Provider fallbacks
-- Cost tracking
-- Streaming responses
-- Function calling (if supported)
-- Rate limit handling
-- Error handling per provider
-
-**Templates to Create (8 files):**
-1. `openrouter-client.ts` - API client setup
-2. `model-selection.ts` - Model routing patterns
-3. `streaming-response.ts` - Streaming chat
-4. `provider-fallback.ts` - Fallback chain
-5. `cost-tracking.ts` - Usage monitoring
-6. `worker-integration.ts` - Hono Worker example
-7. `wrangler-config.jsonc` - API key setup
-8. `package.json`
-
-**References to Create (6 files):**
-1. `model-catalog.md` - Available models and pricing
-2. `provider-comparison.md` - Provider capabilities
-3. `rate-limits.md` - Per-provider limits
-4. `cost-optimization.md` - Best practices
-5. `common-errors.md` - 7 documented errors
-6. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. API key invalid
-2. Model not found/unavailable
-3. Provider rate limit exceeded
-4. Insufficient credits
-5. Invalid request format per provider
-6. Streaming not supported (some models)
-7. Context length exceeded
-
-**Package Versions:**
-- Check if OpenRouter has official SDK
-- Otherwise: fetch API with proper types
-
-**Auto-Trigger Keywords:**
-- `openrouter`, `openrouter api`, `multi llm provider`
-- `openrouter cloudflare`, `model routing`, `llm fallback`
-- `openrouter cost`, `openrouter streaming`
-- Error keywords: `"model not available"`, `"rate limit openrouter"`, `"credits exceeded"`
-
-**Dependencies:**
-- cloudflare-worker-base (optional)
-
-**Production Test:**
-- Test multiple providers
-- Verify fallback chain
-- Test streaming
-- Verify cost tracking
-
----
-
-#### Skill 8: vitest
-**Priority**: HIGH
-**Estimated Time**: 4-5 hours
-**Token Savings**: ~50%
-**Errors Prevented**: 8-10
-
-**Why Build This:**
-- Testing is essential
-- Vite-native (fast)
-- Works with Cloudflare Workers
-- TypeScript support
-
-**Scope:**
-- Vitest installation and setup
-- Test file structure and naming
-- Unit testing patterns
-- Integration testing
-- Mocking (modules, functions, env)
-- Coverage configuration
-- Watch mode
-- CI/CD integration
-- Testing Cloudflare Workers (Miniflare)
-- Snapshot testing
-
-**Templates to Create (10 files):**
-1. `vitest.config.ts` - Complete configuration
-2. `basic-unit-test.test.ts` - Simple tests
-3. `async-test.test.ts` - Async operations
-4. `mock-modules.test.ts` - Module mocking
-5. `mock-env.test.ts` - Environment variables
-6. `cloudflare-worker-test.test.ts` - Worker testing with Miniflare
-7. `integration-test.test.ts` - Integration patterns
-8. `snapshot-test.test.ts` - Snapshot testing
-9. `test-utils.ts` - Shared test utilities
-10. `package.json`
-
-**References to Create (7 files):**
-1. `cloudflare-workers-testing.md` - Miniflare setup
-2. `mocking-guide.md` - All mocking patterns
-3. `coverage-setup.md` - Coverage config and CI
-4. `ci-integration.md` - GitHub Actions, etc.
-5. `best-practices.md` - Test organization
-6. `common-errors.md` - 10 documented errors
-7. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. Module not found in tests
-2. TypeScript path alias errors
-3. Environment variable not defined
-4. Async timeout errors
-5. Mock not clearing between tests
-6. Coverage threshold failures
-7. Miniflare binding errors
-8. Snapshot mismatch
-9. Watch mode file detection issues
-10. CI timeout errors
-
-**Package Versions:**
-- `[email protected]` (latest)
-- `@vitest/[email protected]` (UI)
-- `@vitest/[email protected]` (coverage)
-- `@cloudflare/vitest-pool-workers@latest` (for Worker testing)
-
-**Auto-Trigger Keywords:**
-- `vitest`, `vitest testing`, `unit test vite`, `test cloudflare`
-- `vitest config`, `vitest mock`, `vitest coverage`, `vitest worker`
-- `miniflare test`, `test typescript vite`
-- Error keywords: `"vitest module not found"`, `"mock not working"`, `"coverage failed"`
-
-**Dependencies:**
-- None (works standalone)
-
-**Production Test:**
-- Write tests for example Worker
-- Verify mocking works
-- Test coverage reports
-- Verify CI integration
-
----
-
-### Phase 5: Testing & Monitoring (Week 7-8)
-
-#### Skill 9: authjs
-**Priority**: MEDIUM
-**Estimated Time**: 6-7 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 10-12
-
-**Why Build This:**
-- Alternative to Clerk (more flexible, self-hosted)
-- Official D1 adapter support
-- Next.js, SvelteKit, standalone
-- Free and open source
-
-**Scope:**
-- Auth.js setup (formerly NextAuth)
-- D1 adapter configuration
-- OAuth provider setup (Google, GitHub, etc.)
-- Email provider (magic links)
-- JWT configuration
-- Session management
-- Callbacks and events
-- TypeScript setup
-- Cloudflare Workers deployment
-- Multi-framework support
-
-**Templates to Create (12 files):**
-1. `auth-config.ts` - Core configuration
-2. `d1-adapter-setup.ts` - D1 adapter with schema
-3. `oauth-providers.ts` - Google, GitHub examples
-4. `email-provider.ts` - Magic link setup
-5. `jwt-config.ts` - JWT customization
-6. `session-callbacks.ts` - Session/JWT callbacks
-7. `nextjs-integration.ts` - Next.js App Router
-8. `worker-integration.ts` - Standalone Worker
-9. `middleware-patterns.ts` - Protected routes
-10. `database-schema.sql` - D1 schema for Auth.js
-11. `wrangler-config.jsonc` - Complete bindings
-12. `package.json`
-
-**References to Create (8 files):**
-1. `d1-adapter-guide.md` - D1 setup and migrations
-2. `provider-setup.md` - All OAuth providers
-3. `email-provider-guide.md` - Magic link + Resend
-4. `session-strategies.md` - JWT vs database sessions
-5. `cloudflare-deployment.md` - Workers-specific setup
-6. `multi-framework-guide.md` - Next.js, Vite, etc.
-7. `common-errors.md` - 12 documented errors
-8. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. D1 adapter schema mismatch
-2. OAuth redirect URI mismatch
-3. Secret key not set
-4. Session token not found
-5. Provider configuration errors
-6. Email delivery failures
-7. CSRF token mismatch
-8. Callback URL errors
-9. D1 binding not found
-10. Session expired handling
-11. TypeScript type errors
-12. Cloudflare Workers middleware issues
-
-**Package Versions:**
-- `@auth/core@latest`
-- `@auth/d1-adapter@latest`
-- Next.js: `next-auth@latest`
-
-**Auto-Trigger Keywords:**
-- `authjs`, `auth.js`, `nextauth`, `d1 auth`, `oauth cloudflare`
-- `authjs d1`, `magic link auth`, `session management`
-- `authjs cloudflare`, `authjs typescript`, `authjs worker`
-- Error keywords: `"oauth redirect"`, `"session not found"`, `"d1 adapter error"`
-
-**Dependencies:**
-- cloudflare-d1 (database)
-- cloudflare-worker-base (Worker setup)
-- resend-email (optional, for magic links)
-
-**Production Test:**
-- Set up OAuth with Google
-- Test D1 adapter
-- Verify session persistence
-- Test magic links
-
----
-
-#### Skill 10: playwright
-**Priority**: MEDIUM
-**Estimated Time**: 5-6 hours
-**Token Savings**: ~55%
-**Errors Prevented**: 9-11
-
-**Why Build This:**
-- E2E testing essential for full-stack
-- Tests auth flows
-- Multi-browser support
-- Great debugging tools
-
-**Scope:**
-- Playwright installation
-- Test configuration
-- Page object pattern
-- Authentication testing
-- API testing
-- Visual regression testing
-- Parallel execution
-- CI/CD integration
-- Testing Cloudflare Pages/Workers
-- Debugging techniques
-
-**Templates to Create (10 files):**
-1. `playwright.config.ts` - Complete configuration
-2. `basic-test.spec.ts` - Simple page test
-3. `page-object-pattern.ts` - POM example
-4. `auth-flow-test.spec.ts` - Login/logout tests
-5. `api-test.spec.ts` - API endpoint testing
-6. `visual-regression.spec.ts` - Screenshot comparison
-7. `fixtures.ts` - Shared fixtures
-8. `test-utils.ts` - Helper functions
-9. `ci-config.yml` - GitHub Actions example
-10. `package.json`
-
-**References to Create (7 files):**
-1. `cloudflare-pages-testing.md` - Testing deployed apps
-2. `auth-testing-guide.md` - Auth flow patterns
-3. `debugging-guide.md` - Debugging techniques
-4. `ci-integration.md` - CI/CD setup
-5. `visual-testing.md` - Screenshot testing
-6. `common-errors.md` - 11 documented errors
-7. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. Browser not installed
-2. Timeout errors
-3. Selector not found
-4. Authentication state issues
-5. Screenshot comparison failures
-6. Parallel test race conditions
-7. CI environment setup errors
-8. Network request failures
-9. Page not loaded errors
-10. Test isolation issues
-11. Fixture cleanup errors
-
-**Package Versions:**
-- `@playwright/[email protected]` (latest)
-
-**Auto-Trigger Keywords:**
-- `playwright`, `playwright testing`, `e2e test`, `browser testing`
-- `playwright auth`, `playwright api`, `playwright cloudflare`
-- `visual regression`, `playwright ci`, `page object model`
-- Error keywords: `"playwright timeout"`, `"selector not found"`, `"browser not installed"`
-
-**Dependencies:**
-- None (works standalone)
-
-**Production Test:**
-- Test full auth flow
-- Run in parallel
-- Verify screenshot comparison
-- Test CI integration
-
----
-
-#### Skill 11: sentry
-**Priority**: MEDIUM
-**Estimated Time**: 4-5 hours
-**Token Savings**: ~50%
-**Errors Prevented**: 7-9
-
-**Why Build This:**
-- Production error monitoring
-- Performance tracking
-- Essential for debugging live apps
-
-**Scope:**
-- Sentry SDK setup
-- Error capture and reporting
-- Performance monitoring
-- Source maps configuration
-- Cloudflare Workers integration
-- User context and tags
-- Breadcrumbs
-- Release tracking
-- Environment configuration
-
-**Templates to Create (9 files):**
-1. `sentry-client.ts` - Frontend setup
-2. `sentry-worker.ts` - Worker setup
-3. `error-boundary.tsx` - React error boundary
-4. `performance-monitoring.ts` - Performance tracing
-5. `user-context.ts` - User identification
-6. `breadcrumbs-example.ts` - Custom breadcrumbs
-7. `source-maps-config.ts` - Source map upload
-8. `wrangler-config.jsonc` - Worker integration
-9. `package.json`
-
-**References to Create (6 files):**
-1. `cloudflare-workers-setup.md` - Workers integration
-2. `source-maps-guide.md` - Source map upload
-3. `performance-monitoring.md` - Performance setup
-4. `release-tracking.md` - Release management
-5. `common-errors.md` - 9 documented errors
-6. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. DSN not configured
-2. Source maps not found
-3. Sampling rate too high/low
-4. User context not set
-5. Breadcrumbs buffer overflow
-6. Performance traces missing
-7. Release not found
-8. Environment mismatch
-9. Cloudflare Workers rate limits
-
-**Package Versions:**
-- `@sentry/browser@latest` (frontend)
-- `@sentry/react@latest` (React)
-- `@sentry/cli@latest` (source maps)
-
-**Auto-Trigger Keywords:**
-- `sentry`, `sentry monitoring`, `error tracking`, `sentry cloudflare`
-- `sentry worker`, `sentry react`, `sentry performance`
-- `source maps sentry`, `release tracking`
-- Error keywords: `"sentry dsn"`, `"source maps not found"`, `"sentry not reporting"`
-
-**Dependencies:**
-- cloudflare-worker-base (optional)
-
-**Production Test:**
-- Trigger test errors
-- Verify source maps
-- Test performance monitoring
-- Verify user context
-
----
-
-### Phase 6: Specialized Tools (Week 9-10)
-
-#### Skill 13: cloudflare-images
-**Priority**: MEDIUM
-**Estimated Time**: 4-5 hours
-**Token Savings**: ~55%
-**Errors Prevented**: 7-9
-
-**Why Build This:**
-- Image optimization service
-- Complements R2
-- Good for media-heavy apps
-
-**Scope:**
-- Cloudflare Images setup
-- Image upload patterns
-- Variants configuration
-- URL signing (private images)
-- Transformations
-- Integration with R2
-- Direct upload API
-- Batch operations
-
-**Templates to Create (9 files):**
-1. `images-client.ts` - API client setup
-2. `upload-image.ts` - Upload patterns
-3. `variants-config.ts` - Variant definitions
-4. `url-signing.ts` - Signed URLs
-5. `transformations.ts` - On-the-fly transforms
-6. `r2-integration.ts` - R2 + Images
-7. `direct-upload.ts` - Client-side upload
-8. `worker-integration.ts` - Hono Worker
-9. `package.json`
-
-**References to Create (6 files):**
-1. `variants-guide.md` - Variant configuration
-2. `transformations-reference.md` - All transformation options
-3. `url-signing-guide.md` - Private image patterns
-4. `r2-integration-guide.md` - R2 + Images workflow
-5. `common-errors.md` - 9 documented errors
-6. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. API token not configured
-2. Variant not found
-3. Image too large
-4. Invalid image format
-5. Signature verification failed
-6. Upload quota exceeded
-7. Transformation errors
-8. R2 binding errors
-9. CORS issues with direct upload
-
-**Package Versions:**
-- No official SDK (use fetch API)
-- Types: `@cloudflare/workers-types@latest`
-
-**Auto-Trigger Keywords:**
-- `cloudflare images`, `cf images`, `image optimization cloudflare`
-- `image variants`, `image upload cloudflare`, `signed urls images`
-- `cloudflare transforms`, `r2 images`
-- Error keywords: `"variant not found"`, `"image too large"`, `"signature failed"`
-
-**Dependencies:**
-- cloudflare-worker-base
-- cloudflare-r2 (optional integration)
-
-**Production Test:**
-- Upload test images
-- Configure variants
-- Test signed URLs
-- Verify transformations
-
----
-
-#### Skill 14: react-email
-**Priority**: MEDIUM-LOW
-**Estimated Time**: 3-4 hours
-**Token Savings**: ~50%
-**Errors Prevented**: 5-7
-
-**Why Build This:**
-- Email templates as React components
-- Works with Resend
-- Type-safe email templates
-- Preview server
-
-**Scope:**
-- React Email setup
-- Component-based templates
-- Preview server
-- Build process
-- Integration with Resend
-- Tailwind styling in emails
-- Common email patterns
-- Testing emails
-
-**Templates to Create (8 files):**
-1. `email-config.ts` - React Email config
-2. `welcome-email.tsx` - Welcome template
-3. `receipt-email.tsx` - Transaction receipt
-4. `notification-email.tsx` - Notification template
-5. `password-reset-email.tsx` - Password reset
-6. `preview-server.ts` - Dev preview setup
-7. `resend-integration.ts` - Send React Email via Resend
-8. `package.json`
-
-**References to Create (6 files):**
-1. `components-reference.md` - All React Email components
-2. `styling-guide.md` - Tailwind in emails
-3. `resend-integration-guide.md` - Integration patterns
-4. `preview-server-guide.md` - Dev workflow
-5. `common-errors.md` - 7 documented errors
-6. `links-to-official-docs.md`
-
-**Known Errors to Document:**
-1. Preview server not starting
-2. Build errors (TypeScript)
-3. Styling not rendering in email clients
-4. Component import errors
-5. Resend integration failures
-6. Tailwind config not found
-7. Image paths incorrect
-
-**Package Versions:**
-- `[email protected]` (latest)
-- `@react-email/[email protected]` (latest)
-
-**Auto-Trigger Keywords:**
-- `react email`, `react-email`, `email templates react`
-- `react email resend`, `email components`, `preview email`
-- `tailwind email`, `email builder react`
-- Error keywords: `"react email build"`, `"preview server"`, `"email styling"`
-
-**Dependencies:**
-- resend-email (optional integration)
-
-**Production Test:**
-- Build email templates
-- Test preview server
-- Send via Resend
-- Verify rendering in email clients
-
----
-
-## πŸ“Š Summary Statistics
-
-**Total Skills**: 13
-- Already Complete: 1 (tailwind-v4-shadcn)
-- To Build: 12
-
-**Total Estimated Time**: 56-68 hours
-- Phase 1 (Doc fixes): 0.5 hours
-- Phase 2 (Quick wins): 8-10 hours
-- Phase 3 (SaaS): 9-12 hours
-- Phase 4 (AI/Dev tools): 13-15 hours
-- Phase 5 (Testing/Monitoring): 15-18 hours
-- Phase 6 (Specialized): 7-9 hours
-
-**Average Token Savings**: ~55%
-**Total Errors Prevented**: ~100+
-
----
-
-## 🎯 Recommended Build Order
-
-### Sprint 1 (Next 2 weeks)
-1. βœ… **tailwind-v4-shadcn** - Move to repo (30 min)
-2. **zustand** - Quick win (3-4 hours)
-3. **drizzle-orm-d1** - High value (5-6 hours)
-
-### Sprint 2 (Weeks 3-4)
-4. **stripe-payments** - Critical for monetization (6-8 hours)
-5. **resend-email** - Pairs with Stripe (3-4 hours)
-
-### Sprint 3 (Weeks 5-6)
-6. **vitest** - Testing foundation (4-5 hours)
-7. **mastra-ai** - Your AI framework (6-7 hours)
-
-### Sprint 4 (Weeks 7-8)
-8. **authjs** - Clerk alternative (6-7 hours)
-9. **playwright** - E2E testing (5-6 hours)
-
-### Sprint 5 (Weeks 9-10)
-10. **openrouter** - Multi-provider AI (3-4 hours)
-11. **sentry** - Production monitoring (4-5 hours)
-12. **cloudflare-images** - Image optimization (4-5 hours)
-
-### Sprint 6 (Week 11)
-13. **react-email** - Email templates (3-4 hours)
-
----
-
-## βœ… Next Actions
-
-1. **Immediate** (Today):
- - [ ] Move tailwind-v4-shadcn to repo
- - [ ] Update roadmap (cloudflare-full-stack-scaffold = 100%)
- - [ ] Update roadmap (tanstack-query = βœ… Complete)
- - [ ] Git commit all documentation fixes
-
-2. **This Week**:
- - [ ] Build zustand skill
- - [ ] Build drizzle-orm-d1 skill
-
-3. **Next 2 Weeks**:
- - [ ] Build stripe-payments skill
- - [ ] Build resend-email skill
-
-4. **Month 2-3**:
- - [ ] Continue with remaining skills in order
-
----
-
-## πŸ“ Notes
-
-**Research Requirements:**
-- All skills require Context7 MCP lookup for latest docs
-- Verify npm versions before building each skill
-- Document production examples for each skill
-- Follow atomic skills philosophy (no bundling)
-
-**Quality Standards:**
-- Minimum 50% token savings
-- All errors documented with sources
-- Production-tested examples
-- TypeScript strict mode
-- Complete templates for copy-paste
-
-**Dependency Chain:**
-- Some skills depend on others (e.g., drizzle-orm-d1 needs cloudflare-d1)
-- Build foundational skills first
-- Integration skills can reference multiple base skills
-
----
-
-**Status**: βœ… Ready for Implementation
-**Total Project Duration**: ~11 weeks (at 5-6 hours/week pace)
-**Expected Completion**: Early January 2025
-
diff --git a/archive/planning/2025-12-skills-roadmap.md b/archive/planning/2025-12-skills-roadmap.md
deleted file mode 100644
index 56da103d..00000000
--- a/archive/planning/2025-12-skills-roadmap.md
+++ /dev/null
@@ -1,2207 +0,0 @@
-# Claude Skills Roadmap
-
-**Project**: Claude Code Skills Collection
-**Maintainer**: Jeremy Dawes (Jezweb)
-**Repository**: https://github.com/jezweb/claude-skills
-**Last Updated**: 2025-11-28
-
----
-
-## 🎯 Project Goals
-
-### Primary Objectives:
-1. **Reduce token usage** by 50-70% for common development tasks
-2. **Eliminate errors** from known issues and misconfigurations
-3. **Speed up project setup** from hours to minutes
-4. **Share knowledge** with the Claude Code community
-5. **Build atomic, composable skills** following Claude Code philosophy
-
-### Success Metrics:
-- βœ… 58 production-ready atomic skills
-- βœ… 52.5% average token savings (Phase 2 optimization)
-- βœ… Zero errors for covered use cases
-- βœ… Public GitHub repo with community contributions
-- βœ… Auto-discovery working reliably
-- βœ… Skills are composable and domain-focused
-- βœ… ~84,000 tokens saved per skill invocation (Phase 2)
-
----
-
-## 🧩 Atomic Skills Architecture
-
-**Philosophy**: Each skill is a focused **knowledge domain** that Claude discovers and composes automatically.
-
-### Why Atomic?
-- βœ… **Composability** - Claude combines multiple skills for complex tasks
-- βœ… **Reusability** - Same skill works across different frameworks
-- βœ… **Maintainability** - Update once, benefits all use cases
-- βœ… **Token efficiency** - Only load relevant knowledge
-- βœ… **Flexibility** - Users pick their own stack
-
-### Example Composition:
-```
-User: "Build a Cloudflare full-stack app with auth and database"
-↓
-Claude discovers and uses:
-- cloudflare-worker-base (Hono + Vite)
-- cloudflare-d1 (database)
-- clerk-auth (authentication)
-- tailwind-v4-shadcn (UI)
-↓
-Result: Integrated solution from atomic skills
-```
-
----
-
-## πŸ“Š Skill Priority Matrix
-
-### βœ… Completed Skills
-
-#### tailwind-v4-shadcn
-**Status**: βœ… Complete (2025-10-20)
-**Priority**: High
-**Dependencies**: None
-**Actual Dev Time**: 6 hours
-**Token Savings**: ~70%
-**Errors Prevented**: 3
-
-**What It Does**:
-- Tailwind CSS v4 + shadcn/ui integration
-- Vite plugin setup
-- Dark mode with ThemeProvider
-- @theme inline pattern
-- Complete component library setup
-
-**Production Validated**: WordPress Auditor
-
----
-
-#### cloudflare-worker-base
-**Status**: βœ… Complete (2025-10-20)
-**Priority**: Critical
-**Dependencies**: None
-**Actual Dev Time**: 2 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 6
-
-**What It Does**:
-- Scaffolds Cloudflare Workers project
-- Hono routing framework
-- Workers Static Assets configuration
-- @cloudflare/vite-plugin setup
-- wrangler.jsonc template
-- Local dev + deployment workflow
-
-**Production Validated**: https://cloudflare-worker-base-test.webfonts.workers.dev
-
----
-
-#### firecrawl-scraper
-**Status**: βœ… Complete (2025-10-20)
-**Priority**: Medium
-**Dependencies**: None
-**Actual Dev Time**: 1.5 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 6
-
-**What It Does**:
-- Firecrawl v2 API integration
-- Single page scraping (/v2/scrape)
-- Full site crawling (/v2/crawl)
-- URL discovery (/v2/map)
-- Structured data extraction (/v2/extract)
-- Python SDK (firecrawl-py v4.5.0+)
-- TypeScript SDK (firecrawl-js v1.7.x+)
-- Error handling and retry patterns
-
-**Production Validated**: Templates tested with working examples
-
----
-
-#### cloudflare-d1
-**Status**: βœ… Complete (2025-10-21)
-**Priority**: Critical
-**Dependencies**: cloudflare-worker-base
-**Actual Dev Time**: 2.5 hours
-**Token Savings**: ~58%
-**Errors Prevented**: 6
-
-**What It Does**:
-- D1 database creation and setup with wrangler
-- SQL migrations system (create, list, apply)
-- D1 bindings configuration in wrangler.jsonc
-- Complete D1 Workers API (prepare, bind, batch, exec)
-- Prepared statements for SQL injection prevention
-- Batch queries for performance optimization
-- Indexes and query optimization patterns
-- Error handling and retry strategies
-- Production-ready schema examples
-- Local and remote development workflows
-
-**Production Validated**: Templates tested with working examples
-
----
-
-#### cloudflare-zero-trust-access
-**Status**: βœ… Complete (2025-10-28)
-**Priority**: High
-**Dependencies**: cloudflare-worker-base (optional, works standalone)
-**Actual Dev Time**: 3 hours
-**Token Savings**: ~58%
-**Errors Prevented**: 8
-
-**What It Does**:
-- Cloudflare Zero Trust Access authentication integration
-- Hono middleware setup (@hono/[email protected])
-- Manual JWT validation using Web Crypto API
-- Service token authentication (machine-to-machine)
-- CORS + Access integration (correct middleware ordering)
-- Multi-tenant patterns (organization-level auth)
-- JWT payload structure reference (user vs service tokens)
-- Access policy configuration guide
-- Helper scripts (test-access-jwt.sh, create-service-token.sh)
-
-**Production Validated**: @hono/cloudflare-access actively maintained, 3k+ weekly downloads
-
----
-
-#### cloudflare-sandbox
-**Status**: βœ… Complete (2025-10-29)
-**Priority**: High
-**Dependencies**: cloudflare-worker-base, cloudflare-durable-objects (for understanding)
-**Actual Dev Time**: 5 hours
-**Token Savings**: ~79%
-**Errors Prevented**: 10
-
-**What It Does**:
-- Cloudflare Sandboxes SDK for secure code execution in Linux containers
-- Complete 3-layer architecture guide (Workers + Durable Objects + Containers)
-- Container lifecycle and persistence patterns (Active/Idle/Destroy states)
-- Session management for stateful multi-step workflows
-- Sandbox naming strategies (per-user, per-session, per-task, per-conversation)
-- 4 production templates (basic-executor, chat-agent, ci-cd, workspace)
-- 4 comprehensive reference guides (persistence, sessions, errors, naming)
-- Setup and validation scripts
-- Code interpreter API (Jupyter-like execution)
-- Git operations (clone, diff, commit)
-- Background process management
-- R2/KV integration for file persistence
-- Handles ephemeral container issues (files deleted after ~10min idle)
-
-**Production Validated**: Based on official Cloudflare tutorials (Claude Code integration, AI Code Executor)
-
----
-
-#### typescript-mcp
-**Status**: βœ… Complete (2025-10-28)
-**Priority**: High
-**Dependencies**: None (integrates with cloudflare-worker-base, cloudflare-d1, cloudflare-kv, cloudflare-r2, cloudflare-vectorize)
-**Actual Dev Time**: 4.5 hours
-**Token Savings**: ~70%
-**Errors Prevented**: 10+
-
-**What It Does**:
-- TypeScript MCP server development using official @modelcontextprotocol/sdk
-- 6 production-ready templates (basic, tool-server, resource-server, full-server, authenticated, wrangler config)
-- 7 comprehensive reference guides (tool patterns, authentication, testing, deployment, Cloudflare integration, common errors, agents comparison)
-- Authentication patterns for API keys, OAuth 2.0, Zero Trust, JWT
-- Cloudflare service integrations (D1, KV, R2, Vectorize, Workers AI, Queues)
-- Error prevention with GitHub issue sources (export syntax, memory leaks, schema validation, CORS, auth bypass)
-- Deployment workflows with Wrangler and CI/CD
-- Testing strategies (unit tests, MCP Inspector, E2E)
-- Helper scripts (init-mcp-server.sh, test-mcp-connection.sh)
-
-**Production Validated**: Official MCP SDK examples + Cloudflare MCP server
-
-**Auto-Trigger Keywords**:
-- `typescript mcp`, `mcp server`, `model context protocol`, `@modelcontextprotocol/sdk`
-- `mcp tools`, `mcp resources`, `cloudflare mcp`, `streamablehttpservertransport`
-- Error keywords: `export syntax error mcp`, `mcp schema validation failure`, `mcp memory leak`
-
----
-
-### Batch 1 - Cloudflare Services (Week 1) ⭐⭐⭐
-
-#### 2. cloudflare-r2
-**Status**: βœ… Complete (2025-10-21)
-**Priority**: High
-**Dependencies**: cloudflare-worker-base
-**Actual Dev Time**: 2.5 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 6
-
-**What It Does**:
-- R2 bucket creation and configuration with wrangler
-- Complete R2 Workers API (put, get, head, delete, list)
-- Multipart uploads for large files (>100MB)
-- Presigned URLs for client-side uploads/downloads
-- CORS configuration examples
-- HTTP metadata (content-type, cache-control, etc.)
-- Custom metadata support
-- Batch operations (bulk delete up to 1000 keys)
-- S3 API compatibility guide
-- Common patterns (image uploads, versioning, backups)
-- Error handling and retry strategies
-
-**Production Validated**: Templates tested with working examples
-
-**Auto-Trigger Keywords**:
-- `r2 storage`, `cloudflare r2`, `r2 upload`, `r2 bucket`
-- `object storage`, `r2 cors`, `presigned urls`, `multipart upload`
-
----
-
-#### 3. cloudflare-kv
-**Status**: βœ… Complete (2025-10-21)
-**Priority**: High
-**Dependencies**: cloudflare-worker-base
-**Actual Dev Time**: 3 hours
-**Token Savings**: ~55%
-**Errors Prevented**: 6
-
-**What It Does**:
-- KV namespace creation and configuration with wrangler
-- Complete KV Workers API (get, put, delete, list)
-- Bulk operations (bulk reads, pagination)
-- Metadata storage (up to 1024 bytes)
-- TTL & expiration (relative and absolute)
-- CacheTtl optimization for edge caching
-- List operations with cursor pagination
-- Prefix filtering and search
-- Caching patterns (cache-aside, write-through, stale-while-revalidate)
-- Error handling and retry strategies
-- Rate limit handling (1 write/sec per key)
-
-**Production Validated**: Templates tested with working examples
-
-**Auto-Trigger Keywords**:
-- `kv storage`, `cloudflare kv`, `kv namespace`
-- `kv cache`, `workers kv`, `kv bindings`, `kv ttl`, `kv metadata`
-
----
-
-#### 4. cloudflare-workers-ai
-**Status**: βœ… Complete (2025-10-21)
-**Priority**: High
-**Dependencies**: cloudflare-worker-base
-**Actual Dev Time**: 5 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 6
-
-**What It Does**:
-- Workers AI binding setup (wrangler.jsonc configuration)
-- Complete models catalog (50+ models across 10+ task types)
-- Text generation with streaming (LLMs: Llama, Qwen, Mistral, DeepSeek)
-- Text embeddings for RAG (BGE models with Vectorize integration)
-- Image generation (Flux, Stable Diffusion XL, DreamShaper)
-- Vision models (Llama 3.2 Vision for image understanding)
-- AI Gateway integration (caching, logging, cost tracking)
-- Production patterns (error handling, retry logic, rate limits)
-
-**Files Created**:
-- README.md (auto-trigger keywords, quick example)
-- SKILL.md (comprehensive API reference, 500+ lines)
-- templates/wrangler-ai-config.jsonc
-- templates/ai-text-generation.ts (streaming, chat, structured output)
-- templates/ai-embeddings-rag.ts (complete RAG pattern)
-- templates/ai-image-generation.ts (Flux, SDXL, storage in R2)
-- templates/ai-vision-models.ts (Llama Vision, image understanding)
-- templates/ai-gateway-integration.ts (caching, feedback, analytics)
-- reference/models-catalog.md (complete model listing by task type)
-- reference/best-practices.md (production patterns, cost optimization)
-
-**Auto-Trigger Keywords**:
-- `workers ai`, `cloudflare ai`, `@cf/meta/llama`, `ai bindings`
-- `llm workers`, `ai streaming`, `embeddings`, `image generation`
-- `vision models`, `ai gateway`, `rag pattern`, `text generation`
-
----
-
-#### 5. cloudflare-vectorize
-**Status**: βœ… Complete (2025-10-21)
-**Priority**: Medium
-**Dependencies**: cloudflare-worker-base
-**Actual Dev Time**: 3 hours
-**Token Savings**: ~65%
-**Errors Prevented**: 8
-
-**What It Does**:
-- Vectorize index creation (dimensions, metrics)
-- Metadata indexes (BEFORE vector insertion - critical timing)
-- Vector operations (insert, upsert, query, delete, list)
-- Metadata filtering (10 operators, 10 indexes per index)
-- Workers AI integration (@cf/baai/bge-base-en-v1.5)
-- OpenAI embeddings (text-embedding-3-small/large)
-- RAG patterns (complete chat with context retrieval)
-- Document chunking and ingestion pipelines
-- Namespace-based multi-tenancy
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete API reference with examples)
-- templates/basic-search.ts (simple semantic search)
-- templates/rag-chat.ts (full RAG chatbot with streaming)
-- templates/document-ingestion.ts (chunking + batch processing)
-- templates/metadata-filtering.ts (advanced filtering examples)
-- reference/wrangler-commands.md (complete CLI reference)
-- reference/index-operations.md (index creation guide)
-- reference/vector-operations.md (insert/query/delete operations)
-- reference/metadata-guide.md (filtering operators and patterns)
-- reference/embedding-models.md (Workers AI + OpenAI comparison)
-- examples/workers-ai-bge-base.md (768 dimensions integration)
-- examples/openai-embeddings.md (1536/3072 dimensions integration)
-
-**Production Validated**: Templates tested with working examples
-
-**Auto-Trigger Keywords**:
-- `vectorize`, `cloudflare vectorize`, `vector search`, `vector database`
-- `embeddings storage`, `rag cloudflare`, `semantic search`, `similarity search`
-- `bge-base`, `workers ai embeddings`, `metadata filtering`, `topK search`
-
----
-
-#### 6. cloudflare-queues
-**Status**: βœ… Complete (2025-10-21)
-**Priority**: Medium
-**Dependencies**: cloudflare-worker-base
-**Actual Dev Time**: 3 hours
-**Token Savings**: ~50%
-**Errors Prevented**: 8
-
-**What It Does**:
-- Queue creation and management with wrangler
-- Complete Producer API (send, sendBatch, delays)
-- Complete Consumer API (batch, message, ack/retry)
-- Batching configuration (max_batch_size, max_batch_timeout)
-- Retry strategies (implicit, explicit, exponential backoff)
-- Dead Letter Queues (DLQ) for failed messages
-- Explicit acknowledgement patterns
-- Message delays (up to 12 hours)
-- Consumer concurrency (auto-scaling up to 250)
-- Error handling and best practices
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete API reference, 800+ lines)
-- templates/wrangler-queues-config.jsonc
-- templates/queues-producer.ts (send, sendBatch, delays)
-- templates/queues-consumer-basic.ts (implicit ack)
-- templates/queues-consumer-explicit-ack.ts (non-idempotent ops)
-- templates/queues-dlq-pattern.ts (dead letter queue consumer)
-- templates/queues-retry-with-delay.ts (exponential backoff)
-- reference/wrangler-commands.md (complete CLI reference)
-- reference/producer-api.md (send/sendBatch deep dive)
-- reference/consumer-api.md (queue handler, batch/message operations)
-- reference/best-practices.md (patterns, concurrency, optimization)
-
-**Production Validated**: Templates tested with working examples
-
-**Auto-Trigger Keywords**:
-- `cloudflare queues`, `queues workers`, `message queue`, `async processing`
-- `queue bindings`, `background jobs`, `batch processing`, `dead letter queue`
-- `queue ack`, `message retry`, `consumer concurrency`
-
----
-
-#### 7. cloudflare-images
-**Status**: βœ… Complete (2025-10-26)
-**Priority**: High
-**Dependencies**: None
-**Actual Dev Time**: 5.5 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 13
-
-**What It Does**:
-- Complete Cloudflare Images API (upload, storage, serving)
-- Image Transformations (resize, optimize ANY publicly accessible image)
-- Upload methods (file, URL ingestion, direct creator upload)
-- Variants management (named variants up to 100, flexible variants unlimited)
-- Direct Creator Upload (one-time upload URLs for user uploads without API key exposure)
-- Signed URLs for private images (HMAC-SHA256 tokens with expiry)
-- URL transformations (`/cdn-cgi/image/<OPTIONS>/<SOURCE>`)
-- Workers transformations (`fetch(url, { cf: { image: {...} } })`)
-- All transformation options (resize, crop, quality, format, effects)
-- Format optimization (auto WebP/AVIF conversion)
-- Responsive images (srcset patterns)
-- Batch API for high-volume uploads
-- Webhooks for upload notifications
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords, 300+ lines)
-- SKILL.md (complete guide, 1,200+ lines)
-- 11 templates:
- * wrangler-images-binding.jsonc
- * upload-api-basic.ts
- * upload-via-url.ts
- * direct-creator-upload-backend.ts
- * direct-creator-upload-frontend.html
- * transform-via-url.ts
- * transform-via-workers.ts
- * variants-management.ts
- * signed-urls-generation.ts
- * responsive-images-srcset.html
- * batch-upload.ts
- * package.json
-- 8 references:
- * api-reference.md (complete API endpoints)
- * transformation-options.md (all transform params)
- * variants-guide.md (named vs flexible variants)
- * signed-urls-guide.md (HMAC-SHA256 implementation)
- * direct-upload-complete-workflow.md (full architecture)
- * responsive-images-patterns.md (srcset, sizes, art direction)
- * format-optimization.md (WebP/AVIF strategies)
- * top-errors.md (all 13+ errors with solutions)
-- scripts/check-versions.sh
-
-**Known Issues Prevented**:
-1. Direct Creator Upload CORS error (multipart/form-data requirement)
-2. Error 5408 - Upload timeout (15s limit)
-3. Error 400 - Invalid file parameter name
-4. CORS preflight failures (backend-only `/direct_upload` calls)
-5. Error 9401 - Invalid transformation arguments
-6. Error 9402 - Image too large
-7. Error 9403 - Request loop
-8. Error 9406/9419 - Invalid URL format (HTTPS only, URL encoding)
-9. Error 9412 - Non-image response
-10. Error 9413 - Max image area exceeded (100 megapixels)
-11. Flexible variants + signed URLs incompatibility
-12. SVG resizing limitation
-13. EXIF metadata stripped by default
-
-**Production Validated**: Based on official Cloudflare documentation and community issues
-
-**Auto-Trigger Keywords**:
-- `cloudflare images`, `image upload cloudflare`, `imagedelivery.net`
-- `cloudflare image transformations`, `/cdn-cgi/image/`, `direct creator upload`
-- `image variants cloudflare`, `cf.image workers`, `signed urls images`
-- `flexible variants`, `webp avif conversion`, `responsive images cloudflare`
-- Error keywords: `error 5408`, `error 9401`, `error 9403`, `CORS direct upload`
-
----
-
-#### 7. cloudflare-cron-triggers
-**Status**: βœ… Complete (2025-10-23)
-**Priority**: Medium
-**Dependencies**: cloudflare-worker-base
-**Actual Dev Time**: 1.5 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 6
-
-**What It Does**:
-- Scheduled Worker execution using cron expressions
-- Scheduled handler setup (ES modules format required)
-- Cron expression syntax (5-field format, UTC only)
-- ScheduledController API (cron, type, scheduledTime properties)
-- Multiple cron schedules with switch routing
-- Integration with all Cloudflare bindings (D1, R2, KV, AI, Queues, Workflows)
-- Testing workflow (--test-scheduled flag, /__scheduled endpoint)
-- Green Compute configuration (renewable energy data centers)
-- UTC timezone conversion guide
-- 15-minute propagation delay handling
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete API reference, 900+ lines)
-- templates/basic-scheduled.ts (minimal scheduled Worker)
-- templates/hono-with-scheduled.ts (combined HTTP + scheduled handlers)
-- templates/multiple-crons.ts (multiple schedules with routing)
-- templates/scheduled-with-bindings.ts (all Cloudflare bindings examples)
-- templates/wrangler-cron-config.jsonc (complete configuration patterns)
-- references/cron-expressions-reference.md (complete cron syntax, 50+ patterns)
-- references/common-patterns.md (12 real-world use cases)
-
-**Known Issues Prevented**:
-1. 15-minute propagation delay confusion
-2. Wrong handler name errors (must be 'scheduled')
-3. UTC timezone confusion (no local timezone support)
-4. Invalid cron expression syntax (6-field not supported)
-5. ES modules format requirement (no Service Worker format)
-6. CPU time limit errors (default 30s, max 5min)
-
-**Production Validated**: Cloudflare official documentation examples
-
-**Auto-Trigger Keywords**:
-- `cloudflare cron`, `cron triggers`, `scheduled workers`, `scheduled handler`
-- `scheduled() handler`, `ScheduledController`, `wrangler crons`, `periodic tasks`
-- `scheduled tasks`, `maintenance tasks`, `background jobs`, `cron expression`
-- `green compute`, `workflow triggers`, `UTC timezone`
-- Error keywords: `"scheduled handler not found"`, `"cron expression invalid"`, `"changes not propagating"`
-
----
-
-#### 8. cloudflare-agents
-**Status**: βœ… Complete (2025-10-21)
-**Priority**: Critical
-**Dependencies**: cloudflare-worker-base (recommended)
-**Actual Dev Time**: 18 hours
-**Token Savings**: ~65%
-**Errors Prevented**: 15
-
-**What It Does**:
-- Complete Cloudflare Agents SDK knowledge (all 17 API surfaces)
-- Agent Class API (onRequest, onConnect, onMessage, onStart)
-- WebSocket & Server-Sent Events (real-time bidirectional communication)
-- State management (this.setState, this.sql, state sync)
-- Task scheduling (this.schedule with delays, dates, cron)
-- Workflow integration (triggering Cloudflare Workflows)
-- Browser Rendering (web scraping with Puppeteer)
-- RAG implementation (Vectorize + Workers AI embeddings)
-- MCP servers (Model Context Protocol with McpAgent)
-- Human-in-the-loop patterns (approval workflows)
-- Client APIs (AgentClient, useAgent, useAgentChat hooks)
-- Multi-agent communication and orchestration
-- Durable Objects configuration and migrations
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (1300+ lines covering all APIs)
-- 13 templates (wrangler config, agents, workers, clients, MCP)
-- templates/wrangler-agents-config.jsonc
-- templates/basic-agent.ts
-- templates/websocket-agent.ts
-- templates/state-sync-agent.ts
-- templates/scheduled-agent.ts
-- templates/workflow-agent.ts
-- templates/browser-agent.ts
-- templates/rag-agent.ts
-- templates/chat-agent-streaming.ts
-- templates/calling-agents-worker.ts
-- templates/react-useagent-client.tsx
-- templates/mcp-server-basic.ts
-- templates/hitl-agent.ts
-
-**Production Validated**: Cloudflare's own MCP servers (https://github.com/cloudflare/mcp-server-cloudflare)
-
-**Auto-Trigger Keywords**:
-- `cloudflare agents`, `agents sdk`, `Agent class`, `Durable Objects agents`
-- `this.setState`, `this.sql`, `this.schedule`, `run workflows`
-- `browse web agents`, `rag agents`, `mcp server`, `McpAgent`
-- `useAgent hook`, `AgentClient`, `routeAgentRequest`, `getAgentByName`
-- `stateful agents`, `WebSocket agents`, `streaming chat agent`
-- `human in the loop`, `multi-agent`, `agent orchestration`
-- Error keywords: `"new_sqlite_classes"`, `"migrations required"`, `"binding not found"`
-
----
-
-### Batch 2 - AI SDK & Auth & Frameworks (Week 2-3) ⭐⭐⭐
-
-#### 7. cloudflare-nextjs
-**Status**: βœ… Complete (2025-10-21)
-**Priority**: High
-**Dependencies**: None
-**Actual Dev Time**: 4 hours
-**Token Savings**: ~59%
-**Errors Prevented**: 10
-
-**What It Does**:
-- Deploy Next.js (App Router and Pages Router) to Cloudflare Workers
-- OpenNext Cloudflare adapter (`@opennextjs/cloudflare`) setup
-- New and existing project migration patterns
-- wrangler.jsonc and open-next.config.ts configuration
-- Development workflow (dev + preview modes)
-- Integration with Cloudflare services (D1, R2, KV, Workers AI)
-- Comprehensive error prevention (10+ documented errors)
-- Security (CVE-2025-6087 mitigation)
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords, 200+ lines)
-- SKILL.md (complete guide, 800+ lines)
-- scripts/setup-new-project.sh (C3 scaffold)
-- scripts/setup-existing-project.sh (adapter migration)
-- scripts/analyze-bundle.sh (worker size debugging)
-- references/wrangler.jsonc (complete configuration)
-- references/open-next.config.ts (adapter config)
-- references/package.json (scripts template)
-- references/.env (build configuration)
-- references/database-client-example.ts (request-scoped pattern)
-- references/troubleshooting.md (all errors and solutions)
-- references/feature-support.md (feature compatibility matrix)
-- assets/workflow-diagram.md (development workflow)
-
-**Production Validated**: Official Cloudflare support, OpenNext adapter maintained
-
-**Auto-Trigger Keywords**:
-- `next.js cloudflare`, `nextjs workers`, `opennext adapter`
-- `next.js ssr cloudflare`, `next.js isr workers`, `server components cloudflare`
-- `migrate next.js to cloudflare`, `nextjs d1`, `nextjs workers ai`
-- Error keywords: `worker size limit nextjs`, `finalizationregistry nextjs`, `cannot perform i/o nextjs`
-
----
-
-#### 8. ai-sdk-core
-**Status**: βœ… Complete (2025-10-22)
-**Priority**: Critical
-**Dependencies**: None
-**Actual Dev Time**: 6 hours
-**Token Savings**: ~58%
-**Errors Prevented**: 12
-
-**What It Does**:
-- Backend AI functionality with Vercel AI SDK v5 (stable)
-- Text generation (generateText, streamText) with multi-provider support
-- Structured output (generateObject, streamObject) with Zod validation
-- Tool calling and Agent class for multi-step execution
-- stopWhen conditions for workflow control (replaces maxSteps)
-- Multi-provider support (OpenAI, Anthropic, Google, Cloudflare Workers AI)
-- Critical v4β†’v5 migration guide (15+ breaking changes documented)
-- Node.js, Cloudflare Workers, Next.js Server Components/Actions integration
-- Production patterns for error handling, cost optimization, and performance
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (931 lines - complete API reference)
-- templates/generate-text-basic.ts (simple text generation)
-- templates/stream-text-chat.ts (streaming chat with messages)
-- templates/generate-object-zod.ts (structured output with Zod)
-- templates/stream-object-zod.ts (streaming structured data)
-- templates/tools-basic.ts (tool calling basics)
-- templates/agent-with-tools.ts (Agent class usage)
-- templates/multi-step-execution.ts (stopWhen patterns)
-- templates/openai-setup.ts (OpenAI provider configuration)
-- templates/anthropic-setup.ts (Anthropic provider configuration)
-- templates/google-setup.ts (Google provider configuration)
-- templates/cloudflare-worker-integration.ts (Workers AI integration)
-- templates/nextjs-server-action.ts (Next.js Server Actions)
-- templates/package.json (dependencies template)
-- references/providers-quickstart.md (top 4 providers setup)
-- references/v5-breaking-changes.md (complete migration guide)
-- references/top-errors.md (12 errors with solutions)
-- references/production-patterns.md (best practices)
-- references/links-to-official-docs.md (organized documentation links)
-- scripts/check-versions.sh (package version checker)
-
-**Production Validated**: Templates tested, all files complete
-
-**Auto-Trigger Keywords**:
-- `ai sdk core`, `vercel ai sdk`, `generateText`, `streamText`, `generateObject`
-- `ai tools calling`, `ai agent class`, `openai sdk`, `anthropic sdk`, `google gemini sdk`
-- `multi-provider ai`, `zod ai schema`, `ai streaming backend`
-- Error keywords: `AI_APICallError`, `AI_NoObjectGeneratedError`, `worker startup limit ai`
-
----
-
-#### 9. ai-sdk-ui
-**Status**: βœ… Complete (2025-10-22)
-**Priority**: Critical
-**Dependencies**: None (complements ai-sdk-core)
-**Actual Dev Time**: 6 hours
-**Token Savings**: ~55%
-**Errors Prevented**: 12
-
-**What It Does**:
-- Frontend React hooks for AI-powered UIs with Vercel AI SDK v5
-- useChat hook (chat interfaces with streaming)
-- useCompletion hook (text completions)
-- useObject hook (streaming structured data)
-- v4β†’v5 migration (especially useChat input management)
-- Next.js App Router and Pages Router integration
-- Message rendering, persistence, tool calling UI
-- React, Next.js, and other React frameworks
-
-**Files Created**:
-- SKILL.md (774 lines)
-- README.md (comprehensive keywords)
-- 11 templates (useChat variations, useCompletion, useObject, Next.js examples, persistence, custom renderer, package.json)
-- 5 references (use-chat-migration.md, streaming-patterns.md, top-ui-errors.md, nextjs-integration.md, links-to-official-docs.md)
-- scripts/check-versions.sh
-
-**Production Validated**: WordPress Auditor (https://wordpress-auditor.webfonts.workers.dev)
-
-**Auto-Trigger Keywords**:
-- `ai sdk ui`, `useChat`, `useCompletion`, `useObject`, `react ai chat`
-- `nextjs ai chat`, `streaming ai ui`, `ai chat interface`, `vercel ai ui`
-- `chat message state`, `message persistence`, `ai file attachments`
-- Error keywords: `useChat failed to parse`, `useChat no response`, `unclosed streams`
-
----
-
-#### 10. clerk-auth
-**Status**: βœ… Complete (2025-10-22)
-**Priority**: Critical
-**Dependencies**: None (works across frameworks)
-**Actual Dev Time**: 6 hours
-**Token Savings**: ~67%
-**Errors Prevented**: 10
-
-**What It Does**:
-- Complete Clerk authentication for React, Next.js, Cloudflare Workers
-- JWT verification with @clerk/backend
-- Custom JWT templates and claims extraction
-- Protected routes and middleware patterns
-- User metadata and session management
-- Organization permissions and RBAC
-- shadcn/ui integration with Clerk components
-- Webhook signature verification
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete guide with all frameworks)
-- Templates for React, Next.js, Cloudflare Workers
-- JWT verification examples
-- Custom JWT templates
-- Protected route patterns
-- Webhook handlers
-
-**Production Validated**: Multiple framework implementations tested
-
-**Auto-Trigger Keywords**:
-- `clerk auth`, `clerk`, `@clerk/nextjs`, `@clerk/backend`, `@clerk/clerk-react`
-- `clerkMiddleware`, `verifyToken`, `JWT verification`, `protected routes`
-- `useUser`, `useAuth`, `SignInButton`, `UserButton`, `custom JWT claims`
-- Error keywords: `Missing Clerk Secret Key`, `Invalid session token`, `Clerk webhook failed`
-
----
-
-#### 10.5 better-auth
-**Status**: βœ… Complete (2025-10-31)
-**Priority**: High
-**Dependencies**: None (works with D1, PostgreSQL, MySQL)
-**Actual Dev Time**: 5 hours
-**Token Savings**: ~70%
-**Errors Prevented**: 10
-
-**What It Does**:
-- Production-ready authentication for TypeScript with Cloudflare D1 support
-- Self-hosted alternative to Clerk and Auth.js
-- Email/password, social auth (Google, GitHub, Microsoft), magic links
-- 2FA/passkeys, organizations, multi-tenant, RBAC
-- Complete migration guides from Clerk and Auth.js
-- Session management with KV for strong consistency
-- Rate limiting, CORS configuration, JWT tokens
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords, 300+ lines)
-- SKILL.md (complete guide, 1,200+ lines)
-- scripts/setup-d1.sh (automated D1 database setup)
-- references/cloudflare-worker-example.ts (complete Worker implementation)
-- references/nextjs-api-route.ts (Next.js patterns)
-- references/react-client-hooks.tsx (React client components)
-- references/drizzle-schema.ts (database schema)
-- assets/auth-flow-diagram.md (visual flow diagrams)
-
-**Production Validated**: better-chatbot (852 GitHub stars, active deployment)
-
-**Auto-Trigger Keywords**:
-- `better-auth`, `authentication with D1`, `self-hosted auth`
-- `alternative to Clerk`, `alternative to Auth.js`, `TypeScript authentication`
-- `social auth with Cloudflare`, `D1 authentication`, `multi-tenant auth`
-- `2FA authentication`, `passkeys`, `magic link auth`
-- Error keywords: `D1 session consistency`, `CORS auth error`, `OAuth redirect mismatch`
-
-**Official Resources**:
-- Docs: https://better-auth.com
-- GitHub: https://github.com/better-auth/better-auth (22.4k ⭐)
-- Package: [email protected]
-
----
-
-#### 11. hono-routing
-**Status**: βœ… Complete (2025-10-22)
-**Priority**: High
-**Dependencies**: None
-**Actual Dev Time**: 4 hours
-**Token Savings**: ~56%
-**Errors Prevented**: 8
-
-**What It Does**:
-- Complete Hono routing patterns (route params, query, wildcards, grouping)
-- Middleware composition (built-in middleware, custom middleware, chaining)
-- Request validation (Zod, Valibot, Typia, ArkType with hooks)
-- Typed routes (RPC pattern with type-safe client/server)
-- Error handling (HTTPException, onError, custom errors)
-- Context extension (c.set/c.get, type-safe variables)
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete documentation, 1000+ lines)
-- 8 templates (routing, middleware, validation, RPC, errors, context, client, package.json)
-- 4 references (middleware-catalog.md, validation-libraries.md, rpc-guide.md, top-errors.md)
-- scripts/check-versions.sh
-
-**Production Validated**: Templates tested, all 8 documented errors with solutions
-
-**Auto-Trigger Keywords**:
-- `hono`, `hono routing`, `hono middleware`
-- `hono validation`, `hono rpc`, `typed routes`, `hono validator`
-- `zod validator hono`, `valibot validator hono`, `c.req.valid`
-- Error keywords: `middleware response not typed`, `hono rpc type inference`, `validation hook hono`
-
----
-
-#### 12. react-hook-form-zod
-**Status**: βœ… Complete (2025-10-23)
-**Priority**: High
-**Dependencies**: None
-**Actual Dev Time**: 4 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 12
-
-**What It Does**:
-- Complete React Hook Form API (useForm, register, Controller, useFieldArray, useWatch)
-- Zod schema patterns (all data types, refinements, transforms, error customization)
-- shadcn/ui Form component integration
-- Client + server validation with single source of truth
-- Advanced patterns (dynamic fields, multi-step forms, async validation, nested objects, arrays)
-- Accessible error handling (WCAG compliance, ARIA attributes)
-- Performance optimization (form modes, validation strategies, re-render optimization)
-- Type-safe validation with TypeScript inference
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords, 200+ lines)
-- SKILL.md (complete documentation, 1,000+ lines)
-- 9 templates (basic-form, advanced-form, shadcn-form, server-validation, async-validation, dynamic-fields, multi-step-form, custom-error-display, package.json)
-- 8 references (zod-schemas-guide.md, rhf-api-reference.md, error-handling.md, accessibility.md, performance-optimization.md, shadcn-integration.md, top-errors.md, links-to-official-docs.md)
-- scripts/check-versions.sh
-
-**Known Issues Prevented**:
-1. Zod v4 type inference errors (#13109)
-2. Uncontrolled to controlled warnings
-3. Nested object validation errors
-4. Array field re-renders
-5. Async validation race conditions
-6. Server error mapping issues
-7. Default values not applied
-8. Controller field not updating
-9. useFieldArray key warnings
-10. Schema refinement error paths
-11. Transform vs preprocess confusion
-12. Multiple resolver conflicts
-
-**Production Validated**: Templates tested with TypeScript strict mode
-
-**Auto-Trigger Keywords**:
-- `react-hook-form`, `useForm`, `zod validation`, `form validation`
-- `zodResolver`, `@hookform/resolvers`, `rhf`, `form schema`, `zod schema`
-- `register form`, `handleSubmit`, `formState errors`, `useFieldArray`
-- `shadcn form`, `Field component shadcn`, `async validation`
-- Error keywords: `resolver not found`, `zod type inference`, `uncontrolled to controlled`
-
----
-
-### Batch 3 - Cloudflare Advanced Services ⭐
-
-#### cloudflare-hyperdrive
-**Status**: βœ… Complete (2025-10-22) - See detailed entry above
-
----
-
-#### 10. cloudflare-durable-objects
-**Status**: βœ… Complete (2025-10-22)
-**Priority**: Critical
-**Dependencies**: cloudflare-worker-base
-**Actual Dev Time**: 8 hours
-**Token Savings**: ~66%
-**Errors Prevented**: 18
-
-**What It Does**:
-- Durable Objects class structure (DurableObject base class, constructor patterns)
-- State API (SQL + KV storage, transactions, PITR)
-- WebSocket Hibernation API for real-time connections
-- Alarms API for scheduled tasks
-- RPC vs HTTP fetch patterns
-- Location hints and jurisdiction restrictions
-- Migration patterns (new, rename, delete, transfer)
-- Rate limiting, session management, leader election
-- Real-time applications (chat rooms, multiplayer games, collaboration)
-- Multi-DO coordination patterns
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (1760+ lines covering all APIs)
-- 8 templates (wrangler config, basic DO, WebSocket hibernation, state API, alarms, RPC/fetch, location hints, multi-DO coordination, package.json)
-- 7 references (wrangler commands, state API, WebSocket hibernation, alarms, migrations, RPC patterns, best practices, top errors)
-- scripts/check-versions.sh
-
-**Production Validated**: Templates tested, all 18 documented errors with solutions
-
-**Auto-Trigger Keywords**:
-- `durable objects`, `cloudflare do`, `websocket hibernation`
-- `do state api`, `ctx.storage.sql`, `ctx.acceptWebSocket`, `durable objects alarm`
-- `do migrations`, `location hints`, `RPC methods`, `idFromName`, `getByName`
-- `real-time cloudflare`, `websocket workers`, `multiplayer cloudflare`
-- Error keywords: `do class export`, `new_sqlite_classes`, `migrations required`, `alarm api error`
-
----
-
-#### 11. cloudflare-workflows
-**Status**: βœ… Complete (2025-10-22)
-**Priority**: Critical
-**Dependencies**: cloudflare-worker-base
-**Actual Dev Time**: 4 hours
-**Token Savings**: ~67%
-**Errors Prevented**: 5
-
-**What It Does**:
-- WorkflowEntrypoint API (run, step.do, step.sleep, step.sleepUntil, step.waitForEvent)
-- Automatic retries with configurable backoff (exponential, linear, constant)
-- State persistence between steps
-- Long-running workflows (hours/days)
-- Event-driven patterns (human-in-the-loop, approvals)
-- Error handling (NonRetryableError, try-catch)
-- Workflow chaining and coordination
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete guide, 1100+ lines)
-- 6 templates (basic, retries, scheduled, events, trigger, wrangler config)
-- 2 references (common-issues.md with 5 errors, workflow-patterns.md)
-- Research log: planning/research-logs/cloudflare-workflows.md
-
-**Production Validated**: Based on official Cloudflare docs (Workflows launched Oct 2024)
-
-**Auto-Trigger Keywords**:
-- `cloudflare workflows`, `workflows workers`, `durable execution`, `workflow step`
-- `WorkflowEntrypoint`, `step.do`, `step.sleep`, `step.sleepUntil`, `step.waitForEvent`
-- `workflow retries`, `NonRetryableError`, `long-running tasks`, `workflow events`
-- Error keywords: `I/O context`, `workflow execution failed`, `serialization error`
-
----
-
-#### 12. cloudflare-hyperdrive
-**Status**: βœ… Complete (2025-10-22)
-**Priority**: High
-**Dependencies**: cloudflare-worker-base (recommended)
-**Actual Dev Time**: 5 hours
-**Token Savings**: ~58%
-**Errors Prevented**: 10
-
-**What It Does**:
-- Complete Hyperdrive knowledge (PostgreSQL & MySQL support)
-- Connection pooling patterns (pg.Pool, postgres.js, mysql2)
-- Query caching optimization
-- TLS/SSL certificate configuration (server certs, client certs, mTLS)
-- Drizzle ORM and Prisma ORM integration
-- Local development setup (localConnectionString, env vars)
-- Wrangler CLI commands (create, update, delete, cert upload)
-- Private database access via Cloudflare Tunnel
-- All 10+ documented errors with solutions
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete guide, 1000+ lines)
-- 9 templates (wrangler config, postgres, mysql, Drizzle, Prisma, local setup)
-- 8 references (troubleshooting, wrangler commands, supported databases, connection pooling, query caching, TLS/SSL setup, Drizzle integration, Prisma integration)
-- scripts/check-versions.sh
-
-**Production Validated**: Based on official Cloudflare documentation
-
-**Auto-Trigger Keywords**:
-- `hyperdrive`, `cloudflare hyperdrive`, `postgres workers`, `mysql workers`
-- `node-postgres hyperdrive`, `postgres.js workers`, `mysql2 workers`
-- `drizzle hyperdrive`, `prisma hyperdrive`, `connection pooling cloudflare`
-- Error keywords: `Failed to acquire a connection`, `TLS not supported`, `nodejs_compat missing`
-
----
-
-#### 13. cloudflare-browser-rendering
-**Status**: Planned
-**Priority**: Medium
-**Dependencies**: cloudflare-worker-base, cloudflare-r2 (optional for storage)
-**Estimated Dev Time**: 5-6 hours
-**Token Savings**: ~50%
-**Errors Prevented**: 8+
-
-**What It Does**:
-- Puppeteer in Cloudflare Workers
-- Screenshot generation
-- PDF generation from HTML
-- Web scraping patterns
-- Form automation
-- Navigation and waiting patterns
-- Error handling for browser operations
-- Integration with R2 for storing screenshots/PDFs
-
-**Auto-Trigger Keywords**:
-- `cloudflare browser`, `puppeteer workers`, `browser rendering cloudflare`
-- `screenshot cloudflare`, `pdf generation workers`, `web scraping cloudflare`
-- `cloudflare automation`, `headless browser workers`
-
----
-
-#### 14. cloudflare-cron-triggers
-**Status**: Planned
-**Priority**: Medium
-**Dependencies**: cloudflare-worker-base
-**Estimated Dev Time**: 3-4 hours
-**Token Savings**: ~40%
-**Errors Prevented**: 6+
-
-**What It Does**:
-- Cron syntax and scheduling patterns
-- Scheduled Workers configuration
-- Error handling for cron jobs
-- Idempotency patterns
-- Integration with D1, KV, R2 for data operations
-- Daily reports, cache warming, cleanup jobs, data sync, backup automation
-
-**Auto-Trigger Keywords**:
-- `cloudflare cron`, `scheduled workers`, `cron triggers cloudflare`
-- `workers scheduler`, `daily job cloudflare`, `cache warming`
-- `cleanup job`, `scheduled task workers`
-
----
-
-#### 15. cloudflare-email-workers
-**Status**: Planned
-**Priority**: Medium
-**Dependencies**: cloudflare-worker-base
-**Estimated Dev Time**: 4-5 hours
-**Token Savings**: ~45%
-**Errors Prevented**: 7+
-
-**What It Does**:
-- Email routing configuration
-- Parsing email content and headers
-- Attachment handling and extraction
-- Forwarding patterns and rules
-- Integration with D1 for storage, KV for config
-- Email-to-ticket systems, support automation
-- Spam filtering patterns
-
-**Auto-Trigger Keywords**:
-- `cloudflare email`, `email workers`, `email routing cloudflare`
-- `parse email workers`, `email attachment`, `email-to-ticket`
-- `email forwarding cloudflare`, `receive email workers`
-
----
-
-### Batch 4 - Data & Utilities ⭐
-
-#### 16. tanstack-query
-**Status**: Planned
-**Priority**: Medium
-**Dependencies**: None
-**Estimated Dev Time**: 4 hours
-**Token Savings**: ~55%
-
-**What It Does**:
-- TanStack Query setup
-- Query patterns
-- Mutation patterns
-- Cache management
-- Optimistic updates
-- Infinite queries
-- SSR patterns
-
-**Auto-Trigger Keywords**:
-- `tanstack query`, `react query`, `query cache`
-- `mutations`, `optimistic updates`, `server state`
-
----
-
-#### 17. drizzle-orm-d1
-**Status**: βœ… Complete (2025-10-24)
-**Priority**: High
-**Dependencies**: cloudflare-d1, cloudflare-worker-base
-**Actual Dev Time**: 5.5 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 12
-
-**What It Does**:
-- Drizzle ORM setup for D1
-- Schema definition with relations
-- Type-safe queries with full TypeScript inference
-- Migrations workflow (generate, test local, apply remote)
-- D1 batch API transactions (not SQL BEGIN/COMMIT)
-- Prepared statements with placeholders
-- Query builder patterns
-- Complete Hono Worker integration
-
-**Production Validated**: Blog schema with users, posts, comments
-
-**Auto-Trigger Keywords**:
-- `drizzle orm`, `drizzle d1`, `orm cloudflare`
-- `type-safe sql`, `drizzle schema`, `drizzle migrations`
-- `d1 transaction error`, `foreign key constraint drizzle`
-
----
-
-### Batch 5 - AI API/SDK Suite ⭐⭐⭐
-
-**Overview**: Direct API integration skills for major AI providers (OpenAI, Anthropic Claude, Google Gemini). These complement existing ai-sdk-core/ai-sdk-ui skills by providing direct API access for use cases requiring provider-specific features, full control, or edge deployment without abstraction layers.
-
-**Build Order**: Claude β†’ OpenAI β†’ Google
-**Total Skills**: 9
-**Total Dev Time**: 50-64 hours
-**Average Token Savings**: ~60%
-**Total Errors Prevented**: 90+
-
----
-
-#### 18. claude-api
-**Status**: βœ… Complete (2025-10-25)
-**Priority**: Critical
-**Dependencies**: None
-**Actual Dev Time**: 5.5 hours
-**Token Savings**: ~62%
-**Errors Prevented**: 12
-
-**What It Does**:
-- Anthropic Messages API (v1/messages)
-- Streaming responses with Server-Sent Events (SSE)
-- Extended context (200k tokens for Claude 3.5 Sonnet)
-- Prompt caching for cost optimization (up to 90% savings on repeated prompts)
-- System prompts and multi-turn conversations
-- Tool use (function calling with JSON schemas)
-- Vision (image understanding with base64 or URLs)
-- Thinking mode (extended reasoning for complex problems)
-- Both Cloudflare Workers (fetch-based) and Node.js (@anthropic-ai/sdk)
-- Rate limit handling (429 errors) and retry strategies
-
-**Files to Create**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete API reference, 800+ lines)
-- templates/basic-chat.ts
-- templates/streaming-chat.ts
-- templates/prompt-caching.ts
-- templates/tool-use.ts
-- templates/vision.ts
-- templates/thinking-mode.ts
-- templates/cloudflare-worker.ts
-- templates/nodejs-example.ts
-- templates/package.json
-- references/api-reference.md
-- references/prompt-caching-guide.md
-- references/tool-use-patterns.md
-- references/vision-capabilities.md
-- references/error-handling.md
-- references/top-errors.md (10 common issues)
-- scripts/check-versions.sh
-
-**Known Issues to Prevent**:
-1. Streaming SSE parsing errors (incorrect event format handling)
-2. Prompt caching not activating (cache_control block placement)
-3. Tool use response format errors (JSON schema mismatches)
-4. Vision image format issues (base64 encoding requirements)
-5. Rate limit handling (429 errors without exponential backoff)
-6. Token counting mismatches for billing
-7. System prompt ordering issues (must be first message)
-8. Multi-turn conversation context management
-9. Thinking mode not available on all models (only Claude 3.5 Sonnet+)
-10. CORS errors in browser contexts (API key exposure)
-
-**Production Validated**: Based on official Anthropic documentation and Claude API usage patterns
-
-**Auto-Trigger Keywords**:
-- `claude api`, `anthropic api`, `messages api`, `@anthropic-ai/sdk`
-- `claude streaming`, `prompt caching claude`, `claude tool use`, `claude vision`
-- `claude thinking mode`, `claude function calling`, `anthropic messages`
-- Error keywords: `claude streaming error`, `prompt cache not working`, `anthropic 429`
-
----
-
-#### 19. claude-agent-sdk
-**Status**: βœ… Complete (2025-10-25)
-**Priority**: High
-**Dependencies**: None (standalone Agent SDK skill)
-**Actual Dev Time**: 6 hours
-**Token Savings**: ~65%
-**Errors Prevented**: 12
-
-**What It Does**:
-- Complete Claude Agent SDK knowledge (query, tools, MCP, subagents, sessions)
-- Programmatic interaction with Claude Code CLI
-- Custom MCP servers with Zod schema validation
-- Subagent orchestration for specialized tasks
-- Session management (start, resume, fork)
-- Permission control (modes + custom logic)
-- Filesystem settings integration
-- Streaming message handling (all types)
-- Error handling and recovery patterns
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords, 250+ lines)
-- SKILL.md (complete API reference, 1000+ lines)
-- 11 templates:
- * templates/basic-query.ts
- * templates/query-with-tools.ts
- * templates/custom-mcp-server.ts
- * templates/subagents-orchestration.ts
- * templates/session-management.ts
- * templates/permission-control.ts
- * templates/filesystem-settings.ts
- * templates/error-handling.ts
- * templates/multi-agent-workflow.ts
- * templates/package.json
- * templates/tsconfig.json
-- 6 references:
- * references/query-api-reference.md
- * references/mcp-servers-guide.md
- * references/subagents-patterns.md
- * references/permissions-guide.md
- * references/session-management.md
- * references/top-errors.md (12 errors with solutions)
-- scripts/check-versions.sh
-
-**Known Issues Prevented**:
-1. CLI not found error
-2. Authentication failed (missing API key)
-3. Permission denied errors
-4. Context length exceeded
-5. Tool execution timeout
-6. Session not found
-7. MCP server connection failed
-8. Subagent definition errors
-9. Settings file not found
-10. Tool name collision
-11. Zod schema validation errors
-12. Filesystem permission denied
-
-**Production Validated**: Based on official Anthropic Agent SDK documentation
-
-**Auto-Trigger Keywords**:
-- `claude agent sdk`, `@anthropic-ai/claude-agent-sdk`, `query()`, `createSdkMcpServer`
-- `AgentDefinition`, `tool()`, `claude subagents`, `mcp servers claude`
-- `settingSources`, `permissionMode`, `canUseTool`, `forkSession`
-- Error keywords: `CLI not found`, `session not found`, `tool permission denied`
-
----
-
-#### 20. openai-api
-**Status**: βœ… Complete (2025-10-25)
-**Priority**: Critical
-**Dependencies**: None
-**Actual Dev Time**: 7 hours (Phase 1: 3h, Phase 2: 4h)
-**Token Savings**: ~60%
-**Errors Prevented**: 10
-
-**What It Does**:
-- Core OpenAI API endpoints:
- - Chat Completions (GPT-5, GPT-5-mini, GPT-5-nano, GPT-4o, GPT-4 Turbo)
- - Embeddings (text-embedding-3-small, text-embedding-3-large)
- - Images (DALL-E 3 generation, GPT-Image-1 editing)
- - Audio (Whisper transcription, TTS with 11 voices)
- - Moderation (content safety - 11 categories)
-- Streaming with Server-Sent Events (SSE)
-- Function calling (tool use with JSON schemas)
-- Structured outputs with JSON schema (guaranteed valid JSON)
-- Vision (image understanding with GPT-4o)
-- Both Cloudflare Workers (fetch-based) and Node.js (openai SDK)
-
-**Files Created**:
-- SKILL.md (2112 lines - complete API reference)
-- README.md (comprehensive auto-trigger keywords)
-- 15 templates:
- - chat-completion-basic.ts, chat-completion-nodejs.ts
- - streaming-chat.ts, streaming-fetch.ts
- - function-calling.ts, structured-output.ts
- - embeddings.ts, vision-gpt4o.ts
- - image-generation.ts, image-editing.ts
- - audio-transcription.ts, text-to-speech.ts
- - moderation.ts, rate-limit-handling.ts
- - cloudflare-worker.ts, package.json
-- 8 reference docs:
- - models-guide.md (GPT-5 vs GPT-4o comparison)
- - function-calling-patterns.md
- - structured-output-guide.md
- - embeddings-guide.md
- - images-guide.md
- - audio-guide.md
- - cost-optimization.md
- - top-errors.md (10 common issues with solutions)
-- scripts/check-versions.sh
-
-**Known Issues to Prevent**:
-1. Rate limit errors (429) without exponential backoff
-2. Function calling schema validation failures
-3. Streaming SSE parsing errors (incomplete chunks)
-4. Structured output JSON schema mismatches
-5. Vision image encoding issues (base64 format)
-6. Embeddings dimension mismatches (1536 vs 3072)
-7. Audio file format incompatibility (Whisper requirements)
-8. TTS voice availability errors (model-specific voices)
-9. Token counting for billing accuracy
-10. API key exposure in client-side code
-
-**Production Validated**: Ready for immediate use with official OpenAI APIs
-
-**Relationship**: Complements openai-responses skill (stateless vs stateful workflows)
-
-**Auto-Trigger Keywords**:
-- `openai api`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `chatgpt api`, `openai sdk`
-- `openai streaming`, `function calling`, `structured output`, `openai embeddings`
-- `dall-e-3`, `whisper api`, `openai tts`, `text-to-speech`, `moderation api`
-- `gpt-4o`, `vision api`, `image generation`, `audio transcription`
-- Error keywords: `openai rate limit`, `openai 429`, `function calling error`, `embedding dimension`
-
----
-
-#### 21. openai-responses ⭐ NEW!
-**Status**: βœ… Complete (2025-10-25)
-**Priority**: Critical
-**Dependencies**: openai-api (recommended)
-**Actual Dev Time**: 5.5 hours
-**Token Savings**: ~65%
-**Errors Prevented**: 8
-
-**What It Does**:
-- NEW unified Responses API (launched March 2025)
-- Stateful conversations (vs stateless Chat Completions)
-- Built-in Model Context Protocol (MCP) server integration
-- Code Interpreter tool (integrated, no separate API)
-- Image generation (integrated DALL-E support)
-- File search capabilities (RAG without vector stores)
-- Reusable prompts with variables (template system)
-- Session management (automatic conversation history)
-- Both Cloudflare Workers (fetch-based) and Node.js environments
-
-**Files to Create**:
-- README.md (comprehensive auto-trigger keywords emphasizing "new unified API")
-- SKILL.md (complete guide, 700+ lines)
-- templates/basic-response.ts
-- templates/stateful-conversation.ts
-- templates/mcp-server-integration.ts
-- templates/code-interpreter.ts
-- templates/image-generation-integrated.ts
-- templates/file-search.ts
-- templates/reusable-prompts.ts
-- templates/package.json
-- references/responses-vs-chat-completions.md
-- references/mcp-integration-guide.md
-- references/code-interpreter-patterns.md
-- references/session-management.md
-- references/migration-from-chat-completions.md
-- references/top-errors.md (8 common issues)
-- scripts/check-versions.sh
-
-**Known Issues to Prevent**:
-1. Session state not persisting across requests
-2. MCP server connection failures (authentication errors)
-3. Code Interpreter timeout errors (long executions)
-4. Image generation rate limits (DALL-E quotas)
-5. File search relevance issues (query optimization)
-6. Reusable prompt variable substitution errors
-7. Migration from Chat Completions API (breaking changes)
-8. Cost tracking differences (stateful vs stateless pricing)
-
-**Production Validated**: Based on official OpenAI Responses API documentation (March 2025 release)
-
-**Auto-Trigger Keywords**:
-- `openai responses api`, `responses api`, `stateful openai`, `openai mcp`
-- `code interpreter openai`, `openai sessions`, `reusable prompts`, `unified api`
-- `openai march 2025`, `responses vs chat completions`
-- Error keywords: `responses api error`, `mcp server failed`, `session not found`
-
----
-
-#### 22. openai-assistants
-**Status**: βœ… Complete (2025-10-25)
-**Priority**: High
-**Dependencies**: openai-api (recommended)
-**Actual Dev Time**: 5.5 hours
-**Token Savings**: ~55%
-**Errors Prevented**: 12
-
-**What It Does**:
-- Assistants API v2 (threads, runs, messages)
-- Built-in tools:
- - Code Interpreter (data analysis, code execution, chart generation)
- - File Search (RAG with vector stores, up to 10,000 files per assistant)
- - Function Calling (custom tools with JSON schemas)
-- Thread management (conversation persistence across sessions)
-- Runs and streaming runs (real-time execution updates)
-- Vector stores for file search (automatic embeddings)
-- File uploads and management (up to 512MB per file)
-- Both Cloudflare Workers (fetch-based) and Node.js (openai SDK)
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (2100+ lines - complete API reference)
-- templates/basic-assistant.ts
-- templates/code-interpreter-assistant.ts
-- templates/file-search-assistant.ts
-- templates/function-calling-assistant.ts
-- templates/streaming-assistant.ts
-- templates/thread-management.ts
-- templates/vector-store-setup.ts
-- templates/package.json
-- references/assistants-api-v2.md
-- references/code-interpreter-guide.md
-- references/file-search-rag-guide.md
-- references/thread-lifecycle.md
-- references/vector-stores.md
-- references/migration-from-v1.md
-- references/top-errors.md (12 common issues)
-- scripts/check-versions.sh
-
-**Known Issues Prevented**:
-1. Assistant run status polling timeout errors
-2. Vector store indexing delays (async processing)
-3. File search relevance issues (chunking strategy)
-4. Code Interpreter file output not found
-5. Thread message limit exceeded (max 100k messages)
-6. Function calling tool timeout errors
-7. Streaming run interruption handling
-8. Vector store quota limits (storage and retrieval)
-9. File upload format compatibility issues
-10. Assistant instructions token limit (256k max)
-11. Run cancellation race conditions
-12. Thread deletion while run is active
-
-**Production Validated**: Templates tested with [email protected]
-
-**⚠️ Deprecation**: OpenAI plans to sunset Assistants API in H1 2026. Use openai-responses for new projects.
-
-**Auto-Trigger Keywords**:
-- `openai assistants`, `assistants api`, `openai threads`, `openai runs`
-- `code interpreter assistant`, `file search openai`, `vector store openai`
-- `openai rag`, `assistant streaming`, `thread persistence`
-- Error keywords: `assistant run failed`, `vector store error`, `thread not found`
-
----
-
-#### 23. openai-realtime
-**Status**: Planned
-**Priority**: Medium
-**Dependencies**: None
-**Estimated Dev Time**: 4-5 hours
-**Token Savings**: ~50%
-**Errors Prevented**: 8+
-
-**What It Does**:
-- Realtime API for low-latency audio streaming
-- Speech-to-speech (direct audio-to-audio processing)
-- WebSocket connection patterns (persistent bidirectional)
-- Audio input/output handling (PCM16 at 24kHz, Opus codec)
-- Low-latency conversational AI (sub-second responses)
-- Model Context Protocol (MCP) server support
-- Image input support (multimodal with audio)
-- SIP calling integration for phone systems (optional)
-- Server-side WebSocket for Cloudflare Workers
-- Client-side WebSocket for browsers
-
-**Files to Create**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete guide, 800+ lines)
-- templates/realtime-client.ts (browser WebSocket)
-- templates/realtime-server.ts (server WebSocket)
-- templates/speech-to-speech.ts
-- templates/audio-handling.ts
-- templates/mcp-integration.ts
-- templates/image-input.ts
-- templates/cloudflare-worker-websocket.ts
-- templates/package.json
-- references/realtime-api-reference.md
-- references/audio-formats.md
-- references/websocket-patterns.md
-- references/latency-optimization.md
-- references/sip-calling-guide.md
-- references/top-errors.md (8 common issues)
-- scripts/check-versions.sh
-
-**Known Issues to Prevent**:
-1. WebSocket connection establishment failures
-2. Audio format incompatibility (sample rate, codec)
-3. PCM16 encoding errors (incorrect byte order)
-4. WebSocket message buffering issues (latency spikes)
-5. Audio chunk synchronization problems
-6. MCP server connection timeout errors
-7. Image input encoding for multimodal requests
-8. SIP calling authentication failures
-
-**Production Validated**: Based on official OpenAI Realtime API documentation
-
-**Auto-Trigger Keywords**:
-- `openai realtime`, `realtime api`, `speech to speech openai`, `audio streaming`
-- `websocket openai`, `voice ai openai`, `low latency voice`, `sip calling`
-- Error keywords: `realtime connection failed`, `audio format error`, `websocket closed`
-
----
-
-#### 24. openai-batch
-**Status**: Planned
-**Priority**: Medium
-**Dependencies**: openai-api (recommended)
-**Estimated Dev Time**: 3-4 hours
-**Token Savings**: ~50%
-**Errors Prevented**: 6+
-
-**What It Does**:
-- Batch API for async processing (non-urgent workloads)
-- 50% cost discount vs real-time API calls
-- 24-hour result delivery (results available within 1 day)
-- Bulk processing patterns (thousands of requests in one batch)
-- JSONL file format (JSON Lines for batch input/output)
-- Status polling and result retrieval
-- Use cases: model evaluations, classification, synthetic data generation, summarization
-- Both Cloudflare Workers (fetch-based) and Node.js environments
-
-**Files to Create**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete guide, 600+ lines)
-- templates/create-batch.ts
-- templates/poll-status.ts
-- templates/retrieve-results.ts
-- templates/jsonl-formatter.ts
-- templates/evaluation-batch.ts
-- templates/classification-batch.ts
-- templates/package.json
-- references/batch-api-reference.md
-- references/jsonl-format.md
-- references/use-cases.md
-- references/cost-optimization.md
-- references/top-errors.md (6 common issues)
-- scripts/check-versions.sh
-
-**Known Issues to Prevent**:
-1. JSONL formatting errors (invalid line structure)
-2. Batch file size limits (max 100MB)
-3. Batch request limit exceeded (max 50k requests per batch)
-4. Status polling timeout (24-hour window)
-5. Result retrieval before batch completion
-6. Custom ID collisions (duplicate IDs in batch)
-
-**Production Validated**: Based on official OpenAI Batch API documentation
-
-**Auto-Trigger Keywords**:
-- `openai batch`, `batch api`, `async openai`, `bulk processing openai`
-- `openai jsonl`, `batch jobs openai`, `cost optimization openai`, `50% discount`
-- Error keywords: `batch failed`, `jsonl format error`, `batch status error`
-
----
-
-#### 25. openai-agents-sdk ⚠️ Python-only
-**Status**: Planned
-**Priority**: Low (Python-specific)
-**Dependencies**: None
-**Estimated Dev Time**: 6-8 hours
-**Token Savings**: ~60%
-**Errors Prevented**: 10+
-
-**What It Does**:
-- OpenAI Agents SDK (Python framework, MIT license)
-- Multi-agent workflows and orchestration (coordinated agent teams)
-- Agent handoffs (transfer control between specialized agents)
-- Guardrails (input/output validation with custom rules)
-- Sessions (automatic conversation history management)
-- Tracing and observability (visualize agent execution)
-- Comparison with Responses API (TypeScript alternative for web projects)
-- Python 3.9+ required
-
-**Files to Create**:
-- README.md (comprehensive auto-trigger keywords, note Python-only)
-- SKILL.md (complete guide, 900+ lines)
-- templates/basic-agent.py
-- templates/multi-agent-workflow.py
-- templates/handoffs.py
-- templates/guardrails.py
-- templates/sessions.py
-- templates/tracing.py
-- templates/requirements.txt
-- references/agents-sdk-reference.md
-- references/multi-agent-patterns.md
-- references/handoff-strategies.md
-- references/guardrails-guide.md
-- references/tracing-observability.md
-- references/typescript-alternatives.md (Responses API comparison)
-- references/top-errors.md (10 common issues)
-- scripts/check-versions.sh (Python version check)
-
-**Known Issues to Prevent**:
-1. Agent handoff state transfer failures
-2. Guardrail validation rule conflicts
-3. Session storage quota limits
-4. Tracing data not persisting
-5. Multi-agent coordination deadlocks
-6. Python version compatibility issues (3.9+ required)
-7. Dependency conflicts with openai SDK
-8. Agent timeout in long workflows
-9. Handoff loop detection failures
-10. Observability data volume limits
-
-**Production Validated**: Based on official OpenAI Agents SDK (openai-agents-python) documentation
-
-**Auto-Trigger Keywords**:
-- `openai agents sdk`, `openai-agents`, `openai agents python`, `multi-agent openai`
-- `agent handoffs`, `guardrails openai`, `agent sessions`, `openai tracing`
-- Error keywords: `agent handoff failed`, `guardrail validation error`, `session not found`
-
----
-
-#### 26. google-gemini-api
-**Status**: βœ… Complete (2025-10-25) - Phase 1
-**Priority**: Critical
-**Dependencies**: None
-**Actual Dev Time**: 5 hours (Phase 1)
-**Token Savings**: ~65%
-**Errors Prevented**: 15+
-
----
-
-### Batch 6 - UI & Generative UI ⭐⭐
-
-#### 27. thesys-generative-ui
-**Status**: βœ… Complete (2025-10-26)
-**Priority**: High
-**Dependencies**: None (works with any framework)
-**Actual Dev Time**: 3.5 hours
-**Token Savings**: ~65-70%
-**Errors Prevented**: 12
-
-**What It Does**:
-- TheSys C1 Generative UI API integration for React applications
-- Converts LLM responses into streaming, interactive React components
-- All use cases: chat interfaces, data visualization, dynamic forms, search UIs
-- Multi-framework support: Vite+React, Next.js App Router, Cloudflare Workers + Static Assets
-- AI providers: OpenAI (GPT-4, GPT-5), Anthropic (Claude), Cloudflare Workers AI
-- Complete tool calling with Zod schemas
-- Advanced features: thread management, theming, thinking states, message sharing
-- 15+ working templates (5 Vite, 4 Next.js, 3 Workers, 3 shared utilities)
-- 3 reference guides (component API, AI setup, common errors)
-- 2 automation scripts (install dependencies, check versions)
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords, 250+ lines)
-- SKILL.md (6500+ words, complete integration guide)
-- templates/vite-react/ (5 templates: basic-chat, custom-component, tool-calling, theme-dark-mode, package.json)
-- templates/nextjs/ (4 templates: app-page, api-chat-route, tool-calling-route, package.json)
-- templates/cloudflare-workers/ (3 templates: worker-backend, frontend-setup, wrangler.jsonc)
-- templates/shared/ (3 utilities: theme-config, tool-schemas, streaming-utils)
-- references/common-errors.md (12+ errors with solutions)
-- references/component-api.md (complete prop reference)
-- references/ai-provider-setup.md (provider integration guide)
-- scripts/install-dependencies.sh
-- scripts/check-versions.sh
-
-**Known Issues Prevented**:
-1. Empty agent responses (incorrect streaming setup)
-2. Model not following system prompt (message array ordering)
-3. Version compatibility errors (SDK version mismatches)
-4. Theme not applying (missing ThemeProvider)
-5. Streaming not working (missing headers/props)
-6. Tool calling failures (invalid Zod schemas)
-7. Thread state not persisting (in-memory storage)
-8. CSS conflicts (import order issues)
-9. TypeScript type errors (outdated packages)
-10. CORS errors (missing headers)
-11. Rate limiting issues (no retry logic)
-12. Authentication token errors (env var not loaded)
-
-**Production Validated**: Based on official TheSys docs (docs.thesys.dev) and Context7 documentation
-
-**Auto-Trigger Keywords**:
-- `generative ui`, `thesys`, `thesys c1`, `c1 api`, `@thesysai/genui-sdk`
-- `streaming react components`, `ai chat interface`, `interactive ai responses`
-- `llm to ui`, `ai to components`, `chat with charts`, `chat with forms`
-- `tool calling ui`, `interactive chat`, `streaming chat`, `genui`
-- Error keywords: `c1 streaming error`, `genui theme not working`, `thesys api error`
-
-**What It Does** (Phase 1):
-- βœ… Complete Google GenAI SDK coverage using **CORRECT SDK** (@google/genai v1.27+ NOT deprecated @google/generative-ai)
-- βœ… Models: Gemini 2.5 Pro/Flash/Flash-Lite with **ACCURATE context windows** (1,048,576 input tokens NOT 2M!)
-- βœ… Text generation (basic + streaming with async iteration)
-- βœ… Multimodal inputs (text + images + video + audio + PDFs):
- - Images (JPEG, PNG, WebP, up to 20MB)
- - Video (MP4, MOV, AVI, up to 2GB, inline < 2 min)
- - Audio (WAV, MP3, FLAC, up to 20MB)
- - PDFs (up to 30MB)
-- βœ… Function calling (basic + parallel execution)
-- βœ… System instructions & multi-turn chat
-- βœ… Thinking mode configuration (default enabled on 2.5 models)
-- βœ… Generation parameters (temperature, top-p, top-k, stop sequences)
-- βœ… Both Node.js SDK (@google/genai) AND fetch-based (Cloudflare Workers)
-- βœ… Complete SDK migration guide (from deprecated SDK)
-
-**Phase 2** (Future):
-- Context caching (cost optimization)
-- Code execution (Python interpreter)
-- Grounding with Google Search
-- Embeddings API (text-embedding-004)
-- File API (large files >2GB)
-
-**Files Created** (22 total):
-- README.md (comprehensive keywords, migration warnings)
-- SKILL.md (1200+ lines, complete Phase 1 API reference)
-- templates/package.json
-- templates/text-generation-basic.ts
-- templates/text-generation-fetch.ts (Cloudflare Workers)
-- templates/streaming-chat.ts
-- templates/streaming-fetch.ts (SSE parsing)
-- templates/multimodal-image.ts
-- templates/multimodal-video-audio.ts
-- templates/function-calling-basic.ts
-- templates/function-calling-parallel.ts
-- templates/thinking-mode.ts
-- templates/cloudflare-worker.ts
-- references/models-guide.md (ACCURATE 2.5 model specs)
-- references/sdk-migration-guide.md (deprecated β†’ current)
-- references/function-calling-patterns.md
-- references/multimodal-guide.md
-- references/thinking-mode-guide.md
-- references/generation-config.md
-- references/streaming-patterns.md
-- references/top-errors.md (15+ errors with solutions)
-- scripts/check-versions.sh (warns about deprecated SDK)
-
-**Known Issues Prevented** (15+):
-1. Using deprecated SDK (@google/generative-ai instead of @google/genai)
-2. Wrong context window claims (claiming 2M for Gemini 2.5 models)
-3. Model not found errors (using old/wrong model names)
-4. Chat not working with fetch (SDK-only feature)
-5. Function calling on Flash-Lite (not supported!)
-6. Invalid API key (401) errors
-7. Rate limit exceeded (429) errors
-8. Streaming parse errors (incorrect SSE parsing)
-9. Multimodal format errors (wrong base64/MIME types)
-10. Function schema errors (invalid OpenAPI subset)
-11. Thinking mode on old models (only 2.5 supports it)
-12. Parameter conflicts (using unsupported params)
-13. Token counting errors (multimodal estimation)
-14. System instruction placement (wrong position)
-15. Parallel function call errors (dependency handling)
-15. Large file upload failures (network interruptions)
-
-**Production Validated**: Based on official Google AI documentation and Gemini API usage patterns
-
-**Auto-Trigger Keywords**:
-- `google gemini`, `gemini api`, `gemini 2.5`, `genai sdk`, `@google/generative-ai`
-- `gemini vision`, `gemini video`, `gemini audio`, `gemini pdf`, `long context gemini`
-- `gemini function calling`, `gemini embeddings`, `gemini code execution`, `gemini grounding`
-- `2m tokens`, `context caching gemini`, `structured output gemini`, `multimodal gemini`
-- Error keywords: `gemini rate limit`, `gemini safety filter`, `file api error`, `context too long`
-
----
-
-## πŸ—οΈ Development Workflow
-
-### Step-by-Step Process:
-
-1. **Plan** (30 min)
- - Define auto-trigger keywords
- - List known issues to prevent
- - Sketch template structure
-
-2. **Build** (3-8 hours)
- - Create README.md with keywords
- - Write SKILL.md documentation
- - Develop templates
- - Add examples (optional)
- - Create automation scripts (optional)
-
-3. **Test** (1 hour)
- - Symlink to ~/.claude/skills/
- - Test auto-discovery with Claude
- - Verify templates work
- - Measure token savings
-
-4. **Document** (30 min)
- - Update this roadmap
- - Add to main README.md
- - Document token metrics
-
-5. **Deploy** (15 min)
- - Commit to git
- - Push to GitHub
- - Verify public repo updated
-
----
-
-## πŸ“¦ Skill Template Standard
-
-Every skill MUST include:
-
-### Required Files:
-```
-skills/[skill-name]/
-β”œβ”€β”€ README.md # Auto-trigger keywords
-β”œβ”€β”€ SKILL.md # Complete docs
-└── templates/ # File templates
-```
-
-### Optional Files:
-```
-β”œβ”€β”€ examples/ # Working examples
-β”œβ”€β”€ scripts/ # Automation
-└── reference/ # Deep-dive docs
-```
-
-### README.md Structure:
-- Auto-trigger keywords (Primary, Secondary, Error-based)
-- What the skill does (bullet points)
-- Known issues prevented (table)
-- When to use / when not to use
-- Quick usage example
-- Token efficiency metrics
-
-### SKILL.md Structure:
-- Detailed setup instructions
-- Configuration examples
-- Critical rules (Always Do / Never Do)
-- Common issues & fixes
-- Dependencies list
-- Reference links
-
----
-
-## πŸ§ͺ Testing Protocol
-
-For each skill, verify:
-
-### 1. Auto-Discovery Test
-```
-1. Start fresh Claude Code session
-2. Ask: "Set up [trigger keyword]"
-3. Verify: Claude finds and suggests skill
-4. Measure: Tokens used to suggest skill
-```
-
-### 2. Template Test
-```
-1. Copy templates to new project
-2. Run: pnpm install (if applicable)
-3. Run: pnpm dev or pnpm build
-4. Verify: No errors, everything works
-```
-
-### 3. Token Efficiency Test
-```
-Manual Setup:
-1. Fresh chat, no skill
-2. Ask Claude to set up [technology]
-3. Note: Total tokens used
-4. Count: Errors encountered
-
-With Skill:
-1. Fresh chat, skill installed
-2. Ask Claude to set up [technology]
-3. Note: Total tokens used
-4. Count: Errors encountered
-
-Calculate:
-- Savings % = ((Manual - Skill) / Manual) Γ— 100
-- Error reduction = Manual errors - Skill errors
-```
-
----
-
-## πŸ“ˆ Progress Tracking
-
-### Overall Progress:
-- **Completed**: 50 skills βœ…
-- **In Main Table Below**: 39 skills detailed
-- **Not in Table** (11 skills): vercel-kv, vercel-blob, neon-vercel-postgres, fastmcp, typescript-mcp, project-planning, project-session-management, nextjs, sveltia-cms, zustand-state-management, open-source-contributions
-- **Batch 1 - Cloudflare Foundation**: 9/9 complete (100%) 🎯
-- **Batch 2 - AI SDK & Auth & Frameworks**: 6/6 complete (100%) 🎯
-- **Batch 3 - Cloudflare Advanced**: 6/6 complete (100%) 🎯
-- **Batch 4 - Data & Utilities**: 2/2 complete (100%) 🎯
-- **Batch 5 - AI API/SDK Suite**: 9/9 complete (100%) 🎯
-- **Batch 6 - UI & Generative UI**: 1/1 complete (100%) 🎯
-- **Batch 7 - Development & Contribution Tools**: 1/1 complete (100%) 🎯
-- **New Planned**: 1 skill (cloudflare-sandboxing)
-
-### Skills by Status:
-
-| Skill | Status | Dev Time | Token Savings | Errors Prevented | Priority |
-|-------|--------|----------|---------------|------------------|----------|
-| **tailwind-v4-shadcn** | **βœ… Complete** | **6h** | **~70%** | **3** | High |
-| **cloudflare-worker-base** | **βœ… Complete** | **2h** | **~60%** | **6** | Critical |
-| **firecrawl-scraper** | **βœ… Complete** | **1.5h** | **~60%** | **6** | Medium |
-| **cloudflare-d1** | **βœ… Complete** | **2.5h** | **~58%** | **6** | Critical |
-| **cloudflare-r2** | **βœ… Complete** | **2.5h** | **~60%** | **6** | High |
-| **cloudflare-kv** | **βœ… Complete** | **3h** | **~55%** | **6** | High |
-| **cloudflare-workers-ai** | **βœ… Complete** | **5h** | **~60%** | **6** | High |
-| **cloudflare-vectorize** | **βœ… Complete** | **3h** | **~65%** | **8** | Medium |
-| **cloudflare-queues** | **βœ… Complete** | **3h** | **~50%** | **8** | Medium |
-| **cloudflare-images** | **βœ… Complete** | **5.5h** | **~60%** | **13** | High |
-| **cloudflare-agents** | **βœ… Complete** | **18h** | **~65%** | **15** | Critical |
-| **cloudflare-nextjs** | **βœ… Complete** | **4h** | **~59%** | **10** | High |
-| **ai-sdk-core** | **βœ… Complete** | **6h** | **~58%** | **12** | Critical |
-| **ai-sdk-ui** | **βœ… Complete** | **6h** | **~55%** | **12** | Critical |
-| **cloudflare-durable-objects** | **βœ… Complete** | **8h** | **~66%** | **18** | Critical |
-| **clerk-auth** | **βœ… Complete** | **6h** | **~67%** | **10** | Critical |
-| **hono-routing** | **βœ… Complete** | **4h** | **~56%** | **8** | High |
-| **react-hook-form-zod** | **βœ… Complete** | **4h** | **~60%** | **12** | High |
-| **cloudflare-workflows** | **βœ… Complete** | **4h** | **~67%** | **5** | Critical |
-| **cloudflare-hyperdrive** | **βœ… Complete** | **5h** | **~58%** | **10** | High |
-| **cloudflare-browser-rendering** | **βœ… Complete** | **5h** | **~52%** | **8** | Medium |
-| **cloudflare-cron-triggers** | **βœ… Complete** | **3.5h** | **~45%** | **4** | Medium |
-| **cloudflare-email-routing** | **βœ… Complete** | **4h** | **~48%** | **5** | Medium |
-| **tanstack-query** | **βœ… Complete** | **4h** | **~55%** | **8** | Medium |
-| **drizzle-orm-d1** | **βœ… Complete** | **5.5h** | **~60%** | **12** | High |
-| **claude-api** | **βœ… Complete** | **6h** | **~62%** | **8** | Critical |
-| **claude-agent-sdk** | **βœ… Complete** | **7h** | **~65%** | **10** | High |
-| **openai-api** | **βœ… Complete** | **7h** | **~60%** | **8** | Critical |
-| **openai-responses** | **βœ… Complete** | **5.5h** | **~65%** | **6** | Critical |
-| **openai-assistants** | **βœ… Complete** | **6h** | **~58%** | **10** | High |
-| **openai-agents** | **βœ… Complete** | **8h** | **~63%** | **12** | High |
-| **google-gemini-api** | **βœ… Complete** | **8h** | **~65%** | **8** | Critical |
-| **google-gemini-embeddings** | **βœ… Complete** | **4h** | **~60%** | **6** | Medium |
-| **thesys-generative-ui** | **βœ… Complete** | **6h** | **~62%** | **8** | High |
-
-**Total Skills In Table**: 48 (all complete βœ…)
-**Total Skills In Repo**: 50 (all complete βœ…)
-**Not in Table**: 11 skills (all complete) - vercel-kv, vercel-blob, neon-vercel-postgres, fastmcp, typescript-mcp, project-planning, project-session-management, nextjs, sveltia-cms, zustand-state-management, open-source-contributions
-**Planned Next**: cloudflare-sandboxing
-
----
-
-## 🎯 Success Criteria
-
-A skill is considered "complete" when:
-
-βœ… README.md has comprehensive auto-trigger keywords
-βœ… SKILL.md provides step-by-step instructions
-βœ… Templates are tested and work without errors
-βœ… Token savings >= 50% vs manual setup
-βœ… Auto-discovery works reliably
-βœ… Known errors are prevented
-βœ… Production-tested in real project
-βœ… Committed to Git + pushed to GitHub
-
----
-
-## πŸ”„ Maintenance Plan
-
-### Weekly:
-- Check for dependency updates
-- Test skills with latest Claude Code
-- Review community issues
-
-### Monthly:
-- Update outdated templates
-- Add new auto-trigger keywords based on usage
-- Improve documentation based on feedback
-
-### Quarterly:
-- Major version bumps for dependencies
-- Add new skills based on demand
-- Archive deprecated skills
-
----
-
-## πŸš€ Future Skills (Backlog)
-
-### Batch 7 - Development & Contribution Tools ⭐
-
-#### open-source-contributions
-**Status**: βœ… Complete (2025-11-05)
-**Priority**: High
-**Dependencies**: None
-**Actual Dev Time**: 6 hours
-**Token Savings**: ~70%
-**Errors Prevented**: 15
-
-**What It Does**:
-- Complete guide to contributing to open source projects professionally
-- Pre-PR cleanup scripts (removes SESSION.md, planning/*, screenshots, temp test files)
-- PR description templates (What/Why/How structure)
-- Commit message guide (Conventional Commits format)
-- Communication best practices with maintainers
-- Common mistakes prevention (15 documented issues)
-- Complete checklists for pre-contribution, development, cleanup, submission
-- Good vs bad PR examples
-
-**Files Created**:
-- README.md (comprehensive auto-trigger keywords)
-- SKILL.md (complete guide, 2,500+ lines)
-- scripts/pre-pr-check.sh (scans for artifacts, validates PR size, checks branch)
-- scripts/clean-branch.sh (removes personal files safely)
-- references/pr-template.md (What/Why/How format)
-- references/pr-checklist.md (complete pre-submission checklist)
-- references/commit-message-guide.md (Conventional Commits)
-- references/files-to-exclude.md (comprehensive exclusion patterns)
-- assets/good-pr-example.md (well-structured PR)
-- assets/bad-pr-example.md (common mistakes to avoid)
-
-**Known Issues Prevented**:
-1. Including personal artifacts (SESSION.md, NOTES.md, planning/)
-2. Submitting debug screenshots
-3. Including temporary test files
-4. Not reading CONTRIBUTING.md
-5. Submitting massive PRs (>400 lines)
-6. Not testing before submission
-7. Ignoring code style standards
-8. Poor commit messages
-9. Not linking issues properly
-10. Including unrelated changes
-11. Committing secrets
-12. Not updating documentation
-13. Ignoring CI failures
-14. Being impatient or unresponsive
-15. Not discussing large changes first
-
-**Production Validated**: Based on GitHub official guides, real-world maintainer feedback, and community best practices
-
-**Auto-Trigger Keywords**:
-- `submit PR to`, `contribute to`, `pull request for`, `open source contribution`
-- `create pull request`, `PR to`, `contributing to`, `clean up PR`, `prepare pull request`
-- Error keywords: `personal artifacts in PR`, `pr too large`, `commit secrets`
-
----
-
-### New Skill: cloudflare-sandboxing
-
-**Status**: Planned (2025-10-29)
-**Priority**: High
-**Estimated Dev Time**: 4-6 hours
-**Token Savings**: ~55% (estimated)
-**Errors Prevented**: 8+ (estimated)
-
-**Goal**: Comprehensive skill for Cloudflare Sandboxing API - create isolated execution environments for running untrusted code safely.
-
-**What It Does**:
-- Sandbox creation and configuration
-- Code execution in isolated environments
-- Timeout and resource limit management
-- Security best practices
-- Error handling patterns
-- Integration with Workers
-
-**Use Cases**:
-- Code playgrounds and REPLs
-- User-submitted script execution
-- Plugin systems
-- Multi-tenant applications
-- AI code generation testing
-
-**Documentation References**:
-- Cloudflare Sandboxing docs
-- Worker binding patterns
-- Security considerations
-
-**Templates to Include**:
-- Basic sandbox execution
-- Timeout handling
-- Error boundaries
-- Resource limits
-
----
-
-### Planned Enhancement: cloudflare-full-stack-scaffold v2.0
-
-**Status**: Planned (2025-10-24)
-**Type**: Major enhancement to existing skill
-**Priority**: High
-**Estimated Dev Time**: 12-15 hours
-
-**Goal**: Make the full-stack scaffold more comprehensive with real-time features, advanced AI pipelines, and production-ready file uploads.
-
-**Approach**: Opt-in scripts (maintain current pattern like enable-auth.sh)
-
-**Features to Add**:
-
-**1. Real-time Features** (3 opt-in scripts):
-- `enable-realtime-chat.sh` - Durable Objects chat room with WebSocket Hibernation, message history, presence tracking
-- `enable-collaborative-editing.sh` - Multi-user document editing with operational transforms, conflict resolution
-- `enable-live-notifications.sh` - Server-sent events for real-time updates (messages, status changes, job completion)
-
-**2. AI Capability Pipelines** (4 opt-in scripts):
-- `enable-rag-pipeline.sh` - Complete RAG: Upload docs β†’ Vectorize embeddings β†’ Workers AI retrieval β†’ Stream response with sources
-- `enable-multi-agent.sh` - Multi-agent orchestration using cloudflare-agents SDK (research β†’ writer β†’ editor)
-- `enable-ai-database.sh` - Natural language β†’ SQL queries, AI-powered data analysis, chat with D1 database
-- `enable-ai-vision.sh` - Image/video/audio processing β†’ text extraction β†’ embeddings β†’ multimodal search
-
-**3. Comprehensive File Uploads** (1 opt-in script):
-- `enable-file-uploads.sh` - Drag-drop, multiple files, previews (images/PDFs), progress bars, error handling, presigned URLs, client-side R2 uploads
-
-**New Backend Routes** (8 total):
-- `backend/routes/realtime-chat.ts` (Durable Object)
-- `backend/routes/collaborative-editing.ts` (Durable Object)
-- `backend/routes/live-notifications.ts` (SSE)
-- `backend/routes/rag-pipeline.ts` (Vectorize + Workers AI)
-- `backend/routes/multi-agent.ts` (cloudflare-agents SDK)
-- `backend/routes/ai-database.ts` (natural language β†’ SQL)
-- `backend/routes/ai-vision.ts` (multimodal processing)
-- `backend/routes/file-uploads.ts` (R2 presigned URLs)
-
-**New Frontend Components** (8 total):
-- `src/components/RealtimeChat.tsx`
-- `src/components/CollaborativeEditor.tsx`
-- `src/components/LiveNotifications.tsx`
-- `src/components/FileUploader.tsx`
-- `src/pages/RAGDemo.tsx`
-- `src/pages/MultiAgentDemo.tsx`
-- `src/pages/AIDatabaseChat.tsx`
-- `src/pages/VisionDemo.tsx`
-
-**Documentation Updates**:
-- Update `docs/ARCHITECTURE.md` with real-time and AI pipeline patterns
-- Update `scaffold/README.md` with all new features
-- Add comprehensive examples to SKILL.md
-- Update token savings metrics (estimated ~85% vs building from scratch)
-
-**Why These Features**:
-- **Real-time**: Essential for modern collaborative apps, chat interfaces, live dashboards
-- **AI pipelines**: Showcase integration between multiple Cloudflare services (D1 + Vectorize + Workers AI + R2)
-- **File uploads**: Missing UI component despite R2 being configured - common requirement
-- **All opt-in**: Keeps base scaffold simple, users enable only what they need
-
-**Token Savings**: ~85% (estimated) vs building these features from scratch
-**Production Value**: Transforms scaffold from "starter" to "production-ready for AI-powered SaaS"
-
----
-
-### High Demand:
-- **stripe-payments**: Stripe integration (webhooks, subscriptions, checkout)
-- **resend-email**: Email with Resend API (templates, transactional)
-- **cloudflare-images**: Image optimization and transformations
-- **authjs-auth**: Auth.js integration (alternative to Clerk)
-
-### Medium Demand:
-- **vitest-testing**: Testing with Vitest (unit, integration)
-- **playwright-e2e**: E2E testing setup
-- **sentry-monitoring**: Error tracking and performance monitoring
-- **posthog-analytics**: Product analytics integration
-- **vite-react**: Standalone Vite + React (no Cloudflare)
-
-### Low Demand:
-- **cloudflare-browser-rendering**: Puppeteer on Workers
-- **cloudflare-durable-objects**: Durable Objects patterns
-- **nextjs-setup**: Next.js best practices
-- **prisma-d1**: Prisma ORM for D1 (if Drizzle not sufficient)
-
-### Composite Skills (After Atomic Skills Complete):
-- **cloudflare-full-stack-starter**: References multiple atomic skills for quick starts
-- **saas-starter**: Complete SaaS stack (auth + db + payments + email)
-
----
-
-## πŸ“ž Community Feedback
-
-### How to Suggest Skills:
-1. Open GitHub issue with "Skill Request" label
-2. Describe the problem it solves
-3. Estimate token savings potential
-4. Provide example use case
-
-### How to Report Issues:
-1. Open GitHub issue with "Skill Bug" label
-2. Specify which skill
-3. Describe the problem
-4. Include steps to reproduce
-
----
-
-## πŸ“Š Metrics Dashboard
-
-### Token Efficiency (Atomic Skills):
-- Manual setup (per service): 8,000-15,000 tokens
-- With atomic skill: 3,000-5,000 tokens
-- **Average savings per skill: ~55-60%**
-
-### Composite Task Efficiency:
-- Manual full-stack setup: 50,000-70,000 tokens
-- With 4-5 atomic skills composed: 15,000-25,000 tokens
-- **Total savings: ~65-70%**
-
-### Error Prevention:
-- Manual setup: 2-4 errors average per service
-- With atomic skills: 0 errors
-- **Error reduction: 100%**
-
-### Time Savings:
-- Manual setup: 2-4 hours per service
-- With atomic skills: 15-30 minutes
-- **Time savings: ~85%**
-
-### Atomic Architecture Benefits:
-- βœ… Skills are reusable across different stacks
-- βœ… Update once, benefit everywhere
-- βœ… Claude composes skills automatically
-- βœ… Users only load what they need
-
----
-
-**Last Updated**: 2025-11-05 (51 skills complete! Added open-source-contributions skill)
-**Next Review**: 2025-12-05
-**Maintainer**: Jeremy Dawes | [email protected]
diff --git a/planning/hugo-skill/IMPLEMENTATION_PHASES.md b/planning/hugo-skill/IMPLEMENTATION_PHASES.md
deleted file mode 100644
index 48c18273..00000000
--- a/planning/hugo-skill/IMPLEMENTATION_PHASES.md
+++ /dev/null
@@ -1,346 +0,0 @@
-# Implementation Phases: Hugo Static Site Generator Skill
-
-**Project Type**: Claude Code Skill
-**Stack**: Hugo SSG + Cloudflare Workers Static Assets + Sveltia CMS
-**Estimated Total**: 18-22 hours (~18-22 minutes human time with Claude Code)
-
----
-
-## Phase 1: Research & Validation
-**Type**: Research
-**Estimated**: 3-4 hours
-**Files**: planning/research-logs/hugo.md, test-hugo-project/ (temporary)
-
-**Tasks**:
-- [ ] Install Hugo Extended (latest version v0.152.2)
-- [ ] Create test Hugo blog project with PaperMod theme
-- [ ] Integrate Sveltia CMS with Hugo test project
-- [ ] Configure wrangler.jsonc for Workers Static Assets
-- [ ] Deploy test project to Cloudflare Workers
-- [ ] Test TinaCMS integration (document limitations)
-- [ ] Reproduce all 7-9 documented errors from research
-- [ ] Document error reproduction steps and solutions
-- [ ] Capture screenshots of working setup
-- [ ] Record package versions and dependencies
-
-**Verification Criteria**:
-- [ ] Hugo Extended installed and `hugo version` shows v0.152.2+
-- [ ] Test blog builds successfully with `hugo` command
-- [ ] PaperMod theme renders correctly
-- [ ] Sveltia CMS admin interface accessible at `/admin`
-- [ ] Can create/edit/delete posts via Sveltia CMS
-- [ ] Workers deployment successful (`wrangler deploy` works)
-- [ ] Static assets served correctly from Workers
-- [ ] All 7-9 errors reproduced and documented with solutions
-- [ ] Research log complete with findings and evidence
-
-**Exit Criteria**: Complete understanding of Hugo setup, Sveltia integration, Workers deployment, and all common errors documented with solutions.
-
----
-
-## Phase 2: Skill Structure Setup
-**Type**: Infrastructure
-**Estimated**: 1-2 hours
-**Files**: skills/hugo/SKILL.md, skills/hugo/README.md, skills/hugo/.gitignore
-
-**Tasks**:
-- [ ] Create `skills/hugo/` directory from template
-- [ ] Copy SKILL-TEMPLATE.md to skills/hugo/SKILL.md
-- [ ] Copy README-TEMPLATE.md to skills/hugo/README.md
-- [ ] Fill YAML frontmatter (name, description, license, metadata)
-- [ ] Write description with "Use when" scenarios
-- [ ] Add comprehensive keywords (technologies, use cases, errors)
-- [ ] Create directory structure (scripts/, templates/, references/, assets/)
-- [ ] Create .gitignore for skill directory
-- [ ] Add auto-trigger keywords to README.md
-- [ ] Write initial "What This Skill Does" section
-
-**Verification Criteria**:
-- [ ] YAML frontmatter valid (name: "hugo", description present)
-- [ ] Description includes 3+ "Use when" scenarios
-- [ ] Keywords include: hugo, static-site, blog, documentation, sveltia-cms, cloudflare-workers
-- [ ] Directory structure matches official standards
-- [ ] README.md has clear auto-trigger keywords section
-- [ ] .gitignore includes node_modules, .hugo_build.lock, public/, resources/
-
-**Exit Criteria**: Skill directory structure complete and compliant with official Anthropic standards.
-
----
-
-## Phase 3: Core Hugo Documentation (SKILL.md)
-**Type**: Documentation
-**Estimated**: 3-4 hours
-**Files**: skills/hugo/SKILL.md (main content)
-
-**Tasks**:
-- [ ] Write "Installation" section (Hugo Extended vs Standard, methods)
-- [ ] Document version requirements and compatibility
-- [ ] Write "Project Structure" section (content/, layouts/, static/, themes/, config/)
-- [ ] Document configuration files (hugo.yaml vs hugo.toml, recommended format)
-- [ ] Write "Configuration" section (baseURL, theme, taxonomies, params)
-- [ ] Document content organization (sections, taxonomies, frontmatter)
-- [ ] Write "Themes" section (installation methods, customization, popular themes)
-- [ ] Document Hugo Modules vs Git submodules
-- [ ] Write "Content Management" section (content types, archetypes, frontmatter formats)
-- [ ] Document templating basics (Go templates, partials, shortcodes)
-- [ ] Write "Build & Development" section (hugo server, hugo, flags)
-- [ ] Document advanced features (multilingual, image processing, Sass/SCSS)
-
-**Verification Criteria**:
-- [ ] Installation section covers all methods (binary, Homebrew, Docker, NPM)
-- [ ] Extended vs Standard differences clearly explained
-- [ ] Directory structure diagram included
-- [ ] Configuration examples provided for both YAML and TOML
-- [ ] Theme installation patterns documented (Git submodules recommended)
-- [ ] Frontmatter format comparison table (YAML vs TOML)
-- [ ] Build commands documented with common flags
-- [ ] Advanced features documented with links to official docs
-
-**Exit Criteria**: SKILL.md contains comprehensive Hugo documentation covering installation through advanced features, all in imperative form.
-
----
-
-## Phase 4: Template Creation
-**Type**: Implementation
-**Estimated**: 5-6 hours
-**Files**:
-- skills/hugo/templates/hugo-blog/
-- skills/hugo/templates/hugo-docs/
-- skills/hugo/templates/hugo-landing/
-- skills/hugo/templates/minimal-starter/
-
-**Tasks**:
-- [ ] Create hugo-blog template (PaperMod theme)
- - [ ] hugo.yaml configuration
- - [ ] content/ structure with sample posts
- - [ ] PaperMod theme as Git submodule reference
- - [ ] static/ directory with favicon
- - [ ] .gitignore
- - [ ] README.md with setup instructions
-- [ ] Create hugo-docs template
- - [ ] hugo.yaml for documentation site
- - [ ] content/ structure with nested sections
- - [ ] Docs theme configuration
- - [ ] Sidebar navigation setup
- - [ ] Search configuration
- - [ ] README.md
-- [ ] Create hugo-landing template
- - [ ] hugo.yaml for landing page
- - [ ] Single-page structure
- - [ ] Sections layout (hero, features, CTA)
- - [ ] Minimal theme or custom layouts
- - [ ] README.md
-- [ ] Create minimal-starter template
- - [ ] Bare hugo.yaml
- - [ ] Empty directories (content/, layouts/, static/)
- - [ ] No theme
- - [ ] README.md with customization guide
-
-**Verification Criteria**:
-- [ ] All 4 templates build successfully with `hugo` command
-- [ ] Each template has complete hugo.yaml configuration
-- [ ] Sample content renders correctly
-- [ ] Themes properly configured (where applicable)
-- [ ] READMEs explain setup and customization
-- [ ] .gitignore files present and correct
-- [ ] Templates use YAML format (not TOML) for Sveltia compatibility
-- [ ] Frontmatter in all templates follows consistent YAML format
-
-**Exit Criteria**: All 4 Hugo templates functional, documented, and ready to copy into user projects.
-
----
-
-## Phase 5: Sveltia CMS Integration
-**Type**: Integration
-**Estimated**: 2-3 hours
-**Files**:
-- skills/hugo/templates/sveltia-cms/
-- skills/hugo/references/sveltia-integration-guide.md
-
-**Tasks**:
-- [ ] Create Sveltia CMS config template (static/admin/config.yml)
-- [ ] Configure collections for Hugo content types (posts, pages, docs)
-- [ ] Set up frontmatter templates for each content type
-- [ ] Configure media folder (static/images)
-- [ ] Set up GitHub/GitLab backend configuration
-- [ ] Document Sveltia + Hugo workflow in SKILL.md
-- [ ] Create integration guide in references/
-- [ ] Document YAML vs TOML frontmatter for Sveltia (YAML required)
-- [ ] Add Sveltia admin files to hugo-blog template
-- [ ] Add Sveltia admin files to hugo-docs template
-- [ ] Document OAuth setup for Sveltia (Cloudflare Workers proxy)
-- [ ] Write troubleshooting guide for common Sveltia + Hugo issues
-
-**Verification Criteria**:
-- [ ] config.yml template valid (Sveltia CMS loads without errors)
-- [ ] Collections configured for posts, pages, docs
-- [ ] Frontmatter widgets match Hugo's expected fields
-- [ ] Media uploads work (images saved to static/images/)
-- [ ] GitHub backend configuration documented
-- [ ] OAuth setup documented (Cloudflare Workers proxy pattern)
-- [ ] Integration guide covers setup from scratch
-- [ ] YAML frontmatter enforced (TOML issues documented)
-- [ ] Sveltia + Hugo workflow tested end-to-end
-
-**Exit Criteria**: Sveltia CMS fully integrated with Hugo templates, configuration templates ready, comprehensive integration guide written.
-
----
-
-## Phase 6: Workers Deployment & CI/CD
-**Type**: Integration
-**Estimated**: 2-3 hours
-**Files**:
-- skills/hugo/templates/wrangler/wrangler.jsonc
-- skills/hugo/templates/github-actions/deploy.yml
-- skills/hugo/scripts/deploy-workers.sh
-- skills/hugo/references/workers-deployment-guide.md
-
-**Tasks**:
-- [ ] Create wrangler.jsonc template for Hugo static assets
-- [ ] Configure assets directory (./public)
-- [ ] Set html_handling and not_found_handling options
-- [ ] Create GitHub Actions workflow for auto-deployment
-- [ ] Configure Hugo version in workflow
-- [ ] Add build and deploy steps
-- [ ] Create manual deployment script (deploy-workers.sh)
-- [ ] Document Workers vs Pages deployment in SKILL.md
-- [ ] Write deployment guide in references/
-- [ ] Document environment variables (CLOUDFLARE_API_TOKEN)
-- [ ] Add optional Worker script examples (redirects, headers)
-- [ ] Document custom domain setup
-- [ ] Create troubleshooting guide for deployment issues
-
-**Verification Criteria**:
-- [ ] wrangler.jsonc template valid (wrangler deploy works)
-- [ ] assets.directory set to "./public"
-- [ ] html_handling set to "auto-trailing-slash"
-- [ ] GitHub Actions workflow runs successfully
-- [ ] Hugo version pinned in workflow
-- [ ] Manual script deploys successfully
-- [ ] Deployment guide covers both manual and CI/CD
-- [ ] Optional Worker script examples work (redirects tested)
-- [ ] Custom domain setup documented
-
-**Exit Criteria**: Complete deployment workflow documented and tested, templates ready for both manual and automated deployment.
-
----
-
-## Phase 7: Error Prevention Documentation
-**Type**: Documentation
-**Estimated**: 2-3 hours
-**Files**: skills/hugo/references/common-errors.md, SKILL.md (errors section)
-
-**Tasks**:
-- [ ] Document Error 1: Version Mismatch (Hugo vs Hugo Extended)
- - [ ] Cause, symptoms, solution, prevention
- - [ ] Link to GitHub issue or source
-- [ ] Document Error 2: baseURL Configuration Errors
- - [ ] Cause, symptoms, solution, prevention
-- [ ] Document Error 3: TOML vs YAML Configuration Confusion
- - [ ] Cause, symptoms, solution, prevention
-- [ ] Document Error 4: Hugo Version Mismatch (Local vs Deployment)
- - [ ] Cause, symptoms, solution, prevention
-- [ ] Document Error 5: Content Frontmatter Format Errors
- - [ ] Cause, symptoms, solution, prevention
-- [ ] Document Error 6: Theme Not Found Errors
- - [ ] Cause, symptoms, solution, prevention
-- [ ] Document Error 7: Date Time Warp Issues
- - [ ] Cause, symptoms, solution, prevention
-- [ ] Document Error 8: Public Folder Conflicts
- - [ ] Cause, symptoms, solution, prevention
-- [ ] Document Error 9: Module Cache Issues
- - [ ] Cause, symptoms, solution, prevention
-- [ ] Add error prevention section to SKILL.md
-- [ ] Create quick reference table of errors
-
-**Verification Criteria**:
-- [ ] All 9 errors documented with cause, symptoms, solution, prevention
-- [ ] Each error has link to source (GitHub issue, docs, Stack Overflow)
-- [ ] Solutions tested and verified working
-- [ ] Prevention tips included for each error
-- [ ] SKILL.md has prominent "Common Errors" section
-- [ ] Quick reference table created (error, symptom, fix)
-- [ ] Error documentation is actionable (clear steps)
-
-**Exit Criteria**: All 9 common Hugo errors comprehensively documented with verified solutions and prevention strategies.
-
----
-
-## Phase 8: Example Project & Verification
-**Type**: Testing
-**Estimated**: 3-4 hours
-**Files**: examples/hugo-sveltia-workers/, skills/hugo/ (final touches)
-
-**Tasks**:
-- [ ] Create example project using hugo-blog template
-- [ ] Configure Sveltia CMS for example project
-- [ ] Set up wrangler.jsonc for Workers deployment
-- [ ] Add sample blog posts (3-5 posts)
-- [ ] Configure PaperMod theme
-- [ ] Add GitHub Actions workflow
-- [ ] Deploy example to Cloudflare Workers
-- [ ] Test Sveltia CMS admin interface on deployed site
-- [ ] Verify all templates work (copy each, test build)
-- [ ] Install skill to ~/.claude/skills/hugo
-- [ ] Test skill discovery (ask Claude Code to use skill)
-- [ ] Verify auto-trigger keywords work
-- [ ] Run ONE_PAGE_CHECKLIST.md verification
-- [ ] Update CHANGELOG.md
-- [ ] Create production evidence document
-- [ ] Take screenshots of working example
-
-**Verification Criteria**:
-- [ ] Example project builds successfully
-- [ ] Example deploys to Workers without errors
-- [ ] Sveltia CMS admin accessible and functional
-- [ ] All 4 templates tested and working
-- [ ] Skill installed in ~/.claude/skills/
-- [ ] Claude Code discovers skill automatically when "Hugo" mentioned
-- [ ] Auto-trigger keywords working
-- [ ] ONE_PAGE_CHECKLIST.md passes 100%
-- [ ] CHANGELOG.md updated with version and changes
-- [ ] Production evidence documented
-
-**Exit Criteria**: Working example project deployed, all templates verified, skill discoverable and compliant with standards, ready for production use.
-
----
-
-## Notes
-
-**Testing Strategy**: Build real example project (hugo-sveltia-workers) to validate all templates and documentation.
-
-**Deployment Strategy**: Deploy example project to Cloudflare Workers to prove deployment workflow works.
-
-**Context Management**: Phases sized to fit in single sessions with clear verification criteria. Can clear context after each phase if needed.
-
-**Token Efficiency Target**: 60-65% savings (8,000-10,000 tokens) vs manual Hugo setup.
-
-**Standards Compliance**: Follow official Anthropic standards per planning/claude-code-skill-standards.md and planning/STANDARDS_COMPARISON.md.
-
----
-
-## Phase Dependencies
-
-```
-Phase 1 (Research)
- ↓
-Phase 2 (Structure)
- ↓
-Phase 3 (Documentation) ← Can run parallel with Phase 4
-Phase 4 (Templates) ← Can run parallel with Phase 3
- ↓
-Phase 5 (Sveltia CMS) ← Depends on Phase 4 templates
- ↓
-Phase 6 (Workers Deployment) ← Can run parallel with Phase 7
-Phase 7 (Error Docs) ← Can run parallel with Phase 6
- ↓
-Phase 8 (Example & Verification)
-```
-
-**Parallelization Opportunities**: Phases 3 & 4 can overlap, Phases 6 & 7 can overlap.
-
----
-
-**Total Estimated Time**: 18-22 hours (~18-22 minutes human time)
-**Total Files Created**: ~50+ files (skill, templates, references, example)
-**Production Ready**: After Phase 8 verification
diff --git a/planning/hugo-skill/SESSION.md b/planning/hugo-skill/SESSION.md
deleted file mode 100644
index 934ec918..00000000
--- a/planning/hugo-skill/SESSION.md
+++ /dev/null
@@ -1,273 +0,0 @@
-# Session State - Hugo Skill Development
-
-**Current Phase**: Testing Complete βœ…
-**Current Stage**: Hugo skill production-ready
-**Last Checkpoint**: Skill tested and verified (2025-11-04, commit 63df90c)
-**Planning Docs**: `planning/hugo-skill/IMPLEMENTATION_PHASES.md`, `planning/hugo-skill/hugo-skill-spec.md`, `planning/hugo-skill/hugo-templates-inventory.md`
-
----
-
-## Phase 1: Research & Validation βœ…
-**Type**: Research | **Estimated**: 3-4 hours | **Actual**: ~1 hour
-**Spec**: `planning/hugo-skill/IMPLEMENTATION_PHASES.md#phase-1`
-**Completed**: 2025-11-04
-
-**Status**: Mostly complete (error reproduction deferred to later phases)
-
-**Completed Tasks**:
-- [x] Install Hugo Extended v0.152.2
-- [x] Create test Hugo blog project with PaperMod theme
-- [x] Integrate Sveltia CMS with Hugo test project
-- [x] Configure wrangler.jsonc for Workers Static Assets
-- [x] Deploy test project to Cloudflare Workers (https://hugo-blog-test.webfonts.workers.dev)
-- [x] Test TinaCMS integration (documented limitations - not recommended)
-- [x] Document findings in research log
-
-**Deferred Tasks** (will do during skill development):
-- [ ] Reproduce all 9 documented errors
-- [ ] Capture final screenshots
-
-**Key Findings**:
-- Hugo + Sveltia + Workers stack is production-ready βœ…
-- Build time: 24ms (extremely fast)
-- Deployment: ~21 seconds total
-- Sveltia CMS strongly preferred over TinaCMS
-- YAML config recommended over TOML
-
-**Files Created**:
-- `planning/research-logs/hugo.md` (comprehensive research log)
-- `test-hugo-project/hugo-blog-test/` (working test project)
-
----
-
-## Phase 2: Skill Structure Setup βœ…
-**Type**: Infrastructure | **Estimated**: 1-2 hours | **Actual**: ~30 min
-**Spec**: `planning/hugo-skill/IMPLEMENTATION_PHASES.md#phase-2`
-**Completed**: 2025-11-04
-
-**Status**: Complete
-
-**Completed Tasks**:
-- [x] Create `skills/hugo/` directory
-- [x] Create SKILL.md with comprehensive Hugo documentation
-- [x] Create README.md with auto-trigger keywords
-- [x] Fill YAML frontmatter (name: hugo, description, keywords, metadata)
-- [x] Write "Use when" scenarios (10+ scenarios)
-- [x] Add comprehensive keywords (50+ keywords across categories)
-- [x] Create directory structure (scripts/, templates/, references/, assets/)
-- [x] Create .gitignore
-- [x] Add auto-trigger keywords to README (primary, secondary, error-based)
-- [x] Write "What This Skill Does" section
-
-**Key Achievements**:
-- SKILL.md: 400+ lines, comprehensive documentation
-- README.md: Auto-trigger keywords, token metrics, error table
-- Directory structure: All subdirectories created
-- YAML frontmatter: Complete with metadata (version, hugo_version, production_tested, etc.)
-
-**Files Created**:
-- `skills/hugo/SKILL.md` (comprehensive documentation)
-- `skills/hugo/README.md` (auto-trigger keywords, quick reference)
-- `skills/hugo/.gitignore`
-- `skills/hugo/{scripts,templates,references,assets}/` (directories)
-
----
-
-## Phase 3: Core Hugo Documentation βœ…
-**Type**: Documentation | **Estimated**: 3-4 hours | **Actual**: Integrated into Phase 2
-**Spec**: `planning/hugo-skill/IMPLEMENTATION_PHASES.md#phase-3`
-**Completed**: 2025-11-04 (as part of SKILL.md creation)
-
-**Status**: Complete (documentation integrated into SKILL.md during Phase 2)
-
-**Note**: Core Hugo documentation was completed as part of SKILL.md creation in Phase 2. No separate documentation phase needed.
-
----
-
-## Phase 4: Template Creation βœ…
-**Type**: Implementation | **Estimated**: 5-6 hours | **Actual**: ~3 hours
-**Spec**: `planning/hugo-skill/IMPLEMENTATION_PHASES.md#phase-4`
-**Completed**: 2025-11-04
-
-**Status**: Complete (all 4 templates created)
-
-**Completed Tasks**:
-- [x] hugo-blog template (PaperMod theme, Sveltia CMS, GitHub Actions, comprehensive README)
-- [x] minimal-starter template (bare-bones, customization guide, no theme)
-- [x] hugo-docs template (Hugo Book theme, search, navigation, TOC, comprehensive README)
-- [x] hugo-landing template (custom layouts, responsive CSS, all sections, comprehensive README)
-
-**Templates Created**:
-1. **hugo-blog**: Production-ready blog with PaperMod theme
- - Full PaperMod theme (143 files)
- - Sveltia CMS integration
- - GitHub Actions workflow
- - Comprehensive README with all features
-
-2. **minimal-starter**: Bare-bones starter
- - No theme (clean slate)
- - Basic configuration
- - Deployment files
- - Customization guide
-
-3. **hugo-docs**: Documentation site with Hugo Book
- - Hugo Book theme (Git submodule)
- - Full-text search
- - Nested navigation
- - Sample documentation structure
- - Comprehensive README
-
-4. **hugo-landing**: Marketing landing page
- - Custom layouts (no theme)
- - Responsive CSS
- - Hero, Features, Testimonials, CTA sections
- - Configuration-driven content
- - Comprehensive README
-
-**Files Created**:
-- `skills/hugo/templates/hugo-blog/` - Blog template (145+ files)
-- `skills/hugo/templates/minimal-starter/` - Minimal starter (12 files)
-- `skills/hugo/templates/hugo-docs/` - Docs template (150+ files)
-- `skills/hugo/templates/hugo-landing/` - Landing template (15 files)
-- All templates include README.md, wrangler.jsonc, GitHub Actions, .gitignore
-
-**Key Achievements**:
-- All 4 templates production-tested (builds verified)
-- Comprehensive READMEs (100+ lines each)
-- Deployment-ready (Workers + GitHub Actions)
-- Cover all major Hugo use cases
-
----
-
-## Phase 5: Sveltia CMS Integration ⏸️
-**Type**: Integration | **Estimated**: 2-3 hours
-**Spec**: `planning/hugo-skill/IMPLEMENTATION_PHASES.md#phase-5`
-
----
-
-## Phase 6: Workers Deployment & CI/CD ⏸️
-**Type**: Integration | **Estimated**: 2-3 hours
-**Spec**: `planning/hugo-skill/IMPLEMENTATION_PHASES.md#phase-6`
-
----
-
-## Phase 7: Error Prevention Documentation ⏸️
-**Type**: Documentation | **Estimated**: 2-3 hours
-**Spec**: `planning/hugo-skill/IMPLEMENTATION_PHASES.md#phase-7`
-
----
-
-## Phase 8: Example Project & Verification ⏸️
-**Type**: Testing | **Estimated**: 3-4 hours
-**Spec**: `planning/hugo-skill/IMPLEMENTATION_PHASES.md#phase-8`
-
----
-
-## Project Summary
-
-**Goal**: Create comprehensive Hugo static site generator skill for Claude Code
-
-**Scope**:
-- Comprehensive Hugo coverage (all features)
-- 4 production-ready templates (blog, docs, landing, minimal)
-- Workers Static Assets deployment (primary)
-- Sveltia CMS integration (primary), TinaCMS (secondary)
-- GitHub Actions CI/CD automation
-- 9 documented errors with solutions
-- Real example project for validation
-
-**Total Estimated**: 18-22 hours (~18-22 minutes human time)
-
-**Target Metrics**:
-- Token savings: 60-65% (8,000-10,000 tokens)
-- Errors prevented: 9 documented
-- Templates: 4 complete
-- Standards compliance: 100%
-
----
-
-## Notes
-
-**Hugo Version**: Target v0.152.2 Extended
-**Deployment**: Cloudflare Workers Static Assets (not Pages)
-**CMS**: Sveltia CMS (primary recommendation)
-**Configuration Format**: YAML preferred over TOML (better CMS compatibility)
-
-**Related Skills**:
-- sveltia-cms (perfect complement)
-- cloudflare-worker-base (deployment synergy)
-- tailwind-v4-shadcn (styling integration)
-- tinacms (secondary CMS option)
-
----
-
-## Progress Summary (2025-11-04)
-
-**Completed**: Phases 1, 2, 3 (integrated), 4 (complete), Testing (complete)
-**Status**: Hugo skill is production-ready and verified βœ…
-**Time Invested**: ~5 hours (vs 18-22 estimated for full completion with optional phases)
-
-### What's Complete βœ…
-1. **Research & Validation** βœ… - Hugo + Sveltia + Workers stack verified
-2. **Skill Structure** βœ… - Complete SKILL.md (400+ lines), README.md
-3. **Core Documentation** βœ… - Integrated into SKILL.md
-4. **Templates** βœ… - 4/4 complete (blog, minimal, docs, landing = 100% coverage)
-5. **Test Deployment** βœ… - Live at https://hugo-blog-test.webfonts.workers.dev
-6. **Skill Installation** βœ… - Installed to ~/.claude/skills/hugo
-7. **Template Testing** βœ… - All 4 templates build successfully (7-31ms)
-8. **Verification** βœ… - 100% compliance with official standards
-9. **Documentation** βœ… - CHANGELOG.md updated, test results documented
-
-### Testing Results βœ…
-- **Installation**: βœ… Pass (symlink created successfully)
-- **SKILL.md structure**: βœ… Pass (valid YAML, comprehensive docs)
-- **README.md keywords**: βœ… Pass (100+ auto-trigger keywords)
-- **Template builds**: βœ… Pass (4/4 templates build successfully)
-- **Deployment configs**: βœ… Pass (wrangler.jsonc + GitHub Actions)
-- **Documentation quality**: βœ… Pass (100-400 lines per template)
-- **Error prevention**: βœ… Pass (9/9 errors documented and tested)
-- **Standards compliance**: βœ… Pass (100% adherence to official spec)
-
-### Build Performance βœ…
-- minimal-starter: 4 pages in 8ms βœ…
-- hugo-landing: 6 pages in 7ms βœ…
-- hugo-blog: 20 pages in 24ms βœ…
-- hugo-docs: 16 pages in 31ms βœ…
-
-### What's Pending (Optional Enhancement Phases) ⏸️
-- Sveltia CMS integration guide (Phase 5) - Basic integration already in hugo-blog template
-- Workers deployment guide (Phase 6) - Already covered in SKILL.md and template READMEs
-- Error documentation detail (Phase 7) - All 9 errors already documented in SKILL.md
-- Example project verification (Phase 8) - Already have working test deployment
-
-### Key Achievement
-**The Hugo skill is production-ready and fully verified!** With:
-- Comprehensive SKILL.md documentation (400+ lines)
-- 4 complete templates covering all major use cases:
- - Blog (PaperMod + Sveltia)
- - Documentation (Hugo Book)
- - Landing page (custom)
- - Minimal starter (blank slate)
-- Production-tested deployment
-- All 9 errors documented in SKILL.md
-- Comprehensive READMEs for each template (100-400 lines each)
-- Complete test results (HUGO_SKILL_TEST_RESULTS.md)
-- CHANGELOG.md updated with v1.0.0 entry
-
-### Current Status
-**Status**: βœ… Complete and Production-Ready
-**Skill Version**: 1.0.0
-**Templates**: 4/4 (blog, minimal, docs, landing)
-**Production Tested**: Yes (hugo-blog-test.webfonts.workers.dev)
-**Installed**: Yes (~/.claude/skills/hugo)
-**Test Results**: HUGO_SKILL_TEST_RESULTS.md (100% pass rate)
-**Last Commit**: 63df90c (2025-11-04)
-
-### Recommendation
-**Hugo skill is complete!** βœ… Ready for production use.
-
-**Next Session Options**:
-1. Move to next skill in roadmap
-2. Add optional enhancement phases if desired (scripts/, references/, assets/)
-3. Test skill with real user scenarios
-4. Archive SESSION.md to planning/hugo-skill/
diff --git a/planning/hugo-skill/hugo-skill-spec.md b/planning/hugo-skill/hugo-skill-spec.md
deleted file mode 100644
index b9c4e2e1..00000000
--- a/planning/hugo-skill/hugo-skill-spec.md
+++ /dev/null
@@ -1,636 +0,0 @@
-# Hugo Skill Specification
-
-**Skill Name**: hugo
-**Version**: 1.0.0
-**Status**: Planning
-**Last Updated**: 2025-11-04
-
----
-
-## YAML Frontmatter
-
-```yaml
-name: hugo
-description: |
- Use this skill when building static websites with Hugo static site generator.
-
- This skill should be used when setting up Hugo projects (blogs, documentation sites, landing pages), integrating with Sveltia CMS or TinaCMS for content management, deploying to Cloudflare Workers with Static Assets, configuring themes and templates, and preventing common Hugo setup errors.
-
- The skill covers Hugo Extended installation, project scaffolding, configuration (hugo.yaml/toml), content organization, theme integration (Git submodules, Hugo Modules), Sveltia CMS integration (primary recommendation), TinaCMS integration (with limitations), Cloudflare Workers Static Assets deployment, CI/CD with GitHub Actions, and solutions for 9 documented common errors including version mismatches, baseURL configuration, TOML/YAML confusion, theme errors, and deployment issues.
-
- Production tested with Hugo v0.152.2, Sveltia CMS, and Cloudflare Workers. Includes 4 ready-to-use templates (blog, docs, landing page, minimal starter) and comprehensive error prevention documentation.
-
-license: MIT
-
-metadata:
- version: "1.0.0"
- hugo_version: "0.152.2"
- last_verified: "2025-11-04"
- production_tested: true
- token_savings: "60-65%"
- errors_prevented: 9
- templates_included: 4
-```
-
----
-
-## Comprehensive Keywords
-
-### Technologies
-- hugo
-- hugo-extended
-- static-site-generator
-- ssg
-- go-templates
-- hugo-themes
-- hugo-modules
-- papermod
-- goldmark
-- markdown
-
-### Use Cases
-- blog
-- documentation
-- docs-site
-- landing-page
-- marketing-site
-- portfolio
-- static-website
-- jamstack
-- content-site
-- knowledge-base
-
-### CMS Integration
-- sveltia-cms
-- tina-cms
-- headless-cms
-- content-management
-- git-based-cms
-- netlify-cms
-- decap-cms
-
-### Deployment
-- cloudflare-workers
-- workers-static-assets
-- cloudflare-pages
-- wrangler
-- static-hosting
-- edge-deployment
-- cdn
-
-### Build & Development
-- hugo-server
-- hugo-build
-- live-reload
-- hot-reload
-- hugo-pipes
-- asset-pipeline
-- sass
-- scss
-- postcss
-- tailwindcss
-
-### Content & Structure
-- frontmatter
-- yaml-frontmatter
-- toml-config
-- content-types
-- taxonomies
-- archetypes
-- sections
-- shortcodes
-- partials
-
-### Advanced Features
-- multilingual
-- i18n
-- image-processing
-- hugo-image-resize
-- syntax-highlighting
-- sitemap
-- rss-feed
-- json-feed
-
-### Common Errors
-- version-mismatch
-- baseurl-error
-- theme-not-found
-- toml-vs-yaml
-- hugo-extended
-- build-errors
-- deployment-errors
-- date-warp
-- module-cache
-
-### CI/CD
-- github-actions
-- gitlab-ci
-- automated-deployment
-- continuous-deployment
-- build-automation
-
----
-
-## Auto-Trigger Keywords
-
-Claude Code should **automatically propose** using this skill when the user mentions:
-
-**Primary Triggers** (high confidence):
-- "hugo" or "Hugo"
-- "hugo blog"
-- "hugo documentation"
-- "hugo site"
-- "static site generator"
-
-**Secondary Triggers** (medium confidence):
-- "static website" + "blog"
-- "documentation site" + "markdown"
-- "sveltia cms" (often used with Hugo)
-- "cloudflare pages" + "static"
-- "fast static site"
-
-**Context Triggers** (low confidence, ask first):
-- "blog" (could be many frameworks)
-- "docs" or "documentation" (could be many tools)
-- "markdown website" (could be many SSGs)
-
----
-
-## Scope Definition
-
-### In Scope (Comprehensive Coverage)
-
-**Installation & Setup**:
-- Hugo Extended vs Standard (differences, when to use each)
-- Installation methods (binary, Homebrew, Docker, NPM wrapper)
-- Version management and compatibility
-- System requirements
-
-**Project Structure**:
-- Directory structure (content/, layouts/, static/, themes/, data/, assets/)
-- Configuration files (hugo.yaml vs hugo.toml, best practices)
-- Content organization (sections, bundles, leaf vs branch)
-- Theme structure and customization
-
-**Configuration**:
-- hugo.yaml/toml syntax and options
-- baseURL configuration (critical for deployment)
-- Taxonomies (tags, categories, custom)
-- Parameters and site config
-- Environment-specific configs (config/production/, config/development/)
-- Menu configuration
-- Permalinks and URL structure
-
-**Content Management**:
-- Frontmatter formats (YAML recommended, TOML documented)
-- Content types and archetypes
-- Page bundles (leaf vs branch bundles)
-- Shortcodes (built-in and custom)
-- Markdown configuration (Goldmark)
-
-**Themes**:
-- Installation methods (Git submodules, Hugo Modules, manual)
-- Popular themes (PaperMod, Ananke, Academic, Book, Docsy)
-- Theme customization (layouts override, partials, CSS)
-- Creating custom themes (basic patterns)
-
-**Templating**:
-- Go template syntax (basics)
-- Partials and blocks
-- Data files (YAML, JSON, TOML)
-- Variables and functions
-- Conditionals and loops
-
-**Build & Development**:
-- hugo server (development server, live reload)
-- hugo (production build)
-- Build flags (--minify, --buildFuture, --baseURL, etc)
-- Asset pipeline (Hugo Pipes)
-- PostCSS, Sass/SCSS support
-- TailwindCSS integration
-
-**Sveltia CMS Integration** (Primary CMS):
-- config.yml configuration for Hugo
-- Collections setup (posts, pages, docs)
-- Frontmatter templates
-- Media library configuration
-- Workflow setup (editorial workflow)
-- GitHub/GitLab backend
-- OAuth setup (Cloudflare Workers proxy pattern)
-- YAML frontmatter requirement
-
-**TinaCMS Integration** (Secondary CMS):
-- Tina Cloud configuration
-- Content schema for Hugo
-- Frontmatter compatibility (YAML only)
-- Limitations (no visual editing, sidebar only)
-- When to use vs Sveltia
-
-**Cloudflare Workers Deployment** (Primary):
-- wrangler.jsonc configuration
-- Assets directory setup (./public)
-- html_handling and not_found_handling
-- Manual deployment (hugo && wrangler deploy)
-- GitHub Actions workflow
-- Environment variables
-- Custom domain setup
-- Optional Worker scripts (redirects, headers, auth)
-
-**Cloudflare Pages Deployment** (Alternative):
-- Build configuration
-- Framework preset
-- Environment variables (HUGO_VERSION)
-- baseURL configuration
-- Custom domains
-- When to use vs Workers
-
-**Advanced Features**:
-- Multilingual/i18n setup (basic and advanced)
-- Image processing (resize, fit, fill, filters)
-- Syntax highlighting (Chroma)
-- Related content
-- Sitemap and RSS generation
-- Custom output formats (JSON, AMP, etc)
-- Content summaries
-- Table of contents
-
-**Error Prevention**:
-- All 9 documented errors with solutions
-- Debugging techniques
-- Common gotchas
-- Troubleshooting guide
-
-### Out of Scope (Link to Docs)
-
-**Advanced Topics** (link to official docs):
-- Deep Hugo Modules development
-- Complex custom template functions
-- Advanced Hugo Pipes (custom processors)
-- Render hooks (deep customization)
-- Complex data transformations
-- Server-side JavaScript execution
-
-**Platform-Specific** (outside skill focus):
-- Netlify-specific features
-- Vercel-specific features
-- AWS Amplify setup
-- Self-hosted server deployments
-
-**Non-Hugo Concerns**:
-- Git basics (assume user knows Git)
-- Domain registration
-- DNS management (except Cloudflare basics)
-- SEO strategy (content-level only)
-- Analytics setup (brief mention only)
-
----
-
-## Templates Inventory
-
-### 1. Hugo Blog (PaperMod Theme)
-**Location**: skills/hugo/templates/hugo-blog/
-**Purpose**: Ready-to-use blog with popular PaperMod theme
-**Files**:
-- hugo.yaml (blog configuration)
-- content/posts/ (sample blog posts)
-- .gitmodules (PaperMod theme reference)
-- static/images/ (sample images)
-- static/admin/ (Sveltia CMS config)
-- .gitignore
-- README.md
-
-**Features**:
-- Dark/light mode
-- Search
-- Archive page
-- Tags and categories
-- Social links
-- RSS feed
-- Syntax highlighting
-
-### 2. Hugo Docs Site
-**Location**: skills/hugo/templates/hugo-docs/
-**Purpose**: Documentation site with sidebar navigation
-**Files**:
-- hugo.yaml (docs configuration)
-- content/docs/ (nested documentation structure)
-- .gitmodules (docs theme)
-- static/admin/ (Sveltia CMS config)
-- .gitignore
-- README.md
-
-**Features**:
-- Nested sidebar navigation
-- Search functionality
-- Version selector
-- Edit page links
-- Table of contents
-- Code blocks with syntax highlighting
-
-### 3. Hugo Landing Page
-**Location**: skills/hugo/templates/hugo-landing/
-**Purpose**: Marketing/landing page template
-**Files**:
-- hugo.yaml (landing configuration)
-- content/_index.md (homepage)
-- layouts/ (custom section layouts)
-- static/images/ (marketing assets)
-- .gitignore
-- README.md
-
-**Features**:
-- Hero section
-- Features grid
-- Testimonials
-- CTA sections
-- Contact form
-- Responsive design
-
-### 4. Minimal Starter
-**Location**: skills/hugo/templates/minimal-starter/
-**Purpose**: Bare-bones Hugo project for custom builds
-**Files**:
-- hugo.yaml (minimal config)
-- content/ (empty)
-- layouts/ (empty)
-- static/ (empty)
-- .gitignore
-- README.md
-
-**Features**:
-- No theme
-- Clean slate for custom development
-- Minimal configuration
-- Setup guide for adding themes
-
----
-
-## Scripts Inventory
-
-### 1. init-hugo.sh
-**Location**: skills/hugo/scripts/init-hugo.sh
-**Purpose**: Automated Hugo project setup
-**Usage**: `./init-hugo.sh blog my-blog`
-**Arguments**: [template-type] [project-name]
-**Functions**:
-- Checks Hugo Extended installation
-- Copies specified template
-- Initializes Git repository
-- Optionally installs theme as submodule
-- Creates initial commit
-- Prints next steps
-
-### 2. deploy-workers.sh
-**Location**: skills/hugo/scripts/deploy-workers.sh
-**Purpose**: Manual deployment to Cloudflare Workers
-**Usage**: `./deploy-workers.sh`
-**Functions**:
-- Runs `hugo --minify`
-- Validates build output
-- Runs `wrangler deploy`
-- Checks deployment success
-- Prints deployed URL
-
-### 3. check-versions.sh
-**Location**: skills/hugo/scripts/check-versions.sh
-**Purpose**: Verify Hugo version and compatibility
-**Usage**: `./check-versions.sh`
-**Functions**:
-- Checks Hugo version
-- Verifies Hugo Extended
-- Checks wrangler version
-- Validates Node.js version (if using npm wrapper)
-- Compares local vs CI Hugo versions
-- Prints compatibility warnings
-
----
-
-## References Inventory
-
-### 1. sveltia-integration-guide.md
-**Location**: skills/hugo/references/sveltia-integration-guide.md
-**Content**:
-- Complete Sveltia + Hugo setup
-- config.yml template
-- Collections configuration
-- OAuth setup (Cloudflare Workers proxy)
-- Workflow examples
-- Troubleshooting
-
-### 2. workers-deployment-guide.md
-**Location**: skills/hugo/references/workers-deployment-guide.md
-**Content**:
-- wrangler.jsonc configuration
-- Manual deployment steps
-- GitHub Actions workflow
-- Environment variables
-- Custom domain setup
-- Optional Worker scripts
-- Troubleshooting
-
-### 3. common-errors.md
-**Location**: skills/hugo/references/common-errors.md
-**Content**:
-- All 9 errors documented
-- Error symptoms
-- Root causes
-- Solutions (step-by-step)
-- Prevention tips
-- Links to sources
-
-### 4. theme-customization-guide.md
-**Location**: skills/hugo/references/theme-customization-guide.md
-**Content**:
-- Overriding layouts
-- Custom partials
-- CSS customization
-- Adding custom shortcodes
-- Theme update workflow
-
-### 5. hugo-vs-alternatives.md
-**Location**: skills/hugo/references/hugo-vs-alternatives.md
-**Content**:
-- Hugo vs Next.js (static)
-- Hugo vs Astro
-- Hugo vs Jekyll
-- When to choose Hugo
-- Migration considerations
-
----
-
-## Assets Inventory
-
-### 1. Screenshots
-**Location**: skills/hugo/assets/screenshots/
-- hugo-blog-example.png
-- sveltia-admin-interface.png
-- workers-deployment-success.png
-- theme-customization.png
-
-### 2. Diagrams
-**Location**: skills/hugo/assets/diagrams/
-- hugo-directory-structure.svg
-- deployment-workflow.svg
-- sveltia-oauth-flow.svg
-
----
-
-## Error Prevention Documentation
-
-### Error 1: Version Mismatch (Hugo vs Hugo Extended)
-**Cause**: Theme requires SCSS support (Hugo Extended), user installs standard Hugo
-**Symptoms**: Build fails with "SCSS/SASS support not enabled"
-**Solution**: Install Hugo Extended edition
-**Prevention**: Always install Hugo Extended unless you're certain you don't need SCSS
-**Source**: https://gohugo.io/installation/
-
-### Error 2: baseURL Configuration Errors
-**Cause**: `baseURL` in config doesn't match deployment URL
-**Symptoms**: Broken CSS/JS/image links, 404s on assets
-**Solution**: Set correct `baseURL` or use `-b $CF_PAGES_URL` flag
-**Prevention**: Use environment-specific configs or build flag
-**Source**: Hugo docs, Cloudflare Pages guide
-
-### Error 3: TOML vs YAML Configuration Confusion
-**Cause**: Mixing TOML and YAML config files, or wrong format for CMS
-**Symptoms**: Config not loading, CMS frontmatter errors
-**Solution**: Standardize on YAML (better CMS compatibility)
-**Prevention**: Use hugo.yaml from start, not hugo.toml
-**Source**: Sveltia CMS docs, Hugo config docs
-
-### Error 4: Hugo Version Mismatch (Local vs Deployment)
-**Cause**: Different Hugo versions locally vs CI/CD
-**Symptoms**: Features work locally but fail in deployment
-**Solution**: Pin `HUGO_VERSION` environment variable
-**Prevention**: Document Hugo version in README, set in CI/CD
-**Source**: Cloudflare Pages docs, GitHub Actions hugo-setup
-
-### Error 5: Content Frontmatter Format Errors
-**Cause**: YAML vs TOML delimiters (`---` vs `+++`), invalid syntax
-**Symptoms**: Content files don't render, build errors
-**Solution**: Validate frontmatter, use consistent format
-**Prevention**: Use YAML (`---`), validate with Sveltia CMS
-**Source**: Hugo content management docs
-
-### Error 6: Theme Not Found Errors
-**Cause**: Theme installed but not configured, or Git submodule issues
-**Symptoms**: Blank site, "theme not found"
-**Solution**: Set `theme` in config, use `git submodule add` for themes
-**Prevention**: Always run `git submodule update --init --recursive`
-**Source**: Hugo themes docs, Git submodules guide
-
-### Error 7: Date Time Warp Issues (Netlify/Cloudflare)
-**Cause**: Future-dated posts published locally but not in production
-**Symptoms**: Content missing on deployed site
-**Solution**: Use `--buildFuture` flag or fix post dates
-**Prevention**: Set `date` in frontmatter to current/past date
-**Source**: Hugo date handling docs
-
-### Error 8: Public Folder Conflicts
-**Cause**: Pushing `public/` folder to Git when it should be build output
-**Symptoms**: Stale content, Git conflicts
-**Solution**: Add `public/` to `.gitignore`
-**Prevention**: Never commit `public/`, rebuild on deployment
-**Source**: Hugo project structure docs
-
-### Error 9: Module Cache Issues
-**Cause**: Corrupted Hugo Modules cache
-**Symptoms**: "failed to extract shortcode", module errors
-**Solution**: `hugo mod clean`, clear cache
-**Prevention**: Periodically run `hugo mod tidy`
-**Source**: Hugo modules docs, GitHub issues
-
----
-
-## Token Efficiency Estimate
-
-### Without Skill (~13,000-16,000 tokens)
-1. **Installation research**: ~1,500 tokens (Extended vs Standard, methods)
-2. **Project structure**: ~2,000 tokens (directories, config files)
-3. **Theme setup**: ~2,000 tokens (installation, configuration, customization)
-4. **CMS integration**: ~2,500 tokens (Sveltia config, frontmatter, OAuth)
-5. **Deployment**: ~1,500 tokens (wrangler, Workers, GitHub Actions)
-6. **Error troubleshooting**: ~3,500-5,000 tokens (7-9 errors, trial-and-error)
-
-### With Skill (~5,000-6,000 tokens)
-1. **Skill discovery**: ~100 tokens
-2. **Skill loading (SKILL.md)**: ~3,500 tokens
-3. **Template selection**: ~500 tokens
-4. **Project-specific adjustments**: ~1,000 tokens
-
-### Token Savings
-- **Absolute**: ~8,000-10,000 tokens saved
-- **Percentage**: ~60-65% reduction
-- **Errors prevented**: 100% (all 9 errors documented with solutions)
-
----
-
-## Production Testing Evidence
-
-**Test Project**: examples/hugo-sveltia-workers/
-**Hugo Version**: v0.152.2 Extended
-**Theme**: PaperMod
-**CMS**: Sveltia CMS
-**Deployment**: Cloudflare Workers Static Assets
-**Deployed URL**: [TBD after Phase 8]
-
-**Test Results**:
-- [ ] Hugo Extended installs correctly
-- [ ] All 4 templates build successfully
-- [ ] PaperMod theme renders correctly
-- [ ] Sveltia CMS admin accessible at `/admin`
-- [ ] Can create/edit/delete content via Sveltia
-- [ ] Wrangler deployment successful
-- [ ] Static assets served from Workers
-- [ ] GitHub Actions workflow runs successfully
-- [ ] All 9 errors reproduced and solved
-
----
-
-## Maintenance Plan
-
-**Quarterly Review** (every 3 months):
-- Check Hugo version (update if stable release)
-- Verify PaperMod theme compatibility
-- Check Sveltia CMS for updates
-- Update wrangler.jsonc if API changes
-- Re-test all templates
-- Update "Last Verified" date
-
-**On Breaking Changes**:
-- Update SKILL.md with migration notes
-- Update templates
-- Add migration guide to references/
-- Bump skill version
-
-**On Error Discovery**:
-- Document new error in common-errors.md
-- Add solution to SKILL.md
-- Update error count in metadata
-
----
-
-## Success Metrics
-
-**Quality**:
-- βœ… 100% compliance with official Anthropic standards
-- βœ… Production tested with working example
-- βœ… All package versions current
-- βœ… 9 errors documented with solutions
-
-**Efficiency**:
-- βœ… 60-65% token savings
-- βœ… 100% error prevention (vs manual setup)
-- βœ… 4 ready-to-use templates
-- βœ… First-try skill discovery rate: 95%+
-
-**Adoption**:
-- βœ… Deployed example project
-- βœ… Comprehensive documentation
-- βœ… Easy integration with existing skills (sveltia-cms, cloudflare-worker-base)
-
----
-
-**Last Updated**: 2025-11-04
-**Next Review**: 2026-02-04 (Quarterly)
-**Status**: Ready for Phase 1 (Research & Validation)
diff --git a/planning/hugo-skill/hugo-templates-inventory.md b/planning/hugo-skill/hugo-templates-inventory.md
deleted file mode 100644
index b69060a8..00000000
--- a/planning/hugo-skill/hugo-templates-inventory.md
+++ /dev/null
@@ -1,803 +0,0 @@
-# Hugo Templates Inventory
-
-**Project**: Hugo Skill for Claude Code
-**Templates**: 4 complete Hugo project templates
-**Last Updated**: 2025-11-04
-
----
-
-## Overview
-
-The Hugo skill includes 4 production-ready templates for different use cases. Each template is fully functional, documented, and ready to copy into user projects.
-
-**Common Features Across All Templates**:
-- YAML configuration (not TOML) for Sveltia CMS compatibility
-- .gitignore configured correctly
-- README.md with setup instructions
-- wrangler.jsonc for Cloudflare Workers deployment
-- Optimized for Cloudflare Workers Static Assets
-
----
-
-## Template 1: Hugo Blog (PaperMod Theme)
-
-### Purpose
-Complete blog setup with the popular PaperMod theme, ready for immediate use.
-
-### Location
-`skills/hugo/templates/hugo-blog/`
-
-### Directory Structure
-```
-hugo-blog/
-β”œβ”€β”€ .gitignore
-β”œβ”€β”€ .gitmodules
-β”œβ”€β”€ README.md
-β”œβ”€β”€ wrangler.jsonc
-β”œβ”€β”€ hugo.yaml
-β”œβ”€β”€ content/
-β”‚ β”œβ”€β”€ _index.md
-β”‚ β”œβ”€β”€ about.md
-β”‚ β”œβ”€β”€ archives.md
-β”‚ β”œβ”€β”€ search.md
-β”‚ └── posts/
-β”‚ β”œβ”€β”€ _index.md
-β”‚ β”œβ”€β”€ first-post.md
-β”‚ β”œβ”€β”€ second-post.md
-β”‚ └── third-post.md
-β”œβ”€β”€ static/
-β”‚ β”œβ”€β”€ favicon.ico
-β”‚ β”œβ”€β”€ images/
-β”‚ β”‚ └── sample-post-image.jpg
-β”‚ └── admin/
-β”‚ β”œβ”€β”€ index.html
-β”‚ └── config.yml
-β”œβ”€β”€ themes/
-β”‚ └── PaperMod/ (Git submodule)
-└── .github/
- └── workflows/
- └── deploy.yml
-```
-
-### hugo.yaml Configuration
-```yaml
-baseURL: "https://example.com/"
-title: "My Hugo Blog"
-theme: "PaperMod"
-languageCode: "en-us"
-defaultContentLanguage: "en"
-enableRobotsTXT: true
-buildDrafts: false
-buildFuture: false
-buildExpired: false
-enableEmoji: true
-pygmentsUseClasses: true
-summaryLength: 30
-
-minify:
- disableXML: true
- minifyOutput: true
-
-params:
- env: production
- title: "My Hugo Blog"
- description: "A blog built with Hugo and PaperMod"
- keywords: [Blog, Portfolio, PaperMod]
- author: "Your Name"
- images: ["/images/og-image.jpg"]
- DateFormat: "January 2, 2006"
- defaultTheme: auto # dark, light, auto
- disableThemeToggle: false
-
- ShowReadingTime: true
- ShowShareButtons: true
- ShowPostNavLinks: true
- ShowBreadCrumbs: true
- ShowCodeCopyButtons: true
- ShowWordCount: true
- ShowRssButtonInSectionTermList: true
- UseHugoToc: true
- disableSpecial1stPost: false
- disableScrollToTop: false
- comments: false
- hidemeta: false
- hideSummary: false
- showtoc: true
- tocopen: false
-
- assets:
- disableHLJS: true
- disableFingerprinting: false
-
- label:
- text: "My Hugo Blog"
- icon: /favicon.ico
- iconHeight: 35
-
- profileMode:
- enabled: false
- title: "Welcome"
- subtitle: "A blog built with Hugo"
- imageUrl: "/images/profile.jpg"
- imageWidth: 120
- imageHeight: 120
- imageTitle: "Profile"
- buttons:
- - name: Posts
- url: posts
- - name: Tags
- url: tags
-
- homeInfoParams:
- Title: "Hi there πŸ‘‹"
- Content: Welcome to my blog. Here I share thoughts on web development, technology, and more.
-
- socialIcons:
- - name: twitter
- url: "https://twitter.com/"
- - name: github
- url: "https://github.com/"
- - name: linkedin
- url: "https://linkedin.com/"
- - name: rss
- url: "/index.xml"
-
- cover:
- hidden: false
- hiddenInList: false
- hiddenInSingle: false
-
- editPost:
- URL: "https://github.com/<username>/<repo>/tree/main/content"
- Text: "Suggest Changes"
- appendFilePath: true
-
- fuseOpts:
- isCaseSensitive: false
- shouldSort: true
- location: 0
- distance: 1000
- threshold: 0.4
- minMatchCharLength: 0
- keys: ["title", "permalink", "summary", "content"]
-
-menu:
- main:
- - identifier: search
- name: Search
- url: /search/
- weight: 10
- - identifier: posts
- name: Posts
- url: /posts/
- weight: 20
- - identifier: archives
- name: Archives
- url: /archives/
- weight: 30
- - identifier: tags
- name: Tags
- url: /tags/
- weight: 40
- - identifier: about
- name: About
- url: /about/
- weight: 50
-
-outputs:
- home:
- - HTML
- - RSS
- - JSON # is necessary for search
-```
-
-### wrangler.jsonc
-```jsonc
-{
- "name": "hugo-blog",
- "compatibility_date": "2025-01-29",
- "assets": {
- "directory": "./public",
- "html_handling": "auto-trailing-slash",
- "not_found_handling": "404-page"
- }
-}
-```
-
-### Sveltia CMS Configuration (static/admin/config.yml)
-```yaml
-backend:
- name: github
- repo: username/repo
- branch: main
-
-media_folder: "static/images/uploads"
-public_folder: "/images/uploads"
-
-collections:
- - name: "blog"
- label: "Blog Posts"
- folder: "content/posts"
- create: true
- slug: "{{slug}}"
- fields:
- - {label: "Title", name: "title", widget: "string"}
- - {label: "Description", name: "description", widget: "string", required: false}
- - {label: "Date", name: "date", widget: "datetime"}
- - {label: "Draft", name: "draft", widget: "boolean", default: false}
- - {label: "Tags", name: "tags", widget: "list", required: false}
- - {label: "Categories", name: "categories", widget: "list", required: false}
- - {label: "Cover Image", name: "cover", widget: "object", required: false, fields: [
- {label: "Image", name: "image", widget: "image", required: false},
- {label: "Alt Text", name: "alt", widget: "string", required: false},
- {label: "Caption", name: "caption", widget: "string", required: false}
- ]}
- - {label: "Show Table of Contents", name: "showtoc", widget: "boolean", default: true, required: false}
- - {label: "Body", name: "body", widget: "markdown"}
-
- - name: "pages"
- label: "Pages"
- folder: "content"
- create: true
- slug: "{{slug}}"
- fields:
- - {label: "Title", name: "title", widget: "string"}
- - {label: "Date", name: "date", widget: "datetime"}
- - {label: "Draft", name: "draft", widget: "boolean", default: false}
- - {label: "Body", name: "body", widget: "markdown"}
-```
-
-### GitHub Actions Workflow (.github/workflows/deploy.yml)
-```yaml
-name: Deploy Hugo Blog to Cloudflare Workers
-
-on:
- push:
- branches:
- - main
-
-jobs:
- deploy:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- submodules: recursive
-
- - name: Setup Hugo
- uses: peaceiris/actions-hugo@v2
- with:
- hugo-version: '0.152.2'
- extended: true
-
- - name: Build
- run: hugo --minify
-
- - name: Deploy to Cloudflare Workers
- uses: cloudflare/wrangler-action@v3
- with:
- apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
-```
-
-### Sample Post (content/posts/first-post.md)
-```yaml
----
-title: "Welcome to My Blog"
-description: "My first post on this new Hugo blog"
-date: 2025-11-04T10:00:00+11:00
-draft: false
-tags: ["hugo", "blog", "getting-started"]
-categories: ["General"]
-cover:
- image: "/images/welcome.jpg"
- alt: "Welcome image"
- caption: "Welcome to my blog!"
-showtoc: true
----
-
-# Welcome!
-
-This is my first blog post. I'm excited to share my thoughts and experiences here.
-
-## What You'll Find Here
-
-- Web development tutorials
-- Technology insights
-- Personal projects
-- And more!
-
-## Let's Get Started
-
-Stay tuned for more content coming soon!
-```
-
-### Features
-- βœ… Dark/light/auto theme mode
-- βœ… Search functionality
-- βœ… Archives page
-- βœ… Tags and categories
-- βœ… Social links
-- βœ… RSS feed
-- βœ… Syntax highlighting
-- βœ… Code copy buttons
-- βœ… Reading time
-- βœ… Share buttons
-- βœ… Breadcrumbs
-- βœ… Table of contents
-- βœ… Responsive design
-- βœ… SEO optimized
-
-### Setup Instructions (README.md)
-1. Install Hugo Extended v0.152.2+
-2. Clone repository with submodules: `git clone --recursive`
-3. Run local server: `hugo server`
-4. Build for production: `hugo --minify`
-5. Deploy to Workers: `wrangler deploy`
-
----
-
-## Template 2: Hugo Docs Site
-
-### Purpose
-Documentation site with sidebar navigation, perfect for technical docs, knowledge bases, or API documentation.
-
-### Location
-`skills/hugo/templates/hugo-docs/`
-
-### Directory Structure
-```
-hugo-docs/
-β”œβ”€β”€ .gitignore
-β”œβ”€β”€ .gitmodules
-β”œβ”€β”€ README.md
-β”œβ”€β”€ wrangler.jsonc
-β”œβ”€β”€ hugo.yaml
-β”œβ”€β”€ content/
-β”‚ β”œβ”€β”€ _index.md
-β”‚ └── docs/
-β”‚ β”œβ”€β”€ _index.md
-β”‚ β”œβ”€β”€ getting-started/
-β”‚ β”‚ β”œβ”€β”€ _index.md
-β”‚ β”‚ β”œβ”€β”€ installation.md
-β”‚ β”‚ β”œβ”€β”€ quick-start.md
-β”‚ β”‚ └── configuration.md
-β”‚ β”œβ”€β”€ guides/
-β”‚ β”‚ β”œβ”€β”€ _index.md
-β”‚ β”‚ β”œβ”€β”€ basic-usage.md
-β”‚ β”‚ └── advanced-features.md
-β”‚ └── reference/
-β”‚ β”œβ”€β”€ _index.md
-β”‚ β”œβ”€β”€ api.md
-β”‚ └── cli.md
-β”œβ”€β”€ static/
-β”‚ β”œβ”€β”€ favicon.ico
-β”‚ └── admin/
-β”‚ β”œβ”€β”€ index.html
-β”‚ └── config.yml
-β”œβ”€β”€ themes/
-β”‚ └── hugo-book/ (Git submodule)
-└── .github/
- └── workflows/
- └── deploy.yml
-```
-
-### hugo.yaml Configuration
-```yaml
-baseURL: "https://docs.example.com/"
-title: "Documentation"
-theme: "hugo-book"
-languageCode: "en-us"
-defaultContentLanguage: "en"
-enableRobotsTXT: true
-enableGitInfo: true
-enableEmoji: true
-
-minify:
- disableXML: true
- minifyOutput: true
-
-params:
- BookTheme: "auto" # light, dark, auto
- BookToC: true
- BookComments: false
- BookSearch: true
- BookMenuBundle: /menu
- BookSection: docs
- BookRepo: "https://github.com/username/repo"
- BookEditPath: "edit/main"
- BookDateFormat: "January 2, 2006"
-
-menu:
- after:
- - name: "GitHub"
- url: "https://github.com/username/repo"
- weight: 10
-```
-
-### Sveltia CMS Configuration
-```yaml
-backend:
- name: github
- repo: username/repo
- branch: main
-
-media_folder: "static/images"
-public_folder: "/images"
-
-collections:
- - name: "docs"
- label: "Documentation"
- folder: "content/docs"
- create: true
- nested:
- depth: 100
- summary: "{{title}}"
- slug: "{{slug}}"
- fields:
- - {label: "Title", name: "title", widget: "string"}
- - {label: "Weight", name: "weight", widget: "number", default: 10, required: false}
- - {label: "Draft", name: "draft", widget: "boolean", default: false}
- - {label: "Body", name: "body", widget: "markdown"}
-```
-
-### Features
-- βœ… Nested sidebar navigation
-- βœ… Search functionality
-- βœ… Dark/light theme
-- βœ… Table of contents per page
-- βœ… Git edit links
-- βœ… Breadcrumbs
-- βœ… Mobile responsive
-- βœ… Print-friendly
-- βœ… Keyboard shortcuts
-
----
-
-## Template 3: Hugo Landing Page
-
-### Purpose
-Marketing or landing page with hero section, features, testimonials, and CTAs.
-
-### Location
-`skills/hugo/templates/hugo-landing/`
-
-### Directory Structure
-```
-hugo-landing/
-β”œβ”€β”€ .gitignore
-β”œβ”€β”€ README.md
-β”œβ”€β”€ wrangler.jsonc
-β”œβ”€β”€ hugo.yaml
-β”œβ”€β”€ content/
-β”‚ └── _index.md
-β”œβ”€β”€ layouts/
-β”‚ β”œβ”€β”€ index.html
-β”‚ β”œβ”€β”€ partials/
-β”‚ β”‚ β”œβ”€β”€ header.html
-β”‚ β”‚ β”œβ”€β”€ footer.html
-β”‚ β”‚ β”œβ”€β”€ hero.html
-β”‚ β”‚ β”œβ”€β”€ features.html
-β”‚ β”‚ β”œβ”€β”€ testimonials.html
-β”‚ β”‚ └── cta.html
-β”‚ └── _default/
-β”‚ └── baseof.html
-β”œβ”€β”€ static/
-β”‚ β”œβ”€β”€ favicon.ico
-β”‚ β”œβ”€β”€ css/
-β”‚ β”‚ └── style.css
-β”‚ β”œβ”€β”€ js/
-β”‚ β”‚ └── main.js
-β”‚ └── images/
-β”‚ β”œβ”€β”€ hero-bg.jpg
-β”‚ β”œβ”€β”€ feature-1.svg
-β”‚ β”œβ”€β”€ feature-2.svg
-β”‚ └── feature-3.svg
-└── .github/
- └── workflows/
- └── deploy.yml
-```
-
-### hugo.yaml Configuration
-```yaml
-baseURL: "https://landing.example.com/"
-title: "Product Name"
-languageCode: "en-us"
-enableRobotsTXT: true
-
-params:
- description: "Product tagline goes here"
- author: "Company Name"
-
- hero:
- title: "Build Amazing Things"
- subtitle: "The best solution for your needs"
- cta_primary: "Get Started"
- cta_primary_link: "#signup"
- cta_secondary: "Learn More"
- cta_secondary_link: "#features"
-
- features:
- - title: "Fast"
- description: "Lightning-fast performance"
- icon: "/images/feature-1.svg"
- - title: "Secure"
- description: "Bank-level security"
- icon: "/images/feature-2.svg"
- - title: "Scalable"
- description: "Grows with your business"
- icon: "/images/feature-3.svg"
-```
-
-### Features
-- βœ… Hero section with CTA
-- βœ… Features grid
-- βœ… Testimonials carousel
-- βœ… Pricing table
-- βœ… Contact form
-- βœ… Responsive design
-- βœ… SEO optimized
-- βœ… Fast loading
-
----
-
-## Template 4: Minimal Starter
-
-### Purpose
-Bare-bones Hugo project for complete custom development, no theme included.
-
-### Location
-`skills/hugo/templates/minimal-starter/`
-
-### Directory Structure
-```
-minimal-starter/
-β”œβ”€β”€ .gitignore
-β”œβ”€β”€ README.md
-β”œβ”€β”€ wrangler.jsonc
-β”œβ”€β”€ hugo.yaml
-β”œβ”€β”€ content/
-β”‚ └── _index.md
-β”œβ”€β”€ layouts/
-β”‚ └── _default/
-β”‚ └── .gitkeep
-β”œβ”€β”€ static/
-β”‚ └── .gitkeep
-β”œβ”€β”€ data/
-β”‚ └── .gitkeep
-└── .github/
- └── workflows/
- └── deploy.yml
-```
-
-### hugo.yaml Configuration
-```yaml
-baseURL: "https://example.com/"
-title: "My Site"
-languageCode: "en-us"
-enableRobotsTXT: true
-
-params:
- description: "Site description"
- author: "Your Name"
-```
-
-### README.md
-```markdown
-# Hugo Minimal Starter
-
-A bare-bones Hugo project for custom development.
-
-## Getting Started
-
-1. Install Hugo Extended
-2. Run `hugo server` to start development server
-3. Build with `hugo --minify`
-4. Deploy with `wrangler deploy`
-
-## Adding a Theme
-
-### Option 1: Git Submodule
-git submodule add https://github.com/author/theme.git themes/theme-name
-echo 'theme: "theme-name"' >> hugo.yaml
-
-
-### Option 2: Hugo Module
-hugo mod init github.com/username/repo
-# Add to hugo.yaml:
-# module:
-# imports:
-# - path: github.com/author/theme
-
-
-## Custom Development
-
-- Add layouts in `layouts/`
-- Add content in `content/`
-- Add static assets in `static/`
-- Add data files in `data/`
-```
-
-### Features
-- βœ… Clean slate
-- βœ… No theme dependencies
-- βœ… Minimal configuration
-- βœ… Ready for customization
-- βœ… Deployment configured
-
----
-
-## Common Files Across Templates
-
-### .gitignore
-```
-# Hugo
-/public/
-/resources/_gen/
-.hugo_build.lock
-
-# OS
-.DS_Store
-Thumbs.db
-
-# Editor
-.vscode/
-.idea/
-*.swp
-*.swo
-
-# Dependencies
-node_modules/
-```
-
-### GitHub Actions Workflow (Common Pattern)
-```yaml
-name: Deploy to Cloudflare Workers
-
-on:
- push:
- branches:
- - main
-
-jobs:
- deploy:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- submodules: recursive
-
- - name: Setup Hugo
- uses: peaceiris/actions-hugo@v2
- with:
- hugo-version: '0.152.2'
- extended: true
-
- - name: Build
- run: hugo --minify
-
- - name: Deploy to Cloudflare Workers
- uses: cloudflare/wrangler-action@v3
- with:
- apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
-```
-
----
-
-## Template Selection Guide
-
-### Use Hugo Blog When:
-- Building a personal or company blog
-- Want a ready-to-use, beautiful theme
-- Need search, tags, categories out of the box
-- Want dark/light mode toggle
-- Need minimal setup time
-
-### Use Hugo Docs When:
-- Building technical documentation
-- Need hierarchical navigation
-- Want version control integration
-- Need search across docs
-- Building API reference or knowledge base
-
-### Use Hugo Landing When:
-- Building marketing site
-- Need hero section, features, testimonials
-- Want single-page layout
-- Building product landing page
-- Need conversion-focused design
-
-### Use Minimal Starter When:
-- Building completely custom site
-- Want full control over every aspect
-- Have specific design requirements
-- Don't want theme dependencies
-- Learning Hugo from scratch
-
----
-
-## Installation Instructions (Common)
-
-### Prerequisites
-```bash
-# Install Hugo Extended
-# macOS
-brew install hugo
-
-# Linux (Ubuntu/Debian)
-wget https://github.com/gohugoio/hugo/releases/download/v0.152.2/hugo_extended_0.152.2_linux-amd64.deb
-sudo dpkg -i hugo_extended_0.152.2_linux-amd64.deb
-
-# Verify installation
-hugo version # Should show "hugo v0.152.2+extended"
-```
-
-### Using a Template
-```bash
-# 1. Copy template
-cp -r skills/hugo/templates/hugo-blog/ my-blog/
-cd my-blog/
-
-# 2. Initialize Git (if not already)
-git init
-
-# 3. Add theme as submodule (for blog/docs templates)
-git submodule add https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
-
-# 4. Update hugo.yaml with your details
-# - baseURL
-# - title
-# - author info
-# - social links
-
-# 5. Run local server
-hugo server
-
-# 6. Build for production
-hugo --minify
-
-# 7. Deploy to Workers
-wrangler deploy
-```
-
----
-
-## Customization Tips
-
-### All Templates Support:
-- TailwindCSS integration (add via Hugo Pipes)
-- Custom CSS in static/css/
-- Custom JavaScript in static/js/
-- Google Analytics / Plausible
-- Comments (Disqus, Utterances, etc.)
-- Social sharing
-- RSS feeds
-
-### Theme Customization:
-1. **Override Layouts**: Copy theme file to project layouts/
-2. **Custom Partials**: Create layouts/partials/custom.html
-3. **CSS Override**: Add static/css/custom.css
-4. **Config Override**: hugo.yaml overrides theme defaults
-
----
-
-## Testing Checklist
-
-Before committing a template:
-- [ ] Builds without errors (`hugo`)
-- [ ] Local server works (`hugo server`)
-- [ ] No broken links (check localhost)
-- [ ] Images load correctly
-- [ ] Theme renders properly (if applicable)
-- [ ] Sveltia CMS config valid (if included)
-- [ ] wrangler.jsonc deploys successfully
-- [ ] GitHub Actions workflow syntax valid
-- [ ] README.md has clear instructions
-- [ ] .gitignore includes all necessary patterns
-
----
-
-**Last Updated**: 2025-11-04
-**Status**: Specification complete, ready for Phase 4 (Template Creation)
diff --git a/scripts/check-all-versions.sh b/scripts/check-all-versions.sh
index e2768904..781d3402 100755
--- a/scripts/check-all-versions.sh
+++ b/scripts/check-all-versions.sh
@@ -8,6 +8,7 @@
# - GitHub releases
# - YAML metadata validation
# - AI model references
+# - Marketplace sync (marketplace.json vs actual skills)
#
# Exit code: Always 0 (info only, no failures)
@@ -94,21 +95,25 @@ if [ -n "$SKILL_NAME" ]; then
fi
# 1. NPM Packages
-print_section "1/4: Checking NPM Packages"
+print_section "1/5: Checking NPM Packages"
"$SCRIPT_DIR/check-npm-versions.sh" $CHECKER_ARGS --markdown "$REPORT_FILE"
# 2. GitHub Releases
-print_section "2/4: Checking GitHub Releases"
+print_section "2/5: Checking GitHub Releases"
"$SCRIPT_DIR/check-github-releases.sh" $CHECKER_ARGS --markdown "$REPORT_FILE"
# 3. Metadata
-print_section "3/4: Checking Skill Metadata"
+print_section "3/5: Checking Skill Metadata"
"$SCRIPT_DIR/check-metadata.sh" $CHECKER_ARGS --markdown "$REPORT_FILE"
# 4. AI Models
-print_section "4/4: Checking AI Model References"
+print_section "4/5: Checking AI Model References"
"$SCRIPT_DIR/check-ai-models.sh" $CHECKER_ARGS --markdown "$REPORT_FILE"
+# 5. Marketplace Sync
+print_section "5/5: Checking Marketplace Sync"
+"$SCRIPT_DIR/check-marketplace-sync.sh" --markdown "$REPORT_FILE" || true
+
# Generate action items section
echo "" >> "$REPORT_FILE"
echo "---" >> "$REPORT_FILE"
@@ -122,6 +127,7 @@ npm_warnings=$(grep -c "⚠️.*update" "$REPORT_FILE" 2>/dev/null | tr -d '\n'
major_warnings=$(grep -c "MAJOR.*breaking" "$REPORT_FILE" 2>/dev/null | tr -d '\n' || echo "0")
stale_warnings=$(grep -c "STALE" "$REPORT_FILE" 2>/dev/null | tr -d '\n' || echo "0")
deprecated_models=$(grep -c "Deprecated" "$REPORT_FILE" 2>/dev/null | tr -d '\n' || echo "0")
+marketplace_issues=$(grep -c "Phantom\|Missing" "$REPORT_FILE" 2>/dev/null | tr -d '\n' || echo "0")
echo "### High Priority" >> "$REPORT_FILE"
echo "" >> "$REPORT_FILE"
@@ -138,6 +144,10 @@ if [ "$stale_warnings" -gt 0 ]; then
echo "- ⚠️ **$stale_warnings skill(s) with stale verification dates** - Re-test and update metadata" >> "$REPORT_FILE"
fi
+if [ "$marketplace_issues" -gt 0 ]; then
+ echo "- ❌ **Marketplace out of sync** - Run \`./scripts/check-marketplace-sync.sh --fix\`" >> "$REPORT_FILE"
+fi
+
if [ "$npm_warnings" -gt 0 ]; then
echo "" >> "$REPORT_FILE"
echo "### Medium Priority" >> "$REPORT_FILE"
@@ -145,7 +155,7 @@ if [ "$npm_warnings" -gt 0 ]; then
echo "- ⚠️ **$npm_warnings minor/patch package update(s)** - Update when convenient" >> "$REPORT_FILE"
fi
-if [ "$major_warnings" -eq 0 ] && [ "$deprecated_models" -eq 0 ] && [ "$stale_warnings" -eq 0 ] && [ "$npm_warnings" -eq 0 ]; then
+if [ "$major_warnings" -eq 0 ] && [ "$deprecated_models" -eq 0 ] && [ "$stale_warnings" -eq 0 ] && [ "$npm_warnings" -eq 0 ] && [ "$marketplace_issues" -eq 0 ]; then
echo "βœ… **No action items** - All dependencies are up-to-date!" >> "$REPORT_FILE"
fi
@@ -193,11 +203,12 @@ echo " β€’ NPM packages: See report for details"
echo " β€’ GitHub releases: See report for details"
echo " β€’ Metadata: See report for details"
echo " β€’ AI models: See report for details"
+echo " β€’ Marketplace sync: See report for details"
echo ""
echo -e "${YELLOW}πŸ“„ Full report:${NC} $REPORT_FILE"
echo ""
-if [ "$major_warnings" -gt 0 ] || [ "$deprecated_models" -gt 0 ]; then
+if [ "$major_warnings" -gt 0 ] || [ "$deprecated_models" -gt 0 ] || [ "$marketplace_issues" -gt 0 ]; then
echo -e "${RED}⚠️ HIGH PRIORITY ITEMS DETECTED${NC}"
echo ""
if [ "$major_warnings" -gt 0 ]; then
@@ -206,6 +217,9 @@ if [ "$major_warnings" -gt 0 ] || [ "$deprecated_models" -gt 0 ]; then
if [ "$deprecated_models" -gt 0 ]; then
echo " β€’ $deprecated_models deprecated AI model reference(s)"
fi
+ if [ "$marketplace_issues" -gt 0 ]; then
+ echo " β€’ Marketplace out of sync - run ./scripts/check-marketplace-sync.sh --fix"
+ fi
echo ""
echo " Review $REPORT_FILE for details"
echo ""
diff --git a/scripts/check-marketplace-sync.sh b/scripts/check-marketplace-sync.sh
new file mode 100755
index 00000000..da1fc4d9
--- /dev/null
+++ b/scripts/check-marketplace-sync.sh
@@ -0,0 +1,171 @@
+#!/usr/bin/env bash
+
+# check-marketplace-sync.sh - Verify marketplace.json matches actual skills
+# Usage: ./scripts/check-marketplace-sync.sh [--markdown FILE] [--fix]
+#
+# Checks:
+# - Skills in marketplace.json that don't exist in skills/ (phantom)
+# - Skills in skills/ that aren't in marketplace.json (missing)
+#
+# Options:
+# --markdown FILE Append results to markdown report file
+# --fix Automatically regenerate marketplace.json
+#
+# Exit codes:
+# 0 - All skills in sync
+# 1 - Mismatches found (unless --fix used)
+
+set -e
+
+# Colors
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+YELLOW='\033[1;33m'
+BLUE='\033[0;34m'
+CYAN='\033[0;36m'
+BOLD='\033[1m'
+NC='\033[0m' # No Color
+
+# Paths
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
+MARKETPLACE_FILE="$REPO_ROOT/.claude-plugin/marketplace.json"
+SKILLS_DIR="$REPO_ROOT/skills"
+
+# Parse arguments
+MARKDOWN_FILE=""
+FIX_MODE=false
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ --markdown)
+ MARKDOWN_FILE="$2"
+ shift 2
+ ;;
+ --fix)
+ FIX_MODE=true
+ shift
+ ;;
+ *)
+ shift
+ ;;
+ esac
+done
+
+# Temp files
+MARKETPLACE_SKILLS=$(mktemp)
+ACTUAL_SKILLS=$(mktemp)
+trap "rm -f $MARKETPLACE_SKILLS $ACTUAL_SKILLS" EXIT
+
+# Extract skills from marketplace.json
+if [ ! -f "$MARKETPLACE_FILE" ]; then
+ echo -e "${RED}ERROR: marketplace.json not found at $MARKETPLACE_FILE${NC}"
+ exit 1
+fi
+
+grep -o '"./skills/[^"]*"' "$MARKETPLACE_FILE" | tr -d '"' | sed 's|./skills/||' | sort > "$MARKETPLACE_SKILLS"
+
+# List actual skills
+ls -d "$SKILLS_DIR"/*/ 2>/dev/null | sed "s|$SKILLS_DIR/||" | sed 's|/$||' | sort > "$ACTUAL_SKILLS"
+
+# Find mismatches
+PHANTOM_SKILLS=$(comm -23 "$MARKETPLACE_SKILLS" "$ACTUAL_SKILLS")
+MISSING_SKILLS=$(comm -13 "$MARKETPLACE_SKILLS" "$ACTUAL_SKILLS")
+
+MARKETPLACE_COUNT=$(wc -l < "$MARKETPLACE_SKILLS" | tr -d ' ')
+ACTUAL_COUNT=$(wc -l < "$ACTUAL_SKILLS" | tr -d ' ')
+PHANTOM_COUNT=$(echo "$PHANTOM_SKILLS" | grep -c . 2>/dev/null || echo 0)
+PHANTOM_COUNT=$(echo "$PHANTOM_COUNT" | tr -d '[:space:]')
+MISSING_COUNT=$(echo "$MISSING_SKILLS" | grep -c . 2>/dev/null || echo 0)
+MISSING_COUNT=$(echo "$MISSING_COUNT" | tr -d '[:space:]')
+
+# Print header
+echo -e "${CYAN}${BOLD}Marketplace Sync Check${NC}"
+echo -e "${CYAN}══════════════════════${NC}"
+echo ""
+
+# Summary
+echo -e "${BOLD}Summary:${NC}"
+echo " Skills in marketplace.json: $MARKETPLACE_COUNT"
+echo " Skills in skills/ directory: $ACTUAL_COUNT"
+echo ""
+
+# Check for issues
+HAS_ISSUES=false
+
+if [ "$PHANTOM_COUNT" -gt 0 ]; then
+ HAS_ISSUES=true
+ echo -e "${RED}❌ $PHANTOM_COUNT skill(s) in marketplace.json but NOT in repo:${NC}"
+ echo "$PHANTOM_SKILLS" | while read skill; do
+ [ -n "$skill" ] && echo " - $skill"
+ done
+ echo ""
+fi
+
+if [ "$MISSING_COUNT" -gt 0 ]; then
+ HAS_ISSUES=true
+ echo -e "${YELLOW}⚠️ $MISSING_COUNT skill(s) in repo but NOT in marketplace.json:${NC}"
+ echo "$MISSING_SKILLS" | while read skill; do
+ [ -n "$skill" ] && echo " - $skill"
+ done
+ echo ""
+fi
+
+if [ "$HAS_ISSUES" = false ]; then
+ echo -e "${GREEN}βœ… All $ACTUAL_COUNT skills in sync!${NC}"
+ echo ""
+fi
+
+# Write to markdown report if requested
+if [ -n "$MARKDOWN_FILE" ]; then
+ echo "" >> "$MARKDOWN_FILE"
+ echo "## Marketplace Sync" >> "$MARKDOWN_FILE"
+ echo "" >> "$MARKDOWN_FILE"
+ echo "| Metric | Count |" >> "$MARKDOWN_FILE"
+ echo "|--------|-------|" >> "$MARKDOWN_FILE"
+ echo "| Skills in marketplace.json | $MARKETPLACE_COUNT |" >> "$MARKDOWN_FILE"
+ echo "| Skills in repo | $ACTUAL_COUNT |" >> "$MARKDOWN_FILE"
+ echo "| Phantom (listed but missing) | $PHANTOM_COUNT |" >> "$MARKDOWN_FILE"
+ echo "| Missing (exist but not listed) | $MISSING_COUNT |" >> "$MARKDOWN_FILE"
+ echo "" >> "$MARKDOWN_FILE"
+
+ if [ "$PHANTOM_COUNT" -gt 0 ]; then
+ echo "### Phantom Skills (remove from marketplace.json)" >> "$MARKDOWN_FILE"
+ echo "" >> "$MARKDOWN_FILE"
+ echo "$PHANTOM_SKILLS" | while read skill; do
+ [ -n "$skill" ] && echo "- \`$skill\`" >> "$MARKDOWN_FILE"
+ done
+ echo "" >> "$MARKDOWN_FILE"
+ fi
+
+ if [ "$MISSING_COUNT" -gt 0 ]; then
+ echo "### Missing Skills (add to marketplace.json)" >> "$MARKDOWN_FILE"
+ echo "" >> "$MARKDOWN_FILE"
+ echo "$MISSING_SKILLS" | while read skill; do
+ [ -n "$skill" ] && echo "- \`$skill\`" >> "$MARKDOWN_FILE"
+ done
+ echo "" >> "$MARKDOWN_FILE"
+ fi
+
+ if [ "$HAS_ISSUES" = false ]; then
+ echo "βœ… **All skills in sync** - marketplace.json matches skills/ directory" >> "$MARKDOWN_FILE"
+ echo "" >> "$MARKDOWN_FILE"
+ fi
+fi
+
+# Fix mode
+if [ "$FIX_MODE" = true ] && [ "$HAS_ISSUES" = true ]; then
+ echo -e "${BLUE}Running generate-plugin-manifests.sh to fix...${NC}"
+ "$SCRIPT_DIR/generate-plugin-manifests.sh"
+ echo -e "${GREEN}βœ… marketplace.json regenerated${NC}"
+ exit 0
+fi
+
+# Exit code
+if [ "$HAS_ISSUES" = true ]; then
+ echo -e "${YELLOW}Run with --fix to regenerate marketplace.json${NC}"
+ echo "Or manually run: ./scripts/generate-plugin-manifests.sh"
+ exit 1
+fi
+
+exit 0
diff --git a/skills/ai-sdk-core/SKILL.md b/skills/ai-sdk-core/SKILL.md
index 3f9b7bc5..f1062f06 100644
--- a/skills/ai-sdk-core/SKILL.md
+++ b/skills/ai-sdk-core/SKILL.md
@@ -137,6 +137,54 @@ See official docs for usage: https://ai-sdk.dev/docs/ai-sdk-core
---
+## v5 Stream Response Methods
+
+When returning streaming responses from an API, use the correct method:
+
+| Method | Output Format | Use Case |
+|--------|---------------|----------|
+| `toTextStreamResponse()` | Plain text chunks | Simple text streaming |
+| `toUIMessageStreamResponse()` | SSE with JSON events | **Chat UIs** (text-start, text-delta, text-end, finish) |
+
+**For chat widgets and UIs, always use `toUIMessageStreamResponse()`:**
+
+```typescript
+const result = streamText({
+ model: workersai('@cf/qwen/qwen3-30b-a3b-fp8'),
+ messages,
+ system: 'You are helpful.',
+});
+
+// βœ… For chat UIs - returns SSE with JSON events
+return result.toUIMessageStreamResponse({
+ headers: { 'Access-Control-Allow-Origin': '*' },
+});
+
+// ❌ For simple text - returns plain text chunks only
+return result.toTextStreamResponse();
+```
+
+**Note:** `toDataStreamResponse()` does NOT exist in AI SDK v5 (common misconception).
+
+---
+
+## workers-ai-provider Version Compatibility
+
+**IMPORTANT:** `[email protected]` requires AI SDK v5, NOT v4.
+
+```bash
+# βœ… Correct - AI SDK v5 with workers-ai-provider v2
+npm install ai@^5.0.0 workers-ai-provider@^2.0.0 zod@^3.25.0
+
+# ❌ Wrong - AI SDK v4 causes error
+npm install ai@^4.0.0 workers-ai-provider@^2.0.0
+# Error: "AI SDK 4 only supports models that implement specification version v1"
+```
+
+**Zod Version:** AI SDK v5 requires `zod@^3.25.0` or later for `zod/v3` and `zod/v4` exports. Older versions (3.22.x) cause build errors: "Could not resolve zod/v4".
+
+---
+
## Cloudflare Workers Startup Fix
**Problem:** AI SDK v5 + Zod causes >270ms startup time (exceeds Workers 400ms limit).