<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>R Engineering Playbook: AI and agentic coding</title>
<link>https://insightsurge-dev.web.app/feed-ai.html</link>
<atom:link href="https://insightsurge-dev.web.app/feed-ai.xml" rel="self" type="application/rss+xml"/>
<description>AI, agentic coding and LLM-assisted workflow posts that are not tied to R.</description>
<language>en</language>
<image>
<url>https://insightsurge-dev.web.app/images/social/default.png</url>
<title>R Engineering Playbook: AI and agentic coding</title>
<link>https://insightsurge-dev.web.app/feed-ai.html</link>
</image>
<generator>quarto-1.8.27</generator>
<lastBuildDate>Fri, 25 Sep 2026 18:30:00 GMT</lastBuildDate>
<item>
  <title>Building this blog: from numbered topics to a living Quarto publication</title>
  <link>https://insightsurge-dev.web.app/posts/building-this-blog/</link>
  <description><![CDATA[ 





<!--
  Quarto 1.8.27's title-block.html with three changes: category badges and a
  series link ("Testing series · part 2") sit above the title, as in the brand's
  blog kit; and a post or series page with `trailer: true` shows its trailer beside the title
  (_filters/trailer.lua sets trailer-path; _includes/trailers.html plays it). On a Quarto upgrade, diff this against
  share/formats/html/templates/title-block.html and carry over any changes.
-->



<section id="the-problem" class="level2">
<h2 class="anchored" data-anchor-id="the-problem">The problem</h2>
<p>Technical documentation often begins as a structured, numbered curriculum. As engineering work evolves, that format hits predictable constraints:</p>
<ol type="1">
<li><strong>Rigidity of numbered sequences.</strong> In a linear numbered list (<code>topics/01-...</code>, <code>topics/02-...</code>), inserting new articles breaks sequential numbering, while adding topical posts outside the core sequence feels unnatural.</li>
<li><strong>Broken incoming links.</strong> Moving from numbered directory paths (<code>/topics/01-identity-isolation/</code>) to semantic slugs (<code>/posts/identity-isolation/</code>) breaks bookmarks, search indexing, and existing cross-references unless backwards compatibility is explicitly maintained.</li>
<li><strong>The staleness trap.</strong> Most engineering blogs treat articles as immutable point-in-time snapshots. When a tool releases a breaking change or a security guardrail evolves, authoring a completely new post scatters information, leaving readers stranded on outdated guidance.</li>
<li><strong>Draft clutter and companion metadata.</strong> Authors often want companion artifacts alongside articles—such as executive summaries, newsletter drafts, or test scripts—without having static site generators compile them into public web pages.</li>
</ol>
<p>To address these challenges, we transformed this site from a 14-topic repository into a full Quarto blog and portfolio, preserving existing URLs while adopting living-document standards and automated verification.</p>
</section>
<section id="site-architecture-and-explicit-rendering-_quarto.yml" class="level2">
<h2 class="anchored" data-anchor-id="site-architecture-and-explicit-rendering-_quarto.yml">Site architecture and explicit rendering (<code>_quarto.yml</code>)</h2>
<p>The site configuration in <code>_quarto.yml</code> establishes a clear project structure:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb1-1"><span class="fu" style="color: #4758AB;">project</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb1-2"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">type</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> website</span></span>
<span id="cb1-3"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">render</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="co" style="color: #5E5E5E;">              # explicit: companions next to posts are never rendered</span></span>
<span id="cb1-4"><span class="at" style="color: #657422;">    </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> index.qmd</span><span class="co" style="color: #5E5E5E;">        # landing page = About (Quarto `about:` template)</span></span>
<span id="cb1-5"><span class="at" style="color: #657422;">    </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> blog.qmd</span></span>
<span id="cb1-6"><span class="at" style="color: #657422;">    </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> series/*.qmd</span></span>
<span id="cb1-7"><span class="at" style="color: #657422;">    </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> glossary.qmd</span></span>
<span id="cb1-8"><span class="at" style="color: #657422;">    </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> posts/*/index.qmd</span></span>
<span id="cb1-9"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">resources</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb1-10"><span class="at" style="color: #657422;">    </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"templates/**"</span></span>
<span id="cb1-11"></span>
<span id="cb1-12"><span class="fu" style="color: #4758AB;">website</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb1-13"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">title</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"Your Name"</span></span>
<span id="cb1-14"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">site-url</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> https://example.web.app</span><span class="co" style="color: #5E5E5E;">   # needed for the RSS feed</span></span>
<span id="cb1-15"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">search</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="ch" style="color: #20794D;">true</span></span>
<span id="cb1-16"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">navbar</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb1-17"><span class="at" style="color: #657422;">    </span><span class="fu" style="color: #4758AB;">left</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb1-18"><span class="at" style="color: #657422;">      </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> </span><span class="fu" style="color: #4758AB;">href</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> index.qmd</span></span>
<span id="cb1-19"><span class="at" style="color: #657422;">        </span><span class="fu" style="color: #4758AB;">text</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> About</span></span>
<span id="cb1-20"><span class="at" style="color: #657422;">      </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> </span><span class="fu" style="color: #4758AB;">href</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> blog.qmd</span></span>
<span id="cb1-21"><span class="at" style="color: #657422;">        </span><span class="fu" style="color: #4758AB;">text</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> R Engineering Playbook</span></span>
<span id="cb1-22"><span class="at" style="color: #657422;">      </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> </span><span class="fu" style="color: #4758AB;">text</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> Series</span><span class="co" style="color: #5E5E5E;">          # a dropdown: one page per series</span></span>
<span id="cb1-23"><span class="at" style="color: #657422;">        </span><span class="fu" style="color: #4758AB;">menu</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb1-24"><span class="at" style="color: #657422;">          </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> </span><span class="fu" style="color: #4758AB;">href</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> series/foundations.qmd</span></span>
<span id="cb1-25"><span class="at" style="color: #657422;">            </span><span class="fu" style="color: #4758AB;">text</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> Foundations series</span></span>
<span id="cb1-26"><span class="at" style="color: #657422;">          </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> </span><span class="fu" style="color: #4758AB;">href</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> series/testing.qmd</span></span>
<span id="cb1-27"><span class="at" style="color: #657422;">            </span><span class="fu" style="color: #4758AB;">text</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> Testing series</span></span>
<span id="cb1-28"><span class="at" style="color: #657422;">          </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> </span><span class="fu" style="color: #4758AB;">href</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> series/pharma.qmd</span></span>
<span id="cb1-29"><span class="at" style="color: #657422;">            </span><span class="fu" style="color: #4758AB;">text</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> Pharma series</span></span></code></pre></div></div>
<section id="explicit-render-lists-keep-companion-files-out-of-the-site" class="level3">
<h3 class="anchored" data-anchor-id="explicit-render-lists-keep-companion-files-out-of-the-site">Explicit render lists keep companion files out of the site</h3>
<p>By default, Quarto crawls the repository and renders every <code>.qmd</code> and <code>.md</code> file it finds into HTML.</p>
<p>In our repository structure, every article folder inside <code>posts/&lt;slug&gt;/</code> contains companion files: <code>summary.md</code> (a 1-page executive summary) and <code>message.md</code> (a short social share post). By specifying an <strong>explicit <code>render</code> list</strong> (<code>posts/*/index.qmd</code>), Quarto compiles only the canonical <code>index.qmd</code> for each post. The companion files remain available in the repository for review and team sharing without creating orphaned HTML pages.</p>
</section>
<section id="base-url-for-rss-syndication" class="level3">
<h3 class="anchored" data-anchor-id="base-url-for-rss-syndication">Base URL for RSS syndication</h3>
<p>Declaring <code>site-url</code> provides the absolute domain required for generating standard RSS feeds (<code>feed: true</code> in <code>blog.qmd</code>), ensuring subscribers can follow updates via standard feed readers.</p>
</section>
</section>
<section id="dual-listings-blog-grid-and-series-pages" class="level2">
<h2 class="anchored" data-anchor-id="dual-listings-blog-grid-and-series-pages">Dual listings: Blog grid and series pages</h2>
<p>Readers approach documentation with different goals. Some want a chronological feed of recent technical notes, while others require a structured curriculum. We accommodate both with two dedicated listing views.</p>
<section id="the-blog-listing-blog.qmd" class="level3">
<h3 class="anchored" data-anchor-id="the-blog-listing-blog.qmd">1. The Blog listing (<code>blog.qmd</code>)</h3>
<p>The primary blog index uses a responsive grid layout with category filtering and sorting:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb2-1"><span class="pp" style="color: #AD0000;">---</span></span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;">title</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"R Engineering Playbook"</span></span>
<span id="cb2-3"><span class="fu" style="color: #4758AB;">listing</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb2-4"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">contents</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> posts</span></span>
<span id="cb2-5"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">type</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> grid</span></span>
<span id="cb2-6"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">grid-columns</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="dv" style="color: #AD0000;">3</span></span>
<span id="cb2-7"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">fields</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="kw" style="color: #003B4F;
font-weight: bold;">[</span><span class="at" style="color: #657422;">date</span><span class="kw" style="color: #003B4F;
font-weight: bold;">,</span><span class="at" style="color: #657422;"> title</span><span class="kw" style="color: #003B4F;
font-weight: bold;">,</span><span class="at" style="color: #657422;"> description</span><span class="kw" style="color: #003B4F;
font-weight: bold;">,</span><span class="at" style="color: #657422;"> categories</span><span class="kw" style="color: #003B4F;
font-weight: bold;">,</span><span class="at" style="color: #657422;"> reading-time</span><span class="kw" style="color: #003B4F;
font-weight: bold;">]</span></span>
<span id="cb2-8"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">categories</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="ch" style="color: #20794D;">true</span></span>
<span id="cb2-9"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">sort</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb2-10"><span class="at" style="color: #657422;">    </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"date desc"</span></span>
<span id="cb2-11"><span class="at" style="color: #657422;">    </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"title"</span></span>
<span id="cb2-12"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">feed</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="ch" style="color: #20794D;">true</span></span>
<span id="cb2-13"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">page-size</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="dv" style="color: #AD0000;">12</span></span>
<span id="cb2-14"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">filter-ui</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="ch" style="color: #20794D;">true</span></span>
<span id="cb2-15"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">sort-ui</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="ch" style="color: #20794D;">true</span></span>
<span id="cb2-16"><span class="pp" style="color: #AD0000;">---</span></span></code></pre></div></div>
<p>Setting <code>categories: true</code> creates a sidebar that allows readers to filter posts by topic (e.g.&nbsp;“R packages”, “Agentic AI”, “GxP”).</p>
</section>
<section id="series-pages-seriesfoundations.qmd" class="level3">
<h3 class="anchored" data-anchor-id="series-pages-seriesfoundations.qmd">2. Series pages (<code>series/foundations.qmd</code>)</h3>
<p>To keep a reading order, each series gets its own page under <code>series/</code>, reachable from a <strong>Series</strong> dropdown in the navbar. A post joins a series with two front-matter fields, <code>series:</code> and <code>order:</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb3-1"><span class="fu" style="color: #4758AB;">series</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> foundations</span></span>
<span id="cb3-2"><span class="fu" style="color: #4758AB;">order</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="dv" style="color: #AD0000;">1</span></span></code></pre></div></div>
<p>The series page lists the posts whose <code>series</code> matches, sorted by <code>order</code>:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb4-1"><span class="pp" style="color: #AD0000;">---</span></span>
<span id="cb4-2"><span class="fu" style="color: #4758AB;">title</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"Foundations series"</span></span>
<span id="cb4-3"><span class="fu" style="color: #4758AB;">subtitle</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"From R development to R engineering"</span></span>
<span id="cb4-4"><span class="fu" style="color: #4758AB;">listing</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb4-5"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">contents</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"../posts/*/index.qmd"</span></span>
<span id="cb4-6"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">include</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb4-7"><span class="at" style="color: #657422;">    </span><span class="fu" style="color: #4758AB;">series</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> foundations</span></span>
<span id="cb4-8"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">sort</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"order"</span></span>
<span id="cb4-9"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">type</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> table</span></span>
<span id="cb4-10"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">fields</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="kw" style="color: #003B4F;
font-weight: bold;">[</span><span class="at" style="color: #657422;">order</span><span class="kw" style="color: #003B4F;
font-weight: bold;">,</span><span class="at" style="color: #657422;"> title</span><span class="kw" style="color: #003B4F;
font-weight: bold;">,</span><span class="at" style="color: #657422;"> description</span><span class="kw" style="color: #003B4F;
font-weight: bold;">]</span></span>
<span id="cb4-11"><span class="at" style="color: #657422;">  </span><span class="fu" style="color: #4758AB;">field-display-names</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb4-12"><span class="at" style="color: #657422;">    </span><span class="fu" style="color: #4758AB;">order</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"#"</span></span>
<span id="cb4-13"><span class="pp" style="color: #AD0000;">---</span></span></code></pre></div></div>
<p>A listing’s <code>include:</code> can filter on any front-matter field, not only categories (we checked this with Quarto 1.8.27 before relying on it). The table shows each series in reading order, regardless of publication dates.</p>
<p>We first used a category (“Foundations series”) for this. It worked, but every new series would have added another entry to the category filter, next to the topics readers actually filter by. A separate <code>series:</code> field keeps categories for topics and series for reading order.</p>
</section>
</section>
<section id="url-stability-aliases-preserve-existing-links" class="level2">
<h2 class="anchored" data-anchor-id="url-stability-aliases-preserve-existing-links">URL stability: aliases preserve existing links</h2>
<p>Renaming directory paths from <code>topics/01-identity-isolation/</code> to <code>posts/identity-isolation/</code> would normally create 404 errors for anyone visiting legacy URLs.</p>
<p>Quarto solves this through the <code>aliases</code> front-matter key:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"><span id="cb5-1"><span class="pp" style="color: #AD0000;">---</span></span>
<span id="cb5-2"><span class="fu" style="color: #4758AB;">title</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"Identity &amp; environment isolation"</span></span>
<span id="cb5-3"><span class="fu" style="color: #4758AB;">series</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> foundations</span></span>
<span id="cb5-4"><span class="fu" style="color: #4758AB;">order</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="dv" style="color: #AD0000;">1</span></span>
<span id="cb5-5"><span class="fu" style="color: #4758AB;">aliases</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span></span>
<span id="cb5-6"><span class="at" style="color: #657422;">  </span><span class="kw" style="color: #003B4F;
font-weight: bold;">-</span><span class="at" style="color: #657422;"> /topics/01-identity-isolation/index.html</span></span>
<span id="cb5-7"><span class="fu" style="color: #4758AB;">categories</span><span class="kw" style="color: #003B4F;
font-weight: bold;">:</span><span class="at" style="color: #657422;"> </span><span class="kw" style="color: #003B4F;
font-weight: bold;">[</span><span class="st" style="color: #20794D;">"R"</span><span class="kw" style="color: #003B4F;
font-weight: bold;">,</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"Git"</span><span class="kw" style="color: #003B4F;
font-weight: bold;">,</span><span class="at" style="color: #657422;"> </span><span class="st" style="color: #20794D;">"Security"</span><span class="kw" style="color: #003B4F;
font-weight: bold;">]</span></span>
<span id="cb5-8"><span class="pp" style="color: #AD0000;">---</span></span></code></pre></div></div>
<p>During site compilation, Quarto inspects the <code>aliases</code> list and creates static redirect stubs at <code>_site/topics/01-identity-isolation/index.html</code>. Any request targeting the legacy path is automatically redirected to <code>/posts/identity-isolation/</code>. Verifying the build confirms that redirect files are properly generated in <code>_site/topics/*</code>.</p>
</section>
<section id="controlled-category-taxonomy" class="level2">
<h2 class="anchored" data-anchor-id="controlled-category-taxonomy">Controlled category taxonomy</h2>
<p>Uncontrolled tagging creates fragmented listing sidebars where <code>github</code>, <code>gh-actions</code>, and <code>github-actions</code> compete as near-duplicates.</p>
<p>We established a controlled taxonomy defined directly in <code>blog.qmd</code>’s front-matter header comments: - Every post receives between 2 and 4 taxonomy categories. - Non-taxonomy values are systematically removed. - Series membership is not a category: it lives in the <code>series:</code> field (see above). - Categories are a short, high-level list readers actually filter by (“R”, “Shiny”, “R packages”, “Agentic AI”, “GxP”, “Pharma”, “Git”, “CI/CD”, “Security”, “Quarto”, “Best practices”).</p>
</section>
<section id="articles-as-living-documents" class="level2">
<h2 class="anchored" data-anchor-id="articles-as-living-documents">Articles as living documents</h2>
<p>In software engineering, best practices change when runtimes update, APIs evolve, or new security vulnerabilities emerge.</p>
<p>Rather than writing fragmented follow-up posts (“Why my 2024 article was wrong”), our editorial rules establish that <strong>articles are living documents</strong>:</p>
<ol type="1">
<li><p><strong><code>date-modified</code> tracking:</strong> When an article is updated, <code>date-modified: YYYY-MM-DD</code> is added to its front matter alongside its original <code>date</code>.</p></li>
<li><p><strong>Explicit Updates callouts:</strong> The bottom of each updated article contains a standard callout recording the revision history:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb6-1">::: {.callout-note collapse="false"}</span>
<span id="cb6-2"><span class="fu" style="color: #4758AB;">## Updates</span></span>
<span id="cb6-3"><span class="ss" style="color: #20794D;">- </span>**2026-09-26:** <span class="dt" style="color: #AD0000;">&lt;</span><span class="kw" style="color: #003B4F;
font-weight: bold;">what</span><span class="ot" style="color: #003B4F;"> changed</span><span class="er" style="color: #AD0000;">,</span><span class="ot" style="color: #003B4F;"> </span><span class="er" style="color: #AD0000;">1-3</span><span class="ot" style="color: #003B4F;"> sentences</span><span class="er" style="color: #AD0000;">,</span><span class="ot" style="color: #003B4F;"> with links</span><span class="dt" style="color: #AD0000;">&gt;</span></span>
<span id="cb6-4">:::</span></code></pre></div></div></li>
<li><p><strong>In-body weaving:</strong> New facts, commands, or code samples are woven directly into the relevant body sections rather than existing solely within the changelog box.</p></li>
<li><p><strong>Post template:</strong> Each post follows base sections: <em>The problem → The web-repo way → The R way</em>. Other sections are included only when needed, with no default checklist.</p></li>
</ol>
</section>
<section id="automated-ci-gates-previews-and-link-checking" class="level2">
<h2 class="anchored" data-anchor-id="automated-ci-gates-previews-and-link-checking">Automated CI gates: previews and link checking</h2>
<p>Every pull request modifying the playbook undergoes two automated gates before merging:</p>
<ol type="1">
<li><strong>Ephemeral preview channels:</strong> Each pull request renders and deploys to an isolated Firebase Hosting channel (<code>pr-&lt;number&gt;</code>) that automatically expires 7 days after the last deploy (see <a href="https://insightsurge-dev.web.app/posts/quarto-firebase-previews/index.html">ephemeral PR previews</a>). Reviewers inspect rendered HTML rather than raw markdown diffs.</li>
<li><strong>Offline link validation:</strong> An automated CI step runs <code>lychee --offline</code> across all generated HTML files in <code>_site/</code> (see <a href="https://insightsurge-dev.web.app/posts/link-checking-rendered-sites/index.html">link checking rendered sites</a>), while a local Python script mirrors the check before push. Renamed topics or broken internal links fail the build instantly.</li>
</ol>
</section>
<section id="shared-branding-with-_brand.yml" class="level2">
<h2 class="anchored" data-anchor-id="shared-branding-with-_brand.yml">Shared branding with <code>_brand.yml</code></h2>
<p>Modern technical publishing requires visual coherence between documentation websites, slide decks, and data applications.</p>
<p>Quarto supports the unified <code>_brand.yml</code> standard, which defines typography, color palettes, and logos in a single configuration file readable by both Quarto and Shiny’s <code>bslib</code> package. For our initial migration, the site maintains a neutral default brand configuration, providing a clean baseline that can be customized across both web assets and Shiny applications without rewriting template markup.</p>
</section>
<section id="delegated-multi-model-authoring" class="level2">
<h2 class="anchored" data-anchor-id="delegated-multi-model-authoring">Delegated multi-model authoring</h2>
<p>Migrating an entire documentation site while updating multiple living articles was coordinated using a <strong>two-model workflow</strong> (see <a href="https://insightsurge-dev.web.app/posts/two-model-workflow/index.html">two-model AI delegation</a>):</p>
<pre class="mermaid"><code>flowchart TD
    Claude["Owner Model (Claude)"] --&gt;|"gemini-brief.md (Scope &amp; Constraints)"| Gemini["Delegate Sessions (Gemini)"]
    Gemini --&gt;|"Research / Migration / Drafts / Categories"| Workspaces["posts/** &amp; drafts/**"]
    Claude --&gt;|"Review diffs, quarto render, lychee link check"| Verification{"Verification Gate"}
    Verification --&gt;|"Pass"| Git["PR Commit &amp; Merge"]</code></pre>
<ul>
<li>An <strong>Owner model (Claude)</strong> defined the plan, maintained the project instructions (<code>CLAUDE.md</code>), reviewed every phase, and did all commits, pushes and merges. The delegates were <em>instructed</em> not to use git; that rule was enforced by the brief and by reviewing diffs, not by sandboxing.</li>
<li>Focused <strong>Delegate sessions (Gemini)</strong> operated under a shared brief (<code>gemini-brief.md</code>) with strict file ownership boundaries:
<ul>
<li>A <em>research session</em> explored Quarto listings and themes;</li>
<li>A <em>migration session</em> moved legacy topic paths and updated navigation;</li>
<li>An <em>articles session</em> drafted new technical content in <code>drafts/</code>;</li>
<li>An <em>editor/categories session</em> applied review notes, unified category metadata, and authored amendments;</li>
<li>A <em>theme/bslib session</em> harmonized styling.</li>
</ul></li>
<li>Every change concluded with a structured digest, allowing the owner to verify file diffs and execute link checks before committing.</li>
</ul>
</section>
<section id="the-r-way-patterns-for-r-teams-and-package-documentation" class="level2">
<h2 class="anchored" data-anchor-id="the-r-way-patterns-for-r-teams-and-package-documentation">The R way: patterns for R teams and package documentation</h2>
<p>The patterns powering this blog translate directly to internal tooling within R-focused organisations:</p>
<ul>
<li><strong>R package blogs &amp; vignettes:</strong> An R package team can publish deep-dive tutorials alongside reference documentation by adding a <code>posts/</code> folder and a Quarto blog listing.</li>
<li><strong>Team knowledge bases:</strong> Engineering teams running Posit Connect or internal servers can use the same <code>aliases</code> mechanism to refactor legacy wiki paths without breaking corporate bookmarks.</li>
<li><strong>Living standard operating procedures (SOPs):</strong> In regulated GxP environments, the “living documents” convention (<code>date-modified</code> plus an explicit Updates log) provides transparent revision history for internal guidance and analytical playbooks.</li>
</ul>
</section>
<section id="pitfalls-we-hit" class="level2">
<h2 class="anchored" data-anchor-id="pitfalls-we-hit">Pitfalls we hit</h2>
<ul>
<li><strong>Listings on pages in subfolders.</strong> <code>series/foundations.qmd</code> first used <code>contents: ../posts</code> and <code>contents: /posts</code>; both rendered an empty table with the warning <em>“doesn’t match any files or folders”</em>. A relative <strong>glob</strong> worked: <code>contents: "../posts/*/index.qmd"</code>.</li>
<li><strong>Dark mode and Bootstrap variables.</strong> Quarto compiles separate light and dark stylesheets but doesn’t set Bootstrap’s <code>data-bs-theme="dark"</code>, so variables like <code>--bs-tertiary-bg</code> kept their <em>light</em> values in dark mode, and our callouts and inline code turned into white boxes. The fix is to derive surfaces from the theme’s own SCSS variables (<code>--hv-surface: #{mix($body-color, $body-bg, 6%)}</code>), which are compiled per theme. We also set <code>respect-user-color-scheme: true</code> so the site follows the visitor’s OS setting.</li>
<li><strong>Outdated snippets.</strong> A post that shows your own configuration goes stale as the site evolves. Update it in place (see the living-documents rule above).</li>
</ul>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Updates
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<ul>
<li><strong>2026-09-26:</strong> Removed the end-of-post checklist and updated post template documentation to base sections problem → web-repo way → R way with no default checklist.</li>
<li><strong>2026-09-26:</strong> Series moved from a category to a <code>series:</code> front-matter field, and the Testing and Pharma series pages were added. The category filter now lists topics only.</li>
<li><strong>2026-11-13:</strong> The site’s SCSS theme moved from one <code>styles.scss</code> file into a <code>brand/</code> folder, so the dark-mode pitfall no longer names that file.</li>
</ul>
</div>
</div>
</div>



</section>
<section id="keep-reading" class="level2 unnumbered unlisted no-anchor site-related">
<h2 class="unnumbered unlisted no-anchor" data-anchor-id="keep-reading">Keep reading</h2>
<div class="site-link-list">
<ul>
<li><a href="https://insightsurge-dev.web.app/posts/two-model-workflow/index.html" class="site-link-row" title="Structure dual-model AI workflows with clear task ownership, written briefs, and human verification to maintain engineering rigor."><span class="is-card__eyebrow site-link-row__label">Related</span><span class="site-link-row__title">One owner, two models: delegating to a second AI and verifying it</span></a></li>
<li><a href="https://insightsurge-dev.web.app/posts/quarto-firebase-previews/index.html" class="site-link-row" title="Deploy temporary Firebase Hosting preview channels on every pull request to review rendered Quarto sites before merging."><span class="is-card__eyebrow site-link-row__label">Related</span><span class="site-link-row__title">Deploy a Quarto site with a preview for every pull request</span></a></li>
<li><a href="https://insightsurge-dev.web.app/posts/link-checking-rendered-sites/index.html" class="site-link-row" title="Validate internal links across rendered documentation in CI using offline link scanners to block broken references before release."><span class="is-card__eyebrow site-link-row__label">Related</span><span class="site-link-row__title">Catch broken links before your readers do</span></a></li>
</ul>
</div>
</section>


 ]]></description>
  <category>Quarto</category>
  <category>Agentic AI</category>
  <category>Best practices</category>
  <guid>https://insightsurge-dev.web.app/posts/building-this-blog/</guid>
  <pubDate>Fri, 25 Sep 2026 18:30:00 GMT</pubDate>
</item>
<item>
  <title>Handoffs &amp; agentic context</title>
  <link>https://insightsurge-dev.web.app/posts/handoffs-agentic-context/</link>
  <description><![CDATA[ 





<!--
  Quarto 1.8.27's title-block.html with three changes: category badges and a
  series link ("Testing series · part 2") sit above the title, as in the brand's
  blog kit; and a post or series page with `trailer: true` shows its trailer beside the title
  (_filters/trailer.lua sets trailer-path; _includes/trailers.html plays it). On a Quarto upgrade, diff this against
  share/formats/html/templates/title-block.html and carry over any changes.
-->



<section id="the-problem" class="level2">
<h2 class="anchored" data-anchor-id="the-problem">The problem</h2>
<p>AI coding agents are fast, but every session starts cold. Teams typically compensate in one of two ways, and both are expensive:</p>
<ul>
<li><strong>very long chats</strong>, which cost tokens on every turn, drift, and can’t be reviewed later;</li>
<li><strong>re-explaining the project</strong> each time, which is slow and inconsistent.</li>
</ul>
<p>Instead, give the agent <strong>durable, versioned context</strong> (what a senior colleague would read on day one) plus <strong>short, curated notes</strong> about the work in progress.</p>
</section>
<section id="layer-1-project-instructions-claude.md-agents.md" class="level2">
<h2 class="anchored" data-anchor-id="layer-1-project-instructions-claude.md-agents.md">Layer 1: project instructions (<code>CLAUDE.md</code> / <code>AGENTS.md</code>)</h2>
<p>A markdown file at the repo root that the agent reads at the start of every session. <code>CLAUDE.md</code> is Claude Code’s file. <code>AGENTS.md</code> is a tool-neutral convention that several agents read, and Next.js now generates one for its own framework rules. A <code>CLAUDE.md</code> can import it (<code>@AGENTS.md</code>) and add project rules.</p>
<p>What belongs in it, and what we learned to put there:</p>
<div class="table-responsive">
<table class="caption-top table">
<thead>
<tr class="header">
<th>Section</th>
<th>Why</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Stack + <strong>exact commands</strong> (test one file, full check, format)</td>
<td>Agents otherwise guess, and run the slow full suite every time</td>
</tr>
<tr class="even">
<td>Git rules (Conventional Commits, squash, <strong>no AI attribution</strong>)</td>
<td>Consistent history (<a href="https://insightsurge-dev.web.app/posts/git-workflow/index.html">git workflow</a>, <a href="https://insightsurge-dev.web.app/posts/conventional-commits-pr-titles/index.html">conventional commits</a>)</td>
</tr>
<tr class="odd">
<td><strong>Confidentiality rules</strong> (no client/employer names, no real data)</td>
<td>The agent will otherwise happily paste whatever it sees</td>
</tr>
<tr class="even">
<td>Domain rules (e.g.&nbsp;banned compliance claims or blanket validation claims)</td>
<td>Encodes review knowledge once</td>
</tr>
<tr class="odd">
<td><strong>Verification rule</strong>: done means tests pass, not “the model said so”</td>
<td>Self-reports are not evidence</td>
</tr>
<tr class="even">
<td>Handoff and teaching rules</td>
<td>Continuity and learning</td>
</tr>
</tbody>
</table>
</div>
<p>Keep it short and specific: these instructions take up context in each session. A starter for R packages is in <a href="https://insightsurge-dev.web.app/templates/agentic/CLAUDE.md"><code>templates/agentic/CLAUDE.md</code></a>.</p>
</section>
<section id="layer-2-handoffs-for-work-in-progress" class="level2">
<h2 class="anchored" data-anchor-id="layer-2-handoffs-for-work-in-progress">Layer 2: handoffs for work in progress</h2>
<p>We now keep <strong>long-lived areas</strong>, such as <code>content/</code>, <code>site/</code>, <code>design/</code> and <code>agents/</code>, under <code>dev/handoffs/</code>. An area survives individual issues and PRs. A short-lived feature folder still makes sense for bounded work; close it when that work is done.</p>
<p>The root <code>README.md</code> maps folders to responsibilities. An optional <code>overview/</code> holds shared priorities, decision pointers and a delivered index when work spans areas. Every folder uses the same numbered files (the first keeps its old name, <code>01-feature.md</code>):</p>
<pre class="text"><code>dev/handoffs/&lt;area&gt;/
├── README.md          # dated Status · Next step · Read order · Last session; ≤ 60 lines
├── 01-feature.md      # what and why, scope, acceptance, source-of-truth links
├── 02-code-map.md     # where things live
├── 03-open-issues.md  # open work: tracker pointers and current gotchas
├── 04-plan.md         # next steps, how work runs, verification
├── 05-questions.md    # pending decisions: question, options, recommendation
└── 06-delivered.md    # finished work, newest first, with links</code></pre>
<p>Delete files an area does not need, without renumbering; an overview without code needs no code map. Named extras are fine, including <code>overview/decisions.md</code> for brief decision pointers. The templates live inside the committed skill. The working notes stay <strong>local and gitignored</strong>.</p>
<p>We share one handoff skill across two repositories and two coding agents. Each repository keeps its own handoffs; each agent reads the skill from its own folder, with the instructions, helper and templates kept as identical copies. Shared behaviour does not mean shared session state across repositories. Within one repository, the helper resolves the main checkout’s handoffs, including when called from a worktree.</p>
<p>To use it, copy the published skill into your repository as <code>.claude/skills/handoff/</code> (another agent gets an identical copy in its own skills folder). The commands below use that path. For a new project, <code>init</code> creates the root index and an overview; <code>start content</code> copies the area templates. Both require <code>dev/handoffs/</code> to be gitignored. Fill in the new folder and add it to the root index yourself.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="fu" style="color: #4758AB;">bash</span> .claude/skills/handoff/scripts/handoff.sh init</span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;">bash</span> .claude/skills/handoff/scripts/handoff.sh start content</span></code></pre></div></div>
<p>A fresh session reads the root index, then runs <code>status</code> to see each folder’s Status and Next step. Read only the area the task needs; read the overview when priorities cross areas.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="fu" style="color: #4758AB;">bash</span> .claude/skills/handoff/scripts/handoff.sh status</span>
<span id="cb3-2"><span class="fu" style="color: #4758AB;">bash</span> .claude/skills/handoff/scripts/handoff.sh check</span></code></pre></div></div>
<p><code>check</code> warns about a missing root index or folder README, a README over 60 lines, and an active Status without a date or older than 14 days by default (<code>HANDOFF_STALE_DAYS</code>). It also checks recognised handoff paths in backticks. Repository paths are opt-in with <code>HANDOFF_CHECK_REPO_PATHS=1</code>; bare filenames, URLs and placeholders are skipped. This is a lint check, not proof that the tracker agrees with the notes. Warnings produce exit status 1.</p>
<p>Updating and closing are <strong>skill procedures</strong>, <code>/handoff update content</code> and <code>/handoff close content</code>, not shell subcommands. The rules that make the notes useful:</p>
<ul>
<li><strong>Verify before writing Status.</strong> Check the linked issues and PRs, the branch and the latest commit on main. Do not copy yesterday’s claim that a PR is open after it has merged.</li>
<li><strong>Update every area touched</strong>, before a PR, before compaction and when stopping or handing over. Change <code>overview/</code> only when a shared priority or decision changes, then run <code>check</code>.</li>
<li><strong>Keep the README short.</strong> Date the Status, give one concrete Next step and record 1–3 Last session bullets. Use absolute dates and a Read order. Move finished items from the README, open issues and plan to <code>06-delivered.md</code>, newest first, with brief links.</li>
<li><strong>Point to the tracker; don’t recreate it.</strong> Remove answered questions. Put lasting decisions in issues or <a href="https://insightsurge-dev.web.app/posts/adrs-and-evidence/index.html">ADRs</a>, documentation in the repo and reusable scripts in <code>tools/</code>. Handoffs are not backed up by git.</li>
<li><strong>Close bounded work deliberately.</strong> Do a final update, mark the dated Status as closed, link the durable outcomes and remove the live Next step. Keep the folder unless asked to delete it.</li>
</ul>
<p>When several repositories work together, a session in one often learns something another needs: an idea, a decision, a change, a note there that went stale. It writes it as an entry in the other repository’s inbox, <code>dev/handoffs/external-notes.md</code> (<code>handoff.sh note</code>). The receiving project treats each entry as a claim to verify, not a decision: it spreads what holds into its own notes, opens an issue for agreed work, and moves the entry along with <code>handoff.sh set</code> (<code>triaged</code>, <code>planned</code>, <code>in-progress</code>, then <code>done</code>, <code>future</code>, <code>rejected</code>, <code>duplicate</code> or <code>noted</code>). Handled entries shrink to one line at the bottom of the file, and that record is the point: when the same request arrives again months later, the next session can see it was already rejected, and why. A session hook announces new entries and blocks a merge while an entry has waited untriaged for a day.</p>
<p>For R readers, think of a package’s <code>NEWS.md</code> versus your working lab notebook: the package keeps its lasting change record, while the notebook tells you which test to open next. An area’s <code>06-delivered.md</code> is a local index to finished work, not a replacement for that record. For an R package, exclude <code>dev/</code> from the source tarball with <code>^dev$</code> in <code>.Rbuildignore</code> too.</p>
<section id="the-skill-files" class="level3">
<h3 class="anchored" data-anchor-id="the-skill-files">The skill files</h3>
<p>The full skill, as we run it, is published here. Keep its folder structure when you copy it (the script finds the templates next to itself):</p>
<ul>
<li><a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/SKILL.md"><code>SKILL.md</code></a>: the procedures</li>
<li><a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/scripts/handoff.sh"><code>scripts/handoff.sh</code></a>: the helper (<code>init</code>, <code>start</code>, <code>status</code>, <code>check</code>, and the inbox commands)</li>
<li><a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/scripts/external-notes.sh"><code>scripts/external-notes.sh</code></a>: the inbox commands (<code>inbox</code>, <code>note</code>, <code>set</code>, <code>migrate</code>, <code>gate</code>)</li>
<li><a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/scripts/hook.sh"><code>scripts/hook.sh</code></a> and <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/scripts/hook.py"><code>scripts/hook.py</code></a>: a session hook for Claude Code, Codex and Antigravity (announces new entries, guards merges)</li>
<li>Root index template: <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/root/README.md"><code>root/README.md</code></a></li>
<li>Inbox template: <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/root/external-notes.md"><code>root/external-notes.md</code></a></li>
<li>Overview decision log template: <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/overview/decisions.md"><code>overview/decisions.md</code></a></li>
<li>Area templates: <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/area/README.md"><code>README.md</code></a>, <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/area/01-feature.md"><code>01-feature.md</code></a>, <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/area/02-code-map.md"><code>02-code-map.md</code></a>, <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/area/03-open-issues.md"><code>03-open-issues.md</code></a>, <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/area/04-plan.md"><code>04-plan.md</code></a>, <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/area/05-questions.md"><code>05-questions.md</code></a>, <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/templates/area/06-delivered.md"><code>06-delivered.md</code></a></li>
</ul>
</section>
</section>
<section id="layer-3-skills-and-plugins" class="level2">
<h2 class="anchored" data-anchor-id="layer-3-skills-and-plugins">Layer 3: skills and plugins</h2>
<p>Reusable procedures (a release checklist, a handoff, a review recipe) can be packaged as <strong>skills</strong>: a <code>SKILL.md</code> with instructions, plus scripts and templates. The agent loads them only when relevant, though skill names and descriptions also take up context. Plugins can be enabled at <strong>project scope</strong> (<code>.claude/settings.json</code>) to share the selection with contributors.</p>
</section>
<section id="working-with-more-than-one-model" class="level2">
<h2 class="anchored" data-anchor-id="working-with-more-than-one-model">Working with more than one model</h2>
<p>On this project one model (Claude) <strong>owns</strong> the work: it plans, decides and verifies. A second (Gemini) takes well-scoped tasks: reading docs, analysing dependency PRs, drafting. The rules:</p>
<ul>
<li>Give a clear brief with acceptance checks and constraints (for example, “edit only this file; no git, no push”).</li>
<li>Take back a <strong>short digest</strong>, not a transcript.</li>
<li><strong>Re-check the evidence and review the diff.</strong> In our dependency case the second model’s conclusions held up, but review still surfaced a nuance it had glossed over.</li>
<li>Keep outward-facing actions (push, merge, publish) with the owner, after verification.</li>
</ul>
</section>
<section id="token-discipline-is-cost-governance" class="level2">
<h2 class="anchored" data-anchor-id="token-discipline-is-cost-governance">Token discipline is cost governance</h2>
<p>For teams paying for AI seats, context is money. I use these patterns to keep context focused:</p>
<ul>
<li>short project instructions;</li>
<li>handoffs instead of long chats;</li>
<li>targeted tests while iterating;</li>
<li>digests from delegated work;</li>
<li>skills loaded on demand.</li>
</ul>
<p>We don’t quote savings figures until we’ve measured them. Neither should you.</p>
</section>
<section id="the-gxp-angle" class="level2">
<h2 class="anchored" data-anchor-id="the-gxp-angle">The GxP angle</h2>
<ul>
<li><strong>No real data in prompts, ever.</strong> Use synthetic or public pilot data, or your organisation’s approved enterprise AI environment.</li>
<li><strong>A named human is accountable</strong> for every change an agent makes. It goes through the same PR, review and CI as human code.</li>
<li><strong>Provenance:</strong> keep the lasting record in commits, reviewed PRs and ADRs; local handoffs point to it.</li>
</ul>
</section>
<section id="sources" class="level2">
<h2 class="anchored" data-anchor-id="sources">Sources</h2>
<ul>
<li><strong><code>CLAUDE.md</code> / project memory</strong>: <a href="https://docs.claude.com/en/docs/claude-code/memory">Claude Code Docs: How Claude remembers your project</a></li>
<li><strong><code>AGENTS.md</code></strong> (tool-neutral convention): <a href="https://agents.md/">agents.md</a></li>
<li><strong>Next.js generating <code>AGENTS.md</code>/<code>CLAUDE.md</code> for its own framework rules</strong>: <a href="https://nextjs.org/docs/app/guides/ai-agents">Next.js Docs: Set up your project for AI coding agents</a></li>
<li><strong>Claude Code Skills</strong>: <a href="https://code.claude.com/docs/en/skills">code.claude.com/docs/en/skills</a></li>
<li><strong>Claude Code Plugins</strong>: <a href="https://code.claude.com/docs/en/plugins">overview</a> and <a href="https://code.claude.com/docs/en/discover-plugins">installation scopes</a>.</li>
<li><strong>Areas layout and helper behaviour</strong>: the published skill above (<a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/SKILL.md"><code>SKILL.md</code></a> and <a href="https://insightsurge-dev.web.app/templates/agentic/handoff-skill/scripts/handoff.sh"><code>handoff.sh</code></a>), run on 2026-09-28.</li>
<li><strong>Gitignored working notes</strong>: <a href="https://git-scm.com/docs/gitignore">Git: gitignore</a>.</li>
<li><strong>R package records and build exclusions</strong>: <a href="https://r-pkgs.org/other-markdown.html#sec-news">R Packages: NEWS.md</a> and <a href="https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Building-package-tarballs">Writing R Extensions: Building package tarballs</a>.</li>
</ul>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Updates
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<ul>
<li><strong>2026-09-26:</strong> Removed the end-of-post checklist.</li>
<li><strong>2026-09-26:</strong> Established repository-scoped handoffs across two repositories, configuring <code>CLAUDE.md</code> to reference sibling handoffs for cross-repo context. Copied the handoff skill into the second repository.</li>
<li><strong>2026-09-27:</strong> Added a Sources section.</li>
<li><strong>2026-09-27:</strong> Linked every template file and showed it on the page.</li>
<li><strong>2026-09-28:</strong> Reworked handoffs around long-lived areas, with an optional overview, dated status checks and <code>06-delivered.md</code>. Clarified what belongs in git, the shared skill copies, and <code>status</code> / <code>check</code>. The downloadable skill is now the current version (areas, <code>init</code> / <code>status</code> / <code>check</code>).</li>
<li><strong>2026-10-03:</strong> Added an inbox for notes between related repositories (<code>external-notes.md</code>, with statuses from <code>new</code> to <code>done</code> or <code>rejected</code>), a migration for older notes, and a session hook that announces new entries and blocks a merge while an entry has waited untriaged for a day. The skill now also asks you to keep the tracker in step: close issues through a PR, with a comment, or as not planned. An optional update step now asks whether delegated work showed a new kind of mistake, for projects that keep standing rules for delegated AI work.</li>
</ul>
</div>
</div>
</div>



<div class="site-related">
<div class="site-series-nav">
<p><a href="https://insightsurge-dev.web.app/series/foundations.html" class="site-series-nav__series">Foundations series · part 14 of 16</a></p>
<div class="site-card-grid site-series-nav__links">
<div class="site-card-cell">
<a href="https://insightsurge-dev.web.app/posts/repo-hygiene-files/index.html" class="is-card site-related-card site-series-nav__prev"><span class="is-card__eyebrow">Previous · part 13</span><span class="site-related-card__title">Repo hygiene files</span></a>
</div>
<div class="site-card-cell">
<a href="https://insightsurge-dev.web.app/posts/companion-code/index.html" class="is-card site-related-card site-series-nav__next"><span class="is-card__eyebrow">Next · part 15</span><span class="site-related-card__title">Companion code: show it, link it, test it</span></a>
</div>
</div>
</div>
<section id="keep-reading" class="level2 unnumbered unlisted no-anchor">
<h2 class="unnumbered unlisted no-anchor" data-anchor-id="keep-reading">Keep reading</h2>
<div class="site-link-list">
<ul>
<li><a href="https://insightsurge-dev.web.app/posts/two-model-workflow/index.html" class="site-link-row" title="Structure dual-model AI workflows with clear task ownership, written briefs, and human verification to maintain engineering rigor."><span class="is-card__eyebrow site-link-row__label">Read next</span><span class="site-link-row__title">One owner, two models: delegating to a second AI and verifying it</span></a></li>
<li><a href="https://insightsurge-dev.web.app/posts/building-this-blog/index.html" class="site-link-row" title="How we transformed a 14-part topic site into a Quarto engineering blog and portfolio using URL aliases, living-document conventions, and multi-model agentic collaboration."><span class="is-card__eyebrow site-link-row__label">Related</span><span class="site-link-row__title">Building this blog: from numbered topics to a living Quarto publication</span></a></li>
<li><a href="https://insightsurge-dev.web.app/posts/introducing-mascot/index.html" class="site-link-row" title="The mascot package is now on CRAN: add mood-driven characters to Shiny apps and Quarto pages, with visible status text, speech bubbles, click menus and reduced-motion support."><span class="is-card__eyebrow site-link-row__label">Related</span><span class="site-link-row__title">mascot is on CRAN: live, mood-driven mascots for Shiny and Quarto</span></a></li>
</ul>
</div>
</section>
</div>

</section>

 ]]></description>
  <category>Agentic AI</category>
  <category>R packages</category>
  <category>GxP</category>
  <guid>https://insightsurge-dev.web.app/posts/handoffs-agentic-context/</guid>
  <pubDate>Fri, 25 Sep 2026 18:30:00 GMT</pubDate>
</item>
<item>
  <title>One owner, two models: delegating to a second AI and verifying it</title>
  <link>https://insightsurge-dev.web.app/posts/two-model-workflow/</link>
  <description><![CDATA[ 





<!--
  Quarto 1.8.27's title-block.html with three changes: category badges and a
  series link ("Testing series · part 2") sit above the title, as in the brand's
  blog kit; and a post or series page with `trailer: true` shows its trailer beside the title
  (_filters/trailer.lua sets trailer-path; _includes/trailers.html plays it). On a Quarto upgrade, diff this against
  share/formats/html/templates/title-block.html and carry over any changes.
-->



<section id="the-problem" class="level2">
<h2 class="anchored" data-anchor-id="the-problem">The problem</h2>
<p>Relying on a single AI model for complex software engineering creates subtle failure modes:</p>
<ol type="1">
<li><strong>Context saturation and drift.</strong> Long-running coding sessions accumulate numerous turns. Over time, the model loses sight of original architectural constraints, begins making assumptions, and glosses over breaking changes.</li>
<li><strong>Confirmation bias and echo chambers.</strong> When the same model that wrote a piece of code is asked to review or test it, it frequently confirms its own initial assumptions rather than catching edge cases.</li>
<li><strong>The loss of accountability.</strong> Handing complete control to autonomous agentic workflows violates fundamental engineering governance. In regulated environments (such as GxP clinical analytics), every code change must be attributable to a qualified practitioner who understands and verifies the work.</li>
</ol>
<p>To achieve high velocity without compromising rigor, we use a <strong>two-model workflow</strong>: an <strong>Owner</strong> model that directs, reviews, and executes outward actions, paired with one or more <strong>Delegate</strong> model sessions that perform focused research, drafting, and analysis under strict constraints.</p>
</section>
<section id="the-delegation-pattern-owner-and-delegate" class="level2">
<h2 class="anchored" data-anchor-id="the-delegation-pattern-owner-and-delegate">The delegation pattern: Owner and Delegate</h2>
<p>The workflow establishes a clear division of responsibility between two distinct AI models (in our practice, delegating to Gemini with Claude acting as owner):</p>
<pre class="mermaid"><code>flowchart TD
    Human["Named Human Engineer"] --&gt; Owner["Owner AI (Claude)"]
    Owner --&gt;|"Written Brief &amp; Constraints"| Delegate["Delegate AI (Gemini)"]
    Delegate --&gt;|"Structured Digest"| Owner
    Owner --&gt;|"Re-opens files, verifies claims"| Review{"Verification Gate"}
    Review --&gt;|"Pass"| Actions["Git Commit, Push, Merge, Deploy"]
    Review --&gt;|"Nuance missed / Fail"| Revise["Refine or Reject"]</code></pre>
<section id="the-brief-explicit-scope-and-acceptance-checks" class="level3">
<h3 class="anchored" data-anchor-id="the-brief-explicit-scope-and-acceptance-checks">1. The brief: explicit scope and acceptance checks</h3>
<p>Delegation begins with a structured markdown brief (such as <code>dev/handoffs/playbook-site/research/gemini-brief.md</code>, following our pattern for <a href="https://insightsurge-dev.web.app/posts/handoffs-agentic-context/index.html">handoffs and agentic context</a>). The brief defines: - <strong>Strict file ownership:</strong> Explicit directories the delegate may modify, with all other repository files designated read-only. - <strong>Hard constraints:</strong> Specific forbidden commands (no <code>git commit</code>, <code>git push</code>, or package installations) and strict style guidelines (no marketing hype, no unverified claims). - <strong>Verifiable facts:</strong> Exact evidence from repository configuration and official documentation that the delegate may cite.</p>
</section>
<section id="the-output-contract-digests-not-transcripts" class="level3">
<h3 class="anchored" data-anchor-id="the-output-contract-digests-not-transcripts">2. The output contract: digests, not transcripts</h3>
<p>Delegates are never permitted to dump raw session transcripts or full file contents into the owner’s context. The delegate must conclude with a <strong>compact digest</strong>: - Files created or modified; - Decisions made and rationale; - Unverified items flagged explicitly with <code>&lt;!-- UNVERIFIED: ... --&gt;</code>; - Open questions or discrepancies found.</p>
</section>
<section id="the-owner-retains-outward-actions" class="level3">
<h3 class="anchored" data-anchor-id="the-owner-retains-outward-actions">3. The owner retains outward actions</h3>
<p>The delegate never touches outward-facing tools. The owner model (under human supervision) reviews the diffs, runs test suites, builds the documentation, and executes git operations.</p>
</section>
</section>
<section id="evidence-from-our-own-work" class="level2">
<h2 class="anchored" data-anchor-id="evidence-from-our-own-work">Evidence from our own work</h2>
<p>We applied this two-model workflow to two real engineering challenges in our repositories.</p>
<section id="case-1-dependabot-pr-triage" class="level3">
<h3 class="anchored" data-anchor-id="case-1-dependabot-pr-triage">Case 1: Dependabot PR triage</h3>
<p>When automated dependency PRs arrived on our website repository, we assigned Gemini to analyse three separate pull requests and produce a triage recommendation:</p>
<ol type="1">
<li><strong>React 19.3.0:</strong> Gemini verified that Next.js 16.3 declared a peer dependency range of <code>^19.0.0</code>, confirming that the minor version bump was safe. Recommendation: <em>Merge</em>.</li>
<li><strong><code>@types/node</code> 26.x:</strong> Gemini verified that our runtime environment was pinned to Node 24 (<code>.nvmrc</code> and <code>package.json</code>). While CI passed and no type mismatches were observed, the types should match the Node 24 runtime so code cannot start using Node 26 APIs the runtime lacks. Recommendation: <em>Close and add a semver-major ignore rule in <code>.github/dependabot.yml</code></em>.</li>
<li><strong>TypeScript 7.x:</strong> Gemini verified that Next.js 16.3 bundled official documentation for TypeScript 7 compatibility. Recommendation: <em>Merge</em>.</li>
</ol>
<p><strong>The verification step:</strong> The owner did not simply accept the summary. Claude re-opened every cited file, inspected the diffs, and checked the bundled Next.js documentation.</p>
<p>In doing so, Claude noted a nuance that Gemini had glossed over: running the project’s own <code>tsc</code> is Next 16.3’s default, and the related config page (<code>useTypeScriptCli</code>) is labelled experimental. The triage was accepted with this caveat recorded in the PR description.</p>
</section>
<section id="case-2-playbook-documentation-migration" class="level3">
<h3 class="anchored" data-anchor-id="case-2-playbook-documentation-migration">Case 2: Playbook documentation migration</h3>
<p>Migrating our engineering playbook from legacy topic folders to a modern blog structure was split across five delegate sessions: - A <strong>research session</strong> explored Quarto visual themes and listing options; - A <strong>migrate session</strong> moved files and restructured navigation; - An <strong>articles session</strong> drafted new technical content in <code>drafts/</code>; - An <strong>editor/categories session</strong> finalised copy and unified metadata taxonomy; - A <strong>theme/bslib session</strong> integrated shared branding.</p>
<p>Each session operated under the shared brief (<code>gemini-brief.md</code>). Claude reviewed each phase, rendered the site locally, ran offline link checks, performed browser checks, and committed the verified diffs via pull request. The no-git and no-push constraints were enforced through the explicit brief and owner review rather than technical sandboxing.</p>
</section>
</section>
<section id="the-gxp-link-attributability-and-the-four-eyes-principle" class="level2">
<h2 class="anchored" data-anchor-id="the-gxp-link-attributability-and-the-four-eyes-principle">The GxP link: Attributability and the four-eyes principle</h2>
<p>In GxP regulated industries, data integrity rests on the <strong>ALCOA+</strong> principles, where the <strong>A</strong> stands for <strong>Attributable</strong>: every decision, code change, and clinical analysis must be directly traced to a responsible individual.</p>
<p>An AI model cannot be a regulated legal entity. It cannot sign off on a statistical analysis plan, approve a production release, or testify to an auditor.</p>
<p>The two-model workflow mirrors the traditional <strong>four-eyes principle</strong> (independent technical review) standard in clinical programming: - <strong>First pair of eyes (Delegate):</strong> Performs the heavy lifting—drafting code, researching dependency changelogs, and synthesizing test results. - <strong>Second pair of eyes (Owner &amp; Named Human):</strong> Independently re-opens the primary evidence, verifies the findings against official standards, challenges edge cases, and takes personal responsibility for committing the change.</p>
<p>By keeping the owner accountable for verification and outward actions, teams can leverage the speed of generative AI while keeping changes reviewable and attributable (capturing decisions as described in <a href="https://insightsurge-dev.web.app/posts/adrs-and-evidence/index.html">ADRs and evidence</a>).</p>
</section>
<section id="pitfalls-we-hit" class="level2">
<h2 class="anchored" data-anchor-id="pitfalls-we-hit">Pitfalls we hit</h2>
<ul>
<li><strong>The summary trap.</strong> Trusting a delegate’s polished summary without re-opening the primary source files. If the delegate misinterprets a release note or misses an experimental flag, the owner inherits the error.</li>
<li><strong>Instructions are not technical isolation.</strong> Prompts and briefs that instruct delegates not to run <code>git push</code> or modify credentials rely on compliance, not enforcement. For stronger boundaries, run delegates in an isolated sandbox or git worktree without write credentials.</li>
<li><strong>Overlapping file ownership.</strong> Allowing multiple parallel AI sessions to edit the same files leads to merge conflicts and overwritten context. Enforce strict, non-overlapping directory boundaries.</li>
<li><strong>Context dumping.</strong> Pasting full agent chat transcripts into the owner session rapidly bloats context windows and degrades reasoning performance. Enforce compact, bulleted digests.</li>
<li><strong>Leaking execution authority.</strong> Giving subagents permission to run <code>git push</code>, publish packages, or close PRs bypasses the verification gate. Outward actions must belong exclusively to the owner.</li>
</ul>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="true" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Updates
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse show">
<div class="callout-body-container callout-body">
<ul>
<li><strong>2026-09-26:</strong> Removed the end-of-post checklist.</li>
</ul>
</div>
</div>
</div>



</section>
<section id="keep-reading" class="level2 unnumbered unlisted no-anchor site-related">
<h2 class="unnumbered unlisted no-anchor" data-anchor-id="keep-reading">Keep reading</h2>
<div class="site-link-list">
<ul>
<li><a href="https://insightsurge-dev.web.app/posts/handoffs-agentic-context/index.html" class="site-link-row" title="Provide AI coding agents with durable project instructions and concise handoffs instead of endless chat history."><span class="is-card__eyebrow site-link-row__label">Read first</span><span class="site-link-row__title">Handoffs &amp; agentic context</span></a></li>
<li><a href="https://insightsurge-dev.web.app/posts/test-your-guardrails/index.html" class="site-link-row" title="Challenge CI checks and pre-commit hooks deliberately with failing test PRs to prove guardrails work."><span class="is-card__eyebrow site-link-row__label">Related</span><span class="site-link-row__title">Test your guardrails: probe PRs</span></a></li>
<li><a href="https://insightsurge-dev.web.app/posts/adrs-and-evidence/index.html" class="site-link-row" title="Record architectural decisions with ADRs and verify technical documentation against upstream evidence."><span class="is-card__eyebrow site-link-row__label">Related</span><span class="site-link-row__title">ADRs &amp; evidence: record decisions, verify docs</span></a></li>
</ul>
</div>
</section>


 ]]></description>
  <category>Agentic AI</category>
  <category>GxP</category>
  <category>Best practices</category>
  <guid>https://insightsurge-dev.web.app/posts/two-model-workflow/</guid>
  <pubDate>Fri, 25 Sep 2026 18:30:00 GMT</pubDate>
</item>
</channel>
</rss>
