Skip to content

Ai

001.

Give Your AI Assistant the Docs, Not the Search Bar

An AI coding assistant working on your Home Assistant integration needs to know how config flows work. It can search the web, find a three-year-old forum post, and implement the API that was deprecated in 2023. Or it can read the actual docs.

The second option requires you to put the docs somewhere it can read them.


The Web Search Problem

AI assistants that can search the web will. And they’ll find things. Stack Overflow answers from HA 0.88. GitHub issues marked “fixed in core.” Medium posts from 2021 that are now quietly wrong about three things. The model doesn’t know which sources are authoritative; it doesn’t know what’s stale. It synthesises confidently from whatever it finds.

002.

Learning in Reverse

I’ve been writing C# for years. I knew about raw string literals with triple quotes. I knew about string interpolation with $. I didn’t know you could combine them.

An AI assistant showed me $$"""...""" while generating code. The number of dollar signs determines how many braces you need for interpolation. Two dollar signs means {{variable}} instead of {variable}. Useful for JSON, where braces are everywhere.

// Interpolation: escape quotes and double braces for literals
var json = $"{{ \"name\": \"{name}\", \"count\": {count} }}";

// Raw string interpolation: no escaped quotes, but still double braces
var json = $"""
    {{
        "name": "{name}",
        "count": {count}
    }}
    """;

// Raw string + $$: double braces for interpolation, single for literals
var json = $$"""
    {
        "name": "{{name}}",
        "count": {{count}}
    }
    """;

I wasn’t trying to learn anything. I was trying to get something else done and the knowledge arrived uninvited.

003.

Safer AI Scripting: Using Deno Permissions as a Trust Boundary

AI can write useful scripts. It can also write scripts that read your SSH keys and POST them somewhere interesting.

The problem isn’t malice. AI doesn’t want your secrets. It just can’t tell what’s sensitive. Ask it to “find configuration files” and it might helpfully include ~/.aws/credentials. Ask it to “clean up temporary files” and, well, its definition of temporary is broader than yours.

Don’t run arbitrary AI-generated code.


The Sandbox That Already Exists

Deno denies all permissions by default. Scripts can’t read files, write files, access the network, spawn processes, or read environment variables unless you explicitly allow it.

004.

The Negation Paradox: Why 'Don't Do X' Makes AI Do X

Don’t think about a pink elephant.

You just did. Your brain had to summon the elephant to know what not to think about. The instruction defeated itself.

Large language models have the same problem. Except they can’t even try to comply.

How LLMs Process Text

When you write “don’t use jargon,” the model processes every token. Including “jargon.” That token activates associations, weights, patterns learned from training data. The concept is now present in the context window, influencing what comes next.

005.

Instructions for AI Coding Assistants

This is an instructions file. It lives in your repository root. Your AI coding assistant reads it before touching anything.

The name doesn’t matter. CLAUDE.md, AGENTS.md, INSTRUCTIONS.md. The point is getting expectations out of your head and into a file the tool actually reads. You know things about your codebase that the AI won’t guess correctly: where the boundaries are, what’s shared, which abstractions matter. If you don’t write it down, the AI will make reasonable-sounding decisions that violate your architecture in ways that take an hour to untangle.

006.

Teaching AI to Code Like a Senior Developer: SOLID Principles as Guardrails

There’s a dirty secret about AI-assisted coding: it’s often too helpful.

Ask an AI to implement a feature and it will. Quickly and confidently. It’ll reach across your codebase, modify whatever it needs, create utilities that duplicate existing ones, deliver working code that makes you uncomfortable.

The code works. It doesn’t belong.

The AI isn’t bad at coding. It’s bad at not coding. It lacks the pause that experienced developers have: the “wait, where should this actually live?” moment. The awareness that every line you write exists in a larger context.