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.
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.
When rules pull in different directions, use this order:
- Preserve correctness, safety, and debuggability.
- 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" |
Below is the Effect 4 shape I’d create for a short top-level mlink CLI.
Commands
No links prefix:
mlink health
mlink list [--q] [--status active|tombstoned|all] [--kind alias|generated|all] [--limit] [--cursor] [--all]
mlink get <slug>| 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"; |
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.
- Clone the current upstream repository:
| // 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>> |