Skip to content

Instantly share code, notes, and snippets.

View bradsjm's full-sized avatar

Jonathan Bradshaw bradsjm

  • Tampa, FL
  • 09:23 (UTC -04:00)
View GitHub Profile
@bradsjm
bradsjm / read-only.ts
Created July 25, 2026 03:57
Read Only Mode Toggle extension for oh-my-pi
/**
* Read-Only Mode Extension
*
* Toggle a workspace read-only profile while preserving investigation tools,
* remote MCP tools, read-only GitHub operations, and scout delegation.
*
* Three defense layers:
* 1. setActiveTools — disables only active write tools and remembers them
* so no unrelated tool state is changed on restoration
* 2. tool_call gate — blocks local writes, mutating GitHub operations,
@bradsjm
bradsjm / hue-combined-state-zha.md
Created June 9, 2026 20:11
High-Performance Hue Combined State Writes with ZHA

High-Performance Hue Combined State Writes with ZHA

Overview

Philips Hue lights expose a manufacturer-specific Zigbee cluster, 0xFC03, that can write multiple light properties in one frame. This is the most efficient per-light update path for Hue bulbs because it can combine brightness, color, fade speed, and effect state into a single Zigbee command — avoiding the multiple sequential cluster commands that standard ZCL writes require.

This document captures what was learned during session analysis of the Hue private protocol, zigpy internals, ZHA light paths, and the reference adaptive drain loop design. It is intended as a reusable reference for any Hue-on-ZHA project.

Protocol summary (source: bifrost Hue Zigbee format docs)

@bradsjm
bradsjm / InteractiveDiagramCreationPrompt.md
Created April 23, 2026 02:04
Revised diagram prompt that prompts the LLM to ask questions before generating the image prompt

Diagram Generation Prompt Specifications

You convert software and infrastructure architecture inputs into high-fidelity, production-ready prompts for OpenAI gpt-image-2 and comparable enterprise image-generation models.

Your output is never an image. Your output is a prompt for an image model, plus optional structured diagram data and recommended generation settings.

Your job: Given architecture inputs such as diagrams, screenshots, code, configs, descriptions, requirements, or reference images, generate precise, visually polished image prompts that produce accurate, legible, presentation-ready architecture diagrams, infographics, workflow diagrams, and slide-style visuals.

@bradsjm
bradsjm / DiagramCreationPrompt.md
Last active April 23, 2026 01:31
Prompt to generate instructions for creating OpenAI Image-2 diagrams

You convert software and infrastructure architecture inputs into high-fidelity, production-ready prompts for OpenAI gpt-image-2 and comparable enterprise image-generation models.

Your output is never an image. Your output is a prompt for an image model, plus optional structured diagram data and recommended generation settings.

Your job: Given architecture inputs such as diagrams, screenshots, code, configs, descriptions, requirements, or reference images, generate precise, visually polished image prompts that produce accurate, legible, presentation-ready architecture diagrams, infographics, workflow diagrams, and slide-style visuals.

CORE OPERATING PRINCIPLES

@bradsjm
bradsjm / emporia-vue-v3.yaml
Last active December 28, 2025 23:17
Emporia VUE V3 ESPHome Configuration
substitutions:
name: emporia-vue-v3
friendly_name: Emporia Vue V3
area: "Garage"
# Circuit Labels used for publishing to Home Assistant
circuit_1: "Dryer" #"Circuit 1"
circuit_2: "AC Blower/Heat" #"Circuit 2"
circuit_3: "AC Condenser" #"Circuit 3"
circuit_4: "Water Heater" #"Circuit 4"