<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>DK Development</title>
 <link href="https://dkdevelopment.net/atom.xml" rel="self"/>
 <link href="https://dkdevelopment.net"/>
 <updated>2026-11-08T04:22:01+00:00</updated>
 <id>https://dkdevelopment.net</id>
 <author>
   <name>Damian Karzon</name>
   <email>dkarzon@tboda.com</email>
 </author>

 
 <entry>
   <title>Swanky Kong Runs My Life Admin Now</title>
   <link href="https://dkdevelopment.net/swanky-kong-n8n-agent//"/>
   <updated>2026-10-29T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/swanky-kong-n8n-agent/</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/img/Swanky_Kong_DKC3.png&quot; alt=&quot;Swanky Kong from Donkey Kong Country 3, in a checked yellow vest and bowler hat, holding a cane&quot; style=&quot;float: right; width: 180px; margin: 0 0 1rem 1.5rem; border-radius: 0; box-shadow: none;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Swanky Kong&lt;/strong&gt; started as an excuse to play with agents in n8n. I wanted a bot in Slack that could read my email, so I could ask it things like &lt;em&gt;did the accountant ever get back to me?&lt;/em&gt; instead of scrolling. Most people know me as DK, so something from the Donkey Kong universe seemed appropriate, and Swanky from Donkey Kong Country 3 got the job. I figured I’d lose interest in a fortnight.&lt;/p&gt;

&lt;p&gt;That was a while ago now. These days Swanky files my email, drafts my replies, answers questions about my calendar, keeps a personal wiki of every renewal date, contract and booking I’d otherwise forget, and reminds me about things. It runs on a model on my own hardware. And I use it every day, which I did not see coming.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;version-one-of-the-sorting-was-a-pile-of-switch-nodes&quot;&gt;Version one of the sorting was a pile of switch nodes&lt;/h3&gt;

&lt;p&gt;Once Swanky could read my email, the obvious next step was getting it to sort my email too. The first attempt is still sitting in my n8n instance, and it shows how little I thought it through. An Outlook trigger polled every five minutes, a Markdown node stripped the HTML, and an AI Agent node asked a model to pick a category from a fixed list. Then a &lt;strong&gt;Switch&lt;/strong&gt; node fanned that category out to a different Outlook node for every possible outcome.&lt;/p&gt;

&lt;p&gt;The sticky note on the canvas listed the categories I cared about at the time: bills, spam, rental, car, socials, tax. Adding a new one meant editing the prompt, adding a Switch branch, wiring up another Outlook node and remembering to keep them all in sync. Sender rules (&lt;em&gt;anything from this address goes in that folder&lt;/em&gt;) were yet another Switch, sitting in front of the model.&lt;/p&gt;

&lt;p&gt;It worked fine as a sorter. The problem was everything else I kept wanting it to do. I’d started sending some categories on to a second agent with the instruction &lt;em&gt;if it contains important information, make a note of it&lt;/em&gt;. That was the moment the idea stopped being a toy, and also the moment the canvas became unmaintainable.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;two-things-made-it-usable&quot;&gt;Two things made it usable&lt;/h3&gt;

&lt;p&gt;I could have kept piling Switch nodes onto that canvas. I didn’t, because two things changed around the same time.&lt;/p&gt;

&lt;p&gt;The first was the models. For a long time, anything I could run locally, or afford to run all day in the cloud, wasn’t good enough to trust with my inbox. &lt;strong&gt;Qwen 3.8 27B&lt;/strong&gt; was the first model on Ollama that changed that for me, and &lt;strong&gt;GLM 5.3 Flash&lt;/strong&gt; on Ollama Cloud got cheap enough to run on a side project like this without thinking about the bill. They’re the same models I ended up leaning on for &lt;a href=&quot;/building-local-agent-box-pt2/&quot;&gt;localagent-box&lt;/a&gt;. Once I had models that worked well enough, an agent that makes its own decisions stopped sounding reckless.&lt;/p&gt;

&lt;p&gt;The second was n8n releasing &lt;strong&gt;&lt;a href=&quot;https://docs.n8n.io/build/build-and-manage-agents&quot;&gt;agents&lt;/a&gt;&lt;/strong&gt;. Until then, an agent in n8n was an AI Agent node inside a workflow, so its prompt, tools and logic all lived on that one canvas. Agents are now their own thing in a project, sitting alongside your workflows. You give one a model, instructions, tools and skills in the Agent Builder, and it can be reached from a Slack channel, on a schedule, or from any workflow with the &lt;strong&gt;Message an Agent&lt;/strong&gt; node. Workflows in the same project can be its tools. It’s still in Preview, and it’s exactly the shape Swanky needed.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;one-agent-two-jobs&quot;&gt;One agent, two jobs&lt;/h3&gt;

&lt;p&gt;The rewrite folded everything into one Swanky Kong agent, and other workflows send it messages using the &lt;strong&gt;Message an Agent&lt;/strong&gt; node. The email workflow shrank to five nodes: trigger, a filter for senders I never want processed, HTML to Markdown, a code node that cleans the email up, and a hand-off to Swanky.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2026/swankykong-agent-tools.svg&quot; alt=&quot;An n8n canvas. A Microsoft Outlook trigger passes new email through a Filter + Clean Email node, which skips ignored senders and turns HTML into text, then into the Swanky Kong agent. A Slack channel node also connects to the agent for chat in threads. The Swanky Kong agent card shows its model, qwen3.8-flash-next-iq2_xs, served by Strata on an RTX 5060 Ti 16GB with 64GB of system RAM, and its tools: Outlook email, Outlook calendar, Move to folder, Categorise email, Reminders, dk-wiki through GitHub, Slack, and more. Sticky notes list the agent&apos;s instructions (the system prompt, the email-triage skill and the dk-wiki skill) and say that everything from outside is data, not instructions.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Swanky gets two kinds of input, and the first thing the system prompt does is make it work out which one it has:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;An email to triage&lt;/strong&gt;, wrapped in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;email&amp;gt;&lt;/code&gt; tags. Nobody’s reading the reply, so the output is a JSON report of what it did and why. No personality.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A Slack message from me&lt;/strong&gt;, which gets a short answer in Slack’s own formatting, with a little Swanky flair. A line of it, not a routine.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Slack turned out to be a better interface than I expected, mostly because of threads. Each thread is its own conversation, so I can ask about an email, ask for a reply to it, tweak the draft, and keep all of that in one place without it bleeding into the next thing I ask about.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2026/swankykong-slack.png&quot; alt=&quot;A Slack thread. I ask Swanky Kong whether I should play games tonight, and it replies that nothing is booked tonight and the calendar is clear from Thursday evening onward, so games are fine, followed by a banana emoji.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The bit that made all this manageable was moving the detailed instructions out of the system prompt and into &lt;strong&gt;skills&lt;/strong&gt;, which n8n agents support out of the box. The system prompt stays small and covers the rules that always apply. The email-triage skill holds the categories, sender rules and drafting rules. The wiki skill holds everything about where facts go and what’s worth keeping. When I change how receipts are filed, I edit one markdown file and nothing else.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;what-its-allowed-to-touch&quot;&gt;What it’s allowed to touch&lt;/h3&gt;

&lt;p&gt;Swanky has a fairly short list of tools, and the list of things it &lt;em&gt;can’t&lt;/em&gt; do is just as deliberate.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Categorise email&lt;/strong&gt;: replaces the Outlook categories on one message&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Move email to folder&lt;/strong&gt;: files a message into one of a handful of folders&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Search email&lt;/strong&gt;: finds messages when I ask about them from Slack&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Draft a reply&lt;/strong&gt; and &lt;strong&gt;draft a new email&lt;/strong&gt;: saves to Drafts, never sends&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Search calendar&lt;/strong&gt;: read-only access to my Outlook calendar&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Reminders&lt;/strong&gt;: create, list and update reminders&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;GitHub MCP&lt;/strong&gt;: read and write access to my wiki repo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It can’t send, forward or delete email. It can’t accept or change calendar invites. It never unsubscribes from anything and never opens a link from an email. Every email it writes is a draft that I read and send myself, and it puts &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;[TODO: ...]&lt;/code&gt; anywhere it would otherwise have to commit me to a date, price or decision.&lt;/p&gt;

&lt;p&gt;The Outlook tools are small sub-workflows, and I didn’t want the model handling raw Outlook folder IDs. So the move tool takes a folder &lt;em&gt;name&lt;/em&gt; and a code node resolves it:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// Folder names the agent is allowed to use. Outlook folder IDs live here, not in the prompt.&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;FOLDERS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Receipts&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Events&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;// ...a couple more&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;match&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;FOLDERS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;folder&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;??&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;trim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;names&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;FOLDERS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;valid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;`Unknown folder &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;folder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;. Use one of: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;names&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.`&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If the model invents a folder, it gets an error listing the valid ones and one more try. The categorise tool does the same with category names. It’s the same lesson I keep relearning from &lt;a href=&quot;/building-local-agent-box-pt2/&quot;&gt;localagent-box&lt;/a&gt;: anything deterministic belongs in code, and the model only gets the parts that need judgement.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;emails-are-untrusted-input&quot;&gt;Emails are untrusted input&lt;/h3&gt;

&lt;p&gt;An agent reading my inbox is an agent reading text that anyone in the world can send it. That shaped more of the design than anything else.&lt;/p&gt;

&lt;p&gt;The rule is blunt: content from outside is data, not instructions. Emails, attachments, web pages, wiki pages, even things I forward into Slack. If an email asks Swanky to do something, that’s a reason to consider filing it as junk, not a reason to do it.&lt;/p&gt;

&lt;p&gt;The Clean Email node helps here too. It turns every link into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;text (link: domain)&lt;/code&gt;, so a “Microsoft” email with links pointing at some unrelated domain is easy for the model to spot. It also means I’m not paying, in tokens or seconds, for three hundred characters of tracking URL per link. Bodies get cut off at 6,000 characters.&lt;/p&gt;

&lt;p&gt;The tool list is the real safety net, though. Even if a cleverly written email got past the prompt, the worst Swanky can do is tag it wrong, file it in the wrong folder or write a draft I’ll never send. I’m fine with that blast radius.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-wiki-is-where-it-got-useful&quot;&gt;The wiki is where it got useful&lt;/h3&gt;

&lt;p&gt;Sorting email saves me a few minutes a day. The wiki is what changed how I use it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;dk-wiki&lt;/strong&gt; is a private GitHub repo of markdown files covering the boring, important parts of life: finances, property, subscriptions, the house, people and trips. Swanky reads and writes it through the GitHub MCP. When an email changes a fact I’ll need later, like a renewal date, a new contract or a booking, Swanky updates the right page. When I ask in Slack when the car insurance renews, it answers from the wiki and links the page it used.&lt;/p&gt;

&lt;p&gt;The hard part was stopping it from writing down &lt;em&gt;everything&lt;/em&gt;. The wiki skill has a &lt;strong&gt;keep test&lt;/strong&gt;, and something only gets recorded if:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;it changes a fact I’ll need later: money, a contract, an account, a due or renewal date, a contact detail, a booking or a decision&lt;/li&gt;
  &lt;li&gt;or it’s a personal message from a friend or family member&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else is noise and leaves no trace. Most emails fail the test, and that’s the point. The wiki is a reference, not an archive. When Swanky isn’t sure, it drops a file in an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_inbox/&lt;/code&gt; folder and I decide.&lt;/p&gt;

&lt;p&gt;The other rule that made it work is &lt;strong&gt;entities, not sources&lt;/strong&gt;. Each page is about one thing: a property, an account, a person, a trip. An email is a source that updates an entity page. It never becomes a page of its own. Every page has the same shape: key facts kept at the current truth, open actions with due dates, and an append-only history with a line per change and where it came from.&lt;/p&gt;

&lt;div class=&quot;language-markdown highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gu&quot;&gt;## Open actions&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;
-&lt;/span&gt; [ ] 2026-11-15 — Renew home insurance

&lt;span class=&quot;gu&quot;&gt;## History&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;
-&lt;/span&gt; 2026-10-21 — Insurer: renewal notice, premium up 8% (email)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;!-- TODO: swap in a real-ish (sanitised) example from the wiki --&gt;

&lt;p&gt;Because it’s just a git repo, I get a few things for free. Every change Swanky makes is a commit I can read or revert. CI lints each push for front matter, file naming and broken links, so a sloppy write fails loudly instead of quietly rotting the wiki. And &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;home.md&lt;/code&gt;, the map of every page, is regenerated by automation after each push, so the model never has to maintain an index. It reads &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;home.md&lt;/code&gt; first and writes only the pages.&lt;/p&gt;

&lt;p&gt;Passwords, full account numbers and anything like them never go in. The wiki records the last four digits and a pointer like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1Password: &amp;lt;item name&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;running-it-on-my-own-hardware&quot;&gt;Running it on my own hardware&lt;/h3&gt;

&lt;p&gt;The first version of the sorter used a cloud model through Ollama. Swanky now runs on &lt;strong&gt;Qwen 3.8 Flash Next&lt;/strong&gt;, on my own hardware, served by &lt;strong&gt;Strata&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Ollama and Qwen 3.8 27B got me started, but 16GB of VRAM on an RTX 5060 Ti puts a hard ceiling on how big a model you can run. Strata lets me run larger models split across the GPU and 64GB of system RAM, which opened up a whole tier of models I couldn’t touch before.&lt;/p&gt;

&lt;p&gt;The model I’m running is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IQ2_XS&lt;/code&gt; quant, a 2-bit quantisation. That’s aggressive, and I didn’t pick it for any clever reason: it was the largest model I could fit across my memory. Even so, a triage run finishes in under a minute, which is plenty for something that polls every five minutes.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2026/strata.png&quot; alt=&quot;The Strata monitor dashboard while the model is generating. The model state reads: writing a tool call, dk_wiki_mcp_Create_a_file_in_GitHub. Decode speed is 73 tokens per second and prefill 36 tokens per second. The NVIDIA GeForce RTX 5060 Ti is at 100% load, with 15.7 of 16GB of VRAM used, at 55°C and 74W of a 180W limit. CPU is at 66% across 6 cores and 12 threads.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That’s Strata in the middle of a run, with Swanky writing a page to the wiki. It’s doing 73 tokens a second, with the GPU flat out and 15.7 of its 16GB of VRAM in use.&lt;/p&gt;

&lt;p&gt;Strata gives me an OpenAI-compatible endpoint, so from n8n’s side it’s just the standard OpenAI Chat Model node with a different base URL. Swapping models is a dropdown change.&lt;/p&gt;

&lt;p&gt;Why bother when a cloud model would be smarter? Mostly because of what’s going through it. This is my personal inbox and a wiki of my finances. I’d rather that not pass through someone else’s API at all, and running locally means it doesn’t. It also means a model call every five minutes, all day, costs me nothing beyond power.&lt;/p&gt;

&lt;p&gt;The tradeoff is the one I wrote about with localagent-box: a smaller model has a lower floor, and you feel it the moment the instructions get vague. That’s a big part of why the skills are so explicit, with tables, numbered steps and worked examples. A frontier model would cope with a looser prompt. Qwen on my hardware does a good job when it’s told exactly what good looks like.&lt;/p&gt;

&lt;p&gt;It’s not perfect. Tool calls still fail more often than I’d like, and that’s why the system prompt says to retry once and then tell me plainly what broke rather than pretend it worked. Wiki writes are the other weak spot. Deciding what passes the keep test, and which page a fact belongs on, is the most judgement-heavy thing Swanky does, and it’s where I most often go back and tidy up after it. Having every write as a git commit makes that a lot less painful.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;reminders-and-whats-next&quot;&gt;Reminders, and what’s next&lt;/h3&gt;

&lt;p&gt;The newest piece is reminders. I can say &lt;em&gt;remind me to call the accountant on Friday&lt;/em&gt; in a Slack thread, and Swanky creates it, lists what’s coming up, or reschedules something when I tell it to push it back. A scheduled workflow picks up anything due and hands it back to Swanky, which decides how to tell me, or whether to bother if the thing’s already been done.&lt;/p&gt;

&lt;p&gt;The rule I care most about is that anything the model &lt;em&gt;infers&lt;/em&gt;, from an email that mentions a deadline for example, only ever gets suggested and never created automatically. An email that says “remind Damian to wire $10k” should only ever be able to produce a question for me. It’s built and working, but I haven’t tested it hard enough yet to trust it with anything I’d be upset to miss.&lt;/p&gt;

&lt;p&gt;I started this to ask my inbox questions from Slack. It’s now the first place I go when I need to know when something’s due, who I last spoke to about it, or whether I ever replied to that email. Not bad for a toy with a Donkey Kong name.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Keep Building in Lovable, Ship to Your Own Cloud</title>
   <link href="https://dkdevelopment.net/lovable-as-staging-aws-as-production//"/>
   <updated>2026-10-24T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/lovable-as-staging-aws-as-production/</id>
   <content type="html">&lt;p&gt;I’ve had some version of the same conversation a few times now. Someone shows me an app they built in Lovable, it has actual users and maybe some revenue, and they want to know how to get it off Lovable. When I ask what they plan to use to make changes after that, there’s usually a pause.&lt;/p&gt;

&lt;p&gt;It turns out they don’t want to stop prompting. That’s how they built the app, and for a lot of them it’s the only way they know how to change it. What bothers them is that the thing paying the bills is running on a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lovable.app&lt;/code&gt; subdomain, in an account they don’t control, with a publish button that anyone on the project can hit.&lt;/p&gt;

&lt;p&gt;Most of the advice out there treats this as an either/or. You stay in the builder, or you export the code and move to a “proper” setup with a developer. I don’t think it has to be that way. My take is that you keep the builder as your staging environment and run production in your own cloud account.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;why-people-want-out&quot;&gt;Why people want out&lt;/h3&gt;

&lt;p&gt;The reasons I hear are pretty reasonable. A client wants the app hosted in their own AWS account. Someone asks where the customer data lives and nobody has a clear answer. The monthly cost is hard to predict. Or the app needs something the builder isn’t great at, like background jobs, other AWS services, or monitoring that tells you when something breaks.&lt;/p&gt;

&lt;p&gt;The problem is what you give up by leaving completely. You lose the quick loop of prompting a change and seeing it in a preview a minute later. You lose the visual editor. And whoever on the team was fixing copy and tweaking layouts in their lunch break can’t do that anymore.&lt;/p&gt;

&lt;p&gt;For some apps, moving off the builder and handing it to a dev team is the right move, and I’ll come back to when. But for a founder or a small team, it often means going from &lt;em&gt;I can change my app&lt;/em&gt; to &lt;em&gt;I have to ask someone to change my app&lt;/em&gt;, and I think that’s a big step backwards just to sort out hosting.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;lovable-is-already-a-staging-environment&quot;&gt;Lovable is already a staging environment&lt;/h3&gt;

&lt;p&gt;If you look at what Lovable gives you, it’s a dev and staging environment with a good editor on top. Every change shows up in a preview you can click through and test. That’s most of what staging is.&lt;/p&gt;

&lt;p&gt;What it doesn’t give you is the production side. There’s no point where someone decides a change is ready to go live, nothing stopping a prompt from changing the live app directly, and no infrastructure that belongs to you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub sync&lt;/strong&gt; is what makes it possible to split the two. Lovable syncs both ways with a GitHub repo: changes made in Lovable are committed to the repo, and commits pushed to the synced branch are pulled back into Lovable. The detail that matters here is that Lovable only edits and syncs &lt;a href=&quot;https://docs.lovable.dev/integrations/github&quot;&gt;one branch at a time&lt;/a&gt;, which is the default branch unless you switch it. Anything on other branches, Lovable doesn’t see.&lt;/p&gt;

&lt;p&gt;You’d normally think of that as a limitation, but for this setup it’s exactly what you want. The code lives in a repo you own, and Lovable can only ever write to one branch of it.&lt;/p&gt;

&lt;p&gt;Bolt works much the same way, with two-way GitHub sync and branch support (merging happens over in GitHub). I’m going to stick with Lovable for the examples, but the same idea applies.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;how-id-set-it-up&quot;&gt;How I’d set it up&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;Keep building in Lovable as you do now. Changes sync to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Use Lovable’s preview and published site as staging, and test there.&lt;/li&gt;
  &lt;li&gt;When you’re happy with what’s on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt;, open a pull request into a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;production&lt;/code&gt; branch and merge it.&lt;/li&gt;
  &lt;li&gt;A GitHub Actions workflow on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;production&lt;/code&gt; branch builds the app and deploys it to your AWS account.&lt;/li&gt;
  &lt;li&gt;Production runs on your domain, in your account, and Lovable has no way to touch it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2026/lovable-staging-production-flow.svg&quot; alt=&quot;Staging: Lovable syncs two ways with the main branch, and its preview site uses a staging Supabase project. A pull request from main into production is merged by a person. Production: the production branch triggers GitHub Actions, which applies migrations and functions to a production Supabase project, then deploys the frontend to S3 and CloudFront.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The AWS side is simpler than people expect. A Lovable app is a Vite single-page app that talks to Supabase, so production hosting is mostly an S3 bucket with CloudFront in front of it.&lt;/p&gt;

&lt;p&gt;The pull request is the bit I care about most. When the builder’s publish button &lt;em&gt;is&lt;/em&gt; production, nobody ever has to decide that a change is ready. Putting a pull request in the way means a person makes that call every time. It also gives you one diff of everything that’s changed since the last release, which is handy when the changes came from twenty different prompts and you can’t remember half of them.&lt;/p&gt;

&lt;p&gt;Rolling back gets easier too. If a release goes bad, you revert the merge on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;production&lt;/code&gt; and the pipeline redeploys the previous build. That’s a lot more predictable than asking the AI to undo what it just did and hoping it undoes the right thing.&lt;/p&gt;

&lt;p&gt;One rule I’d stick to: fixes always go through &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt;. If you patch &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;production&lt;/code&gt; directly, Lovable never sees the change, and the next promotion will either conflict or quietly undo your fix.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-hard-part-is-the-data&quot;&gt;The hard part is the data&lt;/h3&gt;

&lt;p&gt;Splitting the code between staging and production is easy. The backend is where it gets fiddly.&lt;/p&gt;

&lt;p&gt;A Lovable project connects to &lt;a href=&quot;https://carolmonroe.com/blog/lovable-cloud-migration&quot;&gt;one backend&lt;/a&gt;, either Lovable Cloud or your own Supabase project, not both. So you need two Supabase projects. Lovable points at the staging one and the production build points at the production one.&lt;/p&gt;

&lt;p&gt;If you’ve already been using your own Supabase project and it has real users in it, that project is your production database. Create a new one for staging and point Lovable at that instead. Supabase recommends staging be a &lt;a href=&quot;https://supabase.com/docs/guides/deployment/managing-environments&quot;&gt;fresh project&lt;/a&gt; rather than one that’s been changed to match production, because the CLI will try to reapply migrations to it. If you’re on Lovable Cloud, you have a migration to do first. Carol Monroe has good write-ups on &lt;a href=&quot;https://carolmonroe.com/blog/export-remove-lovable-cloud&quot;&gt;exporting off Lovable Cloud&lt;/a&gt; and the &lt;a href=&quot;https://carolmonroe.com/blog/lovable-cloud-migration&quot;&gt;full migration&lt;/a&gt;, so I won’t repeat them here.&lt;/p&gt;

&lt;p&gt;After that there are a few things to sort out.&lt;/p&gt;

&lt;p&gt;The Supabase URL and anon key are &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;VITE_&lt;/code&gt; variables, which means they get baked into the frontend when it’s built. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.env&lt;/code&gt; in the repo keeps the staging values for Lovable, and the production pipeline injects the production values from GitHub secrets at build time. Don’t ever let production read from the committed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.env&lt;/code&gt;. Lovable has been known to &lt;a href=&quot;https://carolmonroe.com/blog/lovable-cloud-migration&quot;&gt;rewrite it&lt;/a&gt; back to its own settings, and you don’t want a prompt about button colours pointing your live app at the staging database.&lt;/p&gt;

&lt;p&gt;Lovable writes schema changes as timestamped SQL files in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;supabase/migrations&lt;/code&gt;. On promotion, the pipeline links to the production project and applies them:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;supabase &lt;span class=&quot;nb&quot;&gt;link&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--project-ref&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SUPABASE_PROJECT_ID&lt;/span&gt;
supabase db push&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That needs a Supabase access token, the database password and the project ID stored as GitHub secrets. Run it before the frontend deploys so the new code never hits the old schema. There’s no built-in down migration, so if one fails partway or does something you didn’t want, the fix is another migration that corrects it. This is why I’d read the migrations folder in every promotion pull request, line by line. It’s the one part of the diff that can’t be undone with a revert.&lt;/p&gt;

&lt;p&gt;Edge functions live in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;supabase/functions&lt;/code&gt;, and the same pipeline can deploy them to the production project with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;supabase functions deploy&lt;/code&gt;, so functions and schema go out together. Secrets are set separately in each Supabase project with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;supabase secrets set&lt;/code&gt; or through the dashboard, and they never go in the repo.&lt;/p&gt;

&lt;p&gt;I’ll be honest about the downside. Two environments means two of everything to keep in step, and that’s more work than one. Prompting will also happily write a migration that’s fine against the fifty rows in your staging database and painful against the fifty thousand in production. Renaming a column, adding a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NOT NULL&lt;/code&gt; without a default, dropping a table the AI decided you didn’t need anymore. Staging won’t catch all of those. Someone reading the migration before it ships will catch most of them.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;where-scalebop-fits&quot;&gt;Where ScaleBop fits&lt;/h3&gt;

&lt;p&gt;This setup is a big part of why I built &lt;a href=&quot;/from-vibe-to-viable-scalebop/&quot;&gt;ScaleBop&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You sign in to &lt;a href=&quot;https://app.scalebop.com&quot;&gt;ScaleBop&lt;/a&gt; and connect the GitHub repo that Lovable syncs to. It checks that the app is ready to deploy, generates the AWS infrastructure in CDK along with a GitHub Actions pipeline that uses OIDC, commits all of it to your repo, and deploys into your AWS account. The pipeline runs off the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;production&lt;/code&gt; branch rather than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt;, and it injects the production Supabase values at build time, so the promotion step and the environment split are set up for you.&lt;/p&gt;

&lt;p&gt;It doesn’t handle migrations or edge functions yet. For now you add the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;supabase db push&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;functions deploy&lt;/code&gt; steps to the workflow yourself, as above.&lt;/p&gt;

&lt;p&gt;Because the infrastructure and pipeline sit in the repo, you keep prompting in Lovable the same as before. Lovable just sees some CDK files and a workflow it doesn’t need to care about. And if you stop using ScaleBop, the app keeps running, since everything it set up is in your repo and your account.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;when-this-isnt-the-right-setup&quot;&gt;When this isn’t the right setup&lt;/h3&gt;

&lt;p&gt;It won’t suit everyone. If the app has outgrown prompting, with a dev team writing a lot of code by hand and the builder fighting them on it, it’s time to leave properly. One shared staging environment also gets painful once several people are making changes at the same time and what you need is a preview environment per feature. And if compliance means even your test data has to live in your own account, staging inside the builder isn’t going to fly.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;AI builders are the best prototyping tools I’ve used, and it seems a waste to throw that away as soon as an app gets real users. For most of the people I’ve talked to, adding a pull request and a second Supabase project gets them most of what they were after when they asked how to leave.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Agents are Moving to the Cloud, and so is the Orchestration</title>
   <link href="https://dkdevelopment.net/agents-are-moving-to-the-cloud//"/>
   <updated>2026-10-13T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/agents-are-moving-to-the-cloud/</id>
   <content type="html">&lt;p&gt;I keep seeing engineers carry their laptops around with the lid held open just a crack. They’re walking to a meeting, or out to the car park, and they’re checking that the thing is still running. Some have tethered it to their phone’s hotspot so the agents keep going on the drive home.&lt;/p&gt;

&lt;p&gt;Look at the screen and it’s usually three, four, sometimes six terminal tabs, each one a coding agent partway through something. One is waiting on a permission prompt. One finished ten minutes ago and nobody noticed. One went off down a rabbit hole and is quietly burning tokens on the wrong problem. Close the lid and they all stop.&lt;/p&gt;

&lt;p&gt;The agents are fast, but the engineer has become a scheduler, and a tethered one. Their work is physically bound to a machine they have to keep awake, powered and online. That’s a lot of cognitive load, and a strange amount of logistics, for a job that was supposed to get easier.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-console-is-the-wrong-place&quot;&gt;The Console Is the Wrong Place&lt;/h3&gt;

&lt;p&gt;Local agents made sense as a starting point. You’re in your editor, you’ve got the repo checked out, you type a prompt and watch it go. Watching was the point, because early on you had to. You didn’t trust it and you shouldn’t have.&lt;/p&gt;

&lt;p&gt;But watching doesn’t scale. A single console session is a fine way to supervise one agent. It’s a terrible way to supervise five. There’s no overview, no history you can skim, and no way for anyone else on the team to see what’s happening. The state of the work lives in a scrollback buffer on one person’s laptop.&lt;/p&gt;

&lt;p&gt;That’s the part that bothers me most. We spent years getting work out of people’s heads and into shared tools, and then we put it back into a terminal.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;move-the-work-to-where-work-already-lives&quot;&gt;Move the Work to Where Work Already Lives&lt;/h3&gt;

&lt;p&gt;Some of the most valuable work I’ve done in previous roles wasn’t writing code. It was making the engineering pipeline visible to the rest of the business. Product, support, sales, leadership: they all wanted to know what was being built, what was stuck and when something would land, and the honest answer used to be “ask an engineer”. Once that information lived somewhere everyone could see it, a whole category of interruptions and status meetings disappeared.&lt;/p&gt;

&lt;p&gt;Agent work is no different. Right now it’s invisible in exactly the same way, except the audience is smaller. It’s the engineer, and nobody else. Agents are moving to the cloud. They run in their own environments, off your machine, kicked off from a ticket or a comment rather than a prompt you typed and then stared at. Once that happens, the console stops being the interface. It doesn’t need to be.&lt;/p&gt;

&lt;p&gt;The interface becomes the tool your team already uses to track work: &lt;strong&gt;Linear&lt;/strong&gt;, &lt;strong&gt;Asana&lt;/strong&gt;, &lt;strong&gt;ClickUp&lt;/strong&gt;, whatever you’ve got. Those tools exist to answer the questions the engineer with six tabs is trying to answer by hand, and the ones the rest of the business keeps asking. What’s in progress? What’s blocked? What’s ready for review?&lt;/p&gt;

&lt;p&gt;A ticket moves to &lt;em&gt;In Progress&lt;/em&gt; because an agent picked it up. It gets a plan attached. It asks a question when it’s stuck, and the question lands where a human will see it. It opens a pull request and moves to &lt;em&gt;In Review&lt;/em&gt;. Nobody needs to watch a screen, and nobody needs to ask the engineer either.&lt;/p&gt;

&lt;p&gt;This is the real shift. Agents stop being something you babysit and become something that reports in. You see what they’re doing when it’s appropriate to see it, and not otherwise. So does everyone else.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2026/agents-local-vs-cloud.svg&quot; alt=&quot;Local agents tie the engineer to an open, powered, online laptop. Cloud agents report to a project board that the engineer, product and leadership can all see.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;its-the-same-sdlc&quot;&gt;It’s the Same SDLC&lt;/h3&gt;

&lt;p&gt;None of this is new, which is what I like about it. The loop is the one we’ve been running for twenty years:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Gather requirements&lt;/li&gt;
  &lt;li&gt;Plan the implementation&lt;/li&gt;
  &lt;li&gt;Execute&lt;/li&gt;
  &lt;li&gt;Verify&lt;/li&gt;
  &lt;li&gt;Review&lt;/li&gt;
  &lt;li&gt;Iterate&lt;/li&gt;
  &lt;li&gt;Ship&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What’s changed is who does the executing, and where the humans sit in the loop. Requirements and planning are still very human, and they matter more than ever, because an agent will faithfully build whatever vague thing you hand it. Review is still human. Execute and a good chunk of verify are increasingly not.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2026/agents-sdlc-loop.svg&quot; alt=&quot;The SDLC: requirements, plan, execute, verify, review, iterate, ship. Humans lead requirements, review and ship, agents lead execute and verify, and plan and iterate are shared.&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Project management tools already model this loop. Statuses, assignees, comments, linked pull requests. We don’t need a new category of tooling to orchestrate agents. We need to take the one we’ve got seriously, and treat an agent as another thing that can pick up a ticket.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;visibility-without-babysitting&quot;&gt;Visibility Without Babysitting&lt;/h3&gt;

&lt;p&gt;The word I keep coming back to is &lt;em&gt;appropriate&lt;/em&gt;. I don’t want a live feed of every file an agent opens. That’s just the terminal tab again with a nicer font.&lt;/p&gt;

&lt;p&gt;I want to see the plan before it executes, so I can catch a wrong turn early when it’s cheap. I want to know when it’s blocked and why. I want to see what was verified, and how, when it says it’s done. And I want a pull request that’s ready to review, not a diff I have to reverse-engineer.&lt;/p&gt;

&lt;p&gt;Everything in between should stay out of my way. If I &lt;em&gt;want&lt;/em&gt; to drill into the detail, it should be there to look at. I just shouldn’t have to look in order to trust that the work is moving.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;what-still-needs-work&quot;&gt;What Still Needs Work&lt;/h3&gt;

&lt;p&gt;This isn’t solved. A few things I’m honest about:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Tickets have to be good.&lt;/strong&gt; An agent working from a two-line ticket will produce a confident guess. Backlog quality was always a problem. Now it has teeth.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Cloud environments are fiddly.&lt;/strong&gt; Getting an agent a working checkout, the right secrets, and a way to actually run the tests is real setup effort, and it’s the difference between useful output and expensive nonsense.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Trust is earned per team.&lt;/strong&gt; Some work I’d hand to an agent unattended today. Some I wouldn’t go near. The board should make that boundary visible rather than hide it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Local still has a place.&lt;/strong&gt; For exploratory work, or when I’m figuring out what I even want, a tight loop in my own terminal is hard to beat.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;This line of thinking didn’t arrive all at once. It started with &lt;a href=&quot;/rise-of-engineering-agent-manager/&quot;&gt;the rise of the engineering agent manager&lt;/a&gt;, when I first noticed the job shifting from writing the code to directing and reviewing it. Then I went and built &lt;a href=&quot;/building-local-agent-box-pt1/&quot;&gt;my own agent harness and orchestrator&lt;/a&gt; to see what it actually takes, and &lt;a href=&quot;/building-local-agent-box-pt2/&quot;&gt;part 2&lt;/a&gt; is where the limits of running it on a local box got hard to ignore. That was the experiment in building an agentic cloud harness. This post is what I took from it.&lt;/p&gt;

&lt;p&gt;It’s also how I’m building &lt;a href=&quot;/from-vibe-to-viable-scalebop/&quot;&gt;ScaleBop&lt;/a&gt;. The work goes on the board, agents pick it up in the cloud, and I spend my time on requirements and review.&lt;/p&gt;

&lt;p&gt;If your workday involves rotating through terminal tabs to see which agent needs you, that’s the signal. The work has outgrown the console. Put it on the board, let the agents report in, and spend your attention on the parts that need a human: deciding what to build, and deciding whether what came back is any good.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>I built my own Coding Agent harness and orchestrator: Part 2</title>
   <link href="https://dkdevelopment.net/building-local-agent-box-pt2//"/>
   <updated>2026-09-28T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/building-local-agent-box-pt2/</id>
   <content type="html">&lt;p&gt;Batch mode worked. You’d hand &lt;strong&gt;&lt;a href=&quot;https://github.com/dkarzon/localagent-box&quot;&gt;localagent-box&lt;/a&gt;&lt;/strong&gt; a repo and a prompt, go make a coffee, and come back to a branch. For small, well-scoped tasks that was enough.&lt;/p&gt;

&lt;p&gt;Then I started giving it bigger jobs, and every fix I made uncovered the next problem. None of them were in my original plan. Each one only showed up once the previous one was solved and the system was doing more work than before.&lt;/p&gt;

&lt;p&gt;I promised last time that this post would be about interactive mode. It got built, it works, and it turned out to be the least interesting part of the whole thing. The problems worth writing about came after, and I think the order I hit them in is the fascinating part.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;getting-agents-to-work-for-longer&quot;&gt;Getting agents to work for longer&lt;/h3&gt;

&lt;p&gt;One &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opencode run&lt;/code&gt; with one prompt has a ceiling. A local model with a modest context window can hold one focused change in its head. Ask it to “add validation to the login form &lt;em&gt;and&lt;/em&gt; write tests &lt;em&gt;and&lt;/em&gt; update the API docs” and it either loses the thread halfway through or declares victory early.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;loop mode&lt;/strong&gt;. Instead of one shot, the worker drives the agent through a repeating cycle until the goal is met:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;INITIAL_PLAN&lt;/strong&gt;: survey the codebase and write a checklist of milestones, each small enough to finish in one iteration&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ORIENT&lt;/strong&gt;: look at the next milestone and the relevant files, and decide on the smallest next change&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ACT&lt;/strong&gt;: make that change&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;REFLECT&lt;/strong&gt;: evaluate progress and say what’s next, or emit a completion marker if the goal is done&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Steps 2–4 repeat up to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;maxIterations&lt;/code&gt;. The whole cycle is config-driven. There’s a default &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;loop.json&lt;/code&gt; on the server and a repo can replace it with its own in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.localagent-box/loop.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A few guard rails turned out to matter more than I expected. The host checks whether the working tree changed between iterations, and if it’s identical twice in a row the run stops as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;stalled&lt;/code&gt; instead of burning iterations going round in circles. Hitting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;maxIterations&lt;/code&gt; commits the partial work rather than throwing it away. And each step can use a different model. Locally I ran a variant of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;qwen3.8-27b&lt;/code&gt; for the coding work and sometimes dropped REFLECT down to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gemma4-12b&lt;/code&gt;, since judging progress doesn’t need the big model.&lt;/p&gt;

&lt;p&gt;It worked. Agents could now grind through multi-step tasks unattended. It also used a frightening number of tokens.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;loop-mode-was-a-token-furnace&quot;&gt;Loop mode was a token furnace&lt;/h3&gt;

&lt;p&gt;“Tokens are free when you run locally” is true for the bill. It isn’t true for time. On local hardware, every extra token of input is extra seconds of prompt processing, and a small model with a stuffed context window gets noticeably dumber on top of being slower. And once I started using Ollama Cloud to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GLM5.3&lt;/code&gt; for the heavier jobs, it was about money again too.&lt;/p&gt;

&lt;p&gt;When I looked at what each iteration was sending, the waste was obvious:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Too many steps.&lt;/strong&gt; The original cycle was OBSERVE → PLAN → ACT → REFLECT. Every step in an iteration shares a session, so each later step replays everything before it, including every file the agent read. Four steps meant a lot of replay.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;The same facts, twice.&lt;/strong&gt; Progress lived in a markdown checklist inside the repo clone, &lt;em&gt;and&lt;/em&gt; the full REFLECT output from the last iteration was injected into the next prompt. Both said the same thing.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Tool calls for bookkeeping.&lt;/strong&gt; ORIENT spent a tool call reading the plan file. REFLECT spent one or two more editing it to tick boxes, which it did unreliably.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fix came down to one principle: &lt;strong&gt;the host should own anything deterministic&lt;/strong&gt;. The model is expensive, slow and forgetful. Node.js reading a JSON file is none of those things.&lt;/p&gt;

&lt;p&gt;So OBSERVE and PLAN merged into a single ORIENT step. REFLECT stopped touching files altogether and now has to answer in a fixed shape:&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;DONE: &amp;lt;what changed this iteration&amp;gt;
REMAINING: &amp;lt;what is left&amp;gt;
NEXT: &amp;lt;the single next change&amp;gt;
FILES TOUCHED: &amp;lt;comma-separated paths&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The host parses that, ticks the matching milestones itself, and stores the state in the agent’s data directory rather than in the repo, so there’s no chance of it being committed by accident. When the next iteration starts on a fresh session, the host injects only what the model needs: the next unfinished milestone, the one-line &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;NEXT&lt;/code&gt; from the last REFLECT, and the output of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git status&lt;/code&gt; and a diffstat so it doesn’t have to go rediscovering what changed.&lt;/p&gt;

&lt;p&gt;Because ORIENT and REFLECT no longer write anything, they run as OpenCode’s read-only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;plan&lt;/code&gt; agent, which also means a smaller tool schema in every request.&lt;/p&gt;

&lt;p&gt;The other big win was letting a repo define a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;checkCommand&lt;/code&gt;. After ACT, the host runs it (usually the test suite) and feeds the exit code and the tail of the output into REFLECT. If the check fails, the host ignores any completion marker. The model doesn’t get to decide it’s done while the tests are red.&lt;/p&gt;

&lt;!-- TODO: before/after numbers here. Tokens per iteration, or total tokens for a representative loop run, before and after the handoff changes. --&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;now-i-had-to-review-all-of-it&quot;&gt;Now I had to review all of it&lt;/h3&gt;

&lt;p&gt;With loops running longer and more reliably, I had a new problem: a pile of branches to review. Reading every agent diff by hand undoes most of the point of fire-and-forget.&lt;/p&gt;

&lt;p&gt;I added a fourth agent mode, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;review&lt;/code&gt;, built on &lt;strong&gt;&lt;a href=&quot;https://open-codereview.ai/&quot;&gt;Open Code Review&lt;/a&gt;&lt;/strong&gt; (OCR). It’s an open source CLI that diffs two branches, reviews the changed files with your LLM of choice, and returns structured findings. A review agent reuses the same clone-and-checkout pipeline as a coding agent, but runs &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ocr review&lt;/code&gt; instead of OpenCode:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ocr review &lt;span class=&quot;nt&quot;&gt;--repo&lt;/span&gt; &amp;lt;workspace&amp;gt; &lt;span class=&quot;nt&quot;&gt;--from&lt;/span&gt; main &lt;span class=&quot;nt&quot;&gt;--to&lt;/span&gt; agent/login-validation &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--format&lt;/span&gt; json &lt;span class=&quot;nt&quot;&gt;--audience&lt;/span&gt; agent
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If there’s a PR for the branch, the findings get posted as a proper GitHub PR review: a summary with a severity breakdown, plus line comments on the diff. Turn on auto-review and every PR a coding agent opens gets a review queued automatically. The review also gets context from the coding session that produced the branch, so it knows what the change was &lt;em&gt;meant&lt;/em&gt; to do rather than guessing.&lt;/p&gt;

&lt;p&gt;That naturally led to the next question: if the review found problems, why am I the one fixing them? So findings above a configurable severity now kick off &lt;strong&gt;autofix&lt;/strong&gt; agents. They work through the findings in small batches, one agent at a time, resolve the GitHub review threads as each batch lands, and finish with a single verification review over the result. The review also shows up as a GitHub check run, so you can make it a required status check.&lt;/p&gt;

&lt;p&gt;A good example is &lt;a href=&quot;https://github.com/dkarzon/localagent-box/pull/37&quot;&gt;the PR that added direct Ollama Cloud support and rebuilt the settings page&lt;/a&gt;. It touched 40 files. OCR, running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;glm-5.3-flash&lt;/code&gt; on Ollama Cloud, reviewed 26 of them in about 21 minutes and came back with 36 findings: 10 medium and 26 low.&lt;/p&gt;

&lt;p&gt;The most useful one was a startup bug. The server only regenerated the OpenCode config when a local &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ollamaBaseUrl&lt;/code&gt; was set, so a cloud-only install running in a container would lose its OpenCode config on every restart until someone re-saved Settings. It also pointed out that the new Ollama Cloud API key was being written to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opencode.json&lt;/code&gt; with default file permissions. Neither of those would have jumped out at me in a 40-file diff.&lt;/p&gt;

&lt;p&gt;The low findings were mostly maintainability nitpicks: duplicated provider labels, an unused export, two refresh handlers that did exactly the same thing. Fair enough, but not why I built it.&lt;/p&gt;

&lt;p&gt;It isn’t cheap, either. That one review used 3.7 million tokens, and three files didn’t get reviewed at all because the session hit its context compression threshold. Two of those three were the review runner and the review flow, so the code reviewer couldn’t review its own code. I found that funnier than I probably should have.&lt;/p&gt;

&lt;p&gt;None of this replaces a human reading the diff. It does catch the things that slip past me in a big PR, and it means the PR I end up reading is a better one. There’s still plenty of refinement to do, starting with making sure it gets through every file and cutting down how many tokens it takes to get there.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;chaining-work-into-one-pr&quot;&gt;Chaining work into one PR&lt;/h3&gt;

&lt;p&gt;With loops and reviews in place, individual agent runs were in good shape. The limit was now the size of a single run. Loop mode stretches what one agent can do, but there’s still a point where a piece of work is better split into chunks, each with its own prompt, all landing on the same branch and the same PR.&lt;/p&gt;

&lt;p&gt;The original design didn’t allow that. A second session on a branch that was already in use got a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;409 BRANCH_IN_USE&lt;/code&gt;, and checkout always created the branch fresh from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;shared-branch queue&lt;/strong&gt; fixes both. You can now create several sessions against the same branch, and they run strictly one at a time on it:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Only one worker per repo and branch at a time, while other branches still run in parallel up to the global concurrency limit&lt;/li&gt;
  &lt;li&gt;Session N+1 starts only once session N has &lt;strong&gt;completed and pushed&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;N+1 fetches the branch from the remote instead of recreating it from base, so it builds on N’s work&lt;/li&gt;
  &lt;li&gt;If N fails, everything after it waits, with a visible reason. You can retry N in place or tell the queue to skip it and start the next one&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I deliberately didn’t build a pipeline system. No multi-prompt composer, no drag-to-reorder, no new job type. It’s the existing FIFO queue with a per-branch mutex and a rule about predecessors. The git handoff is push-then-fetch, which sounds wasteful until you remember that every workspace is isolated and disposable anyway.&lt;/p&gt;

&lt;p&gt;The piece I’m happiest with is how it plays with review. The first chunk to push opens the PR and later chunks just update it. Auto-review holds off while there’s still coding work queued on the branch, then runs once over the finished whole rather than reviewing every half-done intermediate state.&lt;/p&gt;

&lt;p&gt;This is now how most of localagent-box itself gets built. I write a plan doc that breaks a feature into PR-sized tasks, then queue a batch session per task on one branch. Reporting reviews as GitHub check runs landed as 15 queued batch commits on a single branch before I merged it as one PR. The workspace bootstrap in the next section was built the same way, one branch per phase, with 7 to 11 chunks each.&lt;/p&gt;

&lt;p&gt;Plain batch mode, not loop mode, does most of this work now. Once the plan doc has split the work into small tasks, each chunk is the kind of focused, well-scoped job batch mode was always good at.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;agents-spending-half-their-time-on-npm-install&quot;&gt;Agents spending half their time on npm install&lt;/h3&gt;

&lt;p&gt;Queuing ten small chunks instead of one big run meant ten times the setup, and watching them go through the logs one after another made a pattern hard to miss. The first few minutes of nearly every run went on the agent working out how to set up the repo. Find the lockfile, run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm ci&lt;/code&gt;, wait, run the tests, discover it needed a build step first, run that, try again.&lt;/p&gt;

&lt;p&gt;Every chunk starts from a fresh clone, so all of that was repeated every single time. And it was the worst possible work to hand a model: slow, token-hungry, and fully deterministic.&lt;/p&gt;

&lt;p&gt;Same principle as before: move it to the host. Before the OpenCode session starts, the worker now runs a &lt;strong&gt;workspace bootstrap&lt;/strong&gt;. A repo can tell it what to do, in order of precedence:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;A committed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.localagent-box/setup.sh&lt;/code&gt; script, for anything multi-step&lt;/li&gt;
  &lt;li&gt;An explicit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;setup.command&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.localagent-box/environment.json&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Named runtime profiles like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nodejs-pnpm&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;python&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Lockfile auto-detect, when the operator turns it on&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;language-jsonc highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// .localagent-box/environment.json&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;version&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;profiles&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;nodejs-pnpm&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;cacheKey&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;acme-monorepo-pnpm9&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;verifyCommand&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;npm test -- --passWithNoTests&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;verifyCommand&lt;/code&gt; runs after setup as a smoke test, and a failure there always stops the agent before it starts. I’d rather an agent fail fast with “your environment is broken” than spend ten minutes trying to fix a broken environment and then fix my code on top of it.&lt;/p&gt;

&lt;p&gt;Once setup succeeds, the host prepends a short &lt;em&gt;workspace ready&lt;/em&gt; block to the agent’s first prompt saying what ran, so it doesn’t go looking for how to install dependencies all over again.&lt;/p&gt;

&lt;p&gt;Fresh clones also meant a fresh &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm ci&lt;/code&gt; every time, which was often slower than the agent’s actual work. There’s now an optional dependency cache on a persistent volume, keyed by a hash of the lockfile (or an explicit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cacheKey&lt;/code&gt;). On a hit, the host restores &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node_modules&lt;/code&gt; into the fresh clone before the setup command runs. It’s off by default and only covers the Node profiles for now, because caching is exactly the kind of thing that works fine until it quietly doesn’t.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-same-lesson-five-times&quot;&gt;The same lesson, five times&lt;/h3&gt;

&lt;p&gt;Looking back, every one of these fixes follows the same pattern. I started out treating the model as the thing that does the work, with the harness as a thin wrapper around it. I’ve ended up with the opposite: the harness does everything it can deterministically (tracking progress, running checks, managing branches, installing dependencies) and the model only gets the parts that need judgement.&lt;/p&gt;

&lt;p&gt;That matters more with local models than it does with frontier ones. A frontier model can shrug off a messy context and a few wasted tool calls. A 27B model on my own GPU can’t, and every token you save is one it doesn’t have to wade through.&lt;/p&gt;

&lt;p&gt;What I have now is a set of parts that work well on their own. The missing piece is the workflow that connects them. Right now I’m still the glue: I write the plan doc, break it into tasks, queue the sessions, and keep an eye on the reviews.&lt;/p&gt;

&lt;p&gt;Next I’m wiring it all up. &lt;strong&gt;Linear&lt;/strong&gt; holds the tasks, &lt;strong&gt;Slack&lt;/strong&gt; is where I talk about the work and hear back about it, and localagent-box does the work in between. A feature gets broken down into Linear issues, the issues become queued sessions on a branch, and the reviews and PRs come back to me in Slack. The pieces are all built. Now they need to talk to each other.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>I built my own Coding Agent harness and orchestrator: Part 1</title>
   <link href="https://dkdevelopment.net/building-local-agent-box-pt1//"/>
   <updated>2026-08-20T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/building-local-agent-box-pt1/</id>
   <content type="html">&lt;p&gt;Three things lined up over the past few months and pushed me into building this. Token costs kept creeping upwards the more I leaned on cloud coding agents. Open weight models got genuinely good — good enough that “just run it locally” stopped sounding like a compromise. And underneath both of those, I just wanted to know for myself what’s actually possible when you cut the cloud out entirely, rather than take someone else’s word for it.&lt;/p&gt;

&lt;p&gt;None of those three on their own would’ve been enough to get me off the couch. Together, they were.&lt;/p&gt;

&lt;p&gt;This is part one of a series on &lt;strong&gt;&lt;a href=&quot;https://github.com/dkarzon/localagent-box&quot;&gt;localagent-box&lt;/a&gt;&lt;/strong&gt; — something I built to answer that question. It’s a self-hosted orchestration layer that hooks &lt;a href=&quot;https://opencode.ai&quot;&gt;OpenCode&lt;/a&gt; up to &lt;a href=&quot;https://ollama.com&quot;&gt;Ollama&lt;/a&gt; and GitHub. You give it a repo and a prompt, and it goes off and clones the code, creates a branch, runs an AI coding session with a local model, then commits and pushes the result back to GitHub. All on your own hardware. No cloud APIs, no usage bills.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-three-things-that-pushed-me-here&quot;&gt;The three things that pushed me here&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The token bills kept climbing.&lt;/strong&gt; Not one shocking invoice — a slow drift. The more I folded cloud-hosted agents into my day-to-day, the more sessions I was running, and the more each session cost as I asked them to do bigger chunks of work. Nothing that broke the budget, but enough that I started mentally flinching before kicking off a bigger job. That’s not a great place to be if you want to use these tools freely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open weight models stopped being the fallback option.&lt;/strong&gt; A year ago, running a local model for coding felt like a novelty — something you’d do to prove a point, not to get real work done. Models like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;qwen2.5-coder&lt;/code&gt; changed that calculus. They’re not frontier-model good, but they’re good enough for a real slice of the work I throw at an agent, and that slice is only growing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And I just wanted to see for myself.&lt;/strong&gt; I could read benchmarks and other people’s takes all day, but the only way to actually know what a 7B model running on my own GPU can and can’t handle unsupervised is to build the harness and let it loose on real repos. This whole project is as much an experiment as it is a tool.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;why-not-just-use-opencode-directly&quot;&gt;Why not just use OpenCode directly?&lt;/h3&gt;

&lt;p&gt;OpenCode is great — it’s a terminal-first AI coding tool. But it’s built for interactive sessions where you’re sitting there at the keyboard. I wanted something I could fire-and-forget: kick off a job via the web UI or an API call, go do something else, and come back to a branch ready to review.&lt;/p&gt;

&lt;p&gt;LocalAgent-box is the orchestration layer in the middle — it talks to OpenCode, handles the git plumbing, and keeps concurrent jobs from stepping on each other.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;how-it-works&quot;&gt;How it works&lt;/h3&gt;

&lt;p&gt;The core flow is straightforward:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Job comes in&lt;/strong&gt; — via the API or the web UI&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Clone the repo&lt;/strong&gt; — fresh workspace, checks out the base branch&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Create a feature branch&lt;/strong&gt; — so the agent has a clean place to work&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Run OpenCode&lt;/strong&gt; — pointed at the workspace, Ollama as the model provider, using whatever prompt you gave it&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Commit and push&lt;/strong&gt; — stages everything, commits with your message, pushes back to GitHub&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s the default “batch” mode — single prompt, single run, done. No back-and-forth, no follow-ups. Just a PR branch waiting for you when it’s finished.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;whats-under-the-hood&quot;&gt;What’s under the hood&lt;/h3&gt;

&lt;p&gt;The server is a Node.js/TypeScript HTTP API that manages the job queue, spawns worker processes for each agent run, and exposes a REST API for creating and monitoring jobs.&lt;/p&gt;

&lt;p&gt;The UI is a React app (Vite + Tailwind) that shows you what’s running, lets you kick off new jobs, and streams the worker logs so you can see what the agent is actually doing.&lt;/p&gt;

&lt;p&gt;The main bits:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://opencode.ai&quot;&gt;OpenCode CLI&lt;/a&gt;&lt;/strong&gt; — &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opencode run&lt;/code&gt; does the actual coding work&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://ollama.com&quot;&gt;Ollama&lt;/a&gt;&lt;/strong&gt; — local model server; OpenCode talks to this instead of a cloud API&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;GitHub App&lt;/strong&gt; — generates short-lived installation tokens per repo so workers can read and write to private repos without PATs kicking around everywhere&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://open-codereview.ai/&quot;&gt;Open Code Review&lt;/a&gt;&lt;/strong&gt; - Open source code review harness&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last one is worth a mention. I’ve done this kind of GitHub App integration before so it was the natural choice — the server authenticates as a GitHub App and mints a fresh scoped token for each job rather than sitting on a hardcoded PAT. A bit more setup the first time, but it works cleanly.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;what-a-job-actually-looks-like&quot;&gt;What a job actually looks like&lt;/h3&gt;

&lt;p&gt;Kick off a batch agent via the API:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; POST http://localhost:8081/api/v1/agents &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$TOKEN&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Content-Type: application/json&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{
    &quot;repoId&quot;: &quot;myorg-my-app&quot;,
    &quot;prompt&quot;: &quot;Add input validation to the login form&quot;,
    &quot;baseBranch&quot;: &quot;main&quot;,
    &quot;agentBranch&quot;: &quot;agent/login-validation&quot;,
    &quot;commitMessage&quot;: &quot;Agent: add input validation to login form&quot;,
    &quot;push&quot;: true
  }&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You get an agent ID back immediately. Then it’s just polling &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GET /api/v1/agents/:id&lt;/code&gt; for status or tailing logs if you want to watch it run. Status goes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;queued&lt;/code&gt; → &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;running&lt;/code&gt; → &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;completed&lt;/code&gt; (or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;failed&lt;/code&gt; if something blows up).&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;so-did-it-work&quot;&gt;So, did it work?&lt;/h3&gt;

&lt;p&gt;Once the hardware’s paid for, each agent run on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;qwen2.5-coder:7b&lt;/code&gt; costs basically nothing. No token counting, no surprise bills, no throttling at peak hours. That’s the cost side of the equation sorted — but the more interesting answer is how much real work it can actually do.&lt;/p&gt;

&lt;p&gt;Give it something specific and scoped — “add input validation to this form handler” — and it nails it, most of the time. Ask it to “improve the error handling in this service” with no further context and you get something that technically compiles but isn’t what you wanted. It’s a floor lower than GPT-5 or Claude, and you feel that floor the moment your prompt gets vague.&lt;/p&gt;

&lt;p&gt;There’s a bonus I wasn’t chasing but noticed anyway: privacy. Your code never leaves your network. If you’re working on anything sensitive, or just don’t love the idea of your whole codebase passing through a third-party API, running everything locally sidesteps that entirely.&lt;/p&gt;

&lt;p&gt;So the honest answer, a few weeks in: local models won’t replace a frontier model for the hard stuff, but they’ve earned a real spot in the rotation for well-scoped, repetitive work. Which, if I’m being honest about how I spend most of my agent budget, is most of it.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;whats-next-interactive-sessions&quot;&gt;What’s next: interactive sessions&lt;/h3&gt;

&lt;p&gt;Batch mode is great for well-scoped tasks where you know exactly what you want. But sometimes you want to poke at the agent while it’s running — redirect it, ask it to extend something, course-correct before it goes too far down the wrong path.&lt;/p&gt;

&lt;p&gt;Part 2 is about adding &lt;strong&gt;interactive mode&lt;/strong&gt;: instead of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opencode run&lt;/code&gt; and exit, the worker starts up an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;opencode serve&lt;/code&gt; instance and keeps it running. You get a proper chat UI with a live transcript, can send follow-up messages, and hit &lt;strong&gt;Finish&lt;/strong&gt; when you’re happy — which is when the commit and push actually happens.&lt;/p&gt;

&lt;p&gt;The tricky part is that OpenCode’s server API wasn’t built with an orchestration wrapper in mind. There’s a bunch of work mapping its SSE event stream into something the UI can render properly, plus some XDG environment variable gymnastics to make sure concurrent agents don’t step on each other’s sessions.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;More implementation detail in the next post — worker architecture, the GitHub App setup, and diving into interactive sessions. The code is (or will shortly be) open source at &lt;a href=&quot;https://github.com/dkarzon/localagent-box&quot;&gt;github.com/dkarzon/localagent-box&lt;/a&gt;; I’m splitting this into a series to walk through the build, not because it’s still half-finished.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Building Nomii Without the Builder</title>
   <link href="https://dkdevelopment.net/nomii-from-draftbit-to-cursor-expo//"/>
   <updated>2026-08-17T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/nomii-from-draftbit-to-cursor-expo/</id>
   <content type="html">&lt;p&gt;We’ve been building &lt;strong&gt;&lt;a href=&quot;https://www.nomii.com.au/&quot;&gt;Nomii&lt;/a&gt;&lt;/strong&gt;, a family memory keepsake app for parents, for a while now. How we build it has changed a lot in that time. We started in a low-code app builder. These days it’s React Native in a repo we own, with Cursor and a pile of AI tools doing most of the typing.&lt;/p&gt;

&lt;p&gt;It wasn’t a dramatic break, more a gradual shift. The product got clearer, our needs got more specific, and the tooling around us caught up to the point where the next step felt natural instead of risky.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;why-a-builder-was-the-right-place-to-start&quot;&gt;Why a builder was the right place to start&lt;/h3&gt;

&lt;p&gt;Nomii isn’t a project we can give forty hours a week. It’s something we build in the gaps: evenings, weekends, the occasional stolen hour between day jobs. At that stage, low-code made a lot of sense.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://draftbit.com/&quot;&gt;Draftbit&lt;/a&gt; gave us a visual way to lay out screens, wire up navigation, and iterate on UI without bootstrapping a full React Native project from scratch. For a small team with mobile experience in the room but no one living in that world day to day, that’s a reasonable trade. We weren’t avoiding code so much as avoiding &lt;em&gt;setup&lt;/em&gt;, while we figured out what Nomii actually was.&lt;/p&gt;

&lt;p&gt;And it worked. The first version came together faster than we expected — screens, flows, basic data wiring, all the stuff that usually eats the first week of a mobile project. Draftbit let us focus on the product idea: how parents capture milestones, stories, voice recordings, and the bits of family life that scatter across camera rolls and group chats.&lt;/p&gt;

&lt;p&gt;That early phase is exactly what a builder is good for. Get something in front of people, learn, move on.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;when-the-project-started-asking-for-more&quot;&gt;When the project started asking for more&lt;/h3&gt;

&lt;p&gt;As Nomii grew, so did the gap between what we wanted to build and what felt comfortable inside the builder.&lt;/p&gt;

&lt;p&gt;The product vision got more specific: richer memory types, templates and prompts, multi-user accounts, a legacy access system we’re designing for the long term. The flows got more interconnected too. The UI stopped being a collection of screens and started being a &lt;em&gt;system&lt;/em&gt;, with navigation, state, and media handling that needed to evolve together.&lt;/p&gt;

&lt;p&gt;Around the same time, a few things shifted in our toolchain. &lt;strong&gt;Expo&lt;/strong&gt; had matured to the point where the old mobile setup tax (Xcode rabbit holes, SDK path drama, an evening lost to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pod install&lt;/code&gt;) was mostly gone. &lt;a href=&quot;https://cursor.com/&quot;&gt;Cursor&lt;/a&gt; and AI coding agents had gone from novelty to something we were already using seriously on other projects. &lt;a href=&quot;https://www.pen.dev/&quot;&gt;pen.dev&lt;/a&gt; gave us a way to bring our existing &lt;strong&gt;Figma&lt;/strong&gt; designs into Cursor as implementation artifacts, which was basically the visual handoff we liked about the builder, minus staying inside one.&lt;/p&gt;

&lt;p&gt;Draftbit’s move to v2 was part of that picture too, a reminder that the platform was heading in a different direction, with more emphasis on AI assistance and less on the no-code workflow we’d built the early Nomii prototype in. It wasn’t some villain origin story, it just sharpened a question we’d already been circling: &lt;em&gt;are we still in the phase where a builder is the best fit, or have we moved past it?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We had.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;expo-made-the-switch-feel-possible&quot;&gt;Expo made the switch feel possible&lt;/h3&gt;

&lt;p&gt;The thing that kept us on a builder longest wasn’t fear of React Native. It was the &lt;strong&gt;feedback loop&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We needed to change something, see it on a phone, show it to the rest of the team, and keep going, without a build pipeline getting in the way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Expo&lt;/strong&gt; flattened a lot of that. One project template, a dev server, a QR code on your phone, and you’re looking at the app in minutes. Hot reload. Over-the-air updates when we need them. A testing loop that matches how we actually work on Nomii now: implement, run in Expo Go, test on a device, iterate.&lt;/p&gt;

&lt;p&gt;That’s what made the switch possible. The setup cost we’d been paying the builder to absorb was suddenly cheap enough to carry ourselves, especially with AI handling a fair chunk of the boilerplate.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;cursor-agents-and-owning-the-codebase&quot;&gt;Cursor, agents, and owning the codebase&lt;/h3&gt;

&lt;p&gt;Moving off the builder didn’t mean going back to hand-coding every screen like it was 2017. The whole point was still speed. We just wanted speed &lt;strong&gt;with&lt;/strong&gt; source code we could read, diff, refactor, and grow as Nomii gets more ambitious.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cursor&lt;/strong&gt; is where Nomii gets built now. Same pattern we use on other projects: an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt; with conventions, clear scope boundaries, and enough context that the agent isn’t guessing at architecture every session.&lt;/p&gt;

&lt;p&gt;In practice that looks like:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Describing a screen or flow in plain language, then iterating on the generated React Native components&lt;/li&gt;
  &lt;li&gt;Using the agent for the tedious glue (navigation wiring, form validation, API client scaffolding) while we stay in the director’s seat on product decisions&lt;/li&gt;
  &lt;li&gt;Fixing the subtle misses in review: state that works on the happy path but breaks on back navigation, accessibility gaps, the UI that’s technically correct but not quite &lt;em&gt;Nomii&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The output lives in our repo. We can run it locally, test it in Expo Go, rip out a component that isn’t working, and prompt our way to a better version. As the product gets more complex, that ownership matters more. Builders aren’t bad, they just don’t give you a home you control, and mature products tend to need one.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;from-figma-to-code-via-pendev&quot;&gt;From Figma to code via pen.dev&lt;/h3&gt;

&lt;p&gt;We were already designing Nomii in &lt;strong&gt;Figma&lt;/strong&gt;. That’s where the team iterates on layout, flow, and visual polish. What we didn’t have was a clean way to get those designs in front of Cursor as something the agent could actually work from.&lt;/p&gt;

&lt;p&gt;Describing UI in prose works fine for simple screens. For anything with real visual intent (spacing, hierarchy, component structure) it turns into a game of telephone. You end up reviewing generated code that &lt;em&gt;sort of&lt;/em&gt; matches the design, then spending as long fixing it as you would have spent just building it.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.pen.dev/&quot;&gt;pen.dev&lt;/a&gt; bridged that gap. We drop Figma designs in as artifacts alongside the prompt, and Cursor uses them as reference during implementation. The agent isn’t guessing at what “the memory capture screen” should look like; it can see the design we already agreed on.&lt;/p&gt;

&lt;p&gt;The workflow is design in Figma, reference in Pencil, implement in Cursor, run in Expo, test on a device. Each step has a clear handoff. We’re not asking the AI to be a designer and a developer at the same time — we’re giving it the same brief a human developer would get.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;what-changed-and-what-didnt&quot;&gt;What changed, and what didn’t&lt;/h3&gt;

&lt;p&gt;Different tools, different tradeoffs — not a strict upgrade in every dimension.&lt;/p&gt;

&lt;p&gt;We took on more responsibility. Responsive layouts, component libraries, navigation patterns, media handling — the builder had been absorbing some of that thinking for us. Going native-ish means we own those problems again, which is more work but also more flexibility as Nomii’s feature set grows.&lt;/p&gt;

&lt;p&gt;There’s a learning curve to prompting well. A builder UI is constrained; you can only do what the widgets allow, which is frustrating but also guard-railed. Cursor will happily build exactly what you asked for, including the parts you forgot to mention. Review becomes part of the craft.&lt;/p&gt;

&lt;p&gt;And cost isn’t zero: Cursor subscription, Expo tooling, our time reviewing generated code. But it’s a cost structure that fits where Nomii is now — pay for tools, own the output, no platform ceiling on what we can build next.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;what-wed-tell-ourselves-at-the-start&quot;&gt;What we’d tell ourselves at the start&lt;/h3&gt;

&lt;p&gt;If we were starting from scratch today, knowing what we know now, we’d probably still begin with a builder, or at least something equally fast and visual, and plan to graduate once the product vision solidified. That early phase was worth it. We didn’t waste time wrestling a toolchain; we spent it learning what parents actually need from a memory keepsake app.&lt;/p&gt;

&lt;p&gt;We’d just write the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt; earlier when the switch happened. The first week of agent-assisted development involved a lot of re-explaining conventions that should have been captured once. Same lesson as every other AI-native project we’ve worked on: the context doc is the product.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;where-nomii-is-now&quot;&gt;Where Nomii is now&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://www.nomii.com.au/&quot;&gt;Nomii&lt;/a&gt; is still very much in progress — we’re on the waitlist phase while we build out the app. But the build loop feels right for this stage: fast iteration on real devices, a codebase that can grow with the product, and AI doing the parts of mobile development we were happy to delegate anyway.&lt;/p&gt;

&lt;p&gt;Draftbit got us moving when speed mattered most. Expo, Cursor, and Pencil are how we build now that Nomii knows what it wants to be.&lt;/p&gt;

&lt;p&gt;We’ll write more about Nomii itself as we get closer to launch. For now, we’re just enjoying building a mobile app with agents, on our terms, in a repo that’s finally ours.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>ScaleBop: From Vibe to Viable</title>
   <link href="https://dkdevelopment.net/from-vibe-to-viable-scalebop//"/>
   <updated>2026-07-07T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/from-vibe-to-viable-scalebop/</id>
   <content type="html">&lt;p&gt;I’ve been building &lt;strong&gt;ScaleBop&lt;/strong&gt; for a while now, and the more I talk to people who ship with AI coding tools, the clearer the problem gets: we’ve never had it easier to &lt;em&gt;generate&lt;/em&gt; an app, and we’ve never had more confusion about what happens &lt;em&gt;after&lt;/em&gt; the prototype works on localhost.&lt;/p&gt;

&lt;p&gt;Lovable, Bolt, Replit, Claude — pick your tool — they’ll get you a full-stack app in an afternoon. That part of the story is well told. What they don’t tell you is what comes next.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-gap-nobody-talks-about&quot;&gt;The gap nobody talks about&lt;/h3&gt;

&lt;p&gt;Hosting models. Which AWS services you actually need at your current scale. Infrastructure-as-code when you’ve never written infrastructure. CI/CD, secrets, environments — without copying a tutorial that doesn’t match your repo. Whether the generated code is safe to expose to the internet.&lt;/p&gt;

&lt;p&gt;That’s the gap between &lt;em&gt;“I have an app”&lt;/em&gt; and &lt;em&gt;“I have a production system”&lt;/em&gt;. Projects stall there. Founders burn weeks in AWS documentation rabbit holes. Agencies quietly eat margin doing work the AI tools implied was already done.&lt;/p&gt;

&lt;p&gt;ScaleBop is my attempt to close that gap — not by becoming another black-box host, but by meeting you at the codebase and giving you a credible first pass at architecture, infrastructure, and delivery that &lt;strong&gt;you own&lt;/strong&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;what-scalebop-does&quot;&gt;What ScaleBop does&lt;/h3&gt;

&lt;p&gt;The tagline is &lt;strong&gt;from vibe to viable&lt;/strong&gt;. In practice, that’s a short, repeatable workflow:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Import your project&lt;/strong&gt; — connect a GitHub repo, upload a ZIP, or point at an AI-generated project.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Detect the stack&lt;/strong&gt; — frameworks, languages, build tools, databases, deployment patterns. ScaleBop reads what’s actually in the repo, not what you think you built.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Synthesize an architecture&lt;/strong&gt; — a rule-based AWS deployment blueprint tuned for cost, scalability, and simplicity. Next.js maps differently than Express; a SQLite prototype gets different guidance than Postgres.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Generate delivery assets&lt;/strong&gt; — starter AWS CDK scaffolding and GitHub Actions workflows oriented toward OIDC and environment promotion. You merge these into your repo; ScaleBop doesn’t silently deploy into your account without you in the loop.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Scan the source&lt;/strong&gt; — a static security pass on the same snapshot, so you can triage risky patterns before you wire things up to the public internet.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The output isn’t magic. It’s scaffolding — a serious starting point you can review, adapt, and grow. That’s intentional. Whether you’re an enterprise team or an indie founder, you need &lt;strong&gt;artifacts you control&lt;/strong&gt;, not another platform that holds the keys.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-education-problem&quot;&gt;The education problem&lt;/h3&gt;

&lt;p&gt;Here’s the part I find most interesting, and the reason ScaleBop isn’t just a codegen tool.&lt;/p&gt;

&lt;p&gt;A growing audience of &lt;strong&gt;non-technical builders&lt;/strong&gt; — founders, operators, designers, product people — are using AI to create real software. They can describe what they want, iterate on UI and flows, and get surprisingly far. Then someone mentions Lambda, OIDC, or a VPC, and the conversation turns opaque. They either pretend to understand, pay someone without context, or abandon the project.&lt;/p&gt;

&lt;p&gt;We can fix that — not by turning everyone into a cloud architect, but by &lt;strong&gt;translating&lt;/strong&gt; as we go.&lt;/p&gt;

&lt;p&gt;Every architecture recommendation comes with &lt;strong&gt;rationale&lt;/strong&gt;: why this backend shape, why this database choice, what tradeoff you’re making. AWS service names in the blueprint get paired with plain-language explainers. What is CloudFront? Why would a Next.js app use Lambda@Edge versus a container? What does OIDC mean in a GitHub Actions workflow, and why should you care? &lt;strong&gt;Next steps&lt;/strong&gt; land as a checklist, not a wall of jargon — connect AWS, bootstrap CDK, open a PR with generated files, run the pipeline.&lt;/p&gt;

&lt;p&gt;You already have a codebase you care about. ScaleBop connects each infrastructure decision back to &lt;em&gt;your&lt;/em&gt; stack. That’s a much better teaching surface than a generic AWS course.&lt;/p&gt;

&lt;p&gt;If you’re a non-technical builder: you don’t need to master every service. You need enough literacy to ask good questions, spot when something sounds wrong, and collaborate with a developer or consultant without flying blind.&lt;/p&gt;

&lt;p&gt;If you’re a developer: you still get speed. The blueprint and generated IaC are starting points, not gospel. But your stakeholder can finally see &lt;em&gt;why&lt;/em&gt; the architecture looks the way it does.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;problems-i-set-out-to-solve&quot;&gt;Problems I set out to solve&lt;/h3&gt;

&lt;p&gt;When I started, I wrote down a few problems I wanted ScaleBop to address directly:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;“I have code but no cloud plan”&lt;/strong&gt; — stack detection plus a deployment blueprint from the actual repo&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;“AWS is powerful and intimidating”&lt;/strong&gt; — opinionated defaults with explanations, not a blank console&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;“I don’t know what IaC to write”&lt;/strong&gt; — generated CDK bundle matched to detected deployables&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;“CI/CD feels like a separate project”&lt;/strong&gt; — GitHub Actions workflow with OIDC-oriented setup docs&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;“AI-generated code might be unsafe”&lt;/strong&gt; — advisory security scan on import, visible alongside analysis&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;“I want to own my infra, not rent a black box”&lt;/strong&gt; — downloadable artifacts; customer-owned AWS account; no hidden deploy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What ScaleBop is &lt;strong&gt;not&lt;/strong&gt;, at least not today: a fully managed Vercel-style platform that runs your production for you. That’s a deliberate boundary. Trust, security review, and operational ownership matter — especially for anyone learning their way into this space.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;how-i-built-it&quot;&gt;How I built it&lt;/h3&gt;

&lt;p&gt;ScaleBop is a TypeScript monorepo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next.js&lt;/strong&gt; handles the web app — import flows, architecture views, IaC and pipeline previews, billing, admin. The API is &lt;strong&gt;Node.js&lt;/strong&gt; — raw &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node:http&lt;/code&gt; locally, the same handlers packaged as &lt;strong&gt;AWS Lambda&lt;/strong&gt; in production. No Express, no framework magic; one handler shape everywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PostgreSQL&lt;/strong&gt; for application data; &lt;strong&gt;S3&lt;/strong&gt; for code snapshots at scale. The real business logic lives in &lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;packages/core&lt;/code&gt;&lt;/strong&gt;: analyzer, blueprint synthesis, IaC and pipeline generation, security findings normalisation. The API and web app stay thin. &lt;strong&gt;AWS CDK&lt;/strong&gt; defines the ScaleBop platform itself — API Gateway, Lambda, RDS, buckets, secrets.&lt;/p&gt;

&lt;p&gt;The analyzer and blueprint engine are &lt;strong&gt;deterministic&lt;/strong&gt; today — heuristics and rules, not an LLM guessing your architecture. That was a conscious MVP choice. Predictable output you can debug beats impressive-sounding hallucinations when someone is trying to learn.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-tools-that-made-it-possible&quot;&gt;The tools that made it possible&lt;/h3&gt;

&lt;p&gt;Building a product like this solo — or nearly solo — would have been unrealistic a few years ago. Three tools shaped how I work.&lt;/p&gt;

&lt;h4 id=&quot;cursor&quot;&gt;Cursor&lt;/h4&gt;

&lt;p&gt;Cursor is where almost all of the code gets written. Not as a replacement for thinking — as a force multiplier for implementation.&lt;/p&gt;

&lt;p&gt;The ScaleBop codebase has strict conventions: shared types in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;packages/core&lt;/code&gt;, handlers in domain folders, SQL in query modules, Zod validation on request bodies, no &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;console.log&lt;/code&gt; in the API. Cursor helps me move fast &lt;strong&gt;within&lt;/strong&gt; those guardrails — refactoring across workspaces, extending the blueprint rules, writing migrations, keeping tests aligned.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt; file in the repo is effectively a briefing doc for the AI: stack, patterns, things not to do. That meta-layer — human rules plus AI execution — is how a single builder can maintain a monorepo spanning web, API, core logic, and CDK without drowning in context switching.&lt;/p&gt;

&lt;p&gt;Honest take: Cursor doesn’t remove the hard product decisions. It removes friction on the decisions already made.&lt;/p&gt;

&lt;h4 id=&quot;linear&quot;&gt;Linear&lt;/h4&gt;

&lt;p&gt;Linear is the source of truth for &lt;em&gt;what&lt;/em&gt; to build next. Issues are tracked as units of work — Customer-owned AWS connections, security scan UX, CDK bootstrap automation, billing paths, custom domains, and dozens of vertical slices in between.&lt;/p&gt;

&lt;p&gt;Why Linear and not just GitHub Issues? Speed and clarity. Linear’s workflow matches how I think about product work: a crisp issue, a plan doc when scope is fuzzy (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;docs/plans/&lt;/code&gt; often links back to a Linear ticket), ship, close. For a builder wearing product, engineering, and ops hats, that lightweight structure keeps momentum without enterprise ceremony.&lt;/p&gt;

&lt;p&gt;When something breaks in production or a user report comes in, it becomes a ticket. When an idea needs exploration — AWS reseller models, deployment architecture tradeoffs — it gets a plan doc &lt;em&gt;and&lt;/em&gt; a Linear issue so it doesn’t live only in my head.&lt;/p&gt;

&lt;h4 id=&quot;github&quot;&gt;GitHub&lt;/h4&gt;

&lt;p&gt;GitHub shows up twice: as &lt;strong&gt;infrastructure for ScaleBop the product&lt;/strong&gt;, and as &lt;strong&gt;part of what ScaleBop generates for customers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For the product: source control, code review, GitHub OAuth for repo imports, GitHub App flows for listing repositories and opening PRs with generated IaC and pipeline files, CI workflows on push and pull request.&lt;/p&gt;

&lt;p&gt;For customers: ScaleBop generates &lt;strong&gt;GitHub Actions&lt;/strong&gt; workflows designed around &lt;strong&gt;OIDC&lt;/strong&gt; — short-lived credentials, no long-lived AWS keys in the repo. That’s the modern standard, and it’s exactly the kind of thing non-technical builders never know they need until something goes wrong.&lt;/p&gt;

&lt;p&gt;Your code lives here, your pipeline runs here, your AWS account stays yours.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;what-ive-learned-so-far&quot;&gt;What I’ve learned so far&lt;/h3&gt;

&lt;p&gt;The prototype economy is real. AI app generation isn’t a fad; it’s a new on-ramp to software. The downstream tooling lag is the opportunity.&lt;/p&gt;

&lt;p&gt;Ownership beats convenience for the first deploy. People will tolerate more steps if they understand them and retain control. Black-box deploy is a later-stage feature, not an MVP wedge.&lt;/p&gt;

&lt;p&gt;Education is a feature, not a blog sidebar. Explainers in the UI convert better than explainers in a PDF. Builders stay when they understand &lt;em&gt;their&lt;/em&gt; architecture.&lt;/p&gt;

&lt;p&gt;Deterministic beats flashy for trust. A rule-based blueprint you can trace beats an LLM essay that sounds confident and wrong.&lt;/p&gt;

&lt;p&gt;Solo building is a workflow problem. Cursor plus Linear plus GitHub isn’t hype — it’s an operating system for one person shipping a credible SaaS.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;where-it-goes-next&quot;&gt;Where it goes next&lt;/h3&gt;

&lt;p&gt;ScaleBop today delivers the core loop: ingest, analyze, blueprint, generate, scan. The roadmap includes deeper AWS connection flows, richer cost visibility, better security findings UX, and continued work on making the “first deploy” path approachable without crossing the trust boundary.&lt;/p&gt;

&lt;p&gt;If you’re building with AI and stuck between “it works on my machine” and “it runs in prod,” that’s the problem space I’m obsessed with. &lt;a href=&quot;https://scalebop.com&quot;&gt;ScaleBop&lt;/a&gt; is my answer so far — free import and stack detection on the starter tier, enough to see if it understands your app before you commit to anything.&lt;/p&gt;

&lt;p&gt;I’m still figuring out what parts of the journey feel most opaque. If you’ve hit that wall, I’d like to hear about it.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Rise of the Engineering Agent Manager</title>
   <link href="https://dkdevelopment.net/rise-of-engineering-agent-manager//"/>
   <updated>2026-04-07T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/rise-of-engineering-agent-manager/</id>
   <content type="html">&lt;p&gt;There’s a conversation happening in every engineering org right now, whether it’s out loud or just quietly in people’s heads: &lt;em&gt;what exactly is my job now?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For a long time, the path was well understood. Junior developers write code, senior developers write better code and review it, tech leads set patterns and mentor, and engineering managers coordinate people and delivery. Everyone had a lane. AI has blown that model up, not by replacing people, but by fundamentally changing where the value is.&lt;/p&gt;

&lt;p&gt;The engineers and leaders who are thriving right now aren’t the ones who are best at writing code. They’re the ones who are best at directing, reviewing, and shaping the work that AI agents are producing.&lt;/p&gt;

&lt;h3 id=&quot;from-producer-to-director&quot;&gt;From Producer to Director&lt;/h3&gt;

&lt;p&gt;Here’s the mental shift that took me a while to internalise: your job is no longer to be the best implementer. It’s to be the best decision-maker about what gets implemented and why.&lt;/p&gt;

&lt;p&gt;Think of it like the difference between being a craftsman and being an architect. A craftsman’s value is in their ability to produce the work with their hands. An architect’s value is in their ability to understand the brief, envision the outcome, and communicate that clearly enough for others (or now, agents) to execute it faithfully.&lt;/p&gt;

&lt;p&gt;The coding work itself hasn’t disappeared. There’s more of it than ever. But the constraint has shifted from &lt;em&gt;how fast can humans write code&lt;/em&gt; to &lt;em&gt;how well can humans define, review, and guide what agents produce&lt;/em&gt;. That changes everything about what a strong engineering leader looks like.&lt;/p&gt;

&lt;h3 id=&quot;architecture-strategy-vision-now-the-whole-job&quot;&gt;Architecture, Strategy, Vision: Now the Whole Job&lt;/h3&gt;

&lt;p&gt;When an agent can scaffold a feature in minutes, the bottleneck becomes the quality of what you gave it to work from. Vague requirements produce vague code. Poorly considered architecture decisions, when handed to an agent that will faithfully implement them at scale, produce large amounts of faithfully bad code.&lt;/p&gt;

&lt;p&gt;This is where Engineering Managers and tech leads are finding renewed purpose. Spending time deeply on:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;System design and architecture&lt;/strong&gt;: The decisions that are hard to reverse, that constrain everything downstream, that require experience and judgment.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Product strategy&lt;/strong&gt;: What should we actually be building? What’s the simplest version of this that delivers value?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Technical vision&lt;/strong&gt;: Where is the codebase going in 6 months? What patterns should agents be following? What should they never do?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Context documents&lt;/strong&gt;: More on this below, but writing the documentation that puts agents in the right headspace is now a core leadership skill.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The engineers who are leaning into this are finding that their impact is multiplied. One person with a clear vision and a well-configured agent workflow can ship what used to take a team.&lt;/p&gt;

&lt;h3 id=&quot;controlling-agents-through-context&quot;&gt;Controlling Agents Through Context&lt;/h3&gt;

&lt;p&gt;One of the more interesting things about working with AI coding agents (tools like GitHub Copilot, Cursor, and others) is that they’re heavily influenced by the context you give them. This has spawned a new type of document that’s becoming a standard part of engineering workflows: the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt; file, custom instruction files, and project-scoped prompt documents.&lt;/p&gt;

&lt;p&gt;These documents are essentially your communication layer with your agents. A well-written &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt; might define:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The coding style and conventions for the project&lt;/li&gt;
  &lt;li&gt;Which patterns to use and which to avoid&lt;/li&gt;
  &lt;li&gt;How to structure components, name things, and organise files&lt;/li&gt;
  &lt;li&gt;Testing expectations&lt;/li&gt;
  &lt;li&gt;Scope boundaries: what the agent should and shouldn’t touch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tech leads who are writing these documents well are discovering something important: it forces you to articulate things that usually live only in your head. The conventions that you’d catch in a code review but never wrote down anywhere. The architectural decisions that are obvious to you but invisible to a new team member, or an agent.&lt;/p&gt;

&lt;p&gt;There’s also a feedback loop here. When an agent produces something that misses the mark, the right response isn’t just to fix the output. It’s to update your context documents so the agent gets it right next time. This is a fundamentally different kind of engineering leadership work, and it’s a skill that takes practice.&lt;/p&gt;

&lt;h3 id=&quot;linear-and-the-agent-friendly-backlog&quot;&gt;Linear and the Agent-Friendly Backlog&lt;/h3&gt;

&lt;p&gt;Project management tooling is catching up fast. Linear has become the tool of choice for a lot of engineering teams, and it’s easy to see why when you start working in an AI-native way.&lt;/p&gt;

&lt;p&gt;Where a traditional Jira ticket might be a title and two sentences, Linear has nudged teams toward writing richer, more structured issue descriptions. And now with AI agents that can be pointed at a Linear ticket to execute on, the quality of that ticket has a direct impact on the quality of what gets built.&lt;/p&gt;

&lt;p&gt;The mental model is shifting from &lt;em&gt;assign this to a developer&lt;/em&gt; to &lt;em&gt;can an agent execute on this ticket as written?&lt;/em&gt; If the answer is no (too vague, missing acceptance criteria, or lacking technical context), that’s a signal the issue needs more work before it goes anywhere.&lt;/p&gt;

&lt;p&gt;For engineering managers and leads, this creates a new responsibility around backlog hygiene. Grooming a ticket used to be about making sure a human developer had enough information to get started. Now it’s about making sure that information is structured clearly enough that an agent can run with it autonomously, with a human reviewing the output rather than doing the work line by line.&lt;/p&gt;

&lt;p&gt;Some teams are even going further, using agents to draft tickets from higher-level briefs, then having leads review and refine those before they’re executed. The human judgment is still in the loop, just at a different stage.&lt;/p&gt;

&lt;h3 id=&quot;the-review-layer-is-the-new-craft&quot;&gt;The Review Layer Is the New Craft&lt;/h3&gt;

&lt;p&gt;If you’re an engineering leader and you’re worried that AI is devaluing your expertise, I’d push back on that. What’s changing is &lt;em&gt;where&lt;/em&gt; you apply it.&lt;/p&gt;

&lt;p&gt;The code review is becoming more important, not less. When agents are generating code, the review is where human expertise catches the subtle misalignments: the technically correct implementation that misses the intent, the approach that works for this feature but creates problems for the next one, the security concern that the agent didn’t have enough context to see coming.&lt;/p&gt;

&lt;p&gt;This requires:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Deep familiarity with the codebase and its constraints&lt;/li&gt;
  &lt;li&gt;Clear communication about &lt;em&gt;why&lt;/em&gt; something isn’t right, not just that it isn’t&lt;/li&gt;
  &lt;li&gt;The ability to update context documents so the same mistake doesn’t happen again&lt;/li&gt;
  &lt;li&gt;Trust in your own judgment about when to approve and when to push back&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the skills that separate a great engineering leader from a mediocre one, and they haven’t changed. They’ve just been relocated to a new part of the workflow.&lt;/p&gt;

&lt;h3 id=&quot;the-leaders-who-are-struggling&quot;&gt;The Leaders Who Are Struggling&lt;/h3&gt;

&lt;p&gt;It’s also worth being honest about where the friction is. Not everyone is finding this transition easy.&lt;/p&gt;

&lt;p&gt;The engineers who built their identity around being great implementers — who took pride in hammering out clean code quickly — are having to find a new source of professional satisfaction. That’s genuinely hard. The craft is real and it matters, and being asked to step back from it to direct others (or agents) doing it can feel like a demotion even when it isn’t.&lt;/p&gt;

&lt;p&gt;There’s also a learning curve to working effectively with agents that a lot of people underestimate. It’s not as simple as asking a question and accepting whatever comes back. It requires developing intuition for when to trust the output, when to scrutinise it, and how to give feedback that actually improves future results.&lt;/p&gt;

&lt;p&gt;The leaders who are investing time in building this intuition are pulling ahead. The ones who are treating AI tools as a productivity shortcut but not changing how they think about their role are finding the benefits much more limited.&lt;/p&gt;

&lt;h3 id=&quot;getting-started&quot;&gt;Getting Started&lt;/h3&gt;

&lt;p&gt;If you’re an Engineering Manager or tech lead who’s still finding your footing with this shift, a few practical starting points:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Write an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt; for one of your projects.&lt;/strong&gt; Even if it’s imperfect, the act of writing down your conventions is valuable regardless of agents.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Try completing a full feature with an agent&lt;/strong&gt;, staying in the director seat. Define the work clearly, review what it produces, iterate through feedback. Notice where you struggle to articulate what you want.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Audit your Linear (or equivalent) backlog.&lt;/strong&gt; Would an agent have enough context to work from these tickets? Where are the gaps?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Share the experience with your team.&lt;/strong&gt; The best teams right now are learning together, sharing prompt patterns that work, updating shared context docs based on what agents get wrong.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The shift is real and it’s happening fast. The good news is that the skills that make a great engineering leader (clear thinking, good judgment, strong communication, technical depth) are exactly what this new way of working demands. They just need to be applied in new places.&lt;/p&gt;

&lt;p&gt;The Engineering Agent Manager is already here. The question is whether you’re ready to step into that role.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Using Schema.org structured data to improve SEO</title>
   <link href="https://dkdevelopment.net/seo-structured-data-2025//"/>
   <updated>2025-12-03T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/seo-structured-data-2025/</id>
   <content type="html">&lt;p&gt;Search engine optimization has long been a cornerstone of the web, continually evolving as search engines and open‑web initiatives shape how information is discovered.&lt;/p&gt;

&lt;p&gt;Today, the rise of AI tools and AI‑powered search is accelerating that evolution, making structured data more critical than ever. In this post, I’ll explore how adding schema.org markup can enrich your content, improve visibility across both traditional search and AI‑driven platforms, and ultimately create a better experience for users.&lt;/p&gt;

&lt;blockquote&gt;
    Schema.org is a set of extensible schemas that enables webmasters to embed structured data on their web pages for use by search engines and other applications. For more details, see the &lt;a href=&quot;https://schema.org&quot;&gt;homepage&lt;/a&gt;.
&lt;/blockquote&gt;

&lt;h4 id=&quot;why-use-structured-data&quot;&gt;Why Use Structured Data?&lt;/h4&gt;

&lt;p&gt;Adding structured data to your website provides several benefits:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Rich Search Results&lt;/strong&gt;: Your content can appear with enhanced visuals in search results, including star ratings, images, prices, and availability information&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Better Click-Through Rates&lt;/strong&gt;: Rich snippets stand out in search results, leading to higher engagement&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Voice Search Optimization&lt;/strong&gt;: Search assistants use structured data to provide spoken answers&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Knowledge Graph Integration&lt;/strong&gt;: Your content can be featured in Google’s Knowledge Panel&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;AI Agent Compatibility&lt;/strong&gt;: Modern AI systems can better understand and utilise your content (more on this below)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;how-to-implement-structured-data&quot;&gt;How to Implement Structured Data&lt;/h4&gt;

&lt;p&gt;There are 3 main ways to include structured data in a website’s markup:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Microdata&lt;/li&gt;
  &lt;li&gt;JSON-LD&lt;/li&gt;
  &lt;li&gt;RDFa&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Microdata&lt;/strong&gt; adds additional attributes to HTML elements to identify the data on the page. The data is embedded directly within your existing HTML.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;article&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemscope&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemtype=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;https://schema.org/BlogPosting&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemprop=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;headline&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;My Blog Post Title&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemprop=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;author&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemscope&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemtype=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;https://schema.org/Person&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemprop=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Damian Karzon&lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;time&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemprop=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;datePublished&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;datetime=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;2025-12-04&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;December 4, 2025&lt;span class=&quot;nt&quot;&gt;&amp;lt;/time&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;itemprop=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;articleBody&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The content of the blog post goes here...&lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;JSON-LD&lt;/strong&gt; (JavaScript Object Notation for Linked Data) adds a JSON block to the page where the structured data is output in a single location. This is Google’s recommended format as it’s easier to implement and maintain.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;application/ld+json&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@context&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://schema.org&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;BlogPosting&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;headline&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;My Blog Post Title&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Damian Karzon&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;datePublished&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;2025-12-04&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;dateModified&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;2025-12-04&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://example.com/images/post-banner.jpg&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;publisher&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Organization&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;DK Development&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;logo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ImageObject&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://example.com/logo.png&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;RDFa&lt;/strong&gt; (Resource Description Framework in Attributes) like Microdata, adds additional attributes to HTML elements to identify the data on the page. It’s more verbose but offers greater flexibility.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;article&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;vocab=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;https://schema.org/&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;typeof=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;BlogPosting&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;property=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;headline&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;My Blog Post Title&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;property=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;author&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;typeof=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Person&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;property=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Damian Karzon&lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;time&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;property=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;datePublished&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;datetime=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;2025-12-04&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;December 4, 2025&lt;span class=&quot;nt&quot;&gt;&amp;lt;/time&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;property=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;articleBody&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The content of the blog post goes here...&lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;which-format-should-you-use&quot;&gt;Which Format Should You Use?&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;JSON-LD is the recommended approach&lt;/strong&gt; for most implementations because:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;It’s easier to add and maintain (no need to modify existing HTML)&lt;/li&gt;
  &lt;li&gt;It keeps your markup cleaner&lt;/li&gt;
  &lt;li&gt;It’s Google’s preferred format&lt;/li&gt;
  &lt;li&gt;It can be dynamically generated server-side or via JavaScript&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;popular-schema-types&quot;&gt;Popular Schema Types&lt;/h4&gt;

&lt;p&gt;A comprehensive list of schema types can be found at &lt;a href=&quot;https://schema.org/docs/schemas.html&quot;&gt;schema.org/docs/schemas.html&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;The vocabulary currently consists of 792 Types, 1447 Properties, 15 Datatypes, 83 Enumerations and 445 Enumeration members.&lt;/blockquote&gt;

&lt;p&gt;Here are some of the most commonly used schema types:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Schema Type&lt;/th&gt;
      &lt;th&gt;Use Case&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Article/BlogPosting&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Blog posts and news articles&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Product&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;E-commerce product pages&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;LocalBusiness&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Physical business locations&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Organization&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Company information&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Person&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Individual profiles&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Recipe&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Cooking recipes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Event&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Upcoming events&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;FAQPage&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Frequently asked questions&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;HowTo&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Step-by-step guides&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Review&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Product or service reviews&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;BreadcrumbList&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Site navigation breadcrumbs&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;VideoObject&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Video content&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h4 id=&quot;ai-agents-and-structured-data&quot;&gt;AI Agents and Structured Data&lt;/h4&gt;

&lt;p&gt;With the rise of AI assistants like ChatGPT, Claude, Gemini, and others, structured data has taken on a new dimension of importance. Here’s how AI agents interact with schema.org markup:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhanced Content Understanding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI agents parse structured data to better understand the context and meaning of web content. When an AI encounters a page with proper schema markup, it can:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Accurately identify the type of content (article, product, recipe, etc.)&lt;/li&gt;
  &lt;li&gt;Extract key information like authors, dates, prices, and ratings&lt;/li&gt;
  &lt;li&gt;Understand relationships between entities on the page&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AI-Powered Search and Assistants&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many AI systems now power search experiences and virtual assistants:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Retrieval-Augmented Generation (RAG)&lt;/strong&gt;: AI systems that search and synthesise information benefit from structured data to provide accurate, well-attributed responses&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Voice Assistants&lt;/strong&gt;: Siri, Alexa, and Google Assistant use structured data to answer questions directly&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;AI Search Engines&lt;/strong&gt;: Perplexity, Bing Copilot, and Google’s AI Overviews leverage schema markup to generate accurate summaries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Agentic Web Browsing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As AI agents become more autonomous in browsing and interacting with websites:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Structured data helps agents understand page purpose and available actions&lt;/li&gt;
  &lt;li&gt;Schema types like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Action&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;EntryPoint&lt;/code&gt; can indicate how to interact with a service&lt;/li&gt;
  &lt;li&gt;Well-marked content is more likely to be correctly interpreted and cited&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best Practices for AI Compatibility&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To optimise your structured data for AI agents:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Be comprehensive&lt;/strong&gt;: Include as many relevant properties as possible&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Use accurate data&lt;/strong&gt;: AI systems may cross-reference your claims&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Include &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sameAs&lt;/code&gt; properties&lt;/strong&gt;: Link to authoritative sources (Wikipedia, social profiles)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;speakable&lt;/code&gt; schema&lt;/strong&gt;: Indicates content suitable for text-to-speech&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Implement &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;WebPage&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;WebSite&lt;/code&gt; schemas&lt;/strong&gt;: Helps AI understand your site structure&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;application/ld+json&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@context&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://schema.org&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;WebSite&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;DK Development&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://dkdevelopment.net&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;potentialAction&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;SearchAction&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://dkdevelopment.net/search?q={search_term_string}&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;query-input&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;required name=search_term_string&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;testing-your-structured-data&quot;&gt;Testing Your Structured Data&lt;/h4&gt;

&lt;p&gt;Before deploying structured data to production, validate it using these tools:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://search.google.com/test/rich-results&quot;&gt;Google Rich Results Test&lt;/a&gt;&lt;/strong&gt;: Tests if your page is eligible for rich results&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://validator.schema.org/&quot;&gt;Schema.org Validator&lt;/a&gt;&lt;/strong&gt;: Validates your markup against the schema.org specification&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.google.com/webmasters/markup-helper/&quot;&gt;Google Structured Data Markup Helper&lt;/a&gt;&lt;/strong&gt;: Helps generate markup for your pages&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;a-real-world-blog-example&quot;&gt;A Real-World Blog Example&lt;/h4&gt;

&lt;p&gt;Here’s how I’ve implemented structured data on this very blog using JSON-LD:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;application/ld+json&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@context&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://schema.org&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;BlogPosting&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;mainEntityOfPage&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;WebPage&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@id&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://dkdevelopment.net/seo-structured-data-2025/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;headline&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Using Schema.org structured data to improve SEO&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;How to add Schema.org markup to your websites to improve users search experience.&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://dkdevelopment.net/img/Banners/book.jpg&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Damian Karzon&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://dkdevelopment.net&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;publisher&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Organization&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;DK Development&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;logo&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ImageObject&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;https://dkdevelopment.net/img/favicon.ico&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;datePublished&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;2025-12-04&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;dateModified&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;2025-12-04&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;recap&quot;&gt;Recap&lt;/h4&gt;

&lt;p&gt;Structured data is no longer just about improving traditional search results—it’s becoming essential infrastructure for how AI systems understand and interact with web content. By implementing schema.org markup:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Choose JSON-LD&lt;/strong&gt; as your primary format for ease of implementation&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Start with the basics&lt;/strong&gt;: Add Article/BlogPosting schema to your blog posts&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Expand to business schemas&lt;/strong&gt;: Organization, LocalBusiness, and Person for your about pages&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Test thoroughly&lt;/strong&gt; before deployment using Google’s validation tools&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Think about AI&lt;/strong&gt;: Your structured data helps AI agents accurately represent your content&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As AI continues to transform how users discover and consume web content, well-structured data will become a competitive advantage—not just for SEO, but for ensuring your content is accurately understood and represented across an increasingly AI-mediated web.&lt;/p&gt;

&lt;h4 id=&quot;further-reading&quot;&gt;Further Reading&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://schema.org/Blog&quot;&gt;Schema.org Blog Type&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/advanced/structured-data/article&quot;&gt;Google’s Article Structured Data Guide&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/philwareham/schema-microdata-examples/blob/main/blog.html&quot;&gt;Schema Microdata Examples on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>My Home Assistant Docker Compose file</title>
   <link href="https://dkdevelopment.net/my-home-assistant-docker-compose//"/>
   <updated>2022-05-19T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/my-home-assistant-docker-compose/</id>
   <content type="html">&lt;p&gt;Over the last few months I have been playing around with a Home Assistant instance in Docker to run all of my home automation and over time I have slowly added more and more to it (more integrations, more services, more devices, etc.).&lt;/p&gt;

&lt;p&gt;Some info about my setup before we get into it.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Host machine running Windows 10 Pro&lt;/li&gt;
  &lt;li&gt;Docker Desktop using WSL2 backend&lt;/li&gt;
  &lt;li&gt;.wslconfig configured with 30GB Ram and 5 Processors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since I don’t run Home Assistant Operating System I don’t have the ability to use the supervisor and install services through that which means I’ve had to setup my own docker containers for additional services.
The containers I have running here are:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Home Assistant&lt;/strong&gt; - The standalone Home Assistant Core install&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;PostgreSQL&lt;/strong&gt; - Database storage for Home Assistant recorder (instead of using filesystem)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Node Red&lt;/strong&gt; - Low-code programming tool for wiring up events&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Mosquitto&lt;/strong&gt; - An MQTT message broker (to allow devices to use a publish/subscribe model of messaging)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Tasmoadmin&lt;/strong&gt; - Administration platform for Tasmota devices (to allow OTA updates of devices without direct internet access)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Chrony&lt;/strong&gt; - A Network Time Protocol (NTP) Server (to allow devices without internet access to synchronise time)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;InfluxDB&lt;/strong&gt; - A Scalable datastore for metrics, events, and real-time analytics (used for long term storage of sensor data)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Grafana&lt;/strong&gt; - Open source data visualisation platform (to create dashboards from the data in InfluxDB)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So let’s take a look at the docker-compose.yml file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;na&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;3.1&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;home-assistant&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;home-assistant&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;homeassistant/home-assistant:2022.5.4&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;localnet&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/c/local-docker/home-assistant/config:/config&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/c/local-docker/home-assistant/media:/media&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mosquitto&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;8123:8123&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;1400:1400&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;TZ&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Australia/Brisbane&quot;&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;postgres&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;postgres:12.6&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;localnet&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;5432:5432&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;POSTGRES_DB&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;homeassistant&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;POSTGRES_USER&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ha_user&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;POSTGRES_PASSWORD&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;CrazyStr0ngPa$$word&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;nodered&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;nodered&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;nodered/node-red&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;localnet&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;1880:1880&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/c/local-docker/home-assistant/nodered:/data&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;home-assistant&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mosquitto&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;TZ&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Australia/Brisbane&quot;&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;mosquitto&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mosquitto&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;eclipse-mosquitto&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;localnet&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;1883:1883&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;1884:1884&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/c/local-docker/home-assistant/mosquitto/config:/mosquitto/config&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/c/local-docker/home-assistant/mosquitto/data:/mosquitto/data&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/c/local-docker/home-assistant/mosquitto/log:/mosquitto/log&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;TZ&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Australia/Brisbane&quot;&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;tasmoadmin&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;tasmoadmin&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ghcr.io/tasmoadmin/tasmoadmin:v1.8.0&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;localnet&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;8124:80&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/c/local-docker/home-assistant/tasmoadmin:/data/tasmoadmin&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;chrony&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;chrony&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;cturra/ntp&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;localnet&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;NTP_SERVERS=time.windows.com&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;123:123&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;influxdb&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;influxdb&lt;/span&gt; 
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;influxdb:latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;localnet&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;DOCKER_INFLUXDB_INIT_MODE=setup&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;INFLUXDB_DB=home_assistant&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;DOCKER_INFLUXDB_INIT_USERNAME=influx_user&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;DOCKER_INFLUXDB_INIT_PASSWORD=CrazyStr0ngPa$$word&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;DOCKER_INFLUXDB_INIT_ORG=ha-org&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;DOCKER_INFLUXDB_INIT_BUCKET=ha-bucket&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;8086:8086&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/c/local-docker/home-assistant/influxdb:/var/lib/influxdb2&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;grafana&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;grafana&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;grafana/grafana:latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;localnet&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;influxdb&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;GF_SECURITY_ADMIN_USER=grafana_user&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;GF_SECURITY_ADMIN_PASSWORD=CrazyStr0ngPa$$word&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;8125:3000&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/c/local-docker/home-assistant/grafana:/var/lib/grafana&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;localnet&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;driver&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bridge&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Let’s start with a few of the common parts to it.&lt;/p&gt;

&lt;h3 id=&quot;commons&quot;&gt;Commons&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;container_name&lt;/strong&gt; - I’ve given all of the containers specific names instead of the default naming of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;folder name&amp;gt;_&amp;lt;service name&amp;gt;_1&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;networks&lt;/strong&gt; - All the containers have been added to a custom network called &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;localnet&lt;/code&gt; which is also defined at the top level with the driver set to bridge. This is to make sure all of the containers can properly talk to each other and get around some network oddities I was experiencing with my setup.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;restart&lt;/strong&gt; - All of the containers are also set to always restart so whenever docker starts up they will also startup. So if the host is every restarted the containers will come back automatically.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;depends_on&lt;/strong&gt; - I have a few containers that set the depends on to ensure other containers are successfully loaded before them but this isn’t necessary.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now into the containers themselves…&lt;/p&gt;

&lt;h3 id=&quot;home-assistant&quot;&gt;home-assistant&lt;/h3&gt;
&lt;p&gt;The main Home Assistant Core image, here I have given it a specific version so that I can easily see which version I’m using and update when I need to. Using latest here would work as well but may need to make sure if pulls down latest instead of using the existing cached version.&lt;/p&gt;

&lt;p&gt;I also have setup some mapped volumes for this so I can keep my config files in a folder on the Windows host machine. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/c/local-docker/home-assistant/config:/config&lt;/code&gt; This one maps the Windows folder &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;C:\local-docker\home-assistant\config&lt;/code&gt; to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/config&lt;/code&gt; directory within the container which is where the main config yaml files are kept. This allows me to more easily edit the config files from the host machine as well as persisting the config across rebuilds of the container. The other volume entry is for media which allows me to easily add media to the server for local playback on media players. The TZ environment variable here sets the timezone of the container to make sure it’s running in my local timezone.&lt;/p&gt;

&lt;h3 id=&quot;postgres&quot;&gt;postgres&lt;/h3&gt;
&lt;p&gt;I’ve gone with using a PostgreSQL instance here for the recorder because my home assistant container has it’s config folder as a mounted volume which on Windows has a bit of a performance hit and since I run these folders from my local C Drive I wanted to make sure my home assistant wasn’t slowing anything else running on the host machine too much. The recorder integration also supports MySQL, MariaDB and SQLite (default), more info here: &lt;a href=&quot;https://www.home-assistant.io/integrations/recorder/&quot;&gt;https://www.home-assistant.io/integrations/recorder/&lt;/a&gt;. The container I actually use is in a separate docker-compose file because I use it for other things as well but I included it here for completeness.&lt;/p&gt;

&lt;h3 id=&quot;nodered&quot;&gt;nodered&lt;/h3&gt;
&lt;p&gt;I am not setting a version for this image so it will just use the latest available when it is started (I haven’t had any issues with this so far). To connect the node red instance to home assistant you need to make sure you install the relevant home assistant packages:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;node-red-contrib-home-assistant&lt;/li&gt;
  &lt;li&gt;node-red-contrib-home-assistant-websocket&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running node red in docker like this I found that installing packages from the UI didn’t install the latest from npm, because it installed them from the node red flows library (&lt;a href=&quot;https://flows.nodered.org/&quot;&gt;https://flows.nodered.org/&lt;/a&gt;). To install the latest versions here I had to run the npm install commands in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/data&lt;/code&gt; directory on the container itself.
This container has a volume setup for the /data directory so that I can backup the config and the flow json files and state is again persisted between rebuilds of the container.&lt;/p&gt;

&lt;h3 id=&quot;mosquitto&quot;&gt;mosquitto&lt;/h3&gt;
&lt;p&gt;Using the eclipse-mosquitto broker for MQTT (latest version works fine here) because it seems to be the best supported one for home assistant. For this one I have 3 different volumes to map the config, data and log directories to local folders, mainly so I can backup the config and ensure state is persistent between container rebuilds.&lt;/p&gt;

&lt;h3 id=&quot;tasmoadmin&quot;&gt;tasmoadmin&lt;/h3&gt;
&lt;p&gt;The image for this is no longer being uploaded to docker hub which is why it is pulling from github packages (ghcr.io/tasmoadmin/tasmoadmin:v1.8.0). The mapped volume here lets me keep a backup of my config and devices as well as helping to persist state between container rebuilds.&lt;/p&gt;

&lt;h3 id=&quot;chrony&quot;&gt;chrony&lt;/h3&gt;
&lt;p&gt;Not too much to configure for this one, there is an environment variable to set the time server to use (NTP_SERVERS) this can be set to what ever you want. I went with time.windows.com because my host machine is running windows and wanted to have the 2 running against the same time server.&lt;/p&gt;

&lt;h3 id=&quot;influxdb&quot;&gt;influxdb&lt;/h3&gt;
&lt;p&gt;Took me a little bit to decipher the documentation to get the right config I needed for this one since I hadn’t used influxdb before but got all the environment variables setup for it to work. Most of these are pretty straight forward for things like username, password, org and bucket, DOCKER_INFLUXDB_INIT_MODE=setup is used to ensure the automated setup is run the first time it is started. I also have a volume mapped here so that it persists between container builds mainly so that I don’t have to go about reconfiguring the integration with home assistant which requires the organisation id (not the same as the org environment variable) and the API token (generated through the automated setup).&lt;/p&gt;

&lt;h3 id=&quot;grafana&quot;&gt;grafana&lt;/h3&gt;
&lt;p&gt;This one I haven’t used too much yet but so this config may change as I use it more. At the moment I just have a mapped volume for backups and persistent state.&lt;/p&gt;

&lt;h2 id=&quot;bonus-content&quot;&gt;Bonus Content!&lt;/h2&gt;

&lt;p&gt;Since these services are all installed manually via docker I miss some of the integration points that comes with installing them through the HA supervisor. One of those is adding them to the side menu in home assistant, to do this we can make use of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;panel_iframe&lt;/code&gt; integration in home assistant, here is an example of that integration in configuration.yaml.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;na&quot;&gt;panel_iframe&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;nodered&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Node&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Red&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;http://192.168.1.5:1880/&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;icon&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mdi:file-tree&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;tasmoadmin&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;TasmoAdmin&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;http://192.168.1.5:8124/&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;icon&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mdi:home-automation&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
</content>
 </entry>
 
 <entry>
   <title>Basic remote PC monitoring through Home Assistant</title>
   <link href="https://dkdevelopment.net/home-assistant-basic-pc-monitoring//"/>
   <updated>2021-12-15T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/home-assistant-basic-pc-monitoring/</id>
   <content type="html">&lt;p&gt;I’ve had a server running at home for a while to run various things for work and personal use and recently I put Home Assistant on it to have a play with.
If you haven’t heard of Home Assistant before it is an Open source home automation that puts local control and privacy first.&lt;/p&gt;

&lt;p&gt;One thing that I wanted to do was be able to monitor the server status itself, things like storage, memory usage and temps then feed that into Home Assistant so I could try out a notification pipeline. The problem was since my HA instance runs as a docker container it doesn’t have direct access to those APIs in windows to give out that kind of info.&lt;/p&gt;

&lt;p&gt;To get around this limitation I figured I had a look at a few tools that could surface that info as a Rest API that HA could consume but none did quite what I wanted easily so I decided to write my own light weight api to surface this data (also because it was fun). Then using the built in rest integration within HA I could set it up to read this data in as sensors.&lt;/p&gt;

&lt;p&gt;I did this in .net core using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System.IO.DriveInfo.GetDrives()&lt;/code&gt; method which gets me all the details I need about the attached hard drives. Once I had that I filtered out to only should fixed drives (ie. non-removable storage) and mapped it to a model object so that I could output it as JSON without circular reference issues. I also outputted it as a dictionary where the drive letter was the key, this is to make it easier to pick up the specific drives later in HA.&lt;/p&gt;

&lt;p&gt;Here is the code for the controller:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot; data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Microsoft.AspNetCore.Mvc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.IO&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Linq&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;WinSysMon.Controllers&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;HomeController&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Controller&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Route&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;drives&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)]&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IActionResult&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Drives&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;DriveInfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;drives&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DriveInfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;GetDrives&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

            &lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;driveModels&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;drives&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Where&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DriveType&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DriveType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Fixed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DriveInfoModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ToDictionary&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;:&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;

            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;driveModels&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;DriveInfoModel&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AvailableFreeSpace&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DriveFormat&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TotalFreeSpace&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TotalSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;VolumeLabel&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DriveInfoModel&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DriveInfo&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;drive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DriveInfoModel&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;AvailableFreeSpace&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;drive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AvailableFreeSpace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;DriveFormat&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;drive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DriveFormat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;drive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;TotalFreeSpace&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;drive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TotalFreeSpace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;TotalSize&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;drive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TotalSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;VolumeLabel&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;drive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;VolumeLabel&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Once that was done and the API was working I needed to setup the sensors in HA using the rest integration. I setup 3 sensors per drive: availableFreeSpace, totalSize and volumeLabel which gave me enough info to do what I needed.
The rest integration can be configured via the yaml file in HA and it allows you to setup multiple sensors from a single endpoint it also lets you set the interval times and authentication.&lt;/p&gt;

&lt;p&gt;Using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;host.docker.internal&lt;/code&gt; as the url so that my HA instance running in docker can reference the host PC. Also doing some calculations on the values here since the API outputs the values in bytes so that I can just read them in as GB with 2 decimal places which is enough for me but can be changed easily.
Here is my yaml configuration for the rest sensors setting&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-liquid&quot; data-lang=&quot;liquid&quot;&gt;rest:
  - scan_interval: 600
    resource: http://host.docker.internal:55555/drives
    sensor:
      - name: &quot;Server Drive C availableFreeSpace&quot;
        value_template: &quot;&lt;span class=&quot;p&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;value_json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;availableFreeSpace&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;)&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;round(2)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}&lt;/span&gt;&quot;
        unit_of_measurement: GB
        
      - name: &quot;Server Drive C totalSize&quot;
        value_template: &quot;&lt;span class=&quot;p&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;value_json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;totalSize&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;)&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;round(2)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}&lt;/span&gt;&quot;
        unit_of_measurement: GB
        
      - name: &quot;Server Drive C volumeLabel&quot;
        value_template: &quot;&lt;span class=&quot;p&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;value_json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;volumeLabel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}&lt;/span&gt;&quot;
        

      - name: &quot;Server Drive D availableFreeSpace&quot;
        value_template: &quot;&lt;span class=&quot;p&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;value_json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;D&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;availableFreeSpace&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;)&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;round(2)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}&lt;/span&gt;&quot;
        unit_of_measurement: GB
        
      - name: &quot;Server Drive D totalSize&quot;
        value_template: &quot;&lt;span class=&quot;p&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;value_json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;D&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;totalSize&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;/&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt;)&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;round(2)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}&lt;/span&gt;&quot;
        unit_of_measurement: GB
        
      - name: &quot;Server Drive D volumeLabel&quot;
        value_template: &quot;&lt;span class=&quot;p&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;value_json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;D&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;volumeLabel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}&lt;/span&gt;&quot;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;This will add some new entities to Home Assistant for us which look something like this in the dev tools.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2021/ha-deventities.jpg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now that we have the sensor data in HA we can start using it, for now I have put it into a lovelace dashboard but it can also be used in automation rules and setup as triggers etc.
I created a simple gauge card to test it setting severity with red as under 10%, orange as under 50% and green over 50%.&lt;/p&gt;

&lt;table style=&quot;width: 100%;&quot;&gt;
  &lt;tr&gt;
    &lt;td&gt;
      
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-liquid&quot; data-lang=&quot;liquid&quot;&gt;type: gauge
entity: sensor.server_drive_c_availablefreespace
min: 0
max: 233
severity:
  green: 115
  yellow: 23
  red: 0
needle: true
name: &apos;C: Drive Usage&apos;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

    &lt;/td&gt;
    &lt;td style=&quot;text-align: center;&quot;&gt;
      &lt;img src=&quot;/img/posts/2021/ha-drives.png&quot; /&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;From here next steps would be to look at integrating more sensors into the pipeline such as memory and temperature which can be done by querying with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System.Manamgent.ManagementObjectSearcher&lt;/code&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Google Lighthouse CI Server Automation</title>
   <link href="https://dkdevelopment.net/lighthouse-ci-server-automation//"/>
   <updated>2021-09-28T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/lighthouse-ci-server-automation/</id>
   <content type="html">&lt;p&gt;Website performance is one of those things that is “important” to everyone but it is sometime hard to test and keep track of the results in a way that is easy to navigate and doesn’t require too much effort. Recently it has become even more important for SEO (Search Engine Optimization) with the big search engines starting to use these metrics more to affect ranking (See: &lt;a href=&quot;https://developers.google.com/search/docs/advanced/experience/page-experience&quot;&gt;Understanding page experience in Google Search results&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Google Lighthouse is a well known performance testing tool for websites that is built into Google Chrome and used by &lt;a href=&quot;https://developers.google.com/speed/pagespeed/insights&quot;&gt; Google PageSpeed Insights&lt;/a&gt;. But there is also &lt;a href=&quot;https://github.com/GoogleChrome/lighthouse-ci&quot;&gt;Lighthouse CI&lt;/a&gt; which is an open source CLI tool for automating running lighthouse for a CI/CD environment.&lt;/p&gt;

&lt;p&gt;Lighthouse CI also has a server component that let’s you save reports and compare them which can be very useful.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2021/lhci1.gif&quot; /&gt;&lt;/p&gt;

&lt;p&gt;To setup the Lighthouse CI server through docker there are 3 parts to it.&lt;/p&gt;

&lt;h5 id=&quot;dockerfile&quot;&gt;Dockerfile&lt;/h5&gt;

&lt;p&gt;Setup the docker image to run the Lighthouse CI server with the appropriate config.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;err&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;node:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;-buster-slim&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;WORKDIR&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;/usr/src/lhci&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;package.json&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;RUN&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;npm&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;lighthouserc.json&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;EXPOSE&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8000&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;CMD&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;npm&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;start&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h5 id=&quot;packagejson&quot;&gt;package.json&lt;/h5&gt;

&lt;p&gt;The package.json file used to install the libraries and configure the server start.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;lhci&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;version&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0.0.0&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;scripts&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;start&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;lhci server --config=./lighthouserc.json&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;dependencies&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;@lhci/cli&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;^0.8.1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;@lhci/server&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;^0.8.1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;mysql2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;^2.1.0&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;pg&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;^7.12.1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;pg-hstore&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;^2.3.3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;sqlite3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;^4.0.6&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h5 id=&quot;lighthousercjson&quot;&gt;lighthouserc.json&lt;/h5&gt;

&lt;p&gt;The configuration file for the server, using PostgreSQL storage and daily CRON task to collect reports from PageSpeed Insights.
Check out the &lt;a href=&quot;https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/server.md&quot;&gt;Lighthouse CI Server docs&lt;/a&gt; for more info on this.
To enable the PageSpeed Insights cron task you will need to get an API Key from the &lt;a href=&quot;https://developers.google.com/speed/docs/insights/v5/get-started&quot;&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;ci&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;port&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;storage&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;storageMethod&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;sql&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;sqlDialect&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;postgres&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;sqlConnectionUrl&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;postgres://lhci_user:&amp;lt;password&amp;gt;@host.docker.internal:5432/lighthouseci_db&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;basicAuth&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;username&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;damian&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;password&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;PASSWORD&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;psiCollectCron&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;psiApiKey&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;psiApiKey&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;sites&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;urls&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://dkdevelopment.net/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://dkdevelopment.net/2019/05/25/working-remotely/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;https://dkdevelopment.net/resume/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;schedule&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0 0 * * *&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;projectSlug&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;dkdevelopment.net&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Once the server is up and running you then need to create a project on the server, to do this run: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lhci wizard&lt;/code&gt; to create a new project on the server and answer the questions it asks.
Save the tokens it generates (you will need these later).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2021/lhci-wizard.jpg&quot; /&gt;&lt;/p&gt;

&lt;p&gt;With the project setup and the PSI CRON tasks running you will then be able to see the daily reports coming in with the ability to compare reports over time.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/img/posts/2021/lhci-compare.jpg&quot; /&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Tips and tricks for Github Pages</title>
   <link href="https://dkdevelopment.net/tips-and-tricks-for-github-pages//"/>
   <updated>2020-07-26T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/tips-and-tricks-for-github-pages/</id>
   <content type="html">&lt;p&gt;This blog has been hosted on Github Pages for a long time, a very very long time, according to my git history since Feb 2012 (before that it was on Wordpress).&lt;/p&gt;

&lt;p&gt;I decided to make the change for a few reasons:&lt;br /&gt;
-To learn something new (Jekyll/Liquid were new to me)&lt;br /&gt;
-Have it feel more like a dev blog (writing posts in a dev IDE pushing to git etc.)&lt;br /&gt;
-Also the Pretzel Code52 project had just kicked off and I was interested in getting involved in that (&lt;a href=&quot;https://github.com/Code52/pretzel&quot;&gt;https://github.com/Code52/pretzel&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Now, 8 years later I am trying to get into blogging again so I am breathing new life into my Github Pages blog as well as building a new website for a podcast using Github Page so I thought I’d share some of the interesting things it can do.&lt;/p&gt;

&lt;h4&gt;Docker&lt;/h4&gt;
&lt;p&gt;I’m not a ruby developer and I didn’t want to have to install all of the ruby dev tools just to be able to add blog posts. Previously I was using a prebuilt version of pretzel locally which worked pretty well, there were a few things that worked differently or were not supported but I got by. After doing a fair bit of work with docker I figured I should just be able to run jekyll on docker, run the same version that runs on Gihub Pages without all the overhead.&lt;/p&gt;

&lt;p&gt;Luckily there are already github pages images setup so I didn’t need to do much to get this working, the one I went with is &lt;a href=&quot;https://github.com/Starefossen/docker-github-pages&quot;&gt;Starefossen/docker-github-pages&lt;/a&gt;. After finding that it was as easy as creating a powershell script to run it, which also mounts the directory to the docker container so it will auto update when changes are made.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-powershell&quot; data-lang=&quot;powershell&quot;&gt;&lt;span class=&quot;n&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-it&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--rm&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;${PWD}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;/usr/src/app&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;1000:4000&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;starefossen/github-pages&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;jekyll&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;serve&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;/_site&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--drafts&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--watch&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--force_polling&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;0.0.0.0&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;4000&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4&gt;For each loops&lt;/h4&gt;
&lt;p&gt;Github pages and Jekyll use the &lt;a href=&quot;https://jekyllrb.com/docs/liquid/&quot;&gt;Liquid templating language&lt;/a&gt; which lets you do some fun things, one of them is for loops. The below code loops through the posts on the site (getting the first 12) to display links for each. &lt;code&gt;{% for post in site.posts limit: 12 %}&lt;/code&gt; - &lt;code&gt;site.posts&lt;/code&gt; being the collection to iterate over. &lt;code&gt;for post in&lt;/code&gt; defines a post as the individual item being iterated. &lt;code&gt;limit: 12&lt;/code&gt; sets the loop to only iterate over the first 12 items, this can also be used with &lt;code&gt;offset: 12&lt;/code&gt; which sets the iteration to start at item 12 in the collection.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;{% for post in site.posts limit: 12 %}
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;{{ post.url }}&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
        {{ post.title }}
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
{% endfor %}&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4&gt;Combine and Minify CSS&lt;/h4&gt;
&lt;p&gt;This one is a bit of a hack but it allows you to combine and (somewhat) minify CSS files using some of the liquid templating. Starting with the &lt;a href=&quot;https://www.rubydoc.info/github/Shopify/liquid/Liquid/Capture&quot;&gt;&lt;strong&gt;capture block&lt;/strong&gt;&lt;/a&gt; which lets you store a result in a variable without rendering it. Using the capture we then include the relevant css files inside the capture here using the &lt;a href=&quot;https://jekyllrb.com/docs/includes/&quot;&gt;&lt;strong&gt;include_relative&lt;/strong&gt;&lt;/a&gt; tag. Finally we render the newly captured variable making sure to strip out the new lines and multiple spaces.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;permalink&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;dkdev&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.min.css&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%-&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;capture&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;sitecss&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;-%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;include_relative&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;bootstrap.min.css&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;include_relative&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;fontawesome-free.min.css&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;include_relative&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;clean-blog.css&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%-&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;endcapture&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;-%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;{-&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;sitecss&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;strip_newlines&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&quot;  &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4&gt;Data files&lt;/h4&gt;
&lt;p&gt;Jekyll allows you to add other &lt;a href=&quot;https://jekyllrb.com/docs/datafiles/&quot;&gt;data files&lt;/a&gt; that can be used by various pages. These are just yml, json or csv files that can be put in the _data folder that can be accessed from any page or layout using site.data.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;
    &lt;pre&gt;
&lt;code class=&quot;language-yml&quot; data-lang=&quot;yml&quot;&gt;&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Phili J Fry&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Delivery Boy&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&lt;/span&gt;

&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Bender&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Company Chef&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&lt;/span&gt;

&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Turanga Leela&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Captain&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&lt;/span&gt;

&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;John Zoidberg&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Staff doctor&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;This data file can then be used by a for loop to display all the items:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;{% for character in site.data.characters %}
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;
        {{ character.name }} - {{ character.title }}
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
{% endfor %}&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4&gt;Syntax Highlighting&lt;/h4&gt;
&lt;p&gt;Github Pages has built in syntax highlighting that uses the &lt;a href=&quot;https://github.com/rouge-ruby/rouge&quot;&gt;Rouge Ruby syntax highlighter&lt;/a&gt; library.
It let’s you wrap your code with &lt;code&gt;{% highlight %}&lt;/code&gt; and &lt;code&gt;{% endhighlight %}&lt;/code&gt; and it will do some formatting with it which allows you to easily style it.
All you need to do is include a rouge or pygments compatible stylesheet.&lt;/p&gt;

&lt;p&gt;Here is what mine looks like for reference: &lt;a href=&quot;https://dkdevelopment.net/css/pygments_style.css&quot;&gt;https://dkdevelopment.net/css/pygments_style.css&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Getting started with Singer and Docker</title>
   <link href="https://dkdevelopment.net/2020/06/14/singer-io-with-docker//"/>
   <updated>2020-06-14T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/2020/06/14/singer-io-with-docker/</id>
   <content type="html">&lt;p&gt;I’ve been doing a lot of work with data recently and I wanted a way to be able to join some of our platform data to our traffic data from Google Analytics.&lt;/p&gt;

&lt;p&gt;After trying a few methods to get data out of Google Analytics into our PostgreSQL database with not much success I discovered &lt;a href=&quot;https://singer.io&quot;&gt;singer.io&lt;/a&gt; a “Simple, Composable, Open Source ETL” tool. So I started playing around with the Google Analytics tap and the PostgreSQL target (&lt;a href=&quot;https://www.singer.io/tap/google-analytics/postgresql/&quot;&gt;https://www.singer.io/tap/google-analytics/postgresql/&lt;/a&gt;). After a lot of digging through various documentations and source code I was able to get it working!&lt;/p&gt;

&lt;p&gt;Now that I have it running it was time to try and automate it somehow, to do this I tried to set it up as a docker container that way it can be run in the cloud (In our case AWS) on a schedule to pull in data daily from Google Analytics.&lt;/p&gt;

&lt;p&gt;Here is the Docker file that puts it all together.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-docker&quot; data-lang=&quot;docker&quot;&gt;&lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; python:3.7.6-stretch&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;RUN &lt;/span&gt;pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;singer-target-postgres

&lt;span class=&quot;k&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; ./tap-google-analytics-master/ ./external/tap-google-analytics-master/&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;WORKDIR&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; /external/tap-google-analytics-master&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;RUN &lt;/span&gt;pip &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; .

&lt;span class=&quot;k&quot;&gt;WORKDIR&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; /&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; ./singer/tap_google-analytics_config.json ./tap_google-analytics_config.json&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; ./singer/client_secrets.json ./client_secrets.json&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; ./singer/tap_google-analytics_reports.json ./tap_google-analytics_reports.json&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; ./singer/target_postgres_config.json ./target_postgres_config.json&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;CMD&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; tap-google-analytics -c ./tap_google-analytics_config.json | target-postgres -c ./target_postgres_config.json &amp;gt;&amp;gt; state.json&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;A few things here to call out to get this working. Installing the PostgreSQL target was straight forward but for the Google Analytics tap I used an unofficial library and built it from the source at &lt;a href=&quot;https://gitlab.com/meltano/tap-google-analytics&quot;&gt;https://gitlab.com/meltano/tap-google-analytics&lt;/a&gt;. After that we have the various config files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tap_google-analytics_config.json&lt;/strong&gt; This is the config for the Google Analytics tap, key file location is name of the config file that details the service account credentials. The reports property is a json file that defines the reports to pull from Google Analytics. The start date and end date here define the date range to pull the report data for.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;key_file_location&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;client_secrets.json&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;view_id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;111111111&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;reports&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;tap_google-analytics_reports.json&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;start_date&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2020-06-01T00:00:00Z&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;end_date&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;2020-06-15T00:00:00Z&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;client_secrets.json&lt;/strong&gt; this file contains the service account credentials, to get these follow the instructions defined in &lt;a href=&quot;https://gitlab.com/meltano/tap-google-analytics#creating-service-account-credentials&quot;&gt;https://gitlab.com/meltano/tap-google-analytics#creating-service-account-credentials&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tap_google-analytics_reports.json&lt;/strong&gt; this file defines the report data being pulled from Google Analytics. A full list of the available dimensions and metrics can be found here: &lt;a href=&quot;https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/&quot;&gt;https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/&lt;/a&gt;. Here is an example of a report for pageviews.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;[{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ga_pageviews&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;dimensions&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ga:date&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ga:pagePath&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ga:source&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ga:medium&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ga:sourceMedium&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;metrics&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ga:pageviews&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;target_postgres_config.json&lt;/strong&gt; This file is the config for the PostgreSQL target, mostly straight forward connection config.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;postgres_host&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;localhost&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;postgres_port&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5432&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;postgres_database&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ga_data&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;postgres_username&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;db_user&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;postgres_password&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;db_treasure&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;postgres_schema&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;public&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;after_run_sql&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now that we have everything setup to run in docker to truly automate this all that is left to do is being able to update the start and end date properties in the Google Analytics config file dynamically. This can be done with a bit of bash.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Working Remotely (and how)</title>
   <link href="https://dkdevelopment.net/2019/05/25/working-remotely//"/>
   <updated>2019-05-25T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/2019/05/25/working-remotely/</id>
   <content type="html">&lt;p&gt;I work remotely and have been full time for over 6 months now and I wanted to take some time to talk about my experience with it. I quite often joke about this, for example here is a post from my Instagram after my 2nd week at another fully remote workplace.&lt;/p&gt;

&lt;blockquote class=&quot;instagram-media2&quot; style=&quot; background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; margin-bottom: 12px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);&quot;&gt;
    &lt;div style=&quot;padding:16px;&quot;&gt;
        &lt;div style=&quot; display: flex; flex-direction: row; align-items: center;&quot;&gt;
            &lt;div style=&quot;background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;&quot;&gt;
                &lt;a href=&quot;https://www.instagram.com/damiankarzon/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
                    &lt;img style=&quot;border-radius: 50%;&quot; src=&quot;https://pbs.twimg.com/profile_images/721583338671058944/M83ceTNZ_200x200.jpg&quot; alt=&quot;damiankarzon&quot; /&gt;
                &lt;/a&gt;
            &lt;/div&gt;
            &lt;div style=&quot;display: flex; flex-direction: column; flex-grow: 1; justify-content: center;&quot;&gt;
                &lt;div style=&quot;border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 12px; width: 100px;&quot;&gt;
                    &lt;a style=&quot;color: #000; font-weight: 500; font-size: 14px;&quot; href=&quot;https://www.instagram.com/damiankarzon/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
                        damiankarzon
                    &lt;/a&gt;
                &lt;/div&gt;
                &lt;div style=&quot;border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;&quot;&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div style=&quot;padding-top: 8px;&quot;&gt;
            &lt;a href=&quot;https://www.instagram.com/p/BuxJFmmBHOi/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
                &lt;img src=&quot;/img/posts/2019-05/work-remotely.png&quot; alt=&quot;Damian working from home&quot; /&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div style=&quot;display: flex; flex-direction: row; align-items: center;&quot;&gt;
            &lt;a href=&quot;https://www.instagram.com/p/BuxJFmmBHOi/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
                &lt;div style=&quot;background-color: #EEEEEE; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);&quot;&gt;
                &lt;/div&gt;
                &lt;div style=&quot;background-color: #EEEEEE; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;&quot;&gt;
                &lt;/div&gt;
                &lt;div style=&quot;background-color: #EEEEEE; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);&quot;&gt;
                &lt;/div&gt;
            &lt;/a&gt;
            &lt;a href=&quot;https://www.instagram.com/p/BuxJFmmBHOi/&quot; target=&quot;_blank&quot; style=&quot;margin-left: 8px;&quot; rel=&quot;noopener&quot;&gt;
                &lt;div style=&quot; background-color: #EEEEEE; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;&quot;&gt;
                &lt;/div&gt;
                &lt;div style=&quot; width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #EEEEEE; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)&quot;&gt;
                &lt;/div&gt;
            &lt;/a&gt;
            &lt;a href=&quot;https://www.instagram.com/p/BuxJFmmBHOi/&quot; target=&quot;_blank&quot; style=&quot;margin-left: auto;&quot; rel=&quot;noopener&quot;&gt;
                &lt;div style=&quot; width: 0px; border-top: 8px solid #EEEEEE; border-right: 8px solid transparent; transform: translateY(16px);&quot;&gt;
                &lt;/div&gt;
                &lt;div style=&quot; background-color: #EEEEEE; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);&quot;&gt;
                &lt;/div&gt;
                &lt;div style=&quot; width: 0; height: 0; border-top: 8px solid #EEEEEE; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);&quot;&gt;
                &lt;/div&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;p style=&quot;font-family:Arial,sans-serif; font-size:14px; line-height:16px; margin-bottom:0; margin-top:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;&quot;&gt;
            &lt;a href=&quot;https://www.instagram.com/damiankarzon/&quot; style=&quot;font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:16px;&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt; Damian Karzon&lt;/a&gt; (@damiankarzon) on &lt;time style=&quot; font-family:Arial,sans-serif; font-size:14px; line-height:17px;&quot; datetime=&quot;2019-03-09T00:42:34+00:00&quot;&gt;Mar 8, 2019 at 4:42pm PST&lt;/time&gt;&lt;/p&gt;
        &lt;p style=&quot; margin:0;&quot;&gt;
            &lt;a href=&quot;https://www.instagram.com/p/BuxJFmmBHOi/&quot; style=&quot; color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:16px; text-decoration:none; word-wrap:break-word;&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What people think of when I say I work from home vs. what it&amp;#39;s actually like.&lt;/a&gt;
        &lt;/p&gt;
    &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;But this is actually something I take very seriously and I am constantly asked about it. When I tell people I work from home they often ask me a question like &lt;em&gt;“How often do you have to go into the office?”&lt;/em&gt; or &lt;em&gt;“Where is their head office?”&lt;/em&gt;. My current workplace&lt;strong&gt;&lt;em&gt;has no office&lt;/em&gt;&lt;/strong&gt;, none at all. The entire company works remotely which is sometimes a strange concept for people.&lt;/p&gt;

&lt;p&gt;When I first started working remotely there were a few things that I was worried about:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Distractions&lt;/li&gt;
  &lt;li&gt;Cabin fever&lt;/li&gt;
  &lt;li&gt;Isolation&lt;/li&gt;
  &lt;li&gt;Work-life balance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Again, this post is specifically about my experience with remote work and, as I have learned throughout this time, everyone is different and depending on personalities are affected in different ways when it comes to this sort of thing.&lt;/p&gt;

&lt;h4 id=&quot;distractions&quot;&gt;Distractions&lt;/h4&gt;
&lt;p&gt;When I first started I thought the distractions would be a big problem for me (from past experience working from home in a non-full time way) so I set out to make sure I could minimise it. The main thing I did for this was to separate my home and work life both physically and mentally. I had a spare room at my place which I have converted into my home office that I use exclusively for working, I also have a dedicated work computer that I don’t use for anything else (ie. no games on it). To separate my home and work life mentally I try to go for a walk every day when I finish work, this helps to break up the work day from the non-work day (it’s also good to get some exercise in).&lt;/p&gt;

&lt;h4 id=&quot;cabin-fever&quot;&gt;Cabin fever&lt;/h4&gt;
&lt;p&gt;This wasn’t something I had actually considered when I started since I am quite comfortable staying at home for long periods of time. However the problem came up often when I found myself being stuck in a problem that I couldn’t solve. I would start to get irritated very easily by my surroundings and not being able to solve the problem in front of me so I would end up walking up and down the hallway for no reason. In this situation now I quite often turn to someone else on the team and jump of a quick call just to talk things out or I leave the house and go for a walk to get some fresh air.&lt;/p&gt;

&lt;h4 id=&quot;isolation&quot;&gt;Isolation&lt;/h4&gt;
&lt;p&gt;I often hear people talk about isolation being their biggest problem when it comes to working remotely but this hasn’t been a massive problem for me, probably due to living alone for the last 6 years. This is also helped by the virtual meetings we have which are all video calls and always start with a bit of a chat before getting into business. A great example of this is our weekly whole company meetings where we start by everyone having a chance to share something personal (maybe they did something exciting on the weekend or during the week) or they can share a learning from the previous week.&lt;/p&gt;

&lt;h4 id=&quot;work-life-balance&quot;&gt;Work-life balance&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;“Do you find yourself working more since it’s all just there?”&lt;/em&gt; or &lt;em&gt;“Do you sometimes just go and watch tv instead of working?”&lt;/em&gt; other questions I sometimes get asked. Both are on opposite sides of the work-life balance, on one hand you have the potential to over work since it is so close and on the other you could do no work at all because you are not confined to an office. My answer to both of these questions is normally &lt;em&gt;“Yes but…”&lt;/em&gt;, yes sometimes I do find myself working more, yes sometimes I do take a random break during the day if I’m feeling drained or stuck. It’s all about having the balance between the 2, it is much easier when working from home to over work or to under work but if you are motivated to do the work and have the discipline to keep working when you need to then you won’t have a problem. Motivation can be hard to find sometimes so it’s important to have work that you enjoy and are passionate about and to have a team that work well together. It is also important to remember that no job is awesome all the time and work will sometimes get you down but you need to keep at it anyway and work on making it better where you can.&lt;/p&gt;

&lt;h4 id=&quot;environment&quot;&gt;Environment&lt;/h4&gt;

&lt;p&gt;I have put a lot a lot of time, effort and investment into getting my home office setup and it’s at a point where I am more productive there than any office I have ever worked at.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Desk: SKARSTA sit/stand desk from IKEA (120x70 cm)&lt;/li&gt;
  &lt;li&gt;Chair: DX Racer Classic Series&lt;/li&gt;
  &lt;li&gt;Laptop: Microsoft Surface Book 2 (13” i7, 16GB Ram, 512GB SSD) with Surface dock&lt;/li&gt;
  &lt;li&gt;Monitor: Dell P2715Q 27” 4K&lt;/li&gt;
  &lt;li&gt;Audio: Steelseries Arctis 3 Bluetooth headset &amp;amp; JBL Charge 2 Bluetooth speaker&lt;/li&gt;
  &lt;li&gt;Keyboard: Steelseries Apex 350&lt;/li&gt;
  &lt;li&gt;Mouse: Steelseries Rival 110&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;tools&quot;&gt;Tools&lt;/h4&gt;

&lt;p&gt;It is also super important to find the right tools and team process to be able to work remotely. The majority of our communication is text based and for that we use Slack mostly (some emails here and there when dealing with external parties).
Sometimes it’s harder to communicate things over text, when this happens we tend to jump on a quick call using either a phone call, Slack call or a Zoom video call.
We currently run a “scrum-like” development process which includes daily virtual stand-ups, for this we use Zoom. We also use video calls for larger team meetings such as the weekly whole company or product team meetings, this makes discussions much easier and allows people to share screens if required.&lt;/p&gt;

&lt;p&gt;There are also times when the team (or at least part of the team) will meet up in person, for example the Brisbane dev team try to get together once a month and spend the day working together, this is either at a co-working space or a shared space (such as a library). There are also times when all of the workers in Brisbane will get together for a team lunch, this greatly heaps everyone get to know each other more and to feel more comfortable with each other.&lt;/p&gt;

&lt;p&gt;Well that’s enough ramblings from me about working remotely, let me know your thoughts on it or if you have any questions feel free to reach out to me (&lt;a href=&quot;https://twitter.com/dkarzon&quot;&gt;@dkarzon&lt;/a&gt; on Twitter).&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Building a Discord voice bot with Discord.NET</title>
   <link href="https://dkdevelopment.net/2019/02/18/discord-voice-bot//"/>
   <updated>2019-02-18T00:00:00+00:00</updated>
   <id>https://dkdevelopment.net/2019/02/18/discord-voice-bot/</id>
   <content type="html">&lt;p&gt;
    I&apos;ve been playing around with the Discord api recently, I wanted to see what could actually be done with it.
    I set a goal to make a discord bot that slightly annoys people by joining voice channels and randomly say Zapp Brannigan quotes.
&lt;/p&gt;

&lt;p&gt;
    For those who don&apos;t know Discord is an: &lt;blockquote&gt;All-in-one voice and text chat for gamers that&apos;s free, secure, and works on both your desktop and phone. - &lt;a href=&quot;https://discordapp.com/&quot;&gt;https://discordapp.com/&lt;/a&gt;&lt;/blockquote&gt;
&lt;/p&gt;

&lt;p&gt;
    I got started with &lt;a href=&quot;https://github.com/discord-net/Discord.Net&quot;&gt;Discord.NET&lt;/a&gt; and was able to get the bot connected very quickly. Discord.NET is an unofficial .NET API wrapper for discord which seem to be the most popular and widely used library for it so I went with it. Be sure to check out the &lt;a href=&quot;https://discord.foxbot.me/docs/&quot;&gt;documentation&lt;/a&gt; for details. For this to work with voice connections there are a few native dlls that you need to download and put with your application. These are simple enough to get from the &lt;a href=&quot;https://discord.foxbot.me/docs/guides/voice/sending-voice.html&quot;&gt;voice documentation&lt;/a&gt; (or check out my full source link at the end).
&lt;/p&gt;
&lt;p&gt;
    First thing you need to do is get an instance of &lt;strong&gt;DiscordSocketClient&lt;/strong&gt; for my project I am doing a .NET Core 2.2 console app with the built in dependency injection.
&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot; data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;n&quot;&gt;_discord&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_services&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetRequiredService&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DiscordSocketClient&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;();&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_discord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;LoginAsync&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TokenType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Bot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_botToken&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_discord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;StartAsync&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That is all the code you need to have your bot connect to discord!&lt;/p&gt;

&lt;p&gt;
    I wanted my bot to detect when a user joined a voice channel and connect to that channel (if it wasn&apos;t already). To do that I used the &lt;strong&gt;UserVoiceStateUpdated&lt;/strong&gt; event on the DiscordSocketClient which can tell us when a users voice state updates (join/leave/move voice channels).
&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot; data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Add this before calling StartAsync&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;_discord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;UserVoiceStateUpdated&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;OnVoiceStateUpdated&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The code to handle the event then looks like this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot; data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Task&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;OnVoiceStateUpdated&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SocketUser&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SocketVoiceState&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SocketVoiceState&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Check if this was a non-bot user joining a voice channel&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IsBot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;state1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;VoiceChannel&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;state2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;VoiceChannel&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;ConnectToVoice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;state2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;VoiceChannel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Task&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;ConnectToVoice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SocketVoiceChannel&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voiceChannel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;voiceChannel&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$&quot;Connecting to channel &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;voiceChannel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voiceChannel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ConnectAsync&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$&quot;Connected to channel &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;voiceChannel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;div class=&quot;blocknote&quot;&gt;Important to note here is that we don&apos;t await ConnectToVoice, this is because if we await that call from inside the UserVoiceStateUpdated event it will cause a deadlock and never return from connecting to the voice channel.&lt;/div&gt;

&lt;p&gt;Now we are connecting to a voice channel when we detect a user joins it so lets look at having the bot actually send audio through. To do this the documentation for the library has an example using ffmpeg to read the sound files and pipes that into a stream that then gets sent to Discord.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot; data-lang=&quot;csharp&quot;&gt;&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;psi&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ProcessStartInfo&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;FileName&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;ffmpeg&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Arguments&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;$@&quot;-i &quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sound&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Filename&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&quot; -ac 2 -f s16le -ar 48000 pipe:1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;RedirectStandardOutput&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;UseShellExecute&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;false&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ffmpeg&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Process&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;psi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ffmpeg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;StandardOutput&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;BaseStream&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;discord&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;CreatePCMStream&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AudioApplication&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Voice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;CopyToAsync&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;discord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;discord&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;FlushAsync&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;
    Here we start a new process passing in start info that opens up ffmpeg.exe (also included in the project) passing in a relative path to out sound file and a few other command line args to play the sound and pipe the output which we then copy into a stream into discord.
&lt;/p&gt;

&lt;p&gt;
    This is the basics of creating a voice capable discord bot with Discord.NET, for a more advanced implementation take a look at the full source for this project at &lt;a href=&quot;https://github.com/dkarzon/DiscordZapBot&quot;&gt;https://github.com/dkarzon/DiscordZapBot&lt;/a&gt;.
&lt;/p&gt;
</content>
 </entry>
 
 
</feed>