Skip to content

Instantly share code, notes, and snippets.

View dmmulroy's full-sized avatar

Dillon Mulroy dmmulroy

View GitHub Profile
@dmmulroy
dmmulroy / calm-error-tone.md
Created November 19, 2026 14:31
R10 coding traits (.agents/traits)

name: calm-error-tone subject: Wording of error messages. requirement: Error messages use calm, direct, ordinary language that describes the problem without blaming the caller or a third party. Public messages use the product's domain vocabulary; internal messages may name the failing internal capability when that helps an operator. applicability: Public messages exclude database tables, framework or runtime mechanics, stack traces, vendor exceptions, and internal service names. purpose: Keeps failures serious and understandable for the audience reading them.

@dmmulroy
dmmulroy / coding-standards-draft.md
Created June 18, 2026 22:39
coding-standards-draft.md

TypeScript Coding Standards

These standards describe how to design and write TypeScript code in this codebase. They are especially intended for agents: before adding patterns, libraries, adapters, or abstractions, read the existing code and prefer the local convention unless it conflicts with the safety/correctness principles below.

Decision priority

When rules pull in different directions, use this order:

  1. Preserve correctness, safety, and debuggability.
  2. Follow established project architecture and conventions.
#!/usr/bin/env bash
set -euo pipefail
# Writes Home Assistant OS to this machine's internal disk.
# Intended to be run from a live Ubuntu USB session, not from the OS installed
# on the internal drive.
DEFAULT_IMAGE="$HOME/Downloads/haos_generic-x86-64-17.3.img.xz"
DEFAULT_TARGET="/dev/nvme0n1"
import { DynamicWorkerExecutor } from "@cloudflare/codemode";
import { openApiMcpServer } from "@cloudflare/codemode/mcp";
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import {
createFetchYnabApiClient,
createYnabOpenApiRequestHandler,
type YnabApiClient,
} from "./ynab-client.ts";
import ynabOpenApi from "./ynab-openapi.json";
@dmmulroy
dmmulroy / alchemy-issue-366-agent-prompt.md
Created May 18, 2026 12:53
Agent prompt: debug and PR alchemy-run/alchemy-effect issue #366

Agent prompt: fix Alchemy issue #366 and submit the PR

You are a coding agent starting with no assumed prior knowledge of Effect, Alchemy v2, Cloudflare Workers, or Durable Objects. Your job is to learn the relevant codebase conventions, reproduce alchemy-run/alchemy-effect issue #366, fix the root cause in Alchemy, add a regression test at the correct seam, and submit a pull request.

Do not treat this prompt as a substitute for investigation. Use it as a briefing and independently verify every important claim against the current repository source and a reproducible failing signal.

Outcome required

  1. Clone the current upstream repository:

jj-ai: AI Attribution Tracking for Jujutsu VCS

Version: 0.1.1-draft
Status: Design Specification
Date: 2026-02-03


Executive Summary

@dmmulroy
dmmulroy / example-usage.ts
Last active June 22, 2026 15:59
Durable Object stub wrapper with better-result hydration
// example-usage.ts
import { Result } from "better-result";
import { stubWithBetterResultHydration } from "./stub-with-better-result-hydration";
import type { MyDurableObject } from "./my-durable-object";
// In a Worker handler:
export default {
async fetch(req: Request, env: Env) {
const id = env.MY_DO.idFromName("user-123");
import { DurableObjectError } from "./errors";
import { Err, Ok, Result, type Result as ResultType } from "./result";
/**
* Adds DurableObjectError to Result error unions, wraps non-Result returns.
* - Promise<Result<T, E>> → Promise<Result<T, E | DurableObjectError>>
* - Promise<T> → Promise<Result<T, DurableObjectError>>
*/
type AddDOError<R> =
R extends Promise<ResultType<infer T, infer E>>

Worker Bindings Architecture

1. How env.MY_D1 Works Under the Hood

Data Flow: Configuration → C++ → JavaScript

workerd.capnp config → server.c++ (parsing) → WorkerdApi::Global → createBindingValue() → v8::Object (env)