Skip to content

Instantly share code, notes, and snippets.

@mattzcarey
mattzcarey / README.md
Created July 8, 2026 18:27
Cloudflare-native AI SDK v7 tracing prototype (unverified design artifact)

Cloudflare-native AI SDK v7 tracing prototype

Prototype extracted from Cloudflare Agents PR #1860 before the v7 adapter was removed from the shipping package.

Status: design artifact only. It has structural unit tests, but it has not been integration-tested against a real installed AI SDK v7 package. The Cloudflare Agents repository is currently on AI SDK v6, so this should not be shipped until the repository upgrades and can run real v7 integration tests.

Intended behavior

  • AI SDK v7 operation/model/tool lifecycle callbacks become invoke_agent, chat, and execute_tool spans.
  • executeLanguageModelCall and executeTool preserve active context for nested provider/tool work.
@mattzcarey
mattzcarey / cloudflare-internal-services-skill.md
Created May 19, 2026 10:57
Pi/Claude skill: Cloudflare internal services via cloudflared access curl

Cloudflare Internal Services

Use this skill when a user asks to access, inspect, curl, query, automate, or debug a Cloudflare internal service protected by Cloudflare Access.

This is especially relevant for internal URLs such as:

  • https://jira.cfdata.org/...
  • https://wiki.cfdata.org/... or other Confluence/wiki hosts
  • Any host ending in .cfdata.org
  • Any internal Cloudflare service that redirects through Cloudflare Access
@mattzcarey
mattzcarey / SKILL.md
Created March 19, 2026 11:18
Chrome CDP skill for Claude Code - lightweight Chrome DevTools Protocol CLI
name chrome-cdp
description Interact with local Chrome browser session (only on explicit user approval after being asked to inspect, debug, or interact with a page open in Chrome)

Chrome CDP

Lightweight Chrome DevTools Protocol CLI. Connects directly via WebSocket — no Puppeteer, works with 100+ tabs, instant connection.

Prerequisites

@mattzcarey
mattzcarey / test-sse-newlines.ts
Last active December 24, 2025 11:58
Test SSE endpoints for newline terminator stripping (WARP/proxy issues)
#!/usr/bin/env npx tsx
/**
* Script to test if SSE responses have proper newline terminators.
*
* SSE (Server-Sent Events) requires messages to be terminated with \n\n (two newlines).
* Some proxies (like Cloudflare WARP) may strip trailing newlines, causing EventSource
* to hang waiting for message terminators that never arrive.
*
* Usage:
* npx tsx test-sse-newlines.ts [url]

You are Claude, an AI assistant designed to help with GitHub issues and pull requests. Think carefully as you analyze the context and respond appropriately. Here's the context for your current task:

<formatted_context> Issue Title: migrate servers from hub worker to the new api Issue Author: mattzcarey Issue State: OPEN </formatted_context>

<pr_or_issue_body> We have built a new api for the mcp servers.

@mattzcarey
mattzcarey / installheadlessfirefoxonpi.sh
Last active January 27, 2021 13:46 — forked from nestukh/installheadlessfirefoxonpi.sh
Install firefox-esr + geckodriver + selenium + python3 on raspberry pi 3 and above
#!/bin/bash
pypcks="python3-pip python3 python3-all-dev python3-dev libffi-dev libssl-dev librtmp-dev python-dev python3 python3-doc python3-tk python3-setuptools tix xvfb python-bluez python-gobject python-dbus python cython python-doc python-tk python-numpy python-scipy python-qt4 python3-pyqt5 python3-pyqt5.q* python3-qtpy python-pyqt5.q* python-lxml fontconfig python-demjson qt5-default libqt5webkit5-dev build-essential libudev-dev python-lxml libxml2-dev libxslt-dev libpq-dev python-pyside python-distlib python-pip python-setuptools" # python-examples python3-examples python-vte
allgoodpcks="ca-certificates virtualenv autotools-dev cdbs git expect libnss3-tools util-linux xvfb curl bridge-utils chromium-browser chromium-chromedriver firefox-esr"
sudo apt-get install --reinstall -y $pypcks $allgoodpcks
if [[ ! -f /usr/lib/chromium-browser/chromedriver ]]; then
sudo ln -s /usr/bin/chromedriver /usr/lib/chromium-browser/chromedriver
fi