<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Caffeine, Code, &amp; Chaos</title>
 <link href="https://www.dxrf.com/atom.xml" rel="self"/>
 <link href="https://www.dxrf.com/"/>
 <updated>2026-07-19T01:32:07+00:00</updated>
 <id>https://www.dxrf.com</id>
 <author>
   <name>Jenna Massardo</name>
   <email>jenna@dxrf.com</email>
 </author>

 
 <entry>
   <title>Git Worktrees: Work on Multiple Branches Without Losing Your Mind</title>
   <link href="https://www.dxrf.com/blog/2026/06/12/git-worktrees-work-on-multiple-branches/"/>
   <updated>2026-06-12T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/06/12/git-worktrees-work-on-multiple-branches</id>
   <excerpt type="html">Git worktrees let you check out multiple branches simultaneously in separate directories. Here is why you should care and how to actually use them.</excerpt>
   <content type="html">&lt;p&gt;You are deep in a feature branch. Tests are passing, code is flowing, and you are in the zone. Then Slack pings: “Hey, can you review this PR? Also, there is a production bug that needs a hotfix.”&lt;/p&gt;

&lt;p&gt;Now you have two choices. You can stash everything, switch branches, do the work, switch back, pop the stash, and pray nothing broke. Or you can just… open another directory that is already on the right branch.&lt;/p&gt;

&lt;p&gt;That is what &lt;a href=&quot;https://git-scm.com/docs/git-worktree&quot;&gt;git worktrees&lt;/a&gt; do.&lt;/p&gt;

&lt;!-- more --&gt;

&lt;h2 id=&quot;what-are-worktrees&quot;&gt;What Are Worktrees?&lt;/h2&gt;

&lt;p&gt;Every git repo has a &lt;strong&gt;main working tree&lt;/strong&gt; - that is the directory you cloned into. A worktree is an additional checkout of the same repository in a different directory, on a different branch, sharing the same &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.git&lt;/code&gt; data.&lt;/p&gt;

&lt;p&gt;No second clone. No duplicate downloads. No syncing between copies. One repo, multiple checkouts.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;~/code/my-app/                    # Main working tree (feature/auth branch)
├── .git/                         # All git data lives here
~/code/my-app-hotfix/             # Worktree (hotfix/login-bug branch)
~/code/my-app-review/             # Worktree (coworker/new-api branch)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;All three directories share the same commits, tags, remotes, and history. But each has its own working directory and index. You can have different files open in different editors, run different builds, even run different test suites, all at the same time.&lt;/p&gt;

&lt;h2 id=&quot;the-basics&quot;&gt;The Basics&lt;/h2&gt;

&lt;h3 id=&quot;creating-a-worktree&quot;&gt;Creating a Worktree&lt;/h3&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;&lt;span class=&quot;c&quot;&gt;# Create a worktree for an existing branch&lt;/span&gt;
git worktree add ../my-app-hotfix hotfix/login-bug

&lt;span class=&quot;c&quot;&gt;# Create a worktree AND a new branch in one shot&lt;/span&gt;
git worktree add ../my-app-experiment &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; experiment/new-cache-layer

&lt;span class=&quot;c&quot;&gt;# Create a worktree from a remote branch&lt;/span&gt;
git fetch origin
git worktree add ../my-app-review origin/coworker/new-api
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The first argument is the &lt;strong&gt;path&lt;/strong&gt; for the new directory. The second is the &lt;strong&gt;branch&lt;/strong&gt; to check out. That is it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One rule:&lt;/strong&gt; each branch can only be checked out in one worktree at a time. Git enforces this to prevent conflicts.&lt;/p&gt;

&lt;h3 id=&quot;listing-worktrees&quot;&gt;Listing Worktrees&lt;/h3&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;git worktree list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/Users/you/code/my-app            abc1234 [main]
/Users/you/code/my-app-hotfix     def5678 [hotfix/login-bug]
/Users/you/code/my-app-review     ghi9012 [coworker/new-api]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;removing-a-worktree&quot;&gt;Removing a Worktree&lt;/h3&gt;

&lt;p&gt;When you are done with a worktree, clean it up:&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;&lt;span class=&quot;c&quot;&gt;# Remove a worktree (the directory must be clean)&lt;/span&gt;
git worktree remove ../my-app-hotfix

&lt;span class=&quot;c&quot;&gt;# Force remove if there are uncommitted changes&lt;/span&gt;
git worktree remove &lt;span class=&quot;nt&quot;&gt;--force&lt;/span&gt; ../my-app-hotfix
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;pruning-stale-worktrees&quot;&gt;Pruning Stale Worktrees&lt;/h3&gt;

&lt;p&gt;If a worktree directory was deleted manually (not via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git worktree remove&lt;/code&gt;), prune the stale references:&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;git worktree prune
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;practical-patterns&quot;&gt;Practical Patterns&lt;/h2&gt;

&lt;h3 id=&quot;pattern-1-hotfix-without-context-switching&quot;&gt;Pattern 1: Hotfix Without Context Switching&lt;/h3&gt;

&lt;p&gt;You are on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;feature/auth&lt;/code&gt;. A production bug comes in.&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;&lt;span class=&quot;c&quot;&gt;# Create a worktree for the hotfix&lt;/span&gt;
git worktree add ../my-app-hotfix &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; hotfix/login-bug main

&lt;span class=&quot;c&quot;&gt;# Open it in a new editor window&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app-hotfix
code &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Fix the bug, commit, push, open a PR&lt;/span&gt;
git add &lt;span class=&quot;nt&quot;&gt;-A&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Fix login redirect loop&quot;&lt;/span&gt;
git push &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; origin hotfix/login-bug

&lt;span class=&quot;c&quot;&gt;# Clean up when the PR is merged&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app
git worktree remove ../my-app-hotfix
git branch &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; hotfix/login-bug
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Your feature branch is untouched. No stashing. No context switching. No mental overhead.&lt;/p&gt;

&lt;h3 id=&quot;pattern-2-pr-review-with-a-running-build&quot;&gt;Pattern 2: PR Review With a Running Build&lt;/h3&gt;

&lt;p&gt;You want to actually run a PR’s code, not just read the diff.&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;&lt;span class=&quot;c&quot;&gt;# Check out the PR branch into a worktree&lt;/span&gt;
git fetch origin pull/42/head:pr-42
git worktree add ../my-app-pr42 pr-42

&lt;span class=&quot;c&quot;&gt;# Run it&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app-pr42
npm &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Done reviewing? Clean up.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app
git worktree remove ../my-app-pr42
git branch &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; pr-42
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;pattern-3-parallel-ai-agents&quot;&gt;Pattern 3: Parallel AI Agents&lt;/h3&gt;

&lt;p&gt;This is the big one. Spin up multiple worktrees and point a separate AI agent at each one. Each agent works on its own branch, in its own directory, with zero risk of conflicts.&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;&lt;span class=&quot;c&quot;&gt;# Create worktrees for parallel AI tasks&lt;/span&gt;
git worktree add ../my-app-task-1 &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; agent/add-tests
git worktree add ../my-app-task-2 &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; agent/refactor-api
git worktree add ../my-app-task-3 &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; agent/update-docs

&lt;span class=&quot;c&quot;&gt;# Point your AI tool at each worktree (in separate terminals or containers)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app-task-1 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; copilot &lt;span class=&quot;nt&quot;&gt;--autopilot&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Write tests for the auth module&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app-task-2 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; copilot &lt;span class=&quot;nt&quot;&gt;--autopilot&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Refactor the API layer to use middleware&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app-task-3 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; copilot &lt;span class=&quot;nt&quot;&gt;--autopilot&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Add JSDoc to all exported functions&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Three agents, three branches, zero conflicts.&lt;/p&gt;

&lt;h3 id=&quot;pattern-4-compare-two-branches-side-by-side&quot;&gt;Pattern 4: Compare Two Branches Side by Side&lt;/h3&gt;

&lt;p&gt;Need to compare how something works on two different branches?&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;git worktree add ../my-app-v2 feature/v2-api

&lt;span class=&quot;c&quot;&gt;# Now open both directories in your editor and compare directly&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# No more switching back and forth&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;merging-the-work-back&quot;&gt;Merging the Work Back&lt;/h2&gt;

&lt;p&gt;Once work is done in a worktree, the branch exists in your shared git history. Merging is the same as any other branch.&lt;/p&gt;

&lt;h3 id=&quot;option-a-merge-locally&quot;&gt;Option A: Merge Locally&lt;/h3&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;&lt;span class=&quot;c&quot;&gt;# From your main working tree&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/code/my-app
git checkout main

git merge agent/add-tests
git merge agent/refactor-api
git merge agent/update-docs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If there are conflicts, resolve them one branch at a time. Since the agents were working on separate areas, conflicts should be minimal.&lt;/p&gt;

&lt;h3 id=&quot;option-b-push-and-open-prs&quot;&gt;Option B: Push and Open PRs&lt;/h3&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;&lt;span class=&quot;c&quot;&gt;# From each worktree, push the branch&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app-task-1 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git push &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; origin agent/add-tests
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app-task-2 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git push &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; origin agent/refactor-api
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../my-app-task-3 &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git push &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; origin agent/update-docs

&lt;span class=&quot;c&quot;&gt;# Open PRs via GitHub CLI&lt;/span&gt;
gh &lt;span class=&quot;nb&quot;&gt;pr &lt;/span&gt;create &lt;span class=&quot;nt&quot;&gt;--base&lt;/span&gt; main &lt;span class=&quot;nt&quot;&gt;--head&lt;/span&gt; agent/add-tests &lt;span class=&quot;nt&quot;&gt;--title&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Add auth module tests&quot;&lt;/span&gt;
gh &lt;span class=&quot;nb&quot;&gt;pr &lt;/span&gt;create &lt;span class=&quot;nt&quot;&gt;--base&lt;/span&gt; main &lt;span class=&quot;nt&quot;&gt;--head&lt;/span&gt; agent/refactor-api &lt;span class=&quot;nt&quot;&gt;--title&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Refactor API to middleware&quot;&lt;/span&gt;
gh &lt;span class=&quot;nb&quot;&gt;pr &lt;/span&gt;create &lt;span class=&quot;nt&quot;&gt;--base&lt;/span&gt; main &lt;span class=&quot;nt&quot;&gt;--head&lt;/span&gt; agent/update-docs &lt;span class=&quot;nt&quot;&gt;--title&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Add JSDoc documentation&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;PRs give you code review, CI checks, and an audit trail. This is the safer choice for anything you did not directly supervise.&lt;/p&gt;

&lt;h3 id=&quot;cleanup-script&quot;&gt;Cleanup Script&lt;/h3&gt;

&lt;p&gt;Here is a quick helper to tear down all your agent worktrees at once:&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;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# cleanup-worktrees.sh&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Remove all worktrees with &quot;agent/&quot; branches&lt;/span&gt;

git worktree list &lt;span class=&quot;nt&quot;&gt;--porcelain&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;^worktree &quot;&lt;/span&gt; | &lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; _ path&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;branch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git branch &lt;span class=&quot;nt&quot;&gt;--show-current&lt;/span&gt; 2&amp;gt;/dev/null&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$branch&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; agent/&lt;span class=&quot;k&quot;&gt;*&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;k&quot;&gt;then
        &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Removing worktree: &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; (branch: &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$branch&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&quot;&lt;/span&gt;
        git worktree remove &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--force&lt;/span&gt;
        git branch &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$branch&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; 2&amp;gt;/dev/null
    &lt;span class=&quot;k&quot;&gt;fi
done

&lt;/span&gt;git worktree prune
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Done. Remaining worktrees:&quot;&lt;/span&gt;
git worktree list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;things-to-watch-out-for&quot;&gt;Things to Watch Out For&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Shared &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.git&lt;/code&gt; data&lt;/strong&gt; - All worktrees share the same git objects, refs, and config. A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git gc&lt;/code&gt; in one worktree affects all of them.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node_modules&lt;/code&gt; and build artifacts&lt;/strong&gt; - Each worktree needs its own &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm install&lt;/code&gt; or equivalent. Dependencies are not shared across worktrees.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Disk space&lt;/strong&gt; - Worktrees are lightweight (they share git objects), but each one has its own copy of the working files. For large repos with big assets, this can add up.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;IDE state&lt;/strong&gt; - Some editors/IDEs get confused when the same repo has multiple checkouts. VS Code handles it well. Your mileage may vary.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Branch locking&lt;/strong&gt; - A branch can only be checked out in one worktree at a time. If you try to add a worktree for a branch that is already checked out, git will refuse.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;quick-reference&quot;&gt;Quick Reference&lt;/h2&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;&lt;span class=&quot;c&quot;&gt;# Create worktree (existing branch)&lt;/span&gt;
git worktree add &amp;lt;path&amp;gt; &amp;lt;branch&amp;gt;

&lt;span class=&quot;c&quot;&gt;# Create worktree (new branch from current HEAD)&lt;/span&gt;
git worktree add &amp;lt;path&amp;gt; &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; &amp;lt;new-branch&amp;gt;

&lt;span class=&quot;c&quot;&gt;# Create worktree (new branch from specific base)&lt;/span&gt;
git worktree add &amp;lt;path&amp;gt; &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt; &amp;lt;new-branch&amp;gt; &amp;lt;base&amp;gt;

&lt;span class=&quot;c&quot;&gt;# List all worktrees&lt;/span&gt;
git worktree list

&lt;span class=&quot;c&quot;&gt;# Remove a worktree&lt;/span&gt;
git worktree remove &amp;lt;path&amp;gt;

&lt;span class=&quot;c&quot;&gt;# Force remove&lt;/span&gt;
git worktree remove &lt;span class=&quot;nt&quot;&gt;--force&lt;/span&gt; &amp;lt;path&amp;gt;

&lt;span class=&quot;c&quot;&gt;# Prune stale worktrees&lt;/span&gt;
git worktree prune
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;Git worktrees solve a simple problem: &lt;strong&gt;you need to be on multiple branches at the same time&lt;/strong&gt;. Whether that is a hotfix interrupting your feature work, a PR review you want to run locally, or three AI agents working in parallel, worktrees keep everything clean and isolated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is your action plan:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Stop stashing and switching.&lt;/strong&gt; Use worktrees for any task that pulls you off your current branch.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-b&lt;/code&gt; flag&lt;/strong&gt; to create branches and worktrees in one command.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Clean up when you are done.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git worktree remove&lt;/code&gt; is your friend. Run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git worktree prune&lt;/code&gt; periodically.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Combine with containers&lt;/strong&gt; for AI agent workflows. Each agent gets its own worktree and its own sandbox.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Push branches and open PRs&lt;/strong&gt; for anything you want reviewed before merging.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Worktrees have been in git since version 2.5 (2015) and most developers have never heard of them. That changes today.&lt;/p&gt;
</content>
   
    <category term="git" />
   
    <category term="devops" />
   
    <category term="developer-tools" />
   
    <category term="automation" />
   
    <category term="best-practices" />
   
 </entry>
 
 <entry>
   <title>Automation as an Engineering Discipline, Not a Shortcut</title>
   <link href="https://www.dxrf.com/blog/2026/06/10/automation-engineering-discipline/"/>
   <updated>2026-06-10T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/06/10/automation-engineering-discipline</id>
   <excerpt type="html">Automation is frequently introduced to &apos;go faster.&apos; But speed alone is a poor justification. Poorly designed automation can amplify failures. Automation should reduce fragility, not hide it.</excerpt>
   <content type="html">&lt;p&gt;“Let’s automate it.”&lt;/p&gt;

&lt;p&gt;Music to every engineer’s ears. Who doesn’t want to replace tedious manual work with elegant automated solutions?&lt;/p&gt;

&lt;p&gt;But here’s the thing: automation isn’t magic. It’s engineering. And like all engineering, it has tradeoffs, risks, and failure modes.&lt;/p&gt;

&lt;p&gt;Bad automation doesn’t just fail to help. It actively makes things worse. It amplifies errors. It hides problems. It creates new categories of failure that didn’t exist before.&lt;/p&gt;

&lt;p&gt;Let’s talk about what it means to treat automation as a discipline, not a shortcut.&lt;/p&gt;

&lt;h2 id=&quot;the-go-faster-trap&quot;&gt;The “Go Faster” Trap&lt;/h2&gt;

&lt;p&gt;The most common justification for automation is speed. “We can deploy faster if we automate.” “We can respond to incidents faster if we automate.” “We can onboard faster if we automate.”&lt;/p&gt;

&lt;p&gt;Speed is good. But speed is a side effect, not a goal. If you optimize purely for speed, you’ll create fast automation that’s also brittle, opaque, and dangerous.&lt;/p&gt;

&lt;p&gt;Consider: a script that deploys to production in 30 seconds is faster than a human who takes 5 minutes. But if the script can also destroy production in 30 seconds when something goes wrong, have you actually improved the situation?&lt;/p&gt;

&lt;h2 id=&quot;what-can-go-wrong&quot;&gt;What Can Go Wrong&lt;/h2&gt;

&lt;h3 id=&quot;automation-amplifies-errors&quot;&gt;Automation Amplifies Errors&lt;/h3&gt;

&lt;p&gt;When a human makes a mistake, it affects one thing. When automation makes a mistake, it can affect everything.&lt;/p&gt;

&lt;p&gt;Delete the wrong file manually? You deleted one file. Automate that deletion? You might delete the file across every server simultaneously.&lt;/p&gt;

&lt;p&gt;This is the automation paradox: the same properties that make automation powerful (speed, scale, consistency) also make it dangerous.&lt;/p&gt;

&lt;h3 id=&quot;automation-hides-problems&quot;&gt;Automation Hides Problems&lt;/h3&gt;

&lt;p&gt;Manual processes have a feature: human attention. When someone does something manually, they see what’s happening. They notice when things look wrong. They adapt.&lt;/p&gt;

&lt;p&gt;Automation removes that attention. Problems that a human would catch get processed automatically. The system looks healthy because all the automated checks pass, but underneath, something is quietly going wrong.&lt;/p&gt;

&lt;h3 id=&quot;automation-creates-new-failure-modes&quot;&gt;Automation Creates New Failure Modes&lt;/h3&gt;

&lt;p&gt;Before automation, “the deploy script has a bug” wasn’t a failure mode. Now it is. Before automation, “the automated cleanup job deleted production data” wasn’t a risk. Now it is.&lt;/p&gt;

&lt;p&gt;Every piece of automation is a new system component. It can fail. It can interact badly with other components. It adds complexity even as it removes manual effort.&lt;/p&gt;

&lt;h3 id=&quot;automation-can-be-hard-to-override&quot;&gt;Automation Can Be Hard to Override&lt;/h3&gt;

&lt;p&gt;Good automation has escape hatches. Bad automation doesn’t.&lt;/p&gt;

&lt;p&gt;When the automated process is doing the wrong thing and you can’t stop it or override it, you’re not in control of your system anymore. The automation is.&lt;/p&gt;

&lt;h2 id=&quot;automation-as-engineering&quot;&gt;Automation as Engineering&lt;/h2&gt;

&lt;p&gt;So how do you do automation right? By treating it as engineering, not scripting.&lt;/p&gt;

&lt;h3 id=&quot;intentionality&quot;&gt;Intentionality&lt;/h3&gt;

&lt;p&gt;Don’t automate just because you can. Automate because you’ve thought through the tradeoffs and decided it’s worth it.&lt;/p&gt;

&lt;p&gt;Questions to ask:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;What problem is this automation solving?&lt;/li&gt;
  &lt;li&gt;What are the risks if it goes wrong?&lt;/li&gt;
  &lt;li&gt;What are the failure modes?&lt;/li&gt;
  &lt;li&gt;Is this the right thing to automate, or should it stay manual for safety?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;observability&quot;&gt;Observability&lt;/h3&gt;

&lt;p&gt;You should be able to see what your automation is doing. Logs, metrics, audit trails.&lt;/p&gt;

&lt;p&gt;When something goes wrong (and eventually it will), you need to be able to answer: What did the automation do? When? Why? What was the state before and after?&lt;/p&gt;

&lt;p&gt;Black-box automation that does things invisibly is a liability.&lt;/p&gt;

&lt;h3 id=&quot;reversibility&quot;&gt;Reversibility&lt;/h3&gt;

&lt;p&gt;Can you undo what the automation did?&lt;/p&gt;

&lt;p&gt;Good automation either makes reversible changes or is very careful about irreversible ones. Delete operations are dangerous. State modifications can be dangerous. Think about how to recover when automation does the wrong thing.&lt;/p&gt;

&lt;p&gt;This might mean:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Soft deletes instead of hard deletes&lt;/li&gt;
  &lt;li&gt;Backups before destructive operations&lt;/li&gt;
  &lt;li&gt;Change records that allow rollback&lt;/li&gt;
  &lt;li&gt;Confirmation steps for high-risk actions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;gradual-rollout&quot;&gt;Gradual Rollout&lt;/h3&gt;

&lt;p&gt;Don’t automate everything at once. Start small. Automate one step. See how it goes. Automate the next step.&lt;/p&gt;

&lt;p&gt;This is the same principle as incremental deployment for code changes. Gradual rollout limits blast radius and gives you feedback before you’re fully committed.&lt;/p&gt;

&lt;h3 id=&quot;testing&quot;&gt;Testing&lt;/h3&gt;

&lt;p&gt;Yes, your automation code needs tests.&lt;/p&gt;

&lt;p&gt;This is obvious for application code, but people often skip it for “scripts.” That script that runs in production at 3 AM is production code. Test it like production code.&lt;/p&gt;

&lt;h3 id=&quot;escape-hatches&quot;&gt;Escape Hatches&lt;/h3&gt;

&lt;p&gt;Always have a way to stop or override the automation.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Kill switches that halt automated processes&lt;/li&gt;
  &lt;li&gt;Manual approval gates for high-risk operations&lt;/li&gt;
  &lt;li&gt;Ability to run manually when automation can’t be trusted&lt;/li&gt;
  &lt;li&gt;Clear documentation on how to intervene&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;rate-limiting-and-circuit-breakers&quot;&gt;Rate Limiting and Circuit Breakers&lt;/h3&gt;

&lt;p&gt;Automation that goes wrong should stop itself before it causes maximum damage.&lt;/p&gt;

&lt;p&gt;If your automated cleanup script is deleting way more files than expected, it should notice and stop. If your deployment automation is seeing failures, it should halt rather than continuing to roll out bad code.&lt;/p&gt;

&lt;p&gt;Build in safeguards that trip before disaster is complete.&lt;/p&gt;

&lt;h2 id=&quot;when-not-to-automate&quot;&gt;When Not to Automate&lt;/h2&gt;

&lt;p&gt;Not everything should be automated. Some things are better left manual.&lt;/p&gt;

&lt;h3 id=&quot;rare-operations&quot;&gt;Rare Operations&lt;/h3&gt;

&lt;p&gt;If you do something once a year, automating it might cost more than it saves. The automation will probably be broken when you need it anyway because it hasn’t been tested in a year.&lt;/p&gt;

&lt;h3 id=&quot;high-risk-operations-with-low-volume&quot;&gt;High-Risk Operations with Low Volume&lt;/h3&gt;

&lt;p&gt;Some operations are dangerous enough that human attention is a feature. “Delete all customer data for GDPR compliance” might be something you want a human to think about and confirm.&lt;/p&gt;

&lt;h3 id=&quot;operations-requiring-judgment&quot;&gt;Operations Requiring Judgment&lt;/h3&gt;

&lt;p&gt;Automation is good at following rules. It’s bad at judgment calls. If the operation requires nuanced human judgment, automating it means either removing the judgment (risky) or building very complex decision logic (expensive and probably buggy).&lt;/p&gt;

&lt;h3 id=&quot;when-you-dont-understand-the-process&quot;&gt;When You Don’t Understand the Process&lt;/h3&gt;

&lt;p&gt;If you can’t clearly articulate what the manual process is and why, you’re not ready to automate it. Automation encodes your understanding. If your understanding is wrong, the automation will be wrong at scale.&lt;/p&gt;

&lt;h2 id=&quot;automation-maturity&quot;&gt;Automation Maturity&lt;/h2&gt;

&lt;p&gt;Think of automation maturity as a ladder:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Manual:&lt;/strong&gt; Humans do everything. Slow but adaptable.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Documented:&lt;/strong&gt; Humans follow runbooks. Still manual but more consistent.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Semi-automated:&lt;/strong&gt; Automation handles parts of the process. Human oversight and approval for key steps.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Automated with guardrails:&lt;/strong&gt; Automation handles the process but has safeguards, monitoring, and easy override.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Full autonomous:&lt;/strong&gt; Automation handles everything including recovery from failures.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most organizations should aim for level 4. Level 5 is only appropriate for well-understood, low-risk processes where you have extremely high confidence in the automation.&lt;/p&gt;

&lt;h2 id=&quot;tldr&quot;&gt;TL;DR&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Automation is engineering with tradeoffs, not a magic shortcut&lt;/li&gt;
  &lt;li&gt;Bad automation amplifies errors, hides problems, creates new failure modes, and can be hard to override&lt;/li&gt;
  &lt;li&gt;Treat automation as a discipline: intentionality, observability, reversibility, gradual rollout, testing, escape hatches, rate limiting&lt;/li&gt;
  &lt;li&gt;Not everything should be automated. Rare operations, high-risk low-volume tasks, and operations requiring judgment may be better manual&lt;/li&gt;
  &lt;li&gt;Automation should reduce fragility, not hide it. If your automation makes the system harder to understand or control, you’ve gone backward.&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;Have automation horror stories? Or examples of automation done right? I’m collecting both. Reach out on &lt;a href=&quot;https://www.linkedin.com/in/jenna-massardo/&quot;&gt;LinkedIn&lt;/a&gt;, &lt;a href=&quot;https://bsky.app/profile/jmassardo.bsky.social&quot;&gt;Bluesky&lt;/a&gt;, or &lt;a href=&quot;https://github.com/jmassardo&quot;&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
   
    <category term="automation" />
   
    <category term="engineering" />
   
    <category term="devops" />
   
    <category term="reliability" />
   
    <category term="best-practices" />
   
 </entry>
 
 <entry>
   <title>GitHub API Best Practices: Are You Being a Good API Citizen?</title>
   <link href="https://www.dxrf.com/blog/2026/06/08/github-api-best-practices-good-citizenship/"/>
   <updated>2026-06-08T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/06/08/github-api-best-practices-good-citizenship</id>
   <excerpt type="html">Pull up a chair. This workshop-style guide walks through how real teams build GitHub API integrations that avoid over-polling, over-scoped auth, and rate-limit chaos in production.</excerpt>
   <content type="html">&lt;p&gt;Picture this: you are in a conference room with twelve engineers, one product manager, and one platform lead who has already said, “our integration works fine,” three times in the first five minutes.&lt;/p&gt;

&lt;p&gt;I walk to the whiteboard and ask one question:&lt;/p&gt;

&lt;p&gt;“How many of your GitHub API calls are truly necessary?”&lt;/p&gt;

&lt;p&gt;Silence. A few side glances. Then someone says, “Define necessary.”&lt;/p&gt;

&lt;p&gt;Exactly.&lt;/p&gt;

&lt;p&gt;Most GitHub API integrations fail in slow motion, not in flames. They over-poll, over-scope permissions, under-handle limits, and quietly become expensive to operate. Nobody notices until delivery gets noisy, incident channels get busier, and trust in automation drops.&lt;/p&gt;

&lt;p&gt;That is not a GitHub problem. It is an API citizenship problem.&lt;/p&gt;

&lt;p&gt;If you are building against GitHub APIs, being a good citizen means doing three things well:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Ask for only what you need&lt;/li&gt;
  &lt;li&gt;Ask at the right time (not all the time)&lt;/li&gt;
  &lt;li&gt;Prove your integration is safe when it scales&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this post, we are going to run this like a workshop. You and I are designing the integration together, making tradeoffs in real time.&lt;/p&gt;

&lt;h2 id=&quot;workshop-ground-rules&quot;&gt;Workshop Ground Rules&lt;/h2&gt;

&lt;p&gt;Before we touch code, I put these three rules on the board:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Every call needs a reason.&lt;/strong&gt; “We might need it later” is not a reason.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Every credential needs an owner.&lt;/strong&gt; Shared mystery tokens are not ownership.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Every retry needs a limit.&lt;/strong&gt; Infinite optimism is not resilience.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If we keep those three rules, most integration pain disappears before it starts.&lt;/p&gt;

&lt;h2 id=&quot;start-with-api-contracts-and-schemas&quot;&gt;Start with API Contracts and Schemas&lt;/h2&gt;

&lt;p&gt;Before you write logic, lock in your request and response contract.&lt;/p&gt;

&lt;p&gt;For REST, this means:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Set a stable &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Accept&lt;/code&gt; header and API version&lt;/li&gt;
  &lt;li&gt;Validate required fields before making requests&lt;/li&gt;
  &lt;li&gt;Treat undocumented fields as non-contractual&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For GraphQL, this means:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Request only fields you use&lt;/li&gt;
  &lt;li&gt;Keep queries small and purpose-built&lt;/li&gt;
  &lt;li&gt;Use typed models in your code so schema drift is obvious&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In workshop terms: if your payload contract is fuzzy, every downstream consumer pays for that fuzziness.&lt;/p&gt;

&lt;p&gt;The anti-pattern is familiar:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;One “universal” response model with optional everything&lt;/li&gt;
  &lt;li&gt;One giant GraphQL query “for flexibility”&lt;/li&gt;
  &lt;li&gt;Runtime null checks everywhere&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The better pattern:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Separate models by use case&lt;/li&gt;
  &lt;li&gt;Small focused queries and endpoints&lt;/li&gt;
  &lt;li&gt;Contract tests that fail fast when expectations drift&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example REST baseline:&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;-L&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;Accept: application/vnd.github+json&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;X-GitHub-Api-Version: 2022-11-28&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;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$GITHUB_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;
  https://api.github.com/repos/OWNER/REPO/issues
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Official docs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest&quot;&gt;REST API overview&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/graphql&quot;&gt;GraphQL API overview&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;picking-rest-vs-graphql-without-religious-wars&quot;&gt;Picking REST vs GraphQL Without Religious Wars&lt;/h2&gt;

&lt;p&gt;This part always gets spicy in workshops, so here is the practical answer.&lt;/p&gt;

&lt;p&gt;Choose REST when:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Your workflow maps cleanly to resource endpoints&lt;/li&gt;
  &lt;li&gt;You want straightforward debugging with predictable URLs&lt;/li&gt;
  &lt;li&gt;You are building operational automation quickly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Choose GraphQL when:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;You need to compose data from multiple objects efficiently&lt;/li&gt;
  &lt;li&gt;You need stricter control over over-fetching&lt;/li&gt;
  &lt;li&gt;You can invest in query governance and typed clients&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use both when it makes sense. Teams lose months arguing “one true API style” while production outages are caused by retries and token sprawl.&lt;/p&gt;

&lt;h2 id=&quot;polling-vs-event-driven-default-to-events&quot;&gt;Polling vs Event-Driven: Default to Events&lt;/h2&gt;

&lt;p&gt;If your integration still polls every 30 seconds “just in case,” you are paying API tax for no reason.&lt;/p&gt;

&lt;p&gt;Use webhooks for near-real-time events and poll only as a fallback or reconciliation mechanism.&lt;/p&gt;

&lt;p&gt;Use webhooks when:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;You need low latency triggers&lt;/li&gt;
  &lt;li&gt;You can process events idempotently&lt;/li&gt;
  &lt;li&gt;Your source system can expose a receiver endpoint&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use polling when:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;You cannot expose inbound endpoints&lt;/li&gt;
  &lt;li&gt;You are reconciling missed state on a schedule&lt;/li&gt;
  &lt;li&gt;You need periodic health validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A practical hybrid pattern:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Webhooks trigger primary processing&lt;/li&gt;
  &lt;li&gt;A low-frequency poller reconciles missed or delayed events&lt;/li&gt;
  &lt;li&gt;Deduplicate by event ID or deterministic resource key&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In the room, this is where someone says, “we poll every minute because we do not trust webhooks.”&lt;/p&gt;

&lt;p&gt;That is not a webhook problem. That is a delivery design problem.&lt;/p&gt;

&lt;p&gt;What you actually need is:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Idempotent consumers&lt;/li&gt;
  &lt;li&gt;Replay-safe processing&lt;/li&gt;
  &lt;li&gt;A reconciliation job with clear SLA&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That combination beats high-frequency polling every time.&lt;/p&gt;

&lt;p&gt;Official docs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/webhooks-and-events/webhooks/about-webhooks&quot;&gt;About webhooks&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/webhooks/using-webhooks/best-practices-for-using-webhooks&quot;&gt;Best practices for using webhooks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;authentication-scope-is-a-security-feature&quot;&gt;Authentication: Scope Is a Security Feature&lt;/h2&gt;

&lt;p&gt;Authentication is not just “make the request pass.” It is the boundary of blast radius.&lt;/p&gt;

&lt;p&gt;Key rule: use the least-privileged identity that can complete the job.&lt;/p&gt;

&lt;p&gt;In practice, auth choices are architecture choices. They define blast radius, auditability, and operational burden.&lt;/p&gt;

&lt;h3 id=&quot;when-to-use-fine-grained-pats&quot;&gt;When to use fine-grained PATs&lt;/h3&gt;

&lt;p&gt;Use fine-grained personal access tokens for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Short-lived user-owned scripts&lt;/li&gt;
  &lt;li&gt;Small operational tasks with clear repo scope&lt;/li&gt;
  &lt;li&gt;Temporary migration tooling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Avoid PATs for long-running org-wide automation where ownership continuity matters.&lt;/p&gt;

&lt;p&gt;PATs break in exactly the ways you expect:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Human owner changes role&lt;/li&gt;
  &lt;li&gt;Token rotation gets delayed&lt;/li&gt;
  &lt;li&gt;Scope grows “temporarily” and never shrinks&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;when-to-use-github-apps&quot;&gt;When to use GitHub Apps&lt;/h3&gt;

&lt;p&gt;Use GitHub Apps for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Multi-repo or org-wide automation&lt;/li&gt;
  &lt;li&gt;Service-to-service integrations&lt;/li&gt;
  &lt;li&gt;Workloads needing granular, install-based permissions&lt;/li&gt;
  &lt;li&gt;Better auditability and lifecycle management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GitHub Apps should be your default for production automations.&lt;/p&gt;

&lt;p&gt;If your integration matters to more than one repo, you probably want an App.&lt;/p&gt;

&lt;p&gt;The workshop rule of thumb:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;One human, one short task:&lt;/strong&gt; fine-grained PAT&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;One team, one durable system:&lt;/strong&gt; GitHub App&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Official docs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/overview/authenticating-to-the-rest-api&quot;&gt;About authentication to GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens&quot;&gt;Fine-grained personal access tokens&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/apps/creating-github-apps/about-creating-github-apps&quot;&gt;About GitHub Apps&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#make-authenticated-requests&quot;&gt;Make authenticated requests&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;rate-limiting-design-for-limits-not-around-them&quot;&gt;Rate Limiting: Design for Limits, Not Around Them&lt;/h2&gt;

&lt;p&gt;If your strategy is “retry immediately until it works,” your strategy is to get throttled harder.&lt;/p&gt;

&lt;p&gt;Build a rate-aware client:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Read and log &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;X-RateLimit-*&lt;/code&gt; headers&lt;/li&gt;
  &lt;li&gt;Respect &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Retry-After&lt;/code&gt; for secondary limits&lt;/li&gt;
  &lt;li&gt;Use exponential backoff with jitter&lt;/li&gt;
  &lt;li&gt;Add local request budgets per workflow/job&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple control loop:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Check remaining budget&lt;/li&gt;
  &lt;li&gt;If low, defer non-critical calls&lt;/li&gt;
  &lt;li&gt;Retry only idempotent operations automatically&lt;/li&gt;
  &lt;li&gt;Escalate persistent throttling as a system health signal&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now for the part nobody loves: secondary limits are often behavior limits, not just volume limits.&lt;/p&gt;

&lt;p&gt;If your app bursts aggressively, parallelizes blindly, and retries instantly, you can hit limits while your primary budget still looks fine.&lt;/p&gt;

&lt;p&gt;Build a client that behaves like it has manners:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Centralized retry policy&lt;/li&gt;
  &lt;li&gt;Per-endpoint concurrency caps&lt;/li&gt;
  &lt;li&gt;Backoff with jitter and max-attempt guardrails&lt;/li&gt;
  &lt;li&gt;Circuit breaker behavior for repeated throttle responses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your integration can only succeed by being loud, it is not production-ready yet.&lt;/p&gt;

&lt;p&gt;Official docs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/overview/rate-limits-for-the-rest-api&quot;&gt;Rate limits for the REST API&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/guides/best-practices-for-integrators&quot;&gt;Best practices for integrators&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#handle-rate-limit-errors-appropriately&quot;&gt;Handle rate limit errors appropriately&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;good-vs-bad-handling-rate-limits&quot;&gt;Good vs Bad: Handling Rate Limits&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Bad approach (hammer retry):&lt;/strong&gt;&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;on 403/429:
  retry immediately
  retry immediately again
  keep retrying until success
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Good approach (header-aware retry):&lt;/strong&gt;&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;on 403/429:
  if Retry-After exists: sleep that many seconds
  else if X-RateLimit-Remaining == 0: sleep until X-RateLimit-Reset
  else: exponential backoff with jitter
  stop after bounded retry attempts and raise error
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sample response headers you should parse:&lt;/p&gt;

&lt;div class=&quot;language-http 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;k&quot;&gt;HTTP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1.1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;403&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;Forbidden&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;X-RateLimit-Limit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;5000&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;X-RateLimit-Remaining&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;X-RateLimit-Reset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;1780517400&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;Retry-After&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;60&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;concurrency-and-mutative-request-pacing&quot;&gt;Concurrency and Mutative Request Pacing&lt;/h2&gt;

&lt;p&gt;This is one of the most overlooked sections in GitHub’s docs and one of the most common workshop findings.&lt;/p&gt;

&lt;p&gt;GitHub explicitly recommends:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Avoid concurrent request floods when possible&lt;/li&gt;
  &lt;li&gt;Make requests serially through a queue when you can&lt;/li&gt;
  &lt;li&gt;Pause at least one second between large runs of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;POST&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATCH&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PUT&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DELETE&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good vs bad pattern:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt; 100 concurrent &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATCH&lt;/code&gt; calls with immediate retries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good:&lt;/strong&gt; queued mutative operations with a minimum one-second interval and bounded parallelism.&lt;/p&gt;

&lt;p&gt;Sample worker log output:&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;[worker] job=repo-sync-142 op=PATCH /repos/org/service/labels/id123
[worker] throttling mutative request: sleep=1.0s
[worker] status=200 remaining=4211
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Official docs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#avoid-concurrent-requests&quot;&gt;Avoid concurrent requests&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#pause-between-mutative-requests&quot;&gt;Pause between mutative requests&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;conditional-requests-stop-downloading-the-same-data-repeatedly&quot;&gt;Conditional Requests: Stop Downloading the Same Data Repeatedly&lt;/h2&gt;

&lt;p&gt;Conditional requests are one of the easiest wins for API efficiency.&lt;/p&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ETag&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;If-None-Match&lt;/code&gt; so unchanged resources return &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;304 Not Modified&lt;/code&gt; instead of full payloads.&lt;/p&gt;

&lt;p&gt;Real workshop example (open issues list in one repository):&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;&lt;span class=&quot;c&quot;&gt;# 1) First call: get current data and the ETag&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-sD&lt;/span&gt; headers.txt &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; body.json &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;Accept: application/vnd.github+json&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;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$GITHUB_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;
  https://api.github.com/repos/OWNER/REPO/issues?state&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;open&amp;amp;per_page&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;30

&lt;span class=&quot;c&quot;&gt;# 2) Grab ETag from response headers&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;etag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;BEGIN{IGNORECASE=1}/^ETag:/{print $2}&apos;&lt;/span&gt; headers.txt | &lt;span class=&quot;nb&quot;&gt;tr&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;\r&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ETag is: &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$etag&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# 3) Re-check later with If-None-Match&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&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;Accept: application/vnd.github+json&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;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$GITHUB_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;If-None-Match: &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$etag&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;s2&quot;&gt;&quot;https://api.github.com/repos/OWNER/REPO/issues?state=open&amp;amp;per_page=30&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If nothing changed, you should see output like this:&lt;/p&gt;

&lt;div class=&quot;language-http 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;k&quot;&gt;HTTP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1.1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;304&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;Not Modified&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;ETag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;W/\&quot;d7f9d13c9a0f...\&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;X-RateLimit-Remaining&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;4988&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Critical detail: when the request is correctly authenticated (with an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Authorization&lt;/code&gt; header) and you get &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;304 Not Modified&lt;/code&gt;, that request does not count against your primary rate limit.&lt;/p&gt;

&lt;p&gt;If something changed (new issue, closed issue, label update), you should see:&lt;/p&gt;

&lt;div class=&quot;language-http 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;k&quot;&gt;HTTP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1.1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;OK&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;ETag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;W/\&quot;e8121b9b2c44...\&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;Content-Type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;application/json; charset=utf-8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the response body will contain the updated issue list.&lt;/p&gt;

&lt;p&gt;Why this matters:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Lower bandwidth and lower compute in your integration&lt;/li&gt;
  &lt;li&gt;Fewer unnecessary API calls under load&lt;/li&gt;
  &lt;li&gt;Better resilience during burst periods&lt;/li&gt;
  &lt;li&gt;Authenticated &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;304&lt;/code&gt; responses preserve primary rate-limit budget, which is huge for high-frequency read paths&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In almost every workshop, we find one expensive read path that is re-fetching unchanged data all day. Conditional requests are the fastest cost/performance win you can ship this sprint.&lt;/p&gt;

&lt;p&gt;Official docs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#conditional-requests&quot;&gt;Conditional requests&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#use-conditional-requests-if-appropriate&quot;&gt;Use conditional requests if appropriate&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tip for workshop pilots: start with one high-volume read path (issues, pull requests, checks, or runs), add ETag handling there, and measure request reduction for one week.&lt;/p&gt;

&lt;h2 id=&quot;redirects-url-parsing-and-pagination-discipline&quot;&gt;Redirects, URL Parsing, and Pagination Discipline&lt;/h2&gt;

&lt;p&gt;These three show up together in production bugs more often than people expect.&lt;/p&gt;

&lt;h3 id=&quot;follow-redirects-correctly&quot;&gt;Follow redirects correctly&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;301&lt;/code&gt;: follow and update future code paths&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;302&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;307&lt;/code&gt;: follow for now, do not persist as canonical URL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sample redirect response:&lt;/p&gt;

&lt;div class=&quot;language-http 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;k&quot;&gt;HTTP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1.1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;301&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;Moved Permanently&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;Location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;https://api.github.com/repositories/123456/issues&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;do-not-manually-parse-urls&quot;&gt;Do not manually parse URLs&lt;/h3&gt;

&lt;p&gt;If the API gives you &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;number&lt;/code&gt;, use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;number&lt;/code&gt;. Do not split &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;html_url&lt;/code&gt; and hope format never changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt; parse &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https://github.com/org/repo/issues/1347&lt;/code&gt; to derive issue number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good:&lt;/strong&gt; use JSON field directly:&lt;/p&gt;

&lt;div class=&quot;language-json 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;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;number&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;1347&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;html_url&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://github.com/org/repo/issues/1347&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;h3 id=&quot;do-not-manually-construct-pagination&quot;&gt;Do not manually construct pagination&lt;/h3&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Link&lt;/code&gt; headers instead of hand-building &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;?page=&lt;/code&gt; assumptions.&lt;/p&gt;

&lt;p&gt;This is one of those details that looks minor until it burns a week of incident time.&lt;/p&gt;

&lt;p&gt;Common bad pattern:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Start at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;?page=1&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Increment page numbers until one request returns an empty array&lt;/li&gt;
  &lt;li&gt;Assume every endpoint behaves consistently with that approach&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why this fails in production:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Not every endpoint behaves the same way under filtering and sorting&lt;/li&gt;
  &lt;li&gt;Data can change while you are paging, so page boundaries shift&lt;/li&gt;
  &lt;li&gt;You can skip or duplicate records when new items arrive mid-run&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Better pattern:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Request the first page with a stable sort and explicit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;per_page&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Parse the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Link&lt;/code&gt; header for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rel=&quot;next&quot;&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Continue following only &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rel=&quot;next&quot;&lt;/code&gt; until absent&lt;/li&gt;
  &lt;li&gt;Track an idempotency key so reruns do not duplicate processing&lt;/li&gt;
  &lt;li&gt;Persist checkpoint state so failures resume cleanly&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Workshop guidance: if the data set is volatile, add a time window filter (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updated since&lt;/code&gt;) and overlap windows with dedupe so you do not lose records during high write activity.&lt;/p&gt;

&lt;p&gt;Sample pagination header:&lt;/p&gt;

&lt;div class=&quot;language-http 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;err&quot;&gt;Link: &amp;lt;https://api.github.com/repositories/123/issues?page=2&amp;gt;; rel=&quot;next&quot;, &amp;lt;https://api.github.com/repositories/123/issues?page=8&amp;gt;; rel=&quot;last&quot;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Good pagination loop (pseudocode):&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;url = &quot;https://api.github.com/repos/OWNER/REPO/issues?state=open&amp;amp;per_page=100&quot;
while url exists:
  response = GET(url)
  process_items_idempotently(response.body)
  url = parse_link_header(response.headers[&quot;Link&quot;]).next
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sample worker output:&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;[pager] page=1 items=100 next=yes remaining=4932
[pager] page=2 items=100 next=yes remaining=4931
[pager] page=3 items=27 next=no remaining=4930
[pager] complete total_items=227
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Official docs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#follow-redirects&quot;&gt;Follow redirects&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#do-not-manually-parse-urls&quot;&gt;Do not manually parse URLs&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/guides/using-pagination-in-the-rest-api&quot;&gt;Using pagination in the REST API&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;reference-architecture-for-a-well-behaved-integration&quot;&gt;Reference Architecture for a Well-Behaved Integration&lt;/h2&gt;

&lt;p&gt;If you are building a serious integration, design for resilience from day one. A minimal production-ready flow looks like this:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Ingress:&lt;/strong&gt; Webhook receiver validates signature and normalizes payloads&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Queue:&lt;/strong&gt; Events are buffered for retry-safe processing&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Worker:&lt;/strong&gt; Idempotent processor enriches data and calls GitHub APIs&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;State store:&lt;/strong&gt; Tracks last-processed marker, ETags, and dedupe keys&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Control plane:&lt;/strong&gt; Rate-limit telemetry, retry policy, and alerting&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This gives you replay support, better failure isolation, and cleaner audit trails.&lt;/p&gt;

&lt;p&gt;If you skip queueing and state tracking, you are not building an integration. You are building a coincidence that currently works.&lt;/p&gt;

&lt;h2 id=&quot;failure-modes-to-plan-for-up-front&quot;&gt;Failure Modes to Plan for Up Front&lt;/h2&gt;

&lt;p&gt;Most API incidents are predictable. Treat these as design requirements, not surprises:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Webhook delays or drops:&lt;/strong&gt; Reconcile with scheduled polling and deterministic dedupe&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Permission drift:&lt;/strong&gt; Detect permission errors and surface actionable remediation&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Secondary limits:&lt;/strong&gt; Back off globally, not per request loop&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Schema shifts:&lt;/strong&gt; Fail fast on parsing mismatches and alert on model drift&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Token expiration/rotation gaps:&lt;/strong&gt; Automate renewals and include health checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you test these failure modes in staging, your production incidents become recoverable instead of chaotic.&lt;/p&gt;

&lt;h2 id=&quot;do-not-ignore-errors&quot;&gt;Do Not Ignore Errors&lt;/h2&gt;

&lt;p&gt;Repeated &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4xx&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;5xx&lt;/code&gt; responses are not noise. They are feedback that your integration contract is broken, your permissions are wrong, or your assumptions are stale.&lt;/p&gt;

&lt;p&gt;Good vs bad response handling:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt; swallow &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;422&lt;/code&gt; validation errors and continue processing as success.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good:&lt;/strong&gt; classify, log structured details, and fail the unit of work with remediation hints.&lt;/p&gt;

&lt;p&gt;Sample validation error output:&lt;/p&gt;

&lt;div class=&quot;language-json 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;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;message&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;Validation Failed&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;errors&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;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;resource&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;Issue&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;field&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;title&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;code&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;missing_field&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;nl&quot;&gt;&quot;documentation_url&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://docs.github.com/rest&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;Official docs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#do-not-ignore-errors&quot;&gt;Do not ignore errors&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;observability-the-part-teams-add-too-late&quot;&gt;Observability: The Part Teams Add Too Late&lt;/h2&gt;

&lt;p&gt;I ask every workshop group the same question: “How will you know this integration is sick before customers do?”&lt;/p&gt;

&lt;p&gt;The minimum signal set:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Request success rate by endpoint&lt;/li&gt;
  &lt;li&gt;P95 and P99 latency for API calls&lt;/li&gt;
  &lt;li&gt;Throttle and secondary-limit event counts&lt;/li&gt;
  &lt;li&gt;Queue depth and event age&lt;/li&gt;
  &lt;li&gt;Reconciliation drift (expected vs observed state)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add an integration SLO early. Something simple:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Availability:&lt;/strong&gt; 99.5% successful processing over rolling 30 days&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Freshness:&lt;/strong&gt; 95% of events processed within 2 minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without explicit SLOs, you cannot separate noise from real degradation.&lt;/p&gt;

&lt;h2 id=&quot;a-maturity-model-you-can-actually-use&quot;&gt;A Maturity Model You Can Actually Use&lt;/h2&gt;

&lt;p&gt;When teams ask “how good are we,” I use this 4-level model.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Level&lt;/th&gt;
      &lt;th&gt;Behavior&lt;/th&gt;
      &lt;th&gt;Risk&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;L1 - Scripted&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;PAT-heavy, polling-heavy, minimal retries&lt;/td&gt;
      &lt;td&gt;Fragile and person-dependent&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;L2 - Structured&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Basic webhook handling, scoped auth, some backoff&lt;/td&gt;
      &lt;td&gt;Works but noisy under scale&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;L3 - Operable&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;App-based auth, idempotent workers, reconciliation loops&lt;/td&gt;
      &lt;td&gt;Stable and supportable&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;L4 - Resilient&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;SLO-driven ops, contract tests, automated policy checks&lt;/td&gt;
      &lt;td&gt;Predictable at enterprise scale&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;You do not need L4 on day one. You do need to know which level you are at and what must be true before growth.&lt;/p&gt;

&lt;h2 id=&quot;quick-decision-matrix&quot;&gt;Quick Decision Matrix&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Concern&lt;/th&gt;
      &lt;th&gt;Prefer&lt;/th&gt;
      &lt;th&gt;Why&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Long-running org automation&lt;/td&gt;
      &lt;td&gt;GitHub App&lt;/td&gt;
      &lt;td&gt;Better permission model and lifecycle&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;User-scoped short script&lt;/td&gt;
      &lt;td&gt;Fine-grained PAT&lt;/td&gt;
      &lt;td&gt;Fast setup with bounded scope&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Change detection&lt;/td&gt;
      &lt;td&gt;Webhooks&lt;/td&gt;
      &lt;td&gt;Lower latency, less API churn&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Drift correction&lt;/td&gt;
      &lt;td&gt;Scheduled polling&lt;/td&gt;
      &lt;td&gt;Catches missed events safely&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;High read volume&lt;/td&gt;
      &lt;td&gt;Conditional requests&lt;/td&gt;
      &lt;td&gt;Reduces waste and throttling risk&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;are-we-good-citizens-use-this-checklist&quot;&gt;Are We Good Citizens? Use This Checklist&lt;/h2&gt;

&lt;ul class=&quot;task-list&quot;&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We use GitHub Apps for production integrations where possible&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Our tokens are least-privilege and time-bounded&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We default to webhooks and use polling for reconciliation only&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We handle rate and secondary limits with backoff and jitter&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We avoid uncontrolled concurrency and pace mutative requests&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We follow redirects and treat 301 vs 302/307 differently&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We do not parse resource URLs or hand-roll pagination paths&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We use conditional requests on high-volume reads&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We version API usage and monitor schema-breaking assumptions&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We classify and act on repeated 4xx/5xx errors&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;We track integration SLOs (success rate, latency, throttle events)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;official-rest-best-practice-map&quot;&gt;Official REST Best-Practice Map&lt;/h2&gt;

&lt;p&gt;If you want a direct cross-check against GitHub docs, use this table during reviews:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;GitHub guidance&lt;/th&gt;
      &lt;th&gt;Covered in this workshop&lt;/th&gt;
      &lt;th&gt;Official docs&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Avoid polling&lt;/td&gt;
      &lt;td&gt;Webhook-first plus reconciliation&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#avoid-polling&quot;&gt;Avoid polling&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Make authenticated requests&lt;/td&gt;
      &lt;td&gt;Least-privilege auth model&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#make-authenticated-requests&quot;&gt;Make authenticated requests&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Avoid concurrent requests&lt;/td&gt;
      &lt;td&gt;Queue and bounded parallelism&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#avoid-concurrent-requests&quot;&gt;Avoid concurrent requests&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Pause mutative requests&lt;/td&gt;
      &lt;td&gt;One-second pacing for write bursts&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#pause-between-mutative-requests&quot;&gt;Pause between mutative requests&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Handle rate limits&lt;/td&gt;
      &lt;td&gt;Header-aware retry policy&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#handle-rate-limit-errors-appropriately&quot;&gt;Handle rate limit errors appropriately&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Follow redirects&lt;/td&gt;
      &lt;td&gt;Correct 301/302/307 behavior&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#follow-redirects&quot;&gt;Follow redirects&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Do not parse URLs&lt;/td&gt;
      &lt;td&gt;Use structured fields and Link headers&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#do-not-manually-parse-urls&quot;&gt;Do not manually parse URLs&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Use conditional requests&lt;/td&gt;
      &lt;td&gt;ETag and If-None-Match&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#use-conditional-requests-if-appropriate&quot;&gt;Use conditional requests if appropriate&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Do not ignore errors&lt;/td&gt;
      &lt;td&gt;Structured error handling and alerting&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2026-03-10#do-not-ignore-errors&quot;&gt;Do not ignore errors&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;If you can only fix three things this month, do these:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Replace long-lived PAT usage in core automations with a GitHub App&lt;/li&gt;
  &lt;li&gt;Move high-frequency polling paths to webhook-first + reconciliation&lt;/li&gt;
  &lt;li&gt;Add conditional requests and centralized backoff policy&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That trio usually gives the biggest reliability gain per engineering hour.&lt;/p&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;Good API citizenship is not about being polite. It is about building integrations that survive scale, audits, and bad days without becoming the bottleneck in your delivery system.&lt;/p&gt;

&lt;p&gt;Start with secure auth and strict scopes. Shift from polling-first to event-first. Add rate-aware controls and conditional requests so your integration stays efficient when usage spikes.&lt;/p&gt;

&lt;p&gt;If this were a live workshop, this is where I would hand you a marker and ask: “Which one integration are we fixing first?”&lt;/p&gt;

&lt;p&gt;Your move: pick one integration this week, run the checklist, and fix the two biggest citizenship gaps first. Use the best-practice map above as your review rubric. Then rerun the same exercise in 30 days. Good API citizenship is a habit, not a one-time migration.&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="api" />
   
    <category term="automation" />
   
    <category term="devops" />
   
    <category term="best-practices" />
   
    <category term="platform-engineering" />
   
 </entry>
 
 <entry>
   <title>Migrating to GitHub Actions, Part 3: Building the Lego Blocks</title>
   <link href="https://www.dxrf.com/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/"/>
   <updated>2026-06-03T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks</id>
   <excerpt type="html">Time to build. Template workflows, reusable workflows, custom actions, and the composable CI/CD architecture that ties it all together.</excerpt>
   <content type="html">&lt;p&gt;&lt;em&gt;This is Part 3 of a three-part series on migrating to GitHub Actions at scale. &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-1-making-the-case/&quot;&gt;Part 1: Making the Case for Change&lt;/a&gt; covers the why and the planning. &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like/&quot;&gt;Part 2: What Good Looks Like&lt;/a&gt; covers the target architecture.&lt;/em&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;You’ve got the business case (&lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-1-making-the-case/&quot;&gt;Part 1&lt;/a&gt;). You’ve seen the architecture (&lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like/&quot;&gt;Part 2&lt;/a&gt;). Time to build.&lt;/p&gt;

&lt;p&gt;This post is the implementation guide. We’re going to walk through building each layer of the composable workflow system, from the bottom up: custom actions first, then specialized reusable workflows, then the platform pipeline workflows, and finally the starter templates that developers actually interact with.&lt;/p&gt;

&lt;p&gt;Same idea as Lego. Start with the small pieces, assemble them into bigger structures, and eventually you’ve got something that looks like a spaceship. Or in our case, an enterprise CI/CD platform.&lt;/p&gt;

&lt;p&gt;Please keep in mind that these are examples and may or may not directly work in your environment. Disclaimers out of the way, let’s get to work!&lt;/p&gt;

&lt;h2 id=&quot;building-from-the-bottom-up&quot;&gt;Building from the Bottom Up&lt;/h2&gt;

&lt;p&gt;We build bottom-up because each layer depends on the layers below it:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;flowchart BT
    A[&quot;1. Custom Actions&amp;lt;br/&amp;gt;(discrete tasks)&quot;] --&amp;gt; B[&quot;2. Specialized Workflows&amp;lt;br/&amp;gt;(domain-specific pipelines)&quot;]
    B --&amp;gt; C[&quot;3. Platform Workflows&amp;lt;br/&amp;gt;(orchestration layer)&quot;]
    C --&amp;gt; D[&quot;4. Starter Templates&amp;lt;br/&amp;gt;(developer interface)&quot;]

    style A fill:#2ecc71,color:#fff
    style B fill:#3498db,color:#fff
    style C fill:#7b68ee,color:#fff
    style D fill:#4a90d9,color:#fff
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Smallest building blocks first.&lt;/p&gt;

&lt;h2 id=&quot;custom-actions-solving-environment-specific-problems&quot;&gt;Custom Actions: Solving Environment-Specific Problems&lt;/h2&gt;

&lt;p&gt;Every organization has its own internal tools, registries, deployment targets, and operational quirks. Custom actions standardize how you interact with these environment-specific systems so that individual teams don’t each invent their own approach.&lt;/p&gt;

&lt;h3 id=&quot;types-of-custom-actions&quot;&gt;Types of Custom Actions&lt;/h3&gt;

&lt;p&gt;GitHub supports three types of actions:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Type&lt;/th&gt;
      &lt;th&gt;Written In&lt;/th&gt;
      &lt;th&gt;Best For&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Composite&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;YAML (workflow steps)&lt;/td&gt;
      &lt;td&gt;Combining existing actions and shell commands into reusable sequences&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Node.js&lt;/td&gt;
      &lt;td&gt;Complex logic, API integrations, rich input/output handling&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Docker&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Dockerfile + any language&lt;/td&gt;
      &lt;td&gt;Isolated environments, specific tool versions, non-Node runtimes&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;For most platform engineering needs, &lt;strong&gt;composite actions&lt;/strong&gt; are the sweet spot. They’re easy to write, easy to debug, and they compose well with other actions. Reach for JavaScript or Docker actions when you need complex logic or environment isolation.&lt;/p&gt;

&lt;h3 id=&quot;example-internal-artifact-registry-setup&quot;&gt;Example: Internal Artifact Registry Setup&lt;/h3&gt;

&lt;p&gt;A real-world example makes this concrete. Your organization uses JFrog Artifactory as its internal artifact registry. Every team needs to authenticate and configure their build tool to use it. Without a custom action, every team writes their own version of this setup, and half of them get the authentication wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;my-org/custom-actions&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# setup-artifactory/action.yml&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Setup&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Artifactory&apos;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&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;Configures&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;authentication&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;and&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;tool&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;settings&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;internal&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Artifactory&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;registry&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;build-tool&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;description&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;Build&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;tool&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;configure&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(gradle,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;maven,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;npm,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;pip)&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;artifactory-url&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;description&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;Artifactory&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;URL&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;default&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;https://artifactory.internal.company.com&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;runs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;using&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;composite&apos;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Setup JFrog CLI&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;jfrog/setup-jfrog-cli@v4&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;JF_URL&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.artifactory-url }}&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;JF_ACCESS_TOKEN&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ env.ARTIFACTORY_TOKEN }}&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;Configure Gradle&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inputs.build-tool == &apos;gradle&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bash&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;run&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;mkdir -p ~/.gradle&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;cat &amp;gt; ~/.gradle/gradle.properties &amp;lt;&amp;lt; &apos;EOF&apos;&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;artifactory_url=${{ inputs.artifactory-url }}&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;artifactory_user=${{ env.ARTIFACTORY_USER }}&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;artifactory_token=${{ env.ARTIFACTORY_TOKEN }}&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;EOF&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;Configure Maven&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inputs.build-tool == &apos;maven&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bash&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;run&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;mkdir -p ~/.m2&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;cat &amp;gt; ~/.m2/settings.xml &amp;lt;&amp;lt; EOF&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;&amp;lt;settings&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;&amp;lt;servers&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;&amp;lt;server&amp;gt;&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;&amp;lt;id&amp;gt;internal-releases&amp;lt;/id&amp;gt;&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;&amp;lt;username&amp;gt;${{ env.ARTIFACTORY_USER }}&amp;lt;/username&amp;gt;&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;&amp;lt;password&amp;gt;${{ env.ARTIFACTORY_TOKEN }}&amp;lt;/password&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;&amp;lt;/server&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;&amp;lt;/servers&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;&amp;lt;/settings&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;EOF&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;Configure npm&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inputs.build-tool == &apos;npm&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bash&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;run&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;npm config set registry ${{ inputs.artifactory-url }}/api/npm/npm-remote/&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;npm config set //${{ inputs.artifactory-url }}/api/npm/npm-remote/:_authToken ${{ env.ARTIFACTORY_TOKEN }}&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;Configure pip&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inputs.build-tool == &apos;pip&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bash&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;run&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;mkdir -p ~/.config/pip&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;cat &amp;gt; ~/.config/pip/pip.conf &amp;lt;&amp;lt; EOF&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;[global]&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;index-url = https://${{ env.ARTIFACTORY_USER }}:${{ env.ARTIFACTORY_TOKEN }}@${{ inputs.artifactory-url }}/api/pypi/pypi-remote/simple&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now every pipeline that needs Artifactory uses one line:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/custom-actions/setup-artifactory@v1&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;build-tool&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;gradle&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;No copy-pasting setup scripts. No wondering if you got the authentication right. No debugging why Maven can’t find the internal registry on a Tuesday.&lt;/p&gt;

&lt;h3 id=&quot;example-internal-kubernetes-deployment&quot;&gt;Example: Internal Kubernetes Deployment&lt;/h3&gt;

&lt;p&gt;Another common pattern - wrapping your organization’s specific deployment process into a clean action:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# deploy-to-k8s/action.yml&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Deploy&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Internal&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Kubernetes&apos;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&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;Deploys&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;an&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;application&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;internal&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Kubernetes&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;clusters&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;standard&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;conventions&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;cluster&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;description&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;Target&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;cluster&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(staging,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;production-east,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;production-west)&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;namespace&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;description&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;Kubernetes&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;namespace&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&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;na&quot;&gt;description&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;Container&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(full&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;registry&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;tag)&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;manifest-path&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;description&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;Path&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Kubernetes&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;manifests&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;default&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;k8s/&apos;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;dry-run&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;description&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;Perform&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;dry-run&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;without&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;applying&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;changes&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;default&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;false&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;outputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;deployment-url&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;description&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;URL&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;the&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;deployed&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;application&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ steps.deploy.outputs.url }}&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;runs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;using&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;composite&apos;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Configure kubectl&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bash&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;run&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;# Your org&apos;s specific cluster authentication&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;# Maybe OIDC, maybe kubeconfig from secrets, maybe a custom CLI&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;internal-k8s-auth --cluster ${{ inputs.cluster }}&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;Validate manifests&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bash&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;run&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;kubectl apply --dry-run=server -f ${{ inputs.manifest-path }} \&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;-n ${{ inputs.namespace }}&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;Apply manifests&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inputs.dry-run == &apos;false&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bash&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;run&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;# Update image reference in manifests&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;kustomize edit set image app=${{ inputs.image }}&lt;/span&gt;

        &lt;span class=&quot;s&quot;&gt;# Apply with server-side apply for clean diffs&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;kubectl apply --server-side -f ${{ inputs.manifest-path }} \&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;-n ${{ inputs.namespace }}&lt;/span&gt;

        &lt;span class=&quot;s&quot;&gt;# Wait for rollout&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;kubectl rollout status deployment/app \&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;-n ${{ inputs.namespace }} \&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;--timeout=300s&lt;/span&gt;

        &lt;span class=&quot;s&quot;&gt;# Output the service URL&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;URL=$(kubectl get ingress app -n ${{ inputs.namespace }} \&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;-o jsonpath=&apos;{.spec.rules[0].host}&apos;)&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;echo &quot;url=https://${URL}&quot; &amp;gt;&amp;gt; $GITHUB_OUTPUT&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;Post deployment summary&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;bash&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;run&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;echo &quot;## Deployment Summary&quot; &amp;gt;&amp;gt; $GITHUB_STEP_SUMMARY&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;echo &quot;| Detail | Value |&quot; &amp;gt;&amp;gt; $GITHUB_STEP_SUMMARY&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;echo &quot;|--------|-------|&quot; &amp;gt;&amp;gt; $GITHUB_STEP_SUMMARY&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;echo &quot;| Cluster | ${{ inputs.cluster }} |&quot; &amp;gt;&amp;gt; $GITHUB_STEP_SUMMARY&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;echo &quot;| Namespace | ${{ inputs.namespace }} |&quot; &amp;gt;&amp;gt; $GITHUB_STEP_SUMMARY&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;echo &quot;| Image | ${{ inputs.image }} |&quot; &amp;gt;&amp;gt; $GITHUB_STEP_SUMMARY&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;echo &quot;| Dry Run | ${{ inputs.dry-run }} |&quot; &amp;gt;&amp;gt; $GITHUB_STEP_SUMMARY&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;custom-action-best-practices&quot;&gt;Custom Action Best Practices&lt;/h3&gt;

&lt;p&gt;A few ground rules for building actions that don’t become maintenance nightmares:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;One action, one responsibility.&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;setup-artifactory&lt;/code&gt; sets up Artifactory. It doesn’t also run your build.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Sensible defaults for everything optional.&lt;/strong&gt; If 90% of teams use the same Artifactory URL, make it the default.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Validate inputs early.&lt;/strong&gt; Fail fast with a clear error message, not halfway through execution with a cryptic stack trace.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Use step summaries.&lt;/strong&gt; Write to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$GITHUB_STEP_SUMMARY&lt;/code&gt; so developers can see what happened without digging through logs.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Version with semantic versioning.&lt;/strong&gt; Tag releases properly. Use a CI workflow in the action’s own repository to test it.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Document inputs and outputs.&lt;/strong&gt; The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;action.yml&lt;/code&gt; metadata is your API contract.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;specialized-reusable-workflows-domain-team-components&quot;&gt;Specialized Reusable Workflows: Domain Team Components&lt;/h2&gt;

&lt;p&gt;With custom actions as our foundation, we build the next layer: reusable workflows owned by domain teams. Each workflow encapsulates one team’s area of expertise.&lt;/p&gt;

&lt;h3 id=&quot;security-scanning-workflow&quot;&gt;Security Scanning Workflow&lt;/h3&gt;

&lt;p&gt;Owned by the security team. Runs all required security checks and produces a pass/fail result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;my-org/security-workflows&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# .github/workflows/full-scan.yml&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;Security Scan Suite&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;workflow_call&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;auto&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Primary&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;SAST&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;configuration&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;container-image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Container&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;scan&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(if&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;applicable)&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;severity-threshold&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;high&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Minimum&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;severity&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;fail&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;the&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(critical,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;high,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;medium,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;low)&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;outputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;scan-passed&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Whether&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;all&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;security&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;scans&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;passed&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ jobs.summary.outputs.passed }}&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;sast&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;Static Analysis&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;security-events&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;write&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&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;Initialize CodeQL&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;github/codeql-action/init@v3&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;languages&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.language != &apos;auto&apos; &amp;amp;&amp;amp; inputs.language || &apos;&apos; }}&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;Perform CodeQL Analysis&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;github/codeql-action/analyze@v3&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;dependency-scan&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;Dependency Vulnerabilities&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&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;Run dependency review&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;github.event_name == &apos;pull_request&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/dependency-review-action@v4&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;fail-on-severity&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.severity-threshold }}&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;container-scan&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;Container Image Scan&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inputs.container-image != &apos;&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Run Trivy vulnerability scanner&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;aquasecurity/trivy-action@master&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;image-ref&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.container-image }}&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;format&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;sarif&apos;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;output&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;trivy-results.sarif&apos;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;severity&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;CRITICAL,HIGH&apos;&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;Upload Trivy scan results&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;github/codeql-action/upload-sarif@v3&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;sarif_file&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;trivy-results.sarif&apos;&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;secret-detection&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;Secret Detection&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;fetch-depth&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&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;Detect secrets&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;trufflesecurity/trufflehog@main&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;extra_args&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;--only-verified&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;license-check&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;License Compliance&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&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;Check licenses&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;# Your org&apos;s specific license compliance tooling&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;# Example: check that no GPL-licensed dependencies&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;# exist in a project that ships proprietary code&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;echo &quot;Running license compliance check...&quot;&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;summary&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;Security Summary&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&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;nv&quot;&gt;sast&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;dependency-scan&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;container-scan&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;secret-detection&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;license-check&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;if&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;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;outputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;passed&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ steps.check.outputs.passed }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Evaluate results&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;check&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [[ &quot;${{ contains(needs.*.result, &apos;failure&apos;) }}&quot; == &quot;true&quot; ]]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;passed=false&quot; &amp;gt;&amp;gt; $GITHUB_OUTPUT&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;## :x: Security Scan Failed&quot; &amp;gt;&amp;gt; $GITHUB_STEP_SUMMARY&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;exit 1&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;else&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;passed=true&quot; &amp;gt;&amp;gt; $GITHUB_OUTPUT&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;## :white_check_mark: All Security Scans Passed&quot; &amp;gt;&amp;gt; $GITHUB_STEP_SUMMARY&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The security team can add, remove, or update any scanner in this workflow without touching any other team’s code. When they decide to add SBOM generation next quarter, it’s one PR to this repo.&lt;/p&gt;

&lt;h3 id=&quot;sre-operational-readiness-workflow&quot;&gt;SRE Operational Readiness Workflow&lt;/h3&gt;

&lt;p&gt;Owned by the SRE team. Validates that an application meets operational standards before deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;my-org/sre-workflows&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# .github/workflows/operational-readiness.yml&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;Operational Readiness Check&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;workflow_call&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Deployment&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(kubernetes,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ecs,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;lambda)&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;manifest-path&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;k8s/&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;require-health-endpoint&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;boolean&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;resource-validation&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;Resource Configuration&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inputs.deploy-target == &apos;kubernetes&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&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;Validate resource limits&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;# Ensure all deployments have resource requests and limits&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;for file in ${{ inputs.manifest-path }}*.yml; do&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;if grep -q &quot;kind: Deployment&quot; &quot;$file&quot;; then&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;if ! grep -q &quot;resources:&quot; &quot;$file&quot;; then&lt;/span&gt;
                &lt;span class=&quot;s&quot;&gt;echo &quot;::error file=$file::Deployment missing resource limits&quot;&lt;/span&gt;
                &lt;span class=&quot;s&quot;&gt;exit 1&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;done&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;echo &quot;All deployments have resource limits defined&quot;&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;Validate replica count&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;# Production deployments should have at least 2 replicas&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;for file in ${{ inputs.manifest-path }}*.yml; do&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;if grep -q &quot;kind: Deployment&quot; &quot;$file&quot;; then&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;replicas=$(grep &quot;replicas:&quot; &quot;$file&quot; | awk &apos;{print $2}&apos;)&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;if [ &quot;$replicas&quot; -lt 2 ]; then&lt;/span&gt;
                &lt;span class=&quot;s&quot;&gt;echo &quot;::warning file=$file::Deployment has fewer than 2 replicas&quot;&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;done&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;health-endpoint&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;Health Endpoint Check&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inputs.require-health-endpoint&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&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;Verify health endpoint configuration&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;# Check that liveness and readiness probes are defined&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;found_probes=false&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;for file in ${{ inputs.manifest-path }}*.yml; do&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;if grep -q &quot;livenessProbe:&quot; &quot;$file&quot; &amp;amp;&amp;amp; grep -q &quot;readinessProbe:&quot; &quot;$file&quot;; then&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;found_probes=true&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;done&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;if [ &quot;$found_probes&quot; = false ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;::error::No liveness/readiness probes found in deployment manifests&quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;exit 1&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;observability&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;Observability Configuration&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&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;Check for monitoring configuration&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;# Verify that the app includes standard observability config&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;# Check for metrics endpoint, structured logging config, etc.&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;if [ -f &quot;monitoring/alerts.yml&quot; ] || [ -f &quot;monitoring/dashboards.json&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;Monitoring configuration found&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;else&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;::warning::No monitoring configuration found in monitoring/ directory&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;language-guild-quality-gate&quot;&gt;Language Guild Quality Gate&lt;/h3&gt;

&lt;p&gt;Owned by the Java guild. Enforces language-specific standards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;my-org/java-guild-workflows&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# .github/workflows/quality-gate.yml&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;Java Quality Gate&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;workflow_call&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;java-version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;21&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;coverage-threshold&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;number&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;checkstyle-config&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;google&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;code-style&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;Code Style&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/setup-java@v4&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;java-version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.java-version }}&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;distribution&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;temurin&apos;&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;Run Checkstyle&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [ -f &quot;gradlew&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;./gradlew checkstyleMain checkstyleTest&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;elif [ -f &quot;pom.xml&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;mvn checkstyle:check&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;coverage&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;Code Coverage&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/setup-java@v4&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;java-version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.java-version }}&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;distribution&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;temurin&apos;&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;Run tests with coverage&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [ -f &quot;gradlew&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;./gradlew test jacocoTestReport&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;elif [ -f &quot;pom.xml&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;mvn verify&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&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;Check coverage threshold&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;# Parse JaCoCo report and verify coverage meets threshold&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;COVERAGE=$(grep -o &apos;Total[^%]*%&apos; build/reports/jacoco/test/html/index.html \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;| head -1 | grep -o &apos;[0-9]*&apos; | head -1 || echo &quot;0&quot;)&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;echo &quot;Code coverage: ${COVERAGE}%&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;if [ &quot;$COVERAGE&quot; -lt &quot;${{ inputs.coverage-threshold }}&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;::error::Code coverage ${COVERAGE}% is below threshold ${{ inputs.coverage-threshold }}%&quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;exit 1&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;dependency-updates&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;Dependency Freshness&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&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;Check for outdated dependencies&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [ -f &quot;gradlew&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;./gradlew dependencyUpdates --warning-mode all || true&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;# This is informational, not blocking&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;platform-workflows-the-orchestration-layer&quot;&gt;Platform Workflows: The Orchestration Layer&lt;/h2&gt;

&lt;p&gt;Now we assemble the pieces. The platform team’s reusable workflows compose custom actions and domain team workflows into complete pipelines.&lt;/p&gt;

&lt;h3 id=&quot;java-pipeline-complete-implementation&quot;&gt;Java Pipeline (Complete Implementation)&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;my-org/platform-workflows&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# .github/workflows/java-pipeline.yml&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;Java CI/CD Pipeline&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;workflow_call&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;java-version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;21&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Java&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;use&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;build-tool&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;gradle&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Build&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;tool&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(gradle&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;or&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;maven)&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;kubernetes&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Deployment&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(kubernetes,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ecs,&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;none)&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-environments&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;staging&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Comma-separated&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;deployment&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;environments&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(staging,production)&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;coverage-threshold&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;number&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;skip-deploy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;boolean&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;description&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;Skip&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;deployment&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;(CI&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;only)&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;build&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;Build &amp;amp; Test&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;outputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;image-tag&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ steps.meta.outputs.version }}&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;image-digest&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ steps.build-image.outputs.digest }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/setup-java@v4&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;java-version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.java-version }}&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;distribution&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;temurin&apos;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;cache&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.build-tool }}&lt;/span&gt;

      &lt;span class=&quot;c1&quot;&gt;# Use our custom action to configure internal registry&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/custom-actions/setup-artifactory@v1&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;build-tool&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.build-tool }}&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;Build&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [ &quot;${{ inputs.build-tool }}&quot; = &quot;gradle&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;./gradlew build -x test&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;else&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;mvn compile -DskipTests&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&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;Test&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [ &quot;${{ inputs.build-tool }}&quot; = &quot;gradle&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;./gradlew test&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;else&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;mvn test&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&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;Package&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [ &quot;${{ inputs.build-tool }}&quot; = &quot;gradle&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;./gradlew bootJar&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;else&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;mvn package -DskipTests&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&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;Docker meta&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;meta&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker/metadata-action@v5&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;images&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;artifactory.internal.company.com/docker/${{ github.repository }}&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;tags&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;type=sha,prefix=&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;type=ref,event=branch&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;type=semver,pattern={{version}}&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;Build and push container image&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build-image&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inputs.deploy-target != &apos;none&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;docker/build-push-action@v6&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ github.ref == &apos;refs/heads/main&apos; }}&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;tags&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ steps.meta.outputs.tags }}&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ steps.meta.outputs.labels }}&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;Upload test results&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;if&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;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/upload-artifact@v4&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&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;test-results&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;path&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;**/build/reports/tests/&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;**/target/surefire-reports/&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# Security scanning (owned by security team)&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;security&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/security-workflows/.github/workflows/full-scan.yml@v1&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;language&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;java&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;container-image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;&amp;gt;-&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;${{ needs.build.outputs.image-tag != &apos;&apos; &amp;amp;&amp;amp;&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;format(&apos;artifactory.internal.company.com/docker/{0}:{1}&apos;,&lt;/span&gt;
        &lt;span class=&quot;s&quot;&gt;github.repository, needs.build.outputs.image-tag) || &apos;&apos; }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;security-events&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;write&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# SRE operational readiness (owned by SRE team)&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;sre&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/sre-workflows/.github/workflows/operational-readiness.yml@v1&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.deploy-target }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# Java quality gate (owned by Java guild)&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;quality&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/java-guild-workflows/.github/workflows/quality-gate.yml@v1&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;java-version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.java-version }}&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;coverage-threshold&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.coverage-threshold }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# Deploy to staging&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;deploy-staging&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;Deploy to Staging&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&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;nv&quot;&gt;security&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;sre&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;quality&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;&amp;gt;-&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;github.ref == &apos;refs/heads/main&apos; &amp;amp;&amp;amp;&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;!inputs.skip-deploy &amp;amp;&amp;amp;&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;contains(inputs.deploy-environments, &apos;staging&apos;)&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;staging&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;s&quot;&gt;${{ steps.deploy.outputs.deployment-url }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/custom-actions/deploy-to-k8s@v1&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;cluster&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;staging&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;namespace&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ github.event.repository.name }}&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;pi&quot;&gt;&amp;gt;-&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;artifactory.internal.company.com/docker/${{ github.repository }}:${{ needs.build.outputs.image-tag }}&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# Deploy to production (requires approval)&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;deploy-production&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;Deploy to Production&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&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;nv&quot;&gt;deploy-staging&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;&amp;gt;-&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;github.ref == &apos;refs/heads/main&apos; &amp;amp;&amp;amp;&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;!inputs.skip-deploy &amp;amp;&amp;amp;&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;contains(inputs.deploy-environments, &apos;production&apos;)&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production&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;s&quot;&gt;${{ steps.deploy.outputs.deployment-url }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/custom-actions/deploy-to-k8s@v1&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;cluster&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production-east&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;namespace&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ github.event.repository.name }}&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;pi&quot;&gt;&amp;gt;-&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;artifactory.internal.company.com/docker/${{ github.repository }}:${{ needs.build.outputs.image-tag }}&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/custom-actions/notify-release-channel@v1&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;status&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;deployed&apos;&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;production&apos;&lt;/span&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;s&quot;&gt;${{ needs.build.outputs.image-tag }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;deployment-workflow-shared-across-languages&quot;&gt;Deployment Workflow (Shared Across Languages)&lt;/h3&gt;

&lt;p&gt;Some pieces aren’t language-specific. Deployment, for example, often follows the same pattern regardless of what language produced the artifact:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# .github/workflows/deploy.yml&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;Standard Deployment&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;workflow_call&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&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;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&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;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;require-approval&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;boolean&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;deploy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&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;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.environment }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/custom-actions/deploy-to-k8s@v1&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;deploy&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;cluster&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.target }}&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;namespace&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ github.event.repository.name }}&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;${{ inputs.image }}&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;Smoke test&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;# Hit the health endpoint and verify it&apos;s responding&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;DEPLOY_URL=&quot;${{ steps.deploy.outputs.deployment-url }}&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;for i in {1..10}; do&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;if curl -sf &quot;${DEPLOY_URL}/health&quot; &amp;gt; /dev/null; then&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;echo &quot;Health check passed&quot;&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;exit 0&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;Waiting for deployment to be healthy... (attempt $i/10)&quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;sleep 10&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;done&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;echo &quot;::error::Health check failed after 10 attempts&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;exit 1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;production-delivery-mechanics-environments-strategies-and-recovery&quot;&gt;Production Delivery Mechanics: Environments, Strategies, and Recovery&lt;/h2&gt;

&lt;p&gt;Part 2 introduced the architecture. This section closes the implementation gap for production delivery mechanics: how deployments get triggered, how environments are protected, how traffic gets shifted, and how rollback works when things fail.&lt;/p&gt;

&lt;h3 id=&quot;trigger-patterns&quot;&gt;Trigger Patterns&lt;/h3&gt;

&lt;p&gt;Most teams should keep CI and CD as separate workflows and trigger CD when CI completes successfully on the default branch:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;workflow_run&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;workflows&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;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;CI&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;branches&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;nv&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;types&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;nv&quot;&gt;completed&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use tag-based release triggers when you need explicit release control:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;tags&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;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;v*&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;environment-protection-rules&quot;&gt;Environment Protection Rules&lt;/h3&gt;

&lt;p&gt;Treat environment settings as part of your platform contract, not repo-by-repo preferences.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Environment&lt;/th&gt;
      &lt;th&gt;Required Reviewers&lt;/th&gt;
      &lt;th&gt;Wait Timer&lt;/th&gt;
      &lt;th&gt;Branch Restriction&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Dev&lt;/td&gt;
      &lt;td&gt;None&lt;/td&gt;
      &lt;td&gt;None&lt;/td&gt;
      &lt;td&gt;Feature and main&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Staging&lt;/td&gt;
      &lt;td&gt;Optional (platform on-call)&lt;/td&gt;
      &lt;td&gt;None&lt;/td&gt;
      &lt;td&gt;Main and release/*&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Production&lt;/td&gt;
      &lt;td&gt;Platform/SRE approval&lt;/td&gt;
      &lt;td&gt;5-10 min&lt;/td&gt;
      &lt;td&gt;Main only&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Pair these with environment-scoped secrets so production credentials are only available to jobs targeting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;production&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;deployment-strategy-selection&quot;&gt;Deployment Strategy Selection&lt;/h3&gt;

&lt;p&gt;Use the strategy that matches risk and rollback requirements:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Strategy&lt;/th&gt;
      &lt;th&gt;Best For&lt;/th&gt;
      &lt;th&gt;Trade-Off&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Rolling&lt;/td&gt;
      &lt;td&gt;Most internal services&lt;/td&gt;
      &lt;td&gt;Slower rollback, mixed-version window&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Blue-Green&lt;/td&gt;
      &lt;td&gt;Zero-downtime cutovers&lt;/td&gt;
      &lt;td&gt;Double environment cost&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Canary&lt;/td&gt;
      &lt;td&gt;High-risk, high-traffic services&lt;/td&gt;
      &lt;td&gt;More routing + observability complexity&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;For most organizations: start with rolling, use blue-green for critical customer paths, adopt canary where production behavior uncertainty is highest.&lt;/p&gt;

&lt;h3 id=&quot;rollback-by-design&quot;&gt;Rollback by Design&lt;/h3&gt;

&lt;p&gt;Always record the currently deployed version before rollout and automate health-check rollback.&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;&lt;span class=&quot;c&quot;&gt;# Capture previous image before deployment&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;PREV_IMAGE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;kubectl get deployment app &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;jsonpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;{.spec.template.spec.containers[0].image}&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Deploy candidate and verify health&lt;/span&gt;
kubectl &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;image deployment/app &lt;span class=&quot;nv&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;NEW_IMAGE&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
kubectl rollout status deployment/app &lt;span class=&quot;nt&quot;&gt;--timeout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;300s
curl &lt;span class=&quot;nt&quot;&gt;-fsS&lt;/span&gt; https://service.example.com/health

&lt;span class=&quot;c&quot;&gt;# Roll back immediately if health check fails&lt;/span&gt;
kubectl &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;image deployment/app &lt;span class=&quot;nv&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PREV_IMAGE&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The workflow equivalent should gate production promotion behind smoke tests and execute rollback steps automatically on failed validation.&lt;/p&gt;

&lt;h3 id=&quot;oidc-first-long-lived-secrets-last&quot;&gt;OIDC First, Long-Lived Secrets Last&lt;/h3&gt;

&lt;p&gt;For cloud deployments, prefer OpenID Connect federation over static access keys. It reduces credential sprawl and limits token lifetime to the job duration.&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;id-token&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;write&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Configure AWS credentials via OIDC&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;aws-actions/configure-aws-credentials@v4&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;role-to-assume&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;arn:aws:iam::123456789012:role/github-actions-deploy&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;aws-region&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;us-east-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Reserve environment secrets for values that cannot yet be federated.&lt;/p&gt;

&lt;h2 id=&quot;starter-templates-the-developer-interface&quot;&gt;Starter Templates: The Developer Interface&lt;/h2&gt;

&lt;p&gt;The final layer. Starter templates are what developers see when they click “New workflow” in their repository. They live in your organization’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github&lt;/code&gt; repository.&lt;/p&gt;

&lt;h3 id=&quot;setting-up-the-template-repository&quot;&gt;Setting Up the Template Repository&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;my-org/.github&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github&lt;/code&gt; repo has special meaning in GitHub - it’s where organization-level defaults live, including workflow templates.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;my-org/.github/
├── workflow-templates/
│   ├── java-app.yml
│   ├── java-app.properties.json
│   ├── python-app.yml
│   ├── python-app.properties.json
│   ├── go-app.yml
│   ├── go-app.properties.json
│   ├── node-app.yml
│   └── node-app.properties.json
├── ISSUE_TEMPLATE/
├── PULL_REQUEST_TEMPLATE.md
└── profile/
    └── README.md
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;java-application-template&quot;&gt;Java Application Template&lt;/h3&gt;

&lt;div class=&quot;language-yaml 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;# workflow-templates/java-app.yml&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;Java CI/CD&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;branches&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;nv&quot;&gt;$default-branch&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pull_request&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;branches&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;nv&quot;&gt;$default-branch&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Minimal permissions - reusable workflows request what they need&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pipeline&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/platform-workflows/.github/workflows/java-pipeline.yml@v2&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;java-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;21&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;build-tool&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;gradle&apos;&lt;/span&gt;           &lt;span class=&quot;c1&quot;&gt;# Change to &apos;maven&apos; for Maven projects&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&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;kubernetes&apos;&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;# Change to &apos;ecs&apos; or &apos;none&apos; as needed&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-environments&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;staging&apos;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# Add &apos;,production&apos; when ready&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;coverage-threshold&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;security-events&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;write&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-json 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;err&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;workflow-templates/java-app.properties.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;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;Java Application&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;description&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;Standard CI/CD pipeline for Java applications. Includes build, test, security scanning, quality gates, and deployment.&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;iconName&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;java&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;categories&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;Java&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;CI/CD&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;filePatterns&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;pom.xml&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;build.gradle&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;build.gradle.kts&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;/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;properties.json&lt;/code&gt; file controls how the template appears in the UI. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;filePatterns&lt;/code&gt; field is particularly useful - GitHub will suggest this template to repos that contain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pom.xml&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;build.gradle&lt;/code&gt; files.&lt;/p&gt;

&lt;h3 id=&quot;python-application-template&quot;&gt;Python Application Template&lt;/h3&gt;

&lt;div class=&quot;language-yaml 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;# workflow-templates/python-app.yml&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;Python CI/CD&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;branches&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;nv&quot;&gt;$default-branch&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pull_request&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;branches&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;nv&quot;&gt;$default-branch&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pipeline&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/platform-workflows/.github/workflows/python-pipeline.yml@v2&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;python-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.12&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;package-manager&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;pip&apos;&lt;/span&gt;         &lt;span class=&quot;c1&quot;&gt;# Or &apos;poetry&apos;, &apos;uv&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&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;kubernetes&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-environments&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;staging&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;security-events&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;write&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-json 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;err&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;workflow-templates/python-app.properties.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;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;Python Application&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;description&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;Standard CI/CD pipeline for Python applications. Includes build, test, security scanning, quality gates, and deployment.&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;iconName&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;python&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;categories&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;Python&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;CI/CD&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;filePatterns&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;requirements.txt&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;pyproject.toml&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;setup.py&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;Pipfile&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;go-application-template&quot;&gt;Go Application Template&lt;/h3&gt;

&lt;div class=&quot;language-yaml 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;# workflow-templates/go-app.yml&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;Go CI/CD&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;branches&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;nv&quot;&gt;$default-branch&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pull_request&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;branches&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;nv&quot;&gt;$default-branch&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pipeline&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/platform-workflows/.github/workflows/go-pipeline.yml@v2&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;go-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;1.23&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&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;kubernetes&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-environments&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;staging&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;security-events&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;write&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;testing-your-workflow-platform&quot;&gt;Testing Your Workflow Platform&lt;/h2&gt;

&lt;p&gt;Your CI/CD platform is software. It needs tests.&lt;/p&gt;

&lt;h3 id=&quot;testing-custom-actions&quot;&gt;Testing Custom Actions&lt;/h3&gt;

&lt;p&gt;Every custom action repository should have its own CI that validates the action works:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# In my-org/custom-actions/.github/workflows/test-setup-artifactory.yml&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;Test Setup Artifactory Action&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pull_request&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;paths&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;setup-artifactory/**&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;test-gradle&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./setup-artifactory&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;build-tool&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;gradle&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;ARTIFACTORY_TOKEN&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;test-token&apos;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;ARTIFACTORY_USER&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;test-user&apos;&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;Verify Gradle configuration&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [ ! -f ~/.gradle/gradle.properties ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;::error::gradle.properties was not created&quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;exit 1&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;grep -q &quot;artifactory_url&quot; ~/.gradle/gradle.properties&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;test-maven&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./setup-artifactory&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;build-tool&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;maven&apos;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;ARTIFACTORY_TOKEN&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;test-token&apos;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;ARTIFACTORY_USER&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;test-user&apos;&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;Verify Maven configuration&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [ ! -f ~/.m2/settings.xml ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;::error::settings.xml was not created&quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;exit 1&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;grep -q &quot;internal-releases&quot; ~/.m2/settings.xml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;testing-reusable-workflows&quot;&gt;Testing Reusable Workflows&lt;/h3&gt;

&lt;p&gt;Reusable workflow repos should have test workflows that call the reusable workflow against a sample project:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# In my-org/platform-workflows/.github/workflows/test-java-pipeline.yml&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;Test Java Pipeline&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pull_request&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;paths&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.github/workflows/java-pipeline.yml&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;test-gradle&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./.github/workflows/java-pipeline.yml&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;java-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;21&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;build-tool&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;gradle&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&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;none&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;skip-deploy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Keep a sample Java project in the workflow repo (or reference a dedicated test fixture repo) so you have something to build.&lt;/p&gt;

&lt;h3 id=&quot;release-process-for-workflow-repos&quot;&gt;Release Process for Workflow Repos&lt;/h3&gt;

&lt;p&gt;Every workflow repository should follow a release process:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Changes go through PR with required reviews&lt;/li&gt;
  &lt;li&gt;CI tests validate the workflow against sample projects&lt;/li&gt;
  &lt;li&gt;After merge, create a release with a semantic version tag&lt;/li&gt;
  &lt;li&gt;Publish release notes and let update automation propose SHA bumps in consumers&lt;/li&gt;
&lt;/ol&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;&lt;span class=&quot;c&quot;&gt;# After merging a change to the workflow repo&lt;/span&gt;
git tag v2.3.0
git push origin v2.3.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use semantic versions for release communication, and pin consuming workflows to immutable commit SHAs. Then use Dependabot or Renovate to raise PRs for controlled updates.&lt;/p&gt;

&lt;h2 id=&quot;wiring-it-to-your-runner-infrastructure&quot;&gt;Wiring It to Your Runner Infrastructure&lt;/h2&gt;

&lt;p&gt;All of these workflows need somewhere to run. The runner architecture is a separate concern, but it needs to match your workflow design.&lt;/p&gt;

&lt;p&gt;For the complete runner scaling guide, see &lt;a href=&quot;/blog/2026/04/29/github-actions-runner-scaling-patterns/&quot;&gt;GitHub Actions Runner Scaling Patterns: GitHub-Hosted vs ARC&lt;/a&gt;. The short version for this context:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For the workflows we’ve built:&lt;/strong&gt;&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Job Type&lt;/th&gt;
      &lt;th&gt;Runner Recommendation&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Build and test&lt;/td&gt;
      &lt;td&gt;GitHub-hosted or larger runners (for resource-heavy builds)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Security scanning&lt;/td&gt;
      &lt;td&gt;GitHub-hosted (stateless, no special access needed)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Deployment&lt;/td&gt;
      &lt;td&gt;Self-hosted with private network access (or GitHub-hosted with VNet)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Runner groups&lt;/strong&gt; let you segment access. Your deployment jobs should target runners that have network access to your clusters. Your CI jobs don’t need that access and shouldn’t have it (principle of least privilege).&lt;/p&gt;

&lt;p&gt;Use &lt;a href=&quot;/blog/2026/03/10/scaling-github-rulesets-with-custom-properties/&quot;&gt;runner group assignment with rulesets&lt;/a&gt; to ensure production deployment runners are only accessible to repos that should be deploying to production.&lt;/p&gt;

&lt;h2 id=&quot;governance-and-required-workflows&quot;&gt;Governance and Required Workflows&lt;/h2&gt;

&lt;p&gt;For checks that must run on every repository (not just repos that opt into your templates), use &lt;a href=&quot;https://docs.github.com/en/actions/sharing-automations/sharing-workflows-secrets-and-runners-with-your-organization&quot;&gt;required workflows&lt;/a&gt; at the organization level.&lt;/p&gt;

&lt;p&gt;Pair required workflows with &lt;a href=&quot;/blog/2026/03/10/scaling-github-rulesets-with-custom-properties/&quot;&gt;repository rulesets and custom properties&lt;/a&gt; for targeted enforcement:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;All repositories:&lt;/strong&gt; Secret detection, license compliance&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Repositories with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;compliance-level: high&lt;/code&gt;:&lt;/strong&gt; Full SAST scan, SBOM generation, artifact attestation&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Repositories with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;deployment-target: production&lt;/code&gt;:&lt;/strong&gt; SRE operational readiness checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gives you a safety net. Even if a team writes their own custom workflow and skips your templates entirely, the non-negotiable checks still run.&lt;/p&gt;

&lt;h2 id=&quot;where-copilot-based-migrations-fit&quot;&gt;Where Copilot-Based Migrations Fit&lt;/h2&gt;

&lt;p&gt;GitHub’s &lt;a href=&quot;https://github.com/github/actions-migrations-via-copilot&quot;&gt;actions-migrations-via-copilot&lt;/a&gt; can accelerate migration from legacy CI/CD systems. It is especially useful for translating existing pipeline intent into an initial GitHub Actions baseline.&lt;/p&gt;

&lt;p&gt;Use it for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Rapid first-pass conversion from Jenkins/GitLab CI/CircleCI/Azure DevOps pipeline definitions&lt;/li&gt;
  &lt;li&gt;Learning recurring patterns in your current pipelines so generated workflows are closer to your internal standards&lt;/li&gt;
  &lt;li&gt;Reducing manual YAML rewrite effort during large migration waves&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don’t treat it as a final-state generator. Treat it as an accelerator into your target architecture.&lt;/p&gt;

&lt;p&gt;Why not advocate pure lift-and-shift as the destination:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Legacy pipelines usually encode local workarounds, duplicated logic, and inconsistent security controls&lt;/li&gt;
  &lt;li&gt;Direct conversion often produces repo-by-repo workflows, not layered reusable workflows with clear ownership&lt;/li&gt;
  &lt;li&gt;Converted pipelines still need to be refactored into templates, reusable workflows, required workflows, and runner-group guardrails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Practical pattern:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Convert legacy workflows with Copilot migration tooling&lt;/li&gt;
  &lt;li&gt;Validate functional parity in a pilot repo&lt;/li&gt;
  &lt;li&gt;Refactor into your standardized platform workflows and templates&lt;/li&gt;
  &lt;li&gt;Enforce non-negotiables with required workflows and rulesets&lt;/li&gt;
  &lt;li&gt;Pin dependencies to SHAs and automate update PRs&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;migration-execution-checklist&quot;&gt;Migration Execution Checklist&lt;/h2&gt;

&lt;p&gt;Implementation checklist, in build order:&lt;/p&gt;

&lt;h3 id=&quot;week-1-foundation&quot;&gt;Week 1: Foundation&lt;/h3&gt;

&lt;ul class=&quot;task-list&quot;&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Create the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;custom-actions&lt;/code&gt; repository with your first 2-3 actions&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Create domain team workflow repositories (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;security-workflows&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sre-workflows&lt;/code&gt;)&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Set up CI for each workflow repository&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Deploy and validate runner infrastructure&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;week-2-platform-workflows&quot;&gt;Week 2: Platform Workflows&lt;/h3&gt;

&lt;ul class=&quot;task-list&quot;&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Create &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;platform-workflows&lt;/code&gt; repo with your first language pipeline&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Test end-to-end against a sample application&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Run Copilot migration tooling on 1-2 representative legacy pipelines and map outputs to your standardized workflow model&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Create starter templates in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github&lt;/code&gt; repo&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Document the workflow catalog for developers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;weeks-3-4-pilot&quot;&gt;Weeks 3-4: Pilot&lt;/h3&gt;

&lt;ul class=&quot;task-list&quot;&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Onboard 2-3 pilot teams using the starter templates&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Collect feedback and iterate on workflow design&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Validate that all domain team checks work correctly&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Measure build times and compare to baseline&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;weeks-5-scale&quot;&gt;Weeks 5+: Scale&lt;/h3&gt;

&lt;ul class=&quot;task-list&quot;&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Add language pipelines for remaining tech stacks&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Roll out to remaining teams&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Implement required workflows for non-negotiable checks&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Decommission old CI/CD platform pipelines as teams migrate&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;We’ve built a complete composable CI/CD platform from the ground up. What we covered:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The building blocks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Custom Actions&lt;/strong&gt; handle environment-specific tasks (registry setup, deployment, notifications). Build them as composite actions with clear inputs, outputs, and defaults.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Specialized Workflows&lt;/strong&gt; encode domain team expertise (security scanning, SRE checks, language standards). Domain teams own and maintain their workflows independently.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Platform Workflows&lt;/strong&gt; orchestrate everything into complete CI/CD pipelines per language. They compose actions and domain workflows into an opinionated, standardized pipeline.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Starter Templates&lt;/strong&gt; are the developer-facing interface. Simple, obvious, and backed by all the machinery underneath.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key implementation principles:&lt;/strong&gt;&lt;/p&gt;

&lt;ul class=&quot;task-list&quot;&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Build bottom-up.&lt;/strong&gt; Custom actions first, then specialized workflows, then platform workflows, then templates.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Test your CI/CD platform like software.&lt;/strong&gt; Every workflow and action repo needs its own CI.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Version and pin everything.&lt;/strong&gt; Use semantic releases for communication and SHA pinning for consumers.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Use required workflows for non-negotiables.&lt;/strong&gt; Templates handle the happy path; required workflows handle the guardrails.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Start small.&lt;/strong&gt; One language pipeline, two pilot teams. Expand after you’ve validated the pattern works.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This architecture looks like more complexity upfront. In practice, it’s less complexity distributed more intelligently. Teams own their pieces, changes flow automatically, and developers get a five-minute path to a fully standardized CI/CD pipeline.&lt;/p&gt;

&lt;p&gt;Small pieces, clear interfaces, infinite combinations. That’s the Lego block model in action.&lt;/p&gt;

&lt;h2 id=&quot;series-wrap-up&quot;&gt;Series Wrap-Up&lt;/h2&gt;

&lt;p&gt;Across this three-part series, we’ve covered:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-1-making-the-case/&quot;&gt;&lt;strong&gt;Part 1:&lt;/strong&gt;&lt;/a&gt; Building the business case, planning the organizational change, conducting the self-assessment, and phasing the migration&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like/&quot;&gt;&lt;strong&gt;Part 2:&lt;/strong&gt;&lt;/a&gt; Designing the layered architecture with clear ownership, versioning, and composability&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/&quot;&gt;&lt;strong&gt;Part 3:&lt;/strong&gt;&lt;/a&gt; Implementing custom actions, reusable workflows, platform pipelines, and starter templates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re starting a CI/CD migration, start with Part 1. Get the organizational alignment right before you write any YAML. Then use Part 2 for ownership and architecture decisions, and Part 3 as the implementation playbook for composable workflows and production delivery safety.&lt;/p&gt;

&lt;p&gt;Good luck out there. Your pipelines will thank you.&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="github-actions" />
   
    <category term="ci-cd" />
   
    <category term="devops" />
   
    <category term="migration" />
   
    <category term="platform-engineering" />
   
    <category term="reusable-workflows" />
   
    <category term="custom-actions" />
   
    <category term="enterprise" />
   
 </entry>
 
 <entry>
   <title>Migrating to GitHub Actions, Part 2: What Good Looks Like</title>
   <link href="https://www.dxrf.com/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like/"/>
   <updated>2026-06-03T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like</id>
   <excerpt type="html">Template repos, reusable workflows, and layered ownership - here&apos;s the target architecture for a GitHub Actions platform that scales across teams without creating chaos.</excerpt>
   <content type="html">&lt;p&gt;&lt;em&gt;This is Part 2 of a three-part series on migrating to GitHub Actions at scale. &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-1-making-the-case/&quot;&gt;Part 1: Making the Case for Change&lt;/a&gt; covers the why and the planning. &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/&quot;&gt;Part 3: Building the Lego Blocks&lt;/a&gt; gets into hands-on implementation.&lt;/em&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;In &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-1-making-the-case/&quot;&gt;Part 1&lt;/a&gt;, we covered the case for migration and rollout planning. This part is the payoff: designing the system your teams will actually use.&lt;/p&gt;

&lt;p&gt;This post is intentionally architecture-first. &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/&quot;&gt;Part 3&lt;/a&gt; contains the implementation details, including deployment environment protections, trigger patterns, OIDC-based auth wiring, and rollback mechanics.&lt;/p&gt;

&lt;p&gt;Imagine a Java developer on your team wants to set up CI/CD for their new service. Instead of spending a week writing pipeline YAML from scratch, copying snippets from Slack, and hoping they remembered to add the security scan, they browse a catalog of template workflows, pick “Java Application,” add it to their repo, and they’re done. Tests run, artifacts build, security scans execute, SRE checks pass - all from that single template.&lt;/p&gt;

&lt;p&gt;Behind the scenes, that template calls a reusable workflow maintained by the CI/CD platform team. That reusable workflow calls other reusable workflows maintained by the security team, the SRE team, and the Java guild. Every team owns their piece, updates happen in one place, and changes automatically flow out to every repo that uses the template.&lt;/p&gt;

&lt;p&gt;Sounds complicated? It’s actually the opposite - structured simplicity built from composable pieces.&lt;/p&gt;

&lt;h2 id=&quot;the-layered-architecture&quot;&gt;The Layered Architecture&lt;/h2&gt;

&lt;p&gt;Think of this as a three-layer cake:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;block-beta
  columns 1
  block:layer1[&quot;Layer 1: Template Workflows (Dev Teams)&quot;]
    A[&quot;Java App / Python App / Go App&quot;]
  end
  block:layer2[&quot;Layer 2: Standardized CI/CD Workflows (Platform Team)&quot;]
    B[&quot;Build → Test → Scan → Package → Deploy&quot;]
  end
  block:layer3[&quot;Layer 3: Specialized Workflows &amp;amp; Actions (Domain Teams)&quot;]
    C[&quot;Security Scanning / SRE Ops / Guild Standards&quot;]
  end

  layer1 --&amp;gt; layer2
  layer2 --&amp;gt; layer3

  style layer1 fill:#4a90d9,color:#fff
  style layer2 fill:#7b68ee,color:#fff
  style layer3 fill:#2ecc71,color:#fff
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Each layer has a clear owner, a clear responsibility, and a clear interface to the layers above and below it.&lt;/p&gt;

&lt;h3 id=&quot;layer-1-template-workflows-what-developers-see&quot;&gt;Layer 1: Template Workflows (What Developers See)&lt;/h3&gt;

&lt;p&gt;Template workflows are the front door. They’re what developers interact with directly. The goal is to make them so simple and obvious that a developer looks at the options and says, “Oh, I’m building in Java, I’ll use the Java one.”&lt;/p&gt;

&lt;p&gt;These live as &lt;a href=&quot;https://docs.github.com/en/actions/sharing-automations/creating-starter-workflows-for-your-organization&quot;&gt;starter workflows&lt;/a&gt; in your organization’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github&lt;/code&gt; repository, or as template repositories that teams can clone.&lt;/p&gt;

&lt;p&gt;A developer’s experience should look like this:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Create a new repository (or go to an existing one)&lt;/li&gt;
  &lt;li&gt;Navigate to Actions tab and click “New workflow”&lt;/li&gt;
  &lt;li&gt;See organization-specific templates: “Java Application,” “Python Service,” “Go Microservice,” “Static Site”&lt;/li&gt;
  &lt;li&gt;Select the appropriate template&lt;/li&gt;
  &lt;li&gt;Commit the workflow file&lt;/li&gt;
  &lt;li&gt;Done. CI/CD is running.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The template workflow itself is intentionally thin. It defines the trigger events, passes in the parameters specific to this application (Java version, build tool, deployment target), and calls a reusable workflow for the heavy lifting:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# .github/workflows/ci-cd.yml (in the developer&apos;s repo)&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;Java CI/CD&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;branches&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;nv&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pull_request&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;branches&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;nv&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pipeline&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/platform-workflows/.github/workflows/java-pipeline.yml@9b7f6d5c4a3e2f1d0c9b8a7e6d5c4b3a2f1e0d9c&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;java-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;21&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;build-tool&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;gradle&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&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;kubernetes&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Six meaningful lines of configuration. The developer specifies &lt;em&gt;what&lt;/em&gt; they’re building and &lt;em&gt;where&lt;/em&gt; it goes. The platform handles &lt;em&gt;how&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why this matters:&lt;/strong&gt; When the security team adds a new required scan, the developer’s workflow file doesn’t change. When the SRE team updates the deployment strategy, the developer’s workflow file doesn’t change. When a CVE is found in a build tool and needs an urgent patch, the platform team fixes it once and every repo gets the fix automatically.&lt;/p&gt;

&lt;h3 id=&quot;layer-2-standardized-cicd-workflows-what-the-platform-team-manages&quot;&gt;Layer 2: Standardized CI/CD Workflows (What the Platform Team Manages)&lt;/h3&gt;

&lt;p&gt;The orchestration layer lives here. The platform team maintains a repository of &lt;a href=&quot;https://docs.github.com/en/actions/sharing-automations/reusing-workflows&quot;&gt;reusable workflows&lt;/a&gt; that implement the full CI/CD pipeline for each language/framework.&lt;/p&gt;

&lt;p&gt;These workflows are opinionated. They encode your organization’s standards for how Java apps get built, tested, scanned, packaged, and deployed. They’re not infinitely flexible - they’re intentionally constrained to the patterns your organization supports.&lt;/p&gt;

&lt;p&gt;A standardized Java pipeline workflow might orchestrate:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# my-org/platform-workflows/.github/workflows/java-pipeline.yml&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;Standardized Java CI/CD Pipeline&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;workflow_call&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;java-version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;21&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;build-tool&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;gradle&apos;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;string&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;default&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;kubernetes&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;build-and-test&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/setup-java@v4&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;java-version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.java-version }}&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;distribution&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;temurin&apos;&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;Build and Test&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;if [ &quot;${{ inputs.build-tool }}&quot; = &quot;gradle&quot; ]; then&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;./gradlew build test&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;else&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;mvn clean verify&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;security-scan&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build-and-test&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/security-workflows/.github/workflows/full-scan.yml@3f4c2b1e9d8a7c6b5e4f3210a9b8c7d6e5f4a3b2&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;sre-checks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build-and-test&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/sre-workflows/.github/workflows/operational-readiness.yml@7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;deploy-target&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.deploy-target }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;java-standards&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build-and-test&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/java-guild-workflows/.github/workflows/quality-gate.yml@1c2d3e4f5a6b7c8d9e0f1234567890abcdef1234&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;java-version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.java-version }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;deploy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&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;nv&quot;&gt;security-scan&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;sre-checks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;java-standards&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;github.ref == &apos;refs/heads/main&apos;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/platform-workflows/.github/workflows/deploy.yml@8e7d6c5b4a392817f6e5d4c3b2a1908f7e6d5c4b&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;${{ inputs.deploy-target }}&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;inherit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;See what’s happening? The platform workflow calls out to specialized workflows owned by different teams. The security team owns &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;security-workflows&lt;/code&gt;. The SRE team owns &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sre-workflows&lt;/code&gt;. The Java guild owns &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;java-guild-workflows&lt;/code&gt;. The platform team orchestrates the composition.&lt;/p&gt;

&lt;h3 id=&quot;layer-3-specialized-workflows-and-actions-what-domain-teams-own&quot;&gt;Layer 3: Specialized Workflows and Actions (What Domain Teams Own)&lt;/h3&gt;

&lt;p&gt;This layer encodes organizational expertise into reusable components. Domain teams maintain their own repositories of workflows and actions that implement their standards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security team&lt;/strong&gt; owns workflows for:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;SAST scanning (CodeQL, Semgrep)&lt;/li&gt;
  &lt;li&gt;Dependency vulnerability scanning (Dependabot, Snyk)&lt;/li&gt;
  &lt;li&gt;Container image scanning (Trivy)&lt;/li&gt;
  &lt;li&gt;Secret detection&lt;/li&gt;
  &lt;li&gt;License compliance checks&lt;/li&gt;
  &lt;li&gt;Artifact attestations and SBOM generation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SRE team&lt;/strong&gt; owns workflows for:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Health check validation&lt;/li&gt;
  &lt;li&gt;Deployment verification tests&lt;/li&gt;
  &lt;li&gt;Canary analysis&lt;/li&gt;
  &lt;li&gt;Rollback triggers&lt;/li&gt;
  &lt;li&gt;Observability configuration validation&lt;/li&gt;
  &lt;li&gt;Infrastructure-as-code validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Language guilds&lt;/strong&gt; (Java, Python, Go, etc.) own workflows for:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Language-specific linting and formatting&lt;/li&gt;
  &lt;li&gt;Framework-specific best practices (Spring Boot actuator endpoints, Django security middleware)&lt;/li&gt;
  &lt;li&gt;Code coverage thresholds&lt;/li&gt;
  &lt;li&gt;Documentation generation&lt;/li&gt;
  &lt;li&gt;Dependency update policies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation of concerns is powerful. The security team doesn’t need to understand Gradle to enforce security scanning on Java projects. They write a security scanning workflow once, and the platform team composes it into every language pipeline. When a new CVE scanner comes out, the security team updates one workflow and every project in the organization benefits.&lt;/p&gt;

&lt;h2 id=&quot;the-ownership-model&quot;&gt;The Ownership Model&lt;/h2&gt;

&lt;p&gt;The layered architecture only works if ownership is crystal clear. The breakdown:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Layer&lt;/th&gt;
      &lt;th&gt;Owner&lt;/th&gt;
      &lt;th&gt;Responsibility&lt;/th&gt;
      &lt;th&gt;Update Frequency&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Template workflows&lt;/td&gt;
      &lt;td&gt;Platform team&lt;/td&gt;
      &lt;td&gt;Starter templates, input parameters, documentation&lt;/td&gt;
      &lt;td&gt;As needed&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Language pipelines&lt;/td&gt;
      &lt;td&gt;Platform team&lt;/td&gt;
      &lt;td&gt;Build/test/deploy orchestration per language&lt;/td&gt;
      &lt;td&gt;Monthly or as needed&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Security workflows&lt;/td&gt;
      &lt;td&gt;Security team&lt;/td&gt;
      &lt;td&gt;Scanning, compliance checks, attestations&lt;/td&gt;
      &lt;td&gt;Weekly to monthly&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;SRE workflows&lt;/td&gt;
      &lt;td&gt;SRE team&lt;/td&gt;
      &lt;td&gt;Operational readiness, deployment verification&lt;/td&gt;
      &lt;td&gt;Monthly&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Guild workflows&lt;/td&gt;
      &lt;td&gt;Language guilds&lt;/td&gt;
      &lt;td&gt;Language-specific quality gates&lt;/td&gt;
      &lt;td&gt;Quarterly&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Custom actions&lt;/td&gt;
      &lt;td&gt;Platform team + domain teams&lt;/td&gt;
      &lt;td&gt;Environment-specific tooling&lt;/td&gt;
      &lt;td&gt;As needed&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;One rule above all: each team owns their workflows end-to-end.&lt;/strong&gt; They write them, they test them, they version them, they support them. The platform team’s job is composition and orchestration, not micromanaging what the security team puts in their scan workflow.&lt;/p&gt;

&lt;h2 id=&quot;versioning-strategy&quot;&gt;Versioning Strategy&lt;/h2&gt;

&lt;p&gt;Versioning is what keeps this from being a house of cards. Without it, a change to a security workflow could break builds across the entire organization at 2 AM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use semantic versioning for releases, and pin consumers to immutable commit SHAs:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Major version&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v1&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v2&lt;/code&gt;): Breaking changes to inputs, outputs, or behavior. Consuming workflows must update explicitly.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Minor version&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v1.1&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v1.2&lt;/code&gt;): New features, new optional inputs. Backward compatible.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Patch version&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v1.1.1&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v1.1.2&lt;/code&gt;): Bug fixes, security patches. Backward compatible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tags are release labels and communication tools. The workflow reference in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;uses:&lt;/code&gt; should be an immutable SHA to reduce supply-chain risk from tag or branch movement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference pattern for consuming workflows:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# Recommended: pin to an immutable commit SHA&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/security-workflows/.github/workflows/full-scan.yml@3f4c2b1e9d8a7c6b5e4f3210a9b8c7d6e5f4a3b2&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Optional: use tags only in tightly controlled internal repos&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# where tag protection and signed, protected releases are enforced&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-org/security-workflows/.github/workflows/full-scan.yml@v1.2.3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Most teams should pin to SHA and use an automated update process (Dependabot or Renovate) to open PRs when new workflow releases are available. This gives you controlled upgrades with reviewability, rollback, and provenance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Critical: version your workflow repos the same way you’d version any shared library.&lt;/strong&gt; Maintain a changelog. Test before releasing. Protect tags, require reviews, and use a proper release process, not random commits to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;repository-structure&quot;&gt;Repository Structure&lt;/h2&gt;

&lt;p&gt;The repository landscape for a mature Actions platform looks like this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;my-org/
├── .github/                          # Org-level defaults
│   └── workflow-templates/           # Starter workflow templates
│       ├── java-app.yml
│       ├── java-app.properties.json
│       ├── python-app.yml
│       ├── python-app.properties.json
│       ├── go-app.yml
│       └── go-app.properties.json
│
├── platform-workflows/               # Platform team&apos;s reusable workflows
│   └── .github/workflows/
│       ├── java-pipeline.yml
│       ├── python-pipeline.yml
│       ├── go-pipeline.yml
│       └── deploy.yml
│
├── security-workflows/               # Security team&apos;s workflows
│   └── .github/workflows/
│       ├── full-scan.yml
│       ├── sast-scan.yml
│       ├── dependency-scan.yml
│       ├── container-scan.yml
│       └── attestation.yml
│
├── sre-workflows/                    # SRE team&apos;s workflows
│   └── .github/workflows/
│       ├── operational-readiness.yml
│       ├── deployment-verification.yml
│       └── canary-analysis.yml
│
├── java-guild-workflows/             # Java guild&apos;s workflows
│   └── .github/workflows/
│       └── quality-gate.yml
│
└── custom-actions/                   # Shared custom actions
    ├── setup-internal-tools/
    ├── deploy-to-internal-k8s/
    └── notify-release-channel/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Each repository has its own CI (yes, your CI/CD workflows need CI/CD), its own CODEOWNERS, and its own release process.&lt;/p&gt;

&lt;h2 id=&quot;how-changes-flow&quot;&gt;How Changes Flow&lt;/h2&gt;

&lt;p&gt;Walk through a real scenario to see how this architecture handles change:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; The security team needs to add a new container scanning tool (Trivy) alongside the existing scanner.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Security team adds Trivy to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;security-workflows/.github/workflows/container-scan.yml&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Security team tests the change against sample repos&lt;/li&gt;
  &lt;li&gt;Security team releases &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v1.3.0&lt;/code&gt; of their workflow repo&lt;/li&gt;
  &lt;li&gt;Renovate/Dependabot opens PRs in consuming workflow repos to update pinned SHAs to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v1.3.0&lt;/code&gt; commit&lt;/li&gt;
  &lt;li&gt;Platform team validates in test repos, merges, and rolls out in waves&lt;/li&gt;
  &lt;li&gt;Every repo using the standard pipeline gets container scanning with Trivy after controlled promotion&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Teams affected:&lt;/strong&gt; Platform + Security. &lt;strong&gt;Repos updated manually:&lt;/strong&gt; Zero (automation-driven). &lt;strong&gt;Time from decision to full rollout:&lt;/strong&gt; One release + approval window.&lt;/p&gt;

&lt;p&gt;Now compare that to the alternative: someone posts in Slack “hey everyone, please add this Trivy step to your pipelines,” and six months later half the org still hasn’t done it.&lt;/p&gt;

&lt;h2 id=&quot;enforcing-standards-without-being-a-bottleneck&quot;&gt;Enforcing Standards Without Being a Bottleneck&lt;/h2&gt;

&lt;p&gt;There’s a tension in platform engineering between enforcing standards and enabling autonomy. Too strict, and teams route around your platform. Too loose, and you don’t have standards at all.&lt;/p&gt;

&lt;p&gt;The layered workflow architecture resolves this by &lt;strong&gt;making the standard path the easiest path&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Templates make adoption trivial.&lt;/strong&gt; It’s easier to use the template than to write a workflow from scratch.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Reusable workflows encode best practices.&lt;/strong&gt; Teams get security scanning, SRE checks, and quality gates without doing anything.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Custom actions handle edge cases.&lt;/strong&gt; When a team has a legitimate need that doesn’t fit the template, they can extend (not replace) the standard pipeline.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For non-negotiable requirements (security scans, compliance checks), you can use &lt;a href=&quot;https://docs.github.com/en/actions/sharing-automations/sharing-workflows-secrets-and-runners-with-your-organization&quot;&gt;required workflows&lt;/a&gt; and &lt;a href=&quot;/blog/2026/03/10/scaling-github-rulesets-with-custom-properties/&quot;&gt;repository rulesets&lt;/a&gt; to enforce them at the organization level. This guarantees that even repos that don’t use your templates still run the required checks.&lt;/p&gt;

&lt;p&gt;The combination of “easy path that includes everything” plus “hard guardrails for non-negotiables” gives you both flexibility and control.&lt;/p&gt;

&lt;h2 id=&quot;common-objections-and-responses&quot;&gt;Common Objections (and Responses)&lt;/h2&gt;

&lt;h3 id=&quot;this-seems-over-engineered-for-our-size&quot;&gt;“This seems over-engineered for our size”&lt;/h3&gt;

&lt;p&gt;If you have fewer than 20 repos and one development team, it probably is. Start with a single reusable workflow and a couple of starter templates. You can always add layers later. The architecture scales down as well as it scales up.&lt;/p&gt;

&lt;h3 id=&quot;what-if-teams-need-to-customize-their-pipeline&quot;&gt;“What if teams need to customize their pipeline?”&lt;/h3&gt;

&lt;p&gt;They can. Template workflows accept inputs that control behavior (Java version, build tool, deploy target). For deeper customization, teams can add additional jobs or steps in their workflow file alongside the reusable workflow call. The standard pipeline runs regardless; they’re adding to it, not replacing it.&lt;/p&gt;

&lt;h3 id=&quot;what-happens-when-a-reusable-workflow-update-breaks-something&quot;&gt;“What happens when a reusable workflow update breaks something?”&lt;/h3&gt;

&lt;p&gt;SHA pinning prevents updates from propagating automatically. But yes, bugs happen. This is why your workflow repos need their own CI, plus staged rollout and automated update PRs that run integration tests against sample repos before promotion.&lt;/p&gt;

&lt;h3 id=&quot;how-do-we-handle-teams-that-refuse-to-adopt-the-templates&quot;&gt;“How do we handle teams that refuse to adopt the templates?”&lt;/h3&gt;

&lt;p&gt;Required workflows handle the non-negotiables. For the rest, make the templates so good that not using them is obviously more work. If a team still wants to maintain their own artisanal pipeline, that’s their prerogative - as long as they meet the required checks. I personally leave the groups that refuse to adopt to the end of the project. I come back around once 95% of the org is on the new tooling, then ask their leadership why they aren’t taking advantage of the improvements that the rest of the org is seeing. This changes the perspective of the conversation from “You must do this” to “Help us understand why you can’t take advantage of the more efficient tooling.” One is a directive, the other is seeking to understand. Some chafe against directives, where most people in tech will happily explain their setup to you.&lt;/p&gt;

&lt;h2 id=&quot;the-role-of-custom-actions&quot;&gt;The Role of Custom Actions&lt;/h2&gt;

&lt;p&gt;We’ve talked about template workflows and reusable workflows, but there’s a third building block: &lt;a href=&quot;https://docs.github.com/en/actions/sharing-automations/creating-actions&quot;&gt;custom Actions&lt;/a&gt;. While workflows orchestrate the pipeline, Actions handle discrete, reusable tasks.&lt;/p&gt;

&lt;p&gt;Custom actions shine for environment-specific problems:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Internal tool setup.&lt;/strong&gt; Configuring authentication for your internal artifact registry, installing internal CLIs, or setting up VPN connectivity.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Deployment abstractions.&lt;/strong&gt; Wrapping your organization’s specific deployment tooling (internal Kubernetes operators, custom blue-green deployment scripts) into a clean, parameterized action.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Notification and integration.&lt;/strong&gt; Posting to your specific Slack channels, creating tickets in your specific ITSM tool, updating your specific dashboard.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pattern is the same as workflows: &lt;strong&gt;build it once, version it, share it.&lt;/strong&gt; &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/&quot;&gt;Part 3&lt;/a&gt; walks through the implementation details and shows how these actions plug into production-grade deployment flows.&lt;/p&gt;

&lt;h2 id=&quot;runner-architecture&quot;&gt;Runner Architecture&lt;/h2&gt;

&lt;p&gt;The workflow architecture tells you &lt;em&gt;what&lt;/em&gt; runs. The runner architecture tells you &lt;em&gt;where&lt;/em&gt; it runs. These are separate concerns, but they need to be designed together.&lt;/p&gt;

&lt;p&gt;For a detailed deep-dive on runner scaling patterns, see &lt;a href=&quot;/blog/2026/04/29/github-actions-runner-scaling-patterns/&quot;&gt;GitHub Actions Runner Scaling Patterns: GitHub-Hosted vs ARC&lt;/a&gt;. The short version:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TLDR:&lt;/strong&gt; Use GitHub-hosted runners by default for most CI because they are the lowest operational burden. Move to larger runners when performance or static networking requirements justify the extra cost, and use self-hosted ARC when you need deeper environment control, stricter compliance boundaries, or networking patterns that exceed hosted runner options. For additional real-world context, see this runner selection discussion: &lt;a href=&quot;https://github.com/dane-joh/github-actions/issues/1&quot;&gt;github-actions/issues/1&lt;/a&gt;. In my experience, there’s rarely a legitimate need for self-hosted runners but they do exist. Custom hardware, embedded systems that don’t exist in a data center, extremely large scale runners for graphics and AI workloads, etc. Put what you can put on GHR, then use SHR for the exceptions when needed.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Runner Type&lt;/th&gt;
      &lt;th&gt;Use When&lt;/th&gt;
      &lt;th&gt;Scaling Pattern&lt;/th&gt;
      &lt;th&gt;Downside&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;GitHub-hosted&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Stateless CI, broad compatibility, and low ops overhead&lt;/td&gt;
      &lt;td&gt;Create runners, organize into groups&lt;/td&gt;
      &lt;td&gt;Limited environment customization; private networking is possible but requires additional setup and platform constraints&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Larger runners&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Resource-heavy builds, static IPs (or private Azure v-nets)&lt;/td&gt;
      &lt;td&gt;Same as GitHub-hosted, larger specs&lt;/td&gt;
      &lt;td&gt;Higher cost and fewer size/region options than standard hosted runners&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Self-hosted (ARC)&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Private network access, custom tooling, compliance&lt;/td&gt;
      &lt;td&gt;Multiple clusters, same runner scale set name&lt;/td&gt;
      &lt;td&gt;Highest operational overhead: cluster management, patching, and on-call ownership&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Runner groups&lt;/strong&gt; segment runners by workload type, environment, or team. Use &lt;a href=&quot;/blog/2026/03/10/scaling-github-rulesets-with-custom-properties/&quot;&gt;custom properties and rulesets&lt;/a&gt; to control which repos can access which runner groups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ephemeral runners&lt;/strong&gt; are strongly recommended. Every job gets a clean runner, every time. No state leakage between runs, no “it works on the runner because someone installed something manually three months ago” problems.&lt;/p&gt;

&lt;h2 id=&quot;putting-it-all-together&quot;&gt;Putting It All Together&lt;/h2&gt;

&lt;p&gt;To see it end-to-end, follow a single PR through the full system:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;flowchart TD
    A[Developer pushes code] --&amp;gt; B[Template workflow triggers&amp;lt;br/&amp;gt;ci-cd.yml in dev&apos;s repo]
    B --&amp;gt; C[Platform reusable workflow&amp;lt;br/&amp;gt;java-pipeline.yml]
    C --&amp;gt; D[Build &amp;amp; Test&amp;lt;br/&amp;gt;platform team]
    C --&amp;gt; E[Security Scan&amp;lt;br/&amp;gt;security team workflow]
    C --&amp;gt; F[SRE Checks&amp;lt;br/&amp;gt;SRE team workflow]
    C --&amp;gt; G[Quality Gate&amp;lt;br/&amp;gt;Java guild workflow]
    E --&amp;gt; E1[SAST - CodeQL]
    E --&amp;gt; E2[Dependency scan]
    E --&amp;gt; E3[Container scan - Trivy]
    F --&amp;gt; F1[Health endpoint validation]
    F --&amp;gt; F2[Resource limit verification]
    G --&amp;gt; G1[Checkstyle]
    G --&amp;gt; G2[Code coverage 80%+]
    G --&amp;gt; G3[API doc generation]
    D &amp;amp; E &amp;amp; F &amp;amp; G --&amp;gt; H{All gates pass?}
    H --&amp;gt;|main branch| I[Deploy]
    I --&amp;gt; I1[Stage deployment]
    I1 --&amp;gt; I2[Smoke tests]
    I2 --&amp;gt; I3[Production deployment&amp;lt;br/&amp;gt;with approval]

    style A fill:#4a90d9,color:#fff
    style C fill:#7b68ee,color:#fff
    style H fill:#f39c12,color:#fff
    style I fill:#2ecc71,color:#fff
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The developer sees one workflow. Behind it, four teams’ standards are being enforced automatically. Nobody had to copy-paste YAML from a wiki. Nobody forgot the security scan. Nobody skipped the SRE checks because they were in a hurry.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;That&lt;/em&gt; is what good looks like.&lt;/p&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The architecture in a nutshell:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Layer 1 - Templates:&lt;/strong&gt; Simple, language-specific starter workflows that developers adopt in minutes. Thin wrappers that call Layer 2.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Layer 2 - Platform Workflows:&lt;/strong&gt; Standardized CI/CD pipelines per language/framework. Orchestrate Layer 3 components. Owned by the platform team.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Layer 3 - Specialized Workflows:&lt;/strong&gt; Security scanning, SRE operations, guild standards. Owned by the teams with domain expertise.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Custom Actions:&lt;/strong&gt; Reusable building blocks for environment-specific tasks. Complement workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key principles:&lt;/strong&gt;&lt;/p&gt;

&lt;ul class=&quot;task-list&quot;&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Make the right thing the easy thing.&lt;/strong&gt; Templates should be easier to use than DIY.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Separate concerns by ownership.&lt;/strong&gt; Teams own their layer end-to-end.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Version and pin everything.&lt;/strong&gt; Use semantic releases plus SHA pinning to prevent surprise breakage.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Compose, don’t duplicate.&lt;/strong&gt; Workflows call workflows call workflows. One source of truth per concern.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Enforce non-negotiables with guardrails,&lt;/strong&gt; not willpower. Required workflows and rulesets.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Where things live:&lt;/strong&gt;&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;What&lt;/th&gt;
      &lt;th&gt;Where&lt;/th&gt;
      &lt;th&gt;Owner&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Starter templates&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github&lt;/code&gt; repo&lt;/td&gt;
      &lt;td&gt;Platform team&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Language pipelines&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;platform-workflows&lt;/code&gt; repo&lt;/td&gt;
      &lt;td&gt;Platform team&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Security checks&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;security-workflows&lt;/code&gt; repo&lt;/td&gt;
      &lt;td&gt;Security team&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Operational checks&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sre-workflows&lt;/code&gt; repo&lt;/td&gt;
      &lt;td&gt;SRE team&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Language standards&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*-guild-workflows&lt;/code&gt; repos&lt;/td&gt;
      &lt;td&gt;Language guilds&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Custom actions&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;custom-actions&lt;/code&gt; repo&lt;/td&gt;
      &lt;td&gt;Varies&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;em&gt;Next up: &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/&quot;&gt;Part 3 - Building the Lego Blocks&lt;/a&gt; - where we implement the workflows, wire delivery triggers, and add production safety controls.&lt;/em&gt;&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="github-actions" />
   
    <category term="ci-cd" />
   
    <category term="devops" />
   
    <category term="migration" />
   
    <category term="platform-engineering" />
   
    <category term="best-practices" />
   
    <category term="enterprise" />
   
    <category term="reusable-workflows" />
   
 </entry>
 
 <entry>
   <title>Migrating to GitHub Actions, Part 1: Making the Case for Change</title>
   <link href="https://www.dxrf.com/blog/2026/06/03/migrating-to-github-actions-part-1-making-the-case/"/>
   <updated>2026-06-03T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/06/03/migrating-to-github-actions-part-1-making-the-case</id>
   <excerpt type="html">Migrating CI/CD platforms isn&apos;t just a technical project - it&apos;s an organizational change initiative. Here&apos;s how to build the case, identify what matters, and plan a migration that people will actually support.</excerpt>
   <content type="html">&lt;p&gt;&lt;em&gt;This is Part 1 of a three-part series on migrating to GitHub Actions at scale. &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like/&quot;&gt;Part 2: What Good Looks Like&lt;/a&gt; covers the target architecture. &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/&quot;&gt;Part 3: Building the Lego Blocks&lt;/a&gt; gets into hands-on implementation.&lt;/em&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Picture this: your organization runs three different CI/CD platforms. Jenkins handles the legacy Java apps. Some teams adopted CircleCI two years ago. A handful of teams are on TeamCity. And now there’s a smattering of GitHub Actions workflows from a proof of concept last quarter.&lt;/p&gt;

&lt;p&gt;Each team has their own pipeline scripts, their own patterns, their own tribal knowledge about why the build breaks every third Tuesday. Onboarding a new developer means spending a week just figuring out which CI system their team uses and how to read the logs.&lt;/p&gt;

&lt;p&gt;You can live with this. Organizations do it every day. But at some point, the cost of maintaining parallel systems, retraining across platforms, and duplicating security controls starts to compound. When that happens, consolidation stops being a nice-to-have and becomes a strategic imperative.&lt;/p&gt;

&lt;p&gt;This post is about recognizing that moment, building a compelling case for migration, and setting up a project people will actually rally behind.&lt;/p&gt;

&lt;h2 id=&quot;change-for-changes-sake-isnt-a-strategy&quot;&gt;Change for Change’s Sake Isn’t a Strategy&lt;/h2&gt;

&lt;p&gt;Nobody wants to migrate CI/CD platforms. It’s painful, it’s risky, and it’s one of those projects where success means “everything still works the same but different.” That’s a hard sell.&lt;/p&gt;

&lt;p&gt;Before you write a single line of YAML, you need to answer one question: &lt;strong&gt;why are we doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And “because GitHub Actions is newer” isn’t an answer. Neither is “because our VP saw a demo at a conference.” You need a real, specific, defensible reason that connects to problems people actually feel.&lt;/p&gt;

&lt;p&gt;Here are some reasons that hold up:&lt;/p&gt;

&lt;h3 id=&quot;consolidation-eliminating-platform-sprawl&quot;&gt;Consolidation: Eliminating Platform Sprawl&lt;/h3&gt;

&lt;p&gt;If your organization maintains multiple CI/CD platforms, every one of them carries its own overhead:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Separate security reviews&lt;/strong&gt; for each platform’s integration points&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Separate runner/agent infrastructure&lt;/strong&gt; to patch, scale, and monitor&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Separate expertise silos&lt;/strong&gt; - your Jenkins experts don’t know CircleCI, and vice versa&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Separate onboarding paths&lt;/strong&gt; for every team that uses a different system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The math is straightforward. If you spend 2 FTEs maintaining Jenkins, 1.5 on CircleCI, and 0.5 on random other tools, that’s 4 FTEs of platform maintenance. Consolidating to one platform doesn’t eliminate all of that, but it compresses it significantly and lets you invest the savings in making that one platform excellent.&lt;/p&gt;

&lt;h3 id=&quot;standardization-making-the-right-thing-easy&quot;&gt;Standardization: Making the Right Thing Easy&lt;/h3&gt;

&lt;p&gt;When every team builds their own pipelines from scratch, you get a thousand variations of the same patterns. Some teams pin their dependencies. Some don’t. Some run security scans. Some skip them. Some deploy with rollback capability. Some YOLO straight to production.&lt;/p&gt;

&lt;p&gt;The promise of a well-architected Actions platform isn’t just “one CI system” - it’s &lt;strong&gt;template workflows and reusable components that make the right thing the easy thing&lt;/strong&gt;. When a Java team can adopt a standardized workflow in five minutes instead of spending a week writing pipeline scripts, you’ve fundamentally changed the economics of doing the right thing.&lt;/p&gt;

&lt;p&gt;We’ll dig deep into this architecture in &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like/&quot;&gt;Part 2&lt;/a&gt; and &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/&quot;&gt;Part 3&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;developer-experience-reducing-context-switching&quot;&gt;Developer Experience: Reducing Context Switching&lt;/h3&gt;

&lt;p&gt;If your source code is in GitHub, there’s a real productivity argument for having CI/CD in GitHub too. Developers stay in one interface. PR status checks, workflow logs, deployment history, and environment approvals all live in the same place as the code. No more bouncing between tabs, no more “check the Jenkins dashboard” Slack messages.&lt;/p&gt;

&lt;p&gt;This sounds like a minor quality-of-life improvement until you multiply it by hundreds of developers and thousands of builds per day. Context switching is expensive, and every tool boundary is a context switch.&lt;/p&gt;

&lt;h3 id=&quot;compliance-one-platform-to-audit&quot;&gt;Compliance: One Platform to Audit&lt;/h3&gt;

&lt;p&gt;For organizations with regulatory requirements (SOC2, PCI, HIPAA, FedRAMP), fewer platforms means fewer audit surfaces. One set of access controls. One audit log. One secrets management strategy. One OIDC integration. One set of environment protection rules.&lt;/p&gt;

&lt;p&gt;Compare that to explaining to your auditor how you enforce consistent deployment controls across three different CI/CD systems with three different permission models.&lt;/p&gt;

&lt;h2 id=&quot;this-is-an-organizational-change-not-just-a-technical-one&quot;&gt;This Is an Organizational Change, Not Just a Technical One&lt;/h2&gt;

&lt;p&gt;This is where most migrations go sideways. Someone on the platform team writes a beautiful technical migration plan, gets leadership approval, and then wonders why adoption stalls at 20%.&lt;/p&gt;

&lt;p&gt;The reason is simple: &lt;strong&gt;a CI/CD migration changes how people work every single day&lt;/strong&gt;. It changes their muscle memory. It changes which Slack channels they monitor. It changes how they debug failures. It changes their entire inner loop.&lt;/p&gt;

&lt;p&gt;That makes this an organizational change initiative, and those require a different playbook than a typical infrastructure project.&lt;/p&gt;

&lt;h3 id=&quot;identify-your-stakeholders-all-of-them&quot;&gt;Identify Your Stakeholders (All of Them)&lt;/h3&gt;

&lt;p&gt;A CI/CD migration touches more groups than you’d expect:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Stakeholder&lt;/th&gt;
      &lt;th&gt;What They Care About&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Development teams&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;“Will my builds still work? Will I have to rewrite everything?”&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Security/InfoSec&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;“How do we enforce policies? How are secrets managed? What’s the audit story?”&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Platform/SRE team&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;“How do we scale this? How do we monitor it? Who’s on call?”&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Management/Leadership&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;“What’s the timeline? What’s the risk? What’s the ROI?”&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Compliance&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;“Can we prove that required controls are enforced?”&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Each group needs a tailored message. Developers need to know their pain points are getting solved, not just relocated. Security needs to see that the new platform is at least as secure as what they have today. Leadership needs a timeline and risk mitigation plan.&lt;/p&gt;

&lt;h3 id=&quot;find-your-champions&quot;&gt;Find Your Champions&lt;/h3&gt;

&lt;p&gt;You can’t mandate adoption from the top down and expect enthusiasm. Find 2-3 development teams who are already frustrated with the current system and would love to be early adopters. These teams become your proof points, your feedback loop, and your evangelists.&lt;/p&gt;

&lt;p&gt;The best champions are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Credible&lt;/strong&gt; with their peers (not just management-friendly)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Vocal&lt;/strong&gt; about problems with the current system&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Willing&lt;/strong&gt; to tolerate some rough edges during the pilot phase&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Representative&lt;/strong&gt; of different tech stacks and team sizes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;address-the-fear-factor&quot;&gt;Address the Fear Factor&lt;/h3&gt;

&lt;p&gt;You already know what developers are thinking when they hear “we’re migrating CI/CD”:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;“Great, another thing I have to learn while still hitting my sprint commitments”&lt;/li&gt;
  &lt;li&gt;“My pipelines work fine. Why are you breaking them?”&lt;/li&gt;
  &lt;li&gt;“Last time we migrated something, it took six months longer than promised”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren’t irrational concerns. Acknowledge them. Your enablement plan needs to account for the fact that developers have day jobs, and learning a new CI/CD platform isn’t usually in their sprint plans.&lt;/p&gt;

&lt;p&gt;Practical steps:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Provide training in the format people actually use.&lt;/strong&gt; Office hours, pair programming sessions, and working examples beat slide decks every time.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Don’t ask teams to migrate during crunch time.&lt;/strong&gt; Coordinate with release schedules.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Make the migration do something for them,&lt;/strong&gt; not just to them. Faster builds? Easier debugging? Less boilerplate? Lead with the carrot.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-self-assessment-where-are-you-today&quot;&gt;The Self-Assessment: Where Are You Today?&lt;/h2&gt;

&lt;p&gt;Before you can plan a migration, you need an honest inventory of what you’re migrating from. This isn’t just a technical audit - it’s a political one. You need to understand which teams depend on which platforms, which pipelines are critical path, and where the bodies are buried.&lt;/p&gt;

&lt;h3 id=&quot;pipeline-inventory&quot;&gt;Pipeline Inventory&lt;/h3&gt;

&lt;p&gt;For each CI/CD platform currently in use, catalog:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Dimension&lt;/th&gt;
      &lt;th&gt;Questions to Answer&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Volume&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;How many pipelines exist? How many run daily?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Criticality&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Which pipelines gate production deployments?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Complexity&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Simple build-test? Or multi-stage with approvals, environment-specific configs, and conditional logic?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Dependencies&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;What plugins, integrations, or custom tooling do pipelines rely on?&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Ownership&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Which team owns each pipeline? Is there an owner at all?&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;That last question is more important than it looks. Orphaned pipelines - pipelines where nobody knows who wrote them or why they exist - are some of the riskiest to migrate because there’s nobody to validate that the migration is correct.&lt;/p&gt;

&lt;h3 id=&quot;infrastructure-audit&quot;&gt;Infrastructure Audit&lt;/h3&gt;

&lt;p&gt;Map out your current runner/agent infrastructure:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Where are agents running?&lt;/strong&gt; On-prem VMs? Cloud instances? Kubernetes? Developer laptops? (Please say no to that last one.)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;What’s the network topology?&lt;/strong&gt; Can agents reach internal services? Do they need VPN access? Are they in a DMZ?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;How are they provisioned and maintained?&lt;/strong&gt; Golden images? Ansible? “Someone SSHed in and installed stuff three years ago”?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;What’s the scaling model?&lt;/strong&gt; Static pool? Auto-scaling? “We add more when people complain”?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This maps directly to your runner strategy for Actions. If your current agents need private network access to deploy to internal services, you’ll need &lt;a href=&quot;https://docs.github.com/en/actions/using-github-hosted-runners/connecting-to-a-private-network/about-private-networking-with-github-hosted-runners&quot;&gt;self-hosted runners or GitHub-hosted runners with private networking&lt;/a&gt;. If you need GPU or ARM architectures, that drives you toward &lt;a href=&quot;https://docs.github.com/en/actions/using-github-hosted-runners/managing-larger-runners&quot;&gt;larger runners&lt;/a&gt;. We covered runner scaling patterns in depth in &lt;a href=&quot;/blog/2026/04/29/github-actions-runner-scaling-patterns/&quot;&gt;our earlier post on the topic&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;security-and-compliance-baseline&quot;&gt;Security and Compliance Baseline&lt;/h3&gt;

&lt;p&gt;Document your current security posture so you can prove that migration maintains (or improves) it:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;How are secrets managed today?&lt;/strong&gt; Vault? Platform-native secrets? Environment variables that someone exports manually?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;What access controls exist?&lt;/strong&gt; Who can modify pipelines? Who can trigger deployments?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Are there required checks?&lt;/strong&gt; Security scans, linting, tests that must pass before deployment?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;How is the audit trail captured?&lt;/strong&gt; Logs? SIEM integration? “We check when something goes wrong”?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the Actions side, you’ll want to evaluate:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;OIDC federation&lt;/strong&gt; for cloud credentials (eliminates stored secrets entirely)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Organization-level policies&lt;/strong&gt; for which Actions are allowed&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Environment protection rules&lt;/strong&gt; for deployment gates&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;GITHUB_TOKEN&lt;/strong&gt; default permissions (set to read-only, always)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;SHA pinning&lt;/strong&gt; for third-party Actions (tags are mutable, SHAs are not)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re using &lt;a href=&quot;/blog/2026/03/10/scaling-github-rulesets-with-custom-properties/&quot;&gt;repository rulesets&lt;/a&gt;, you can enforce required workflows at scale using custom properties to target the right repos automatically.&lt;/p&gt;

&lt;h3 id=&quot;plugin-and-integration-mapping&quot;&gt;Plugin and Integration Mapping&lt;/h3&gt;

&lt;p&gt;Plugin mapping is where migrations stall. Every CI platform has its own ecosystem, and your teams depend on specific integrations. Build a mapping table:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Current Plugin/Integration&lt;/th&gt;
      &lt;th&gt;GitHub Actions Equivalent&lt;/th&gt;
      &lt;th&gt;Gap?&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;SonarQube scanner plugin&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SonarSource/sonarqube-scan-action&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;None&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Artifactory upload&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jfrog/setup-jfrog-cli&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;None&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Custom deployment script&lt;/td&gt;
      &lt;td&gt;Custom composite action&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;Needs development&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Internal notification bot&lt;/td&gt;
      &lt;td&gt;Custom action or workflow step&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;Needs development&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Items in the “Needs development” column are your risk items. Build these before the teams that depend on them begin migration. This is also where &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/&quot;&gt;custom Actions&lt;/a&gt; come in.&lt;/p&gt;

&lt;h2 id=&quot;planning-the-migration&quot;&gt;Planning the Migration&lt;/h2&gt;

&lt;p&gt;With the self-assessment complete, you can build a realistic plan. The keyword here is &lt;strong&gt;phased&lt;/strong&gt;. Big-bang CI/CD migrations have a terrible track record. Phased rollouts let you learn, adjust, and build confidence incrementally.&lt;/p&gt;

&lt;h3 id=&quot;phase-0-foundation-weeks-1-2&quot;&gt;Phase 0: Foundation (Weeks 1-2)&lt;/h3&gt;

&lt;p&gt;Before any team migrates a single pipeline:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Deploy runner infrastructure.&lt;/strong&gt; Set up runner groups, configure networking, validate scaling behavior.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Implement security policies.&lt;/strong&gt; OIDC integration, secrets management, Action allowlists, default token permissions.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Build the reusable workflow library.&lt;/strong&gt; Create the template workflows and reusable components that teams will consume. (This is the subject of &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like/&quot;&gt;Part 2&lt;/a&gt; and &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-3-building-the-lego-blocks/&quot;&gt;Part 3&lt;/a&gt; in this series.)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Set up monitoring.&lt;/strong&gt; You need to see workflow run times, failure rates, and runner utilization from day one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Phase 0 is unglamorous but critical. Skip it, and pilot teams hit infrastructure issues unrelated to pipeline logic, which kills confidence fast.&lt;/p&gt;

&lt;h3 id=&quot;phase-1-pilot-weeks-3-4&quot;&gt;Phase 1: Pilot (Weeks 3-4)&lt;/h3&gt;

&lt;p&gt;Select 2-3 teams for the pilot. Good pilot candidates:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Have relatively simple pipelines (build, test, maybe a non-production deploy)&lt;/li&gt;
  &lt;li&gt;Are enthusiastic about the migration (your champions from earlier)&lt;/li&gt;
  &lt;li&gt;Represent different tech stacks (a Java team, a Python team, a Node team)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During the pilot:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Run dual pipelines.&lt;/strong&gt; Keep the old system running alongside Actions until you’re confident the new workflows produce identical results.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Measure everything.&lt;/strong&gt; Build times, test pass rates, developer feedback.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Iterate on templates.&lt;/strong&gt; The pilot teams are your design partners. Their feedback shapes the reusable workflows that everyone else will use.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;phase-2-ci-migration-weeks-5-8&quot;&gt;Phase 2: CI Migration (Weeks 5-8)&lt;/h3&gt;

&lt;p&gt;Expand to remaining teams, starting with CI workloads (build and test, not deployment):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Roll out team by team, not all at once&lt;/li&gt;
  &lt;li&gt;Provide office hours and pairing sessions for teams doing manual conversion&lt;/li&gt;
  &lt;li&gt;Use &lt;a href=&quot;https://docs.github.com/en/actions/migrating-to-github-actions/using-github-actions-importer-to-automate-migrations/about-github-actions-importer&quot;&gt;GitHub Actions Importer&lt;/a&gt; where applicable for automated conversion&lt;/li&gt;
  &lt;li&gt;Decommission old pipelines for migrated repos (don’t leave them running in parallel forever)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;phase-3-cd-migration-weeks-9-12&quot;&gt;Phase 3: CD Migration (Weeks 9-12)&lt;/h3&gt;

&lt;p&gt;Production deployments are the high-stakes phase:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Implement &lt;a href=&quot;https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment&quot;&gt;environment protection rules&lt;/a&gt; with required reviewers and wait timers&lt;/li&gt;
  &lt;li&gt;Validate OIDC credentials work for production cloud environments&lt;/li&gt;
  &lt;li&gt;Test rollback procedures before you need them&lt;/li&gt;
  &lt;li&gt;Coordinate with change management processes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;phase-4-decommission-week-13&quot;&gt;Phase 4: Decommission (Week 13+)&lt;/h3&gt;

&lt;p&gt;The unsexy but essential final phase:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Sweep for any remaining unmigrated pipelines&lt;/li&gt;
  &lt;li&gt;Archive old CI/CD configuration (don’t delete it yet - you might need to reference it)&lt;/li&gt;
  &lt;li&gt;Decommission old agent/runner infrastructure&lt;/li&gt;
  &lt;li&gt;Update documentation and runbooks&lt;/li&gt;
  &lt;li&gt;Run a retrospective&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;success-metrics&quot;&gt;Success Metrics&lt;/h3&gt;

&lt;p&gt;Define these before you start, not after:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Metric&lt;/th&gt;
      &lt;th&gt;How to Measure&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Migration progress&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;% of repos migrated by milestone&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Build performance&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Mean workflow run time vs. baseline&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Reliability&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Workflow failure rate vs. baseline&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Developer satisfaction&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Survey at Phase 2 and Phase 4&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Onboarding speed&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Time for a new team to adopt standard workflows&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;risk-register&quot;&gt;Risk Register&lt;/h3&gt;

&lt;p&gt;Every migration has risks. Name them explicitly so you can manage them:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Risk&lt;/th&gt;
      &lt;th&gt;Mitigation&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Runner infrastructure isn’t ready on time&lt;/td&gt;
      &lt;td&gt;Start Phase 0 early; have a fallback to GitHub-hosted runners&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Custom plugins have no Actions equivalent&lt;/td&gt;
      &lt;td&gt;Identify in self-assessment; build custom actions before teams need them&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Teams don’t have bandwidth to migrate&lt;/td&gt;
      &lt;td&gt;Coordinate with sprint planning; provide migration assistance&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Security review blocks the timeline&lt;/td&gt;
      &lt;td&gt;Involve InfoSec from day one, not as a gate at the end&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Migration takes longer than estimated&lt;/td&gt;
      &lt;td&gt;Phased approach limits blast radius; extend timeline rather than cutting corners&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;what-comes-next&quot;&gt;What Comes Next&lt;/h2&gt;

&lt;p&gt;If you’ve made it this far, you’ve got the organizational alignment piece. You know &lt;em&gt;why&lt;/em&gt; you’re migrating, you’ve inventoried &lt;em&gt;what&lt;/em&gt; you’re migrating from, and you’ve got a phased plan for &lt;em&gt;how&lt;/em&gt; to get there.&lt;/p&gt;

&lt;p&gt;But we haven’t talked about the most important part: &lt;strong&gt;what does the target state actually look like?&lt;/strong&gt; How do you structure template workflows, reusable workflows, and custom Actions so that the platform team can manage standards centrally while development teams retain autonomy?&lt;/p&gt;

&lt;p&gt;That’s exactly what &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like/&quot;&gt;Part 2: What Good Looks Like&lt;/a&gt; covers. We’ll walk through the architecture of a layered workflow system where dev teams pick a template, that template calls standardized reusable workflows, and those workflows compose security scanning, SRE operations, and language-specific best practices - all managed by the teams who own those concerns.&lt;/p&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pre-flight checklist:&lt;/strong&gt;&lt;/p&gt;

&lt;ul class=&quot;task-list&quot;&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Find your real reason.&lt;/strong&gt; Consolidation, standardization, developer experience, compliance - pick the ones that resonate with your organization.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Treat this as an organizational change,&lt;/strong&gt; not just a technical project. Identify stakeholders, find champions, address fears.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Do the self-assessment honestly.&lt;/strong&gt; Inventory pipelines, audit infrastructure, map plugins, document security controls.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Plan in phases.&lt;/strong&gt; Foundation, pilot, CI migration, CD migration, decommission. Each phase has entry and exit criteria.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Define success metrics upfront.&lt;/strong&gt; You can’t prove the migration was worth it if you didn’t measure the baseline.&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;&lt;strong&gt;Involve security from day one.&lt;/strong&gt; Not as a gate at the end, but as a design partner from the start.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A CI/CD migration done right is a force multiplier. Done wrong, it’s a multi-month distraction that makes everyone’s life harder. The difference is almost entirely in the planning.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Next up: &lt;a href=&quot;/blog/2026/06/03/migrating-to-github-actions-part-2-what-good-looks-like/&quot;&gt;Part 2 - What Good Looks Like&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="github-actions" />
   
    <category term="ci-cd" />
   
    <category term="devops" />
   
    <category term="migration" />
   
    <category term="platform-engineering" />
   
    <category term="best-practices" />
   
    <category term="enterprise" />
   
 </entry>
 
 <entry>
   <title>Token Optimization for AI-Assisted Development</title>
   <link href="https://www.dxrf.com/blog/2026/05/08/token-optimization-ai-assisted-development/"/>
   <updated>2026-05-08T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/05/08/token-optimization-ai-assisted-development</id>
   <excerpt type="html">Your AI coding tools burn tokens on every interaction. Here&apos;s how to get better results with fewer tokens - from writing effective instructions to choosing the right interaction mode.</excerpt>
   <content type="html">&lt;p&gt;Every time you hit Tab on a Copilot suggestion, ask a question in chat, or kick off an agent task, you’re spending tokens. Those tokens translate to latency, context window pressure, and (depending on your plan) real cost.&lt;/p&gt;

&lt;p&gt;The good news? Most developers are leaving significant performance on the table. A few deliberate practices can get you faster responses, better suggestions, and more effective agent interactions without changing your tooling.&lt;/p&gt;

&lt;h2 id=&quot;why-this-matters-for-your-daily-workflow&quot;&gt;Why This Matters for Your Daily Workflow&lt;/h2&gt;

&lt;p&gt;You might be thinking “I’m on an unlimited Copilot plan, why do I care about tokens?” Three reasons:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Concern&lt;/th&gt;
      &lt;th&gt;Impact on you&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Response quality&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Bloated context dilutes the signal. Less noise = better suggestions.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Speed&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;More tokens = slower responses. Tight context means faster completions.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Context window limits&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Every model has a ceiling. Waste it on irrelevant context and the model can’t see what matters.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Here’s the thing - even with unlimited plans, you’re still bounded by context windows and latency. A 200K token context window sounds huge until your agent is reading your entire &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node_modules&lt;/code&gt; directory trying to understand a one-line change.&lt;/p&gt;

&lt;h2 id=&quot;understanding-what-burns-tokens&quot;&gt;Understanding What Burns Tokens&lt;/h2&gt;

&lt;p&gt;Before optimizing, know where tokens go in AI coding tools:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Instruction files&lt;/strong&gt; load on every single interaction (your persistent “system prompt”)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Open file context&lt;/strong&gt; - the file you’re editing plus nearby tabs&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Conversation history&lt;/strong&gt; accumulates across a chat session&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Agent exploration&lt;/strong&gt; - file reads, searches, and tool calls all consume tokens&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Retrieved context&lt;/strong&gt; - documentation, similar code, and workspace indexing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key insight: instruction files and workspace context are the “fixed costs” of every interaction. Optimizing those pays dividends across every suggestion, every chat, every agent run.&lt;/p&gt;

&lt;h2 id=&quot;instructions-prompt-files-and-skills-know-the-difference&quot;&gt;Instructions, Prompt Files, and Skills: Know the Difference&lt;/h2&gt;

&lt;p&gt;GitHub Copilot has three distinct customization layers, each with a different token profile. Most developers lump them together and miss a significant optimization opportunity.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt; &lt;/th&gt;
      &lt;th&gt;Instructions&lt;/th&gt;
      &lt;th&gt;Prompt Files&lt;/th&gt;
      &lt;th&gt;Skills&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;File format&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;copilot-instructions.md&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.instructions.md&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;*.prompt.md&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SKILL.md&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Location&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/instructions/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/prompts/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/&amp;lt;name&amp;gt;/&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;When loaded&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Automatically on every interaction (or when path matches)&lt;/td&gt;
      &lt;td&gt;Only when you invoke via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/command&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Only when the AI decides it’s relevant&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Who decides&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Always included&lt;/td&gt;
      &lt;td&gt;You (explicit invocation)&lt;/td&gt;
      &lt;td&gt;The AI (based on the description field)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Token cost&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Fixed cost per request&lt;/td&gt;
      &lt;td&gt;Zero until you invoke it&lt;/td&gt;
      &lt;td&gt;Zero until the AI activates it&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Best for&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Universal rules, project conventions&lt;/td&gt;
      &lt;td&gt;Repeatable tasks, workflows&lt;/td&gt;
      &lt;td&gt;Complex multi-step procedures with scripts&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The token optimization insight: anything that doesn’t need to be in every interaction should be moved to either a prompt file or a skill.&lt;/p&gt;

&lt;h3 id=&quot;instructions-always-on-context&quot;&gt;Instructions: Always-On Context&lt;/h3&gt;

&lt;p&gt;Custom instructions load automatically. There are two types per the &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions&quot;&gt;official docs&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Repository-wide&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/copilot-instructions.md&lt;/code&gt;): Loaded on every request in that repo&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Path-specific&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/instructions/NAME.instructions.md&lt;/code&gt;): Loaded only when working on files matching the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;applyTo&lt;/code&gt; glob&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use these for things that genuinely apply universally or to a class of files.&lt;/p&gt;

&lt;h3 id=&quot;prompt-files-user-invoked-workflows&quot;&gt;Prompt Files: User-Invoked Workflows&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://code.visualstudio.com/docs/copilot/customization/prompt-files&quot;&gt;Prompt files&lt;/a&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.prompt.md&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/prompts/&lt;/code&gt;) are reusable slash commands you invoke explicitly by typing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/command-name&lt;/code&gt; in chat. They cost zero tokens until you invoke them.&lt;/p&gt;

&lt;p&gt;Use prompt files for repeatable workflows you trigger yourself:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Scaffolding a new component&lt;/li&gt;
  &lt;li&gt;Running and fixing tests&lt;/li&gt;
  &lt;li&gt;Preparing a PR description&lt;/li&gt;
  &lt;li&gt;Performing a code review checklist&lt;/li&gt;
&lt;/ul&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;gh&quot;&gt;# .github/prompts/new-api-endpoint.prompt.md
---
&lt;/span&gt;description: &quot;Scaffold a new REST API endpoint with controller, service, tests, and route registration&quot;
agent: agent
tools:
&lt;span class=&quot;p&quot;&gt;  -&lt;/span&gt; changes
&lt;span class=&quot;gh&quot;&gt;  - editFiles
---
&lt;/span&gt;
Create a new API endpoint following our conventions:
&lt;span class=&quot;p&quot;&gt;1.&lt;/span&gt; Controller in app/controllers/ with standard CRUD actions
&lt;span class=&quot;p&quot;&gt;2.&lt;/span&gt; Service object in app/services/ for business logic
&lt;span class=&quot;p&quot;&gt;3.&lt;/span&gt; Request specs in spec/requests/
&lt;span class=&quot;p&quot;&gt;4.&lt;/span&gt; Register routes in config/routes.rb
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;skills-ai-selected-on-demand-context&quot;&gt;Skills: AI-Selected On-Demand Context&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/about-agent-skills&quot;&gt;Agent skills&lt;/a&gt; are the real token optimization win. A skill is a directory containing a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SKILL.md&lt;/code&gt; file (and optionally scripts or other resources) inside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/&lt;/code&gt;. The AI reads the skill’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;name&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;description&lt;/code&gt; fields and automatically decides whether to load it based on relevance to the current task.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;.github/skills/database-migration/
├── SKILL.md
└── validate-migration.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&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;gh&quot;&gt;# .github/skills/database-migration/SKILL.md
---
&lt;/span&gt;name: database-migration
&lt;span class=&quot;gh&quot;&gt;description: Guide for creating safe database migrations, including large table changes and column renames. Use when creating or modifying database migrations.
---
&lt;/span&gt;
&lt;span class=&quot;gu&quot;&gt;## Standard migrations&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Always create reversible migrations with up/down methods
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Add indexes for foreign keys and frequently queried columns
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Test against production-size data before merging

&lt;span class=&quot;gu&quot;&gt;## Large table changes&lt;/span&gt;
When adding/modifying columns on tables with &amp;gt;1M rows:
&lt;span class=&quot;p&quot;&gt;1.&lt;/span&gt; Add new column as nullable (no default - avoids table lock)
&lt;span class=&quot;p&quot;&gt;2.&lt;/span&gt; Deploy backfill as a separate background job
&lt;span class=&quot;p&quot;&gt;3.&lt;/span&gt; Add NOT NULL constraint after backfill completes

&lt;span class=&quot;gu&quot;&gt;## Column renames (zero-downtime)&lt;/span&gt;
Three-phase approach:
&lt;span class=&quot;p&quot;&gt;1.&lt;/span&gt; Add new column, dual-write to both old and new
&lt;span class=&quot;p&quot;&gt;2.&lt;/span&gt; Backfill new column, migrate all readers
&lt;span class=&quot;p&quot;&gt;3.&lt;/span&gt; Drop old column in a follow-up migration

Run the &lt;span class=&quot;sb&quot;&gt;`validate-migration.sh`&lt;/span&gt; script to check for common migration issues.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The AI sees “Guide for creating safe database migrations” and only loads this skill when you’re actually working on a migration. The other 95% of the time, those tokens don’t exist in your context.&lt;/p&gt;

&lt;p&gt;Skills can also be personal (stored in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.copilot/skills/&lt;/code&gt;) so they follow you across projects, or installed from shared repositories using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gh skill install&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;moving-content-to-the-right-layer&quot;&gt;Moving Content to the Right Layer&lt;/h3&gt;

&lt;p&gt;Ask yourself: “Does the AI need this on &lt;em&gt;every&lt;/em&gt; interaction, or only for &lt;em&gt;this specific type of work&lt;/em&gt;?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep in instructions&lt;/strong&gt; (always-on):&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Project stack and framework versions&lt;/li&gt;
  &lt;li&gt;Universal code style rules&lt;/li&gt;
  &lt;li&gt;Build and test commands&lt;/li&gt;
  &lt;li&gt;Things that affect every file (naming conventions, error patterns)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Move to prompt files&lt;/strong&gt; (user-invoked):&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Scaffolding templates&lt;/li&gt;
  &lt;li&gt;PR preparation workflows&lt;/li&gt;
  &lt;li&gt;Code review checklists&lt;/li&gt;
  &lt;li&gt;Deployment runbooks you trigger manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Move to skills&lt;/strong&gt; (AI-selected):&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Database migration procedures&lt;/li&gt;
  &lt;li&gt;Complex refactoring patterns&lt;/li&gt;
  &lt;li&gt;Debugging playbooks (e.g., debugging CI failures)&lt;/li&gt;
  &lt;li&gt;Framework-specific upgrade guides&lt;/li&gt;
  &lt;li&gt;Any multi-step procedure the AI should follow when it detects relevance&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;the-token-math&quot;&gt;The Token Math&lt;/h3&gt;

&lt;p&gt;Say you have 5 specialized procedures averaging 300 tokens each in your instruction file. That’s 1,500 tokens loaded on every single request, relevant or not.&lt;/p&gt;

&lt;p&gt;Move them to skills: 0 tokens on most requests, 300 tokens only when the AI determines one is needed. Over hundreds of daily interactions, that’s a massive reduction in noise and context window pressure.&lt;/p&gt;

&lt;h3 id=&quot;tips-for-effective-skills&quot;&gt;Tips for Effective Skills&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Descriptions are critical.&lt;/strong&gt; The AI uses the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;description&lt;/code&gt; field to decide relevance. Be specific: “Guide for debugging failing GitHub Actions workflows” beats “CI stuff.”&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;One skill, one job.&lt;/strong&gt; A skill for “database work” is too broad. Separate “migration” from “query optimization” from “schema design.”&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Include scripts when useful.&lt;/strong&gt; Skills can bundle shell scripts, and you can pre-approve tool access with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;allowed-tools&lt;/code&gt; in the frontmatter.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Skills are standalone.&lt;/strong&gt; They load independently, so don’t assume the AI has read other skills or your instruction file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;custom-instructions-your-most-leveraged-optimization&quot;&gt;Custom Instructions: Your Most Leveraged Optimization&lt;/h2&gt;

&lt;p&gt;Instruction files (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/copilot-instructions.md&lt;/code&gt;, cursor rules, etc.) ship with every request. They’re the single highest-leverage place to optimize because they affect every interaction.&lt;/p&gt;

&lt;h3 id=&quot;what-belongs-in-instructions&quot;&gt;What Belongs in Instructions&lt;/h3&gt;

&lt;p&gt;Focus on things the model genuinely can’t infer from your code:&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;gh&quot;&gt;# .github/copilot-instructions.md&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Architecture decisions&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; This is a modular monolith, NOT microservices. Don&apos;t suggest splitting into services.
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; We use the outbox pattern for async events - see app/events/outbox/
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; All database access goes through repository classes, never raw SQL in controllers

&lt;span class=&quot;gu&quot;&gt;## Stack specifics&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Ruby on Rails 7.2, PostgreSQL 16, Sidekiq for background jobs
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; RSpec + FactoryBot for tests. No minitest.
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Hotwire/Turbo for interactivity. No React/Vue.

&lt;span class=&quot;gu&quot;&gt;## Team conventions&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Prefer early returns over nested conditionals
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Service objects in app/services/ for complex business logic
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; No comments explaining obvious code
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Strong params always - never trust user input
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;what-wastes-tokens-in-instructions&quot;&gt;What Wastes Tokens in Instructions&lt;/h3&gt;

&lt;p&gt;Every generic platitude is tokens stolen from actual context:&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;gh&quot;&gt;# DON&apos;T - these waste tokens on every request&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;
-&lt;/span&gt; Write clean, readable code
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Use meaningful variable names
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Follow SOLID principles
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Add error handling where appropriate
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Write comprehensive tests
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The model already knows these things. You’re paying (in context window space) to tell it things it learned in training.&lt;/p&gt;

&lt;h3 id=&quot;link-instead-of-inline&quot;&gt;Link Instead of Inline&lt;/h3&gt;

&lt;p&gt;Here’s a powerful pattern: instead of cramming detailed documentation into your instruction file (where it loads on every request), provide links to files the AI can read on demand:&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;## Architecture references&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Data model and relationships: docs/architecture/data-model.md
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; API design conventions: docs/architecture/api-standards.md
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Authentication flow: docs/architecture/auth-flow.md
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Deployment pipeline: .github/workflows/README.md

&lt;span class=&quot;gu&quot;&gt;## Decision records&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Why we chose PostgreSQL over MongoDB: docs/adr/003-database-choice.md
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Event sourcing approach: docs/adr/007-event-sourcing.md
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The agent reads these files only when the task is relevant. If you’re working on a database migration, it pulls in the data model doc. If you’re writing an API endpoint, it grabs the API standards. If you’re fixing a CSS bug, it ignores all of them.&lt;/p&gt;

&lt;p&gt;Compare the alternatives:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Approach&lt;/th&gt;
      &lt;th&gt;Tokens per request&lt;/th&gt;
      &lt;th&gt;Quality&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Inline everything in instructions&lt;/td&gt;
      &lt;td&gt;High (always loaded)&lt;/td&gt;
      &lt;td&gt;Diluted by irrelevant content&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Link to reference docs&lt;/td&gt;
      &lt;td&gt;Low (loaded on demand)&lt;/td&gt;
      &lt;td&gt;Focused, relevant context&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Don’t mention docs at all&lt;/td&gt;
      &lt;td&gt;Lowest&lt;/td&gt;
      &lt;td&gt;Agent doesn’t know they exist&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;This works because modern coding agents can read files from your workspace. You’re essentially giving the agent a table of contents - it knows where to look without carrying the entire library in its pocket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips for effective linking:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Use relative paths from repo root (not absolute paths)&lt;/li&gt;
  &lt;li&gt;Add a brief description so the agent knows when each file is relevant&lt;/li&gt;
  &lt;li&gt;Keep referenced docs up to date (stale docs are worse than no docs)&lt;/li&gt;
  &lt;li&gt;Group by topic so related references are easy to scan&lt;/li&gt;
  &lt;li&gt;Link to specific sections when a doc is long: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;docs/api.md#error-handling&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;red-flags-your-instructions-need-a-diet&quot;&gt;Red Flags Your Instructions Need a Diet&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;They’re longer than ~500 words (anything beyond that should be scoped)&lt;/li&gt;
  &lt;li&gt;They repeat information obvious from your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;package.json&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Gemfile&lt;/code&gt;, or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tsconfig.json&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;They contain generic coding advice that applies to any project&lt;/li&gt;
  &lt;li&gt;They include examples for every single rule (one or two key examples is fine)&lt;/li&gt;
  &lt;li&gt;They haven’t been reviewed since you first wrote them&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;scoped-instructions-context-only-when-needed&quot;&gt;Scoped Instructions: Context Only When Needed&lt;/h2&gt;

&lt;p&gt;The biggest instruction file optimization: don’t load everything everywhere. Scoped instruction files activate only for matching files:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# .github/instructions/testing.instructions.md&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;applyTo&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;**/test/**,**/*_test.go,**/*_spec.rb&quot;&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Use table-driven tests for functions with multiple input/output cases&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Mock external services at the HTTP boundary, not internal interfaces&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Test behavior, not implementation. Don&apos;t assert on internal method calls.&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Follow AAA&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Arrange, Act, Assert with blank lines between sections&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-yaml 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;# .github/instructions/database.instructions.md&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;applyTo&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;**/migrations/**,**/models/**,**/repositories/**&quot;&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Always add indexes for foreign keys and frequently queried columns&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Use reversible migrations. No raw SQL without a down method.&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Include database constraints (NOT NULL, unique) not just app-level validations&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-yaml 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;# .github/instructions/api.instructions.md&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;applyTo&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;**/controllers/**,**/handlers/**,**/routes/**&quot;&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;All endpoints require authentication unless explicitly public&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Validate and sanitize all user inputs at the boundary&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Return consistent error response format&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;nv&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;details&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;?:&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;object&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;Include rate limiting headers in responses&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why this matters:&lt;/strong&gt; A monolithic 2,000-word instruction file loads for every request. Scoped instructions mean your testing context only loads when you’re writing tests, your API conventions only load when you’re in controllers. Less noise, better signal, every time.&lt;/p&gt;

&lt;h2 id=&quot;prompting-coding-agents-effectively&quot;&gt;Prompting Coding Agents Effectively&lt;/h2&gt;

&lt;p&gt;When you’re chatting with an AI coding agent, how you frame the request directly impacts how many tokens the agent burns figuring out what you want.&lt;/p&gt;

&lt;h3 id=&quot;the-anatomy-of-a-token-efficient-prompt&quot;&gt;The Anatomy of a Token-Efficient Prompt&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Expensive (agent will explore broadly, ask clarifying questions, over-deliver)
Can you help me add authentication to my app? I&apos;m thinking 
maybe JWT or sessions, not sure which is better. Also it would 
be nice to have role-based access control eventually.

# Efficient (clear scope, clear constraints, clear deliverable)
Add JWT authentication to the /api/v2/* routes. 
- Use the existing User model and bcrypt passwords in db
- Middleware in app/middleware/auth.go
- Return 401 with standard error format on invalid/missing token
- Don&apos;t modify existing routes or tests yet
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The second prompt gives the agent everything it needs to act immediately without exploration. The first one will trigger multiple rounds of file reads, questions, and potentially unwanted refactoring.&lt;/p&gt;

&lt;h3 id=&quot;key-principles-for-agent-prompts&quot;&gt;Key Principles for Agent Prompts&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Reference files explicitly:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Refactor the validation logic in app/services/order_validator.rb 
to use the pattern from app/services/user_validator.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The agent reads two files instead of searching your entire codebase for “validation patterns.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State what’s out of scope:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Add pagination to the /api/users endpoint.
- Don&apos;t modify the frontend
- Don&apos;t change existing tests
- Don&apos;t add new dependencies
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Constraints prevent the agent from “helpfully” updating things you didn’t ask about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Be specific about the deliverable:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Vague - agent doesn&apos;t know when it&apos;s &quot;done&quot;
Improve the error handling in this module

# Specific - clear exit criteria
Add error handling to the three public methods in payment_service.py:
- Wrap Stripe API calls in try/except
- Log errors with context (user_id, amount, operation)
- Raise a custom PaymentError with the original exception
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;when-to-break-tasks-apart&quot;&gt;When to Break Tasks Apart&lt;/h3&gt;

&lt;p&gt;If your prompt contains the word “and” connecting unrelated things, it’s probably two tasks:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# One expensive, sprawling agent session:
Add pagination to the users API and fix the date formatting 
bug in the reports page and update the README

# Three focused, efficient sessions:
1. Add cursor-based pagination to GET /api/users
2. Fix date formatting in app/views/reports/show.html.erb (should use ISO 8601)
3. Update README setup section with new env vars from last PR
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Shorter, focused tasks mean shorter context windows, less exploration, and better results.&lt;/p&gt;

&lt;h2 id=&quot;context-management-in-ide-completions&quot;&gt;Context Management in IDE Completions&lt;/h2&gt;

&lt;p&gt;Inline completions (Tab-complete suggestions) are the lowest-token interaction mode. You can make them significantly better without any extra tokens by being intentional about what’s visible:&lt;/p&gt;

&lt;h3 id=&quot;write-signatures-first-bodies-second&quot;&gt;Write Signatures First, Bodies Second&lt;/h3&gt;

&lt;div class=&quot;language-python 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;# Write this first - gives the model clear intent
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;calculate_shipping_cost&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;OrderItem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;destination&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Address&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ShippingMethod&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ShippingMethod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;STANDARD&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Decimal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;Calculate total shipping cost based on weight, dimensions, and destination zone.&quot;&quot;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now when you start typing the body, the model has full context from your signature and docstring. No extra tokens needed - just better signal from what’s already there.&lt;/p&gt;

&lt;h3 id=&quot;leverage-open-tabs&quot;&gt;Leverage Open Tabs&lt;/h3&gt;

&lt;p&gt;Many AI tools include content from your open editor tabs as context. Use this intentionally:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Open the interface/type definition file when implementing a class&lt;/li&gt;
  &lt;li&gt;Open a similar, completed function when writing a new one that follows the same pattern&lt;/li&gt;
  &lt;li&gt;Open the test file alongside the implementation file&lt;/li&gt;
  &lt;li&gt;Close irrelevant tabs that add noise (that random config file you glanced at)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;naming-is-free-context&quot;&gt;Naming is Free Context&lt;/h3&gt;

&lt;div class=&quot;language-python 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;# The model has almost nothing to work with
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;proc&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;n&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;pass&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# The model knows exactly what to generate
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;process_refund&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;reason&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RefundReason&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RefundResult&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;pass&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Descriptive naming gives the model context at zero extra token cost. It’s the highest-ROI optimization you can make for inline completions.&lt;/p&gt;

&lt;h2 id=&quot;controlling-what-ai-tools-can-see&quot;&gt;Controlling What AI Tools Can See&lt;/h2&gt;

&lt;p&gt;AI tools index and read files from your workspace. Junk in your workspace means junk in your context.&lt;/p&gt;

&lt;h3 id=&quot;exclude-the-noise&quot;&gt;Exclude the Noise&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;language-gitignore&quot;&gt;# .gitignore (most AI tools respect this)
build/
dist/
node_modules/
vendor/
*.min.js
*.min.css
*.map
coverage/
.next/
__pycache__/
*.pyc
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;use-tool-specific-exclusions&quot;&gt;Use Tool-Specific Exclusions&lt;/h3&gt;

&lt;p&gt;Some tools support additional ways to exclude content from AI context. Check your specific tool’s documentation - for example, some support content exclusion settings at the organization or repository level. At minimum, ensure your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.gitignore&lt;/code&gt; is comprehensive since most AI tools respect it for context inclusion.&lt;/p&gt;

&lt;h3 id=&quot;keep-your-workspace-clean&quot;&gt;Keep Your Workspace Clean&lt;/h3&gt;

&lt;p&gt;The less noise in your workspace, the better your AI tools perform:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Delete dead code instead of commenting it out (that’s what git history is for)&lt;/li&gt;
  &lt;li&gt;Remove unused files and abandoned experiments&lt;/li&gt;
  &lt;li&gt;Keep generated files out of your source tree&lt;/li&gt;
  &lt;li&gt;Use clear directory structures so agents navigate efficiently&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;managing-mcp-tool-context&quot;&gt;Managing MCP Tool Context&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://modelcontextprotocol.io/&quot;&gt;MCP (Model Context Protocol)&lt;/a&gt; servers give your AI tools access to external data and services - databases, APIs, deployment tools, you name it. But every connected MCP server adds its tool descriptions to your context window. The AI needs to read all available tool descriptions to decide which ones to use.&lt;/p&gt;

&lt;h3 id=&quot;the-hidden-cost-of-mcp-tools&quot;&gt;The Hidden Cost of MCP Tools&lt;/h3&gt;

&lt;p&gt;Each MCP tool has a name, description, and parameter schema that loads into context. A single MCP server with 20 tools might add 2,000-3,000 tokens just in tool definitions. Connect three or four servers and you’ve burned 10K+ tokens before you even type your prompt.&lt;/p&gt;

&lt;h3 id=&quot;scope-tools-to-tasks&quot;&gt;Scope Tools to Tasks&lt;/h3&gt;

&lt;p&gt;Prompt files and custom agents let you specify exactly which tools are available via the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tools&lt;/code&gt; field. Use this to keep tool context tight:&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;gh&quot;&gt;# .github/prompts/deploy-staging.prompt.md
---
&lt;/span&gt;description: &quot;Deploy the current branch to staging environment&quot;
tools:
&lt;span class=&quot;p&quot;&gt;  -&lt;/span&gt; github/&lt;span class=&quot;err&quot;&gt;*&lt;/span&gt;
&lt;span class=&quot;gh&quot;&gt;  - shell
---
&lt;/span&gt;
Deploy the current branch to staging using our standard process...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&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;gh&quot;&gt;# .github/prompts/db-query.prompt.md
---
&lt;/span&gt;description: &quot;Run a read-only query against the dev database&quot;
tools:
&lt;span class=&quot;gh&quot;&gt;  - postgres-mcp/*
---
&lt;/span&gt;
Run the following query against the dev database...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;By limiting available tools per task, you reduce the tool description overhead and also get more focused results (the AI isn’t tempted to reach for tools you didn’t intend).&lt;/p&gt;

&lt;h3 id=&quot;mcp-server-hygiene&quot;&gt;MCP Server Hygiene&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Disconnect servers you’re not actively using.&lt;/strong&gt; A Jira MCP server adds tool descriptions to every interaction even if you haven’t touched Jira in weeks.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Prefer focused servers over kitchen-sink servers.&lt;/strong&gt; A server with 5 well-scoped tools is better than one with 50 tools covering everything.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Use server-level scoping&lt;/strong&gt; when available (e.g., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;server-name/*&lt;/code&gt; in your tools list) rather than listing every individual tool.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Audit periodically.&lt;/strong&gt; Run the VS Code command &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MCP: List Servers&lt;/code&gt; (or check your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mcp.json&lt;/code&gt;) and ask: am I actually using all of these?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;choosing-the-right-interaction-mode&quot;&gt;Choosing the Right Interaction Mode&lt;/h2&gt;

&lt;p&gt;Different tasks have wildly different token profiles. Matching the mode to the task is the IDE equivalent of model routing:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Mode&lt;/th&gt;
      &lt;th&gt;Token cost&lt;/th&gt;
      &lt;th&gt;Best for&lt;/th&gt;
      &lt;th&gt;Avoid for&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Inline (Tab)&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Lowest&lt;/td&gt;
      &lt;td&gt;Completing known patterns, boilerplate, single expressions&lt;/td&gt;
      &lt;td&gt;Complex logic, multi-step implementations&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Chat (ask/edit)&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Medium&lt;/td&gt;
      &lt;td&gt;Questions, explanations, targeted edits to specific code&lt;/td&gt;
      &lt;td&gt;Multi-file changes, exploratory refactors&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Agent&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Highest&lt;/td&gt;
      &lt;td&gt;New features, multi-file refactors, test generation across a module&lt;/td&gt;
      &lt;td&gt;Simple renames, one-line fixes, things you could type faster&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Rules of thumb:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;If you can describe the change in under 10 words, inline or chat&lt;/li&gt;
  &lt;li&gt;If it touches 1-2 files with clear scope, chat or edit mode&lt;/li&gt;
  &lt;li&gt;If it touches 3+ files or requires exploration, agent mode&lt;/li&gt;
  &lt;li&gt;If you’re not sure what you want yet, start with chat to explore, then switch to agent for implementation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;common-pitfalls&quot;&gt;Common Pitfalls&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Pitfall&lt;/th&gt;
      &lt;th&gt;Fix&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Instruction files full of generic advice&lt;/td&gt;
      &lt;td&gt;Strip to project-specific constraints only&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;One massive instruction file for everything&lt;/td&gt;
      &lt;td&gt;Use path-specific instructions and move procedures to skills&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Detailed procedures in instructions that rarely apply&lt;/td&gt;
      &lt;td&gt;Move to skills (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/&lt;/code&gt;) - AI loads them only when relevant&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Vague agent prompts that trigger exploration&lt;/td&gt;
      &lt;td&gt;State the goal, constraints, and files explicitly&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Leaving build artifacts in workspace&lt;/td&gt;
      &lt;td&gt;Maintain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.gitignore&lt;/code&gt; for context exclusion&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Using agent mode for trivial changes&lt;/td&gt;
      &lt;td&gt;Match mode to complexity - inline/chat for small stuff&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Never reviewing/trimming instruction files&lt;/td&gt;
      &lt;td&gt;Audit monthly - remove what isn’t earning its tokens&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Pasting code into chat instead of referencing files&lt;/td&gt;
      &lt;td&gt;Let the agent read files directly - it has that capability&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Too many MCP servers connected at once&lt;/td&gt;
      &lt;td&gt;Disconnect servers you’re not actively using&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;All tools available on every task&lt;/td&gt;
      &lt;td&gt;Scope tools per prompt file or custom agent&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;quick-reference-token-optimization-checklist&quot;&gt;Quick Reference: Token Optimization Checklist&lt;/h2&gt;

&lt;p&gt;Here’s your action plan:&lt;/p&gt;

&lt;ul class=&quot;task-list&quot;&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Audit instruction files - strip generic advice, keep project-specific constraints&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Create path-specific instructions (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/instructions/&lt;/code&gt;) for distinct areas (tests, API, database)&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Move detailed procedures to skills (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/&lt;/code&gt;) so the AI loads them only when needed&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Create prompt files (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/prompts/&lt;/code&gt;) for repeatable workflows you invoke manually&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Exclude build artifacts and generated files from AI context via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.gitignore&lt;/code&gt;&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Write clear function signatures before implementing bodies&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Use descriptive naming everywhere (it’s free context)&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Reference files by name in agent prompts instead of pasting content&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;State constraints and scope explicitly (“don’t modify X”, “only change Y”)&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Break multi-topic tasks into focused, single-purpose prompts&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Match interaction mode to task complexity&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Manage open tabs intentionally - relevant files open, noise closed&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Disconnect MCP servers you’re not actively using&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Scope MCP tools per prompt file/agent using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tools&lt;/code&gt; field&lt;/li&gt;
  &lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; class=&quot;task-list-item-checkbox&quot; disabled=&quot;disabled&quot; /&gt;Review and trim instruction files monthly&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;Token optimization for your development workflow isn’t about penny-pinching. It’s about signal-to-noise ratio. Every irrelevant token in your context is a relevant token that got pushed out.&lt;/p&gt;

&lt;p&gt;The bottom line:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Use the right layer.&lt;/strong&gt; Instructions for universal rules, skills for specialized procedures the AI activates on demand, prompt files for workflows you trigger manually.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Instruction files are your highest-leverage optimization.&lt;/strong&gt; They ship with every interaction. Make them tight, specific, and scoped.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;How you prompt matters.&lt;/strong&gt; Clear scope, explicit constraints, and file references eliminate wasteful exploration.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Your code IS context.&lt;/strong&gt; Descriptive naming, clean workspaces, and clear structure improve AI suggestions at zero extra cost.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Right-size the interaction.&lt;/strong&gt; Tab-complete for simple, chat for targeted, agent for complex. Don’t use a sledgehammer for a thumbtack.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Less is more.&lt;/strong&gt; Shorter instructions, focused tasks, and clean workspaces consistently outperform verbose, sprawling alternatives.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start with your instruction files. Trim the generic, scope the specific, and notice the difference in your next coding session.&lt;/p&gt;
</content>
   
    <category term="ai" />
   
    <category term="developer-tools" />
   
    <category term="copilot" />
   
    <category term="devops" />
   
    <category term="best-practices" />
   
    <category term="productivity" />
   
 </entry>
 
 <entry>
   <title>GHEC to GHES Migration: A Practical Planning Guide</title>
   <link href="https://www.dxrf.com/blog/2026/05/05/ghec-to-ghes-migration-considerations/"/>
   <updated>2026-05-05T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/05/05/ghec-to-ghes-migration-considerations</id>
   <excerpt type="html">A comprehensive reference for planning a migration from GitHub Enterprise Cloud to GitHub Enterprise Server, covering feature parity, identity, Actions, infrastructure, and the items that are easy to overlook.</excerpt>
   <content type="html">&lt;p&gt;There are good reasons to migrate from GitHub Enterprise Cloud (GHEC) to GitHub Enterprise Server (GHES) - regulatory requirements, data residency mandates, or a shift in hosting strategy. It is a supported path, but it’s more than moving repositories. You’re transitioning from a fully managed platform to one your team owns and operates.&lt;/p&gt;

&lt;p&gt;Beyond the repo migration itself, there’s a broader set of considerations around identity, secrets, Actions runners, infrastructure, and integrations that all need planning. This post is a reference guide covering those considerations, organized by area, so you can build a complete migration plan.&lt;/p&gt;

&lt;h2 id=&quot;feature-and-version-parity&quot;&gt;Feature and Version Parity&lt;/h2&gt;

&lt;p&gt;GHES releases trail GHEC, so it’s important to check the &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/release-notes&quot;&gt;GHES release notes&lt;/a&gt; to confirm which features are available on your target version. Some GHEC-only features (like Copilot-managed networking and metered billing features) may not be available on GHES.&lt;/p&gt;

&lt;p&gt;Some REST and GraphQL API endpoints also behave differently or are absent on GHES. Review the &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/rest&quot;&gt;REST API docs&lt;/a&gt; filtered by GHES version to confirm your existing tooling and automation will work as expected.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/configuring-settings/configuring-github-connect/about-github-connect&quot;&gt;GitHub Connect&lt;/a&gt; can bridge some gaps by enabling unified search, unified contributions, and server statistics. It does require outbound connectivity from GHES to GHEC, so verify that works for your network environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommended step:&lt;/strong&gt; Inventory the GHEC features your teams depend on and validate them against your target GHES version before committing to the migration.&lt;/p&gt;

&lt;h2 id=&quot;migration-tooling-what-gei-covers&quot;&gt;Migration Tooling: What GEI Covers&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.github.com/en/migrations/using-github-enterprise-importer&quot;&gt;GitHub Enterprise Importer (GEI)&lt;/a&gt; is the supported migration path. It handles repos, PRs, and issues well, and the full list of supported data is in the &lt;a href=&quot;https://docs.github.com/en/migrations/using-github-enterprise-importer/understanding-github-enterprise-importer/migration-support-for-github-enterprise-importer&quot;&gt;migration support matrix&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Items that require separate handling (not migrated by GEI):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Webhooks&lt;/li&gt;
  &lt;li&gt;Deploy keys&lt;/li&gt;
  &lt;li&gt;Repository rulesets (branch protection rules migrate with caveats)&lt;/li&gt;
  &lt;li&gt;GitHub Actions workflow run history&lt;/li&gt;
  &lt;li&gt;Discussions&lt;/li&gt;
  &lt;li&gt;Stars, watchers, and fork relationships&lt;/li&gt;
  &lt;li&gt;Repository-level GitHub Apps installations&lt;/li&gt;
  &lt;li&gt;Dependabot alerts and settings&lt;/li&gt;
  &lt;li&gt;Code scanning alerts and configurations&lt;/li&gt;
  &lt;li&gt;Secret scanning alerts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these items needs a remediation plan. For migrations involving many repos, it’s worth scripting or automating the recreation of these items.&lt;/p&gt;

&lt;h2 id=&quot;identity-and-access&quot;&gt;Identity and Access&lt;/h2&gt;

&lt;p&gt;Identity management is typically the area that requires the most planning in a GHEC-to-GHES migration.&lt;/p&gt;

&lt;h3 id=&quot;commit-attribution&quot;&gt;Commit Attribution&lt;/h3&gt;

&lt;p&gt;User identities change when moving between platforms. GEI creates &lt;a href=&quot;https://docs.github.com/en/migrations/using-github-enterprise-importer/completing-your-migration-with-github-enterprise-importer/reclaiming-mannequins-for-github-enterprise-importer&quot;&gt;mannequins&lt;/a&gt; for unmapped users that need to be reclaimed post-migration. Historical &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git blame&lt;/code&gt; and contribution graphs will be affected unless email addresses match between the two platforms.&lt;/p&gt;

&lt;h3 id=&quot;authentication&quot;&gt;Authentication&lt;/h3&gt;

&lt;p&gt;GHES requires its own authentication configuration. The options are &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/managing-iam/using-saml-for-enterprise-iam/about-saml-for-enterprise-iam&quot;&gt;SAML SSO&lt;/a&gt;, &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/managing-iam/using-ldap-for-enterprise-iam/using-ldap&quot;&gt;LDAP&lt;/a&gt;, or &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/managing-iam/using-built-in-authentication/configuring-built-in-authentication&quot;&gt;built-in auth&lt;/a&gt;. GHEC IdP configuration doesn’t carry over, so plan for a fresh setup.&lt;/p&gt;

&lt;h3 id=&quot;tokens-keys-and-apps&quot;&gt;Tokens, Keys, and Apps&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;PATs, SSH keys, GPG keys&lt;/strong&gt;: Users must regenerate tokens and re-add keys against the new GHES instance. Existing GHEC tokens won’t work.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;GitHub Apps and OAuth Apps&lt;/strong&gt;: Must be re-registered on GHES. Client IDs and secrets change. Every third-party integration needs reconfiguration.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Team and org structure&lt;/strong&gt;: Org and team membership doesn’t migrate automatically. Plan to script this via the API or use GEI’s org-level migration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;enterprise-managed-users-emus&quot;&gt;Enterprise Managed Users (EMUs)&lt;/h3&gt;

&lt;p&gt;GHES doesn’t have EMUs - it uses its own IAM model. If you’re currently using EMUs on GHEC, the approach to user lifecycle management will be on you to manage with the LDAP/SAML/SCIM configurations.&lt;/p&gt;

&lt;h2 id=&quot;secrets-packages-and-artifacts&quot;&gt;Secrets, Packages, and Artifacts&lt;/h2&gt;

&lt;p&gt;These items all require manual handling during the migration.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Secrets&lt;/strong&gt;: Actions secrets, Dependabot secrets, and Codespaces secrets are not migrated by GEI. Inventory and re-create them on GHES. Using a secrets vault (HashiCorp Vault, Azure Key Vault) as the canonical source simplifies this and makes it repeatable.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;GitHub Packages&lt;/strong&gt;: Packages don’t migrate. You’ll need to re-publish or mirror them. If you use GHCR (Container Registry), plan to retag and push images to the GHES registry. See the &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/packages/getting-started-with-github-packages-for-your-enterprise&quot;&gt;GHES Packages docs&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Releases and release assets&lt;/strong&gt;: GEI migrates releases but verify asset integrity post-migration.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Actions artifacts&lt;/strong&gt;: Workflow run artifacts and logs don’t migrate. If you need historical artifacts, archive them before migration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;github-actions&quot;&gt;GitHub Actions&lt;/h2&gt;

&lt;p&gt;Actions typically requires the most infrastructure planning in a GHEC-to-GHES migration.&lt;/p&gt;

&lt;h3 id=&quot;self-hosted-runners-are-required&quot;&gt;Self-Hosted Runners Are Required&lt;/h3&gt;

&lt;p&gt;GHES doesn’t include GitHub-hosted runners, so you’ll need to provision and manage &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners&quot;&gt;self-hosted runners&lt;/a&gt;. Key areas to plan for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Runner groups and labels&lt;/strong&gt; to match existing workflow targeting&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ephemeral vs. persistent&lt;/strong&gt; runner strategy&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Autoscaling&lt;/strong&gt; with &lt;a href=&quot;https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/about-actions-runner-controller&quot;&gt;Actions Runner Controller (ARC)&lt;/a&gt; or a custom solution&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Network egress&lt;/strong&gt; for runners to pull dependencies&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;actions-availability&quot;&gt;Actions Availability&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;actions/*&lt;/code&gt; and marketplace actions need to be accessible from GHES. The two options are:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Synced via &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/configuring-settings/configuring-github-connect/enabling-automatic-access-to-githubcom-actions-using-github-connect&quot;&gt;GitHub Connect actions sharing&lt;/a&gt;, OR&lt;/li&gt;
  &lt;li&gt;Manually mirrored or vendored into the GHES instance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Workflows that reference &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;uses: actions/checkout@v4&lt;/code&gt; will fail if the action isn’t accessible on GHES. Audit all action references in your workflows before migration to identify what needs to be synced or mirrored.&lt;/p&gt;

&lt;h3 id=&quot;storage&quot;&gt;Storage&lt;/h3&gt;

&lt;p&gt;GHES requires external blob storage (S3, Azure Blob, MinIO) for Actions logs, artifacts, and caches. See &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/managing-github-actions-for-your-enterprise/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server&quot;&gt;enabling Actions on GHES&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;reusable-workflows-and-composite-actions&quot;&gt;Reusable Workflows and Composite Actions&lt;/h3&gt;

&lt;p&gt;If these reference GHEC-hosted repos, they need to move too. Walk the full dependency tree of your workflows, not just the top-level files.&lt;/p&gt;

&lt;h2 id=&quot;infrastructure-and-operations&quot;&gt;Infrastructure and Operations&lt;/h2&gt;

&lt;p&gt;With GHES, your team takes on platform operations. Here are the key areas to plan for.&lt;/p&gt;

&lt;h3 id=&quot;compute&quot;&gt;Compute&lt;/h3&gt;

&lt;p&gt;Follow the &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/installing-your-enterprise/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-your-platform&quot;&gt;GHES hardware recommendations&lt;/a&gt;. Minimum specs vary by user count. Be generous with CPU and RAM, especially with Actions enabled.&lt;/p&gt;

&lt;h3 id=&quot;storage-1&quot;&gt;Storage&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Root disk plus data disk (SSD strongly recommended, NFS not supported for the data volume)&lt;/li&gt;
  &lt;li&gt;External blob storage for Actions, Packages, and Dependabot&lt;/li&gt;
  &lt;li&gt;Plan for growth - repos, LFS objects, and packages accumulate over time&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;high-availability&quot;&gt;High Availability&lt;/h3&gt;

&lt;p&gt;GHES supports &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/monitoring-and-managing-your-instance/configuring-high-availability/about-high-availability-configuration&quot;&gt;HA replica configuration&lt;/a&gt;. It’s much easier to configure HA from the start than to add it later, so factor this into the initial deployment plan.&lt;/p&gt;

&lt;h3 id=&quot;backup-and-dr&quot;&gt;Backup and DR&lt;/h3&gt;

&lt;p&gt;Configure &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/backing-up-and-restoring-your-instance/configuring-backups-on-your-instance&quot;&gt;GitHub Enterprise Server Backup Utilities&lt;/a&gt; on a separate host. Validate restores as part of the deployment process and determine your RPO and RTO before going live.&lt;/p&gt;

&lt;h3 id=&quot;upgrades&quot;&gt;Upgrades&lt;/h3&gt;

&lt;p&gt;You own the upgrade lifecycle now. GHES releases roughly quarterly, and you need to plan maintenance windows. See the &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/upgrading-your-instance/preparing-to-upgrade/overview-of-the-upgrade-process&quot;&gt;upgrade overview&lt;/a&gt;. Hotpatches help, but feature upgrades require downtime.&lt;/p&gt;

&lt;h3 id=&quot;monitoring&quot;&gt;Monitoring&lt;/h3&gt;

&lt;p&gt;Set up &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/monitoring-and-managing-your-instance/monitoring-your-instance/configuring-collectd-for-your-instance&quot;&gt;monitoring with collectd&lt;/a&gt; and external log forwarding. On GHEC this is managed for you, so on GHES you’ll want monitoring in place from the start.&lt;/p&gt;

&lt;h3 id=&quot;network&quot;&gt;Network&lt;/h3&gt;

&lt;p&gt;GHES needs specific &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/configuring-settings/configuring-network-settings/network-ports&quot;&gt;network ports&lt;/a&gt; open. Plan for firewall rules, DNS, TLS certificates, and potentially a load balancer for HA.&lt;/p&gt;

&lt;h2 id=&quot;security-features&quot;&gt;Security Features&lt;/h2&gt;

&lt;h3 id=&quot;advanced-security-licensing&quot;&gt;Advanced Security Licensing&lt;/h3&gt;

&lt;p&gt;GHAS features (code scanning, secret scanning, Dependabot) require a separate license on GHES. Confirm your GHES license includes &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/managing-code-security/managing-github-advanced-security-for-your-enterprise/enabling-github-advanced-security-for-your-enterprise&quot;&gt;GitHub Advanced Security&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;configurations-that-dont-carry-over&quot;&gt;Configurations That Don’t Carry Over&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Code scanning configs&lt;/strong&gt;: CodeQL analysis configurations in workflows port over, but any GHEC-side default setup configurations need to be re-enabled.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Audit log streaming&lt;/strong&gt;: GHEC’s audit log streaming to SIEM tools needs to be reconfigured for GHES’s &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/about-the-audit-log-for-your-enterprise&quot;&gt;audit log&lt;/a&gt; and &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/monitoring-and-managing-your-instance/monitoring-your-instance/log-forwarding&quot;&gt;log forwarding&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;IP allow lists&lt;/strong&gt;: GHEC IP allow lists don’t apply. Now you handle this at the network and firewall layer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;copilot&quot;&gt;Copilot&lt;/h2&gt;

&lt;p&gt;Copilot Business and Enterprise work with GHES but require &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/configuring-settings/configuring-github-connect/enabling-github-connect&quot;&gt;GitHub Connect&lt;/a&gt; and specific configuration. Certain Copilot features (like Copilot Chat on github.com) are GHEC-only.&lt;/p&gt;

&lt;p&gt;Org-level Copilot policies need to be reconfigured on the GHES instance. Don’t assume settings carry over.&lt;/p&gt;

&lt;h2 id=&quot;commonly-overlooked-items&quot;&gt;Commonly Overlooked Items&lt;/h2&gt;

&lt;p&gt;These items are easy to miss during planning but worth reviewing early:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Item&lt;/th&gt;
      &lt;th&gt;What to Know&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;GitHub Pages&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Supported, but it’s a subdomain of your GHES hostname. Custom domain setup differs from GHEC.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Rulesets&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;If you’ve adopted rulesets on GHEC, verify GHES version support. Rulesets were added in GHES 3.11+.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Webhooks&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;All org and repo webhooks must be recreated. Inventory them before migration.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;LFS objects&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Should migrate with GEI, but verify. LFS storage on GHES is local disk.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Pre-receive hooks&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;GHES supports &lt;a href=&quot;https://docs.github.com/en/enterprise-server@latest/admin/enforcing-policies/enforcing-policy-with-pre-receive-hooks/about-pre-receive-hooks&quot;&gt;pre-receive hooks&lt;/a&gt; and GHEC doesn’t. This is actually an advantage you can leverage.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Projects (V2)&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Support on GHES varies by version. Check your target release.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;recommended-approach&quot;&gt;Recommended Approach&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Inventory first&lt;/strong&gt;: Build a spreadsheet covering repos, secrets, webhooks, apps, teams, and runner configurations. A complete inventory makes the rest of the planning much smoother.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Dry-run on staging&lt;/strong&gt;: Stand up a staging GHES instance and run a full trial migration. Use GEI’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--queue-only&lt;/code&gt; mode for large orgs.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Audit the migration log&lt;/strong&gt;: GEI produces detailed logs. Review them thoroughly - warnings can surface items that need attention before cutover.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Validate before cutover&lt;/strong&gt;: Verify commit history, PR state, issue links, Actions workflows, and package availability on staging before migrating production.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Script the gaps&lt;/strong&gt;: Automate the recreation of webhooks, secrets, team memberships, and app registrations. This makes the process repeatable and reduces manual error.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Communicate the timeline&lt;/strong&gt;: Give teams advance notice. PATs need regenerating, SSH keys need re-adding, and bookmarks need updating. Clear communication helps the transition go smoothly.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;GEI handles the core migration well&lt;/strong&gt;, but there’s a clear list of items it doesn’t cover. Plan for those gaps early.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Identity needs the most attention.&lt;/strong&gt; Mannequin reclamation, auth reconfiguration, and token regeneration affect every user.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Actions requires the most infrastructure work.&lt;/strong&gt; Self-hosted runners, action mirroring, and blob storage are net-new operational responsibilities.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Platform operations are now yours.&lt;/strong&gt; Upgrades, monitoring, HA, and backups need staffing and process from day one.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A staging dry-run is essential.&lt;/strong&gt; A full trial migration surfaces issues before they affect production.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The migration is absolutely doable with the right planning. The repos themselves move in hours. The broader ecosystem - identity, integrations, infrastructure - takes longer and benefits from a thorough, phased approach.&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="ghes" />
   
    <category term="ghec" />
   
    <category term="migration" />
   
    <category term="devops" />
   
    <category term="infrastructure" />
   
    <category term="security" />
   
    <category term="best-practices" />
   
 </entry>
 
 <entry>
   <title>GitHub Actions Runner Scaling Patterns: GitHub-Hosted vs ARC</title>
   <link href="https://www.dxrf.com/blog/2026/04/29/github-actions-runner-scaling-patterns/"/>
   <updated>2026-04-29T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/04/29/github-actions-runner-scaling-patterns</id>
   <excerpt type="html">Scaling GitHub Actions runners requires different architectural patterns depending on whether you&apos;re using GitHub-hosted runners or Actions Runner Controller. Here&apos;s why the approaches are essentially opposite—and how to get each one right.</excerpt>
   <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;When organizations start scaling GitHub Actions, they inevitably hit the question: how do we organize and scale our runners effectively? The answer depends entirely on which runner infrastructure you’re using—and here’s the fun part: the best practices are essentially backwards from each other.&lt;/p&gt;

&lt;p&gt;If you’re using GitHub-hosted runners (including larger runners with private networking), the pattern is: &lt;strong&gt;create runners, organize them into groups, and direct workflows to the appropriate group&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you’re using Actions Runner Controller (ARC) on Kubernetes, the pattern is: &lt;strong&gt;create multiple clusters with the same runner scale set name but different runner groups&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let’s break down why these patterns exist and how to implement each one correctly.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;understanding-the-core-difference&quot;&gt;Understanding the Core Difference&lt;/h2&gt;

&lt;p&gt;The fundamental distinction comes down to where scaling happens and who controls it.&lt;/p&gt;

&lt;h3 id=&quot;github-hosted-runners&quot;&gt;GitHub-Hosted Runners&lt;/h3&gt;

&lt;p&gt;GitHub manages the infrastructure. You define runner configurations, set concurrency limits, and organize runners into groups. GitHub handles provisioning, scaling, and cleanup. Your job is to direct workflows to the right resources. See &lt;a href=&quot;https://docs.github.com/en/actions/how-tos/manage-runners/larger-runners/manage-larger-runners&quot;&gt;Managing larger runners&lt;/a&gt; for the full configuration reference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scaling model&lt;/strong&gt;: GitHub scales runners based on demand within your configured limits. You control access and routing through runner groups.&lt;/p&gt;

&lt;h3 id=&quot;actions-runner-controller-arc&quot;&gt;Actions Runner Controller (ARC)&lt;/h3&gt;

&lt;p&gt;You manage the infrastructure. ARC runs on your Kubernetes clusters and provisions runner pods on demand. You control everything: cluster sizing, node pools, pod specs, and autoscaling behavior. See the &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/quickstart-for-actions-runner-controller&quot;&gt;ARC quickstart&lt;/a&gt; to get up and running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scaling model&lt;/strong&gt;: You scale by deploying more clusters or increasing node capacity. ARC handles pod lifecycle within each cluster.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;pattern-1-github-hosted-runners&quot;&gt;Pattern 1: GitHub-Hosted Runners&lt;/h2&gt;

&lt;h3 id=&quot;the-architecture&quot;&gt;The Architecture&lt;/h3&gt;

&lt;p&gt;With GitHub-hosted runners, the scaling pattern follows a top-down approach:&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;Enterprise
└── Runner Groups (access control layer)
    └── Runners (capacity layer)
        └── Workflows (consumption layer)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You create runners with specific configurations (OS, size, software, networking), assign them to runner groups, and grant organizations/repositories access to those groups. Workflows then target groups by name.&lt;/p&gt;

&lt;h3 id=&quot;best-practice-direct-workflows-to-runner-groups&quot;&gt;Best Practice: Direct Workflows to Runner Groups&lt;/h3&gt;

&lt;p&gt;The key insight: &lt;strong&gt;workflows should target runner groups, not individual runner names&lt;/strong&gt;.&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# Good: Target the runner group&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production-linux-runners&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Also good: Target group with labels&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;production-linux-runners&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;labels&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;nv&quot;&gt;ubuntu-latest&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;4-core&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Why runner groups instead of runner names?&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;: Add or remove runners from a group without changing workflows&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Access control&lt;/strong&gt;: Manage which orgs/repos can use which resources&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Failover&lt;/strong&gt;: If one runner is busy, jobs route to another in the group&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Maintenance&lt;/strong&gt;: Take runners offline for updates without workflow changes&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;organizing-runner-groups&quot;&gt;Organizing Runner Groups&lt;/h3&gt;

&lt;p&gt;Structure your groups around access patterns and capabilities. See &lt;a href=&quot;https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/manage-access&quot;&gt;Managing access to self-hosted runners using groups&lt;/a&gt; for setup instructions - the same runner group concepts apply to both GitHub-hosted larger runners and self-hosted runners.&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;Enterprise Runner Groups
├── general-purpose (all orgs, public repos)
├── private-network (selected orgs, internal resources)
├── high-compute (selected repos, large builds)
└── production-deploy (restricted repos, deployment access)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Each group can contain multiple runners with the same or different configurations. The group is your unit of access control; the runners are your unit of capacity.&lt;/p&gt;

&lt;h3 id=&quot;scaling-github-hosted-runners&quot;&gt;Scaling GitHub-Hosted Runners&lt;/h3&gt;

&lt;p&gt;To scale capacity:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Increase concurrency limits&lt;/strong&gt; on existing runners - see &lt;a href=&quot;https://docs.github.com/en/actions/how-tos/manage-runners/larger-runners/manage-larger-runners#configuring-autoscaling-for-larger-runners&quot;&gt;Configuring autoscaling for larger runners&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Add more runners&lt;/strong&gt; to existing groups&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Create new groups&lt;/strong&gt; for new access patterns or capabilities&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The scaling lever is always on the runner/group side, not the workflow side.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;pattern-2-actions-runner-controller-arc&quot;&gt;Pattern 2: Actions Runner Controller (ARC)&lt;/h2&gt;

&lt;h3 id=&quot;the-architecture-1&quot;&gt;The Architecture&lt;/h3&gt;

&lt;p&gt;With ARC, the scaling pattern is essentially inverted:&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;Kubernetes Clusters (capacity layer)
└── Runner Scale Sets (identity layer)
    └── Runner Groups (access control layer)
        └── Workflows (consumption layer)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here’s the critical difference: you create &lt;strong&gt;multiple clusters with the same runner scale set name&lt;/strong&gt; but register them to &lt;strong&gt;different runner groups&lt;/strong&gt;.&lt;/p&gt;

&lt;h3 id=&quot;why-this-pattern&quot;&gt;Why This Pattern?&lt;/h3&gt;

&lt;p&gt;ARC’s scaling is tied to Kubernetes cluster capacity. Each cluster has:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Node limits (how many VMs can run)&lt;/li&gt;
  &lt;li&gt;Pod density limits (runners per node)&lt;/li&gt;
  &lt;li&gt;Resource constraints (CPU, memory per runner)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you hit a cluster’s capacity, you can’t just “add more runners” like you can with GitHub-hosted. You need to add more clusters or scale node capacity. But here’s the problem: if every cluster has a uniquely named scale set, your workflows need to know which cluster to target.&lt;/p&gt;

&lt;p&gt;The solution: &lt;strong&gt;same scale set name across clusters, different runner groups&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is explicitly supported in the &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/actions/how-tos/manage-runners/use-actions-runner-controller/deploy-runner-scale-sets#high-availability-and-automatic-failover&quot;&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Runner scale set names are unique within the runner group they belong to. If you want to deploy multiple runner scale sets with the same name, they must belong to different runner groups.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;best-practice-consistent-names-different-groups&quot;&gt;Best Practice: Consistent Names, Different Groups&lt;/h3&gt;

&lt;p&gt;Using the official Helm chart configuration (full options in &lt;a href=&quot;https://github.com/actions/actions-runner-controller/blob/master/charts/gha-runner-scale-set/values.yaml&quot;&gt;values.yaml&lt;/a&gt;):&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# Cluster A - Region: East US (values-east.yaml)&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;runnerScaleSetName&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;arc-linux-runners&quot;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;runnerGroup&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;arc-cluster-east&quot;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;githubConfigUrl&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;https://github.com/your-org&quot;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;maxRunners&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;minRunners&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;containers&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;runner&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/actions/actions-runner:latest&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;resources&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;limits&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;cpu&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;2&quot;&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;memory&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;4Gi&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-yaml 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;# Cluster B - Region: West US (values-west.yaml)&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;runnerScaleSetName&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;arc-linux-runners&quot;&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# Same name!&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;runnerGroup&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;arc-cluster-west&quot;&lt;/span&gt;          &lt;span class=&quot;c1&quot;&gt;# Different group!&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;githubConfigUrl&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;https://github.com/your-org&quot;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;maxRunners&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;minRunners&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;containers&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;runner&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/actions/actions-runner:latest&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;resources&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;limits&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;cpu&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;2&quot;&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;memory&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;4Gi&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Deploy each with Helm:&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;&lt;span class=&quot;c&quot;&gt;# Cluster A&lt;/span&gt;
helm &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;arc-linux-runners &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--namespace&lt;/span&gt; arc-runners &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--values&lt;/span&gt; values-east.yaml &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set

&lt;span class=&quot;c&quot;&gt;# Cluster B&lt;/span&gt;
helm &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;arc-linux-runners &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--namespace&lt;/span&gt; arc-runners &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--values&lt;/span&gt; values-west.yaml &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;how-it-works-job-distribution&quot;&gt;How It Works: Job Distribution&lt;/h3&gt;

&lt;p&gt;When both scale sets are online, jobs assigned to either runner group will be distributed arbitrarily (assignment race). You cannot configure the job assignment algorithm—GitHub handles this. If one cluster goes down, the scale set in the other cluster continues acquiring jobs without any intervention.&lt;/p&gt;

&lt;p&gt;This gives you:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;High availability&lt;/strong&gt;: Cluster failure doesn’t stop your pipelines&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Geographic distribution&lt;/strong&gt;: Run jobs closer to your resources&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Capacity headroom&lt;/strong&gt;: Scale by adding clusters, not reconfiguring workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;how-workflows-target-arc-runners&quot;&gt;How Workflows Target ARC Runners&lt;/h3&gt;

&lt;p&gt;With this pattern, workflows can target either:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option A: Target a specific cluster via runner group&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;arc-cluster-east&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;labels&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;nv&quot;&gt;self-hosted&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;linux&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;x64&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Option B: Target the scale set name directly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If both runner groups have access to the same repos, you can use the scale set name in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;runs-on&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;arc-linux-runners&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Jobs will be picked up by whichever cluster has capacity first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option C: Create a parent runner group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a runner group at the enterprise level that includes both regional groups, then target that:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;arc-all-regions&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;scaling-arc&quot;&gt;Scaling ARC&lt;/h3&gt;

&lt;p&gt;To scale capacity:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Adjust &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;maxRunners&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minRunners&lt;/code&gt;&lt;/strong&gt; in your Helm values - see &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/actions/how-tos/manage-runners/use-actions-runner-controller/deploy-runner-scale-sets#setting-the-maximum-and-minimum-number-of-runners&quot;&gt;Setting the maximum and minimum number of runners&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Scale Kubernetes nodes&lt;/strong&gt; in existing clusters&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Deploy additional clusters&lt;/strong&gt; with the same scale set name (different runner group) - see &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/actions/how-tos/manage-runners/use-actions-runner-controller/deploy-runner-scale-sets#high-availability-and-automatic-failover&quot;&gt;High availability and automatic failover&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Add runner groups to the same parent group&lt;/strong&gt; for unified workflow targeting&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The scaling lever is on the infrastructure side (clusters), not the workflow side.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;comparing-the-patterns&quot;&gt;Comparing the Patterns&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Aspect&lt;/th&gt;
      &lt;th&gt;GitHub-Hosted&lt;/th&gt;
      &lt;th&gt;ARC&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Scaling unit&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Runner/concurrency&lt;/td&gt;
      &lt;td&gt;Kubernetes cluster + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;maxRunners&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Identity granularity&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Individual runner&lt;/td&gt;
      &lt;td&gt;Scale set name (unique per group)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Access control&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Runner groups&lt;/td&gt;
      &lt;td&gt;Runner groups&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Workflow targeting&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Group name (recommended)&lt;/td&gt;
      &lt;td&gt;Group name or scale set name&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Adding capacity&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Add runners to group&lt;/td&gt;
      &lt;td&gt;Add clusters with same scale set name&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Who manages infra&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;GitHub&lt;/td&gt;
      &lt;td&gt;You&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Autoscaling&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Automatic (GitHub-managed)&lt;/td&gt;
      &lt;td&gt;Listener-based (within &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minRunners&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;maxRunners&lt;/code&gt;)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;HA pattern&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Multiple runners in group&lt;/td&gt;
      &lt;td&gt;Same name, different groups across clusters&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;mental-model&quot;&gt;Mental Model&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;GitHub-hosted&lt;/strong&gt;: Think of runner groups as pools. You fill pools with runners. Workflows draw from pools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ARC&lt;/strong&gt;: Think of clusters as capacity zones. You name zones consistently. Runner groups aggregate zones. Workflows target groups.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;common-anti-patterns&quot;&gt;Common Anti-Patterns&lt;/h2&gt;

&lt;h3 id=&quot;github-hosted-anti-patterns&quot;&gt;GitHub-Hosted Anti-Patterns&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;❌ Targeting specific runner names in workflows&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# Bad: Coupled to specific runner&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-specific-runner-name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This creates brittleness. If that runner goes offline, jobs fail. Use groups instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❌ One runner per group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creates unnecessary management overhead and eliminates failover benefits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❌ Ignoring concurrency limits&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Queued jobs aren’t scaling—they’re waiting. Monitor queue depth and increase concurrency.&lt;/p&gt;

&lt;h3 id=&quot;arc-anti-patterns&quot;&gt;ARC Anti-Patterns&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;❌ Unique scale set names per cluster without runner groups&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# Bad: Now workflows need to know cluster details&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# Cluster A values.yaml&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;runnerScaleSetName&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;linux-runners-east&quot;&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# Cluster B values.yaml  &lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;runnerScaleSetName&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;linux-runners-west&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This leaks infrastructure details into workflows and complicates scaling. When you add Cluster C, you have to update workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❌ Same runner group for multiple scale sets with the same name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Per the docs: “Runner scale set names are unique within the runner group they belong to.” You’ll get registration conflicts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❌ Single cluster for all workloads&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You’ll hit Kubernetes limits (nodes, pods, API server) before you hit GitHub’s job limits. Plan for multi-cluster from the start.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❌ Ignoring &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;maxRunners&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minRunners&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;maxRunners&lt;/code&gt;, a burst of jobs can overwhelm your cluster. Without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;minRunners&lt;/code&gt;, cold starts delay job pickup. Tune these based on your workload patterns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;❌ No runner groups, just labels&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Labels work for routing but don’t give you the access control granularity of groups. Use runner groups to control which orgs/repos can use which scale sets.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;hybrid-scenarios&quot;&gt;Hybrid Scenarios&lt;/h2&gt;

&lt;p&gt;Many enterprises use both GitHub-hosted and ARC runners. The patterns still apply—just keep them separate:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;github-hosted-builders&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# GitHub-hosted&lt;/span&gt;
  
  &lt;span class=&quot;na&quot;&gt;deploy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;arc-production-cluster&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;# ARC in private network&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Use GitHub-hosted for general compute and ARC for specialized workloads requiring:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Private network access&lt;/li&gt;
  &lt;li&gt;Custom hardware (GPUs, ARM)&lt;/li&gt;
  &lt;li&gt;Specific compliance requirements&lt;/li&gt;
  &lt;li&gt;Cost optimization at scale&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a best practice from the &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/actions/how-tos/manage-runners/use-actions-runner-controller/deploy-runner-scale-sets#using-arc-across-organizations&quot;&gt;ARC documentation&lt;/a&gt;: create a unique namespace for each organization, or even each runner scale set, to maximize isolation and security.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;takeaways&quot;&gt;Takeaways&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;GitHub-hosted&lt;/strong&gt;: Create runners, organize into groups, target groups from workflows. Scale by adding runners or increasing concurrency.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ARC&lt;/strong&gt;: Create clusters with consistent scale set names, assign to different runner groups, target groups from workflows. Scale by adding clusters.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Both patterns&lt;/strong&gt;: Runner groups are your access control and routing layer. Use them consistently.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Key insight&lt;/strong&gt;: ARC scale set names must be unique &lt;em&gt;within a runner group&lt;/em&gt;, not globally. This enables the multi-cluster HA pattern.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Avoid&lt;/strong&gt;: Coupling workflows to specific runner names or infrastructure details. Let groups abstract the underlying capacity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The patterns are opposite because the scaling models are opposite. GitHub-hosted scales within a managed platform; ARC scales across your managed clusters. Once you internalize this difference, the best practices make sense.&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="actions" />
   
    <category term="runners" />
   
    <category term="kubernetes" />
   
    <category term="arc" />
   
    <category term="scaling" />
   
    <category term="devops" />
   
 </entry>
 
 <entry>
   <title>Hacking the Data Bus in a Chinese Solar Generator</title>
   <link href="https://www.dxrf.com/blog/2026/04/28/hacking-the-data-bus-in-a-chinese-solar-generator/"/>
   <updated>2026-04-28T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/04/28/hacking-the-data-bus-in-a-chinese-solar-generator</id>
   <excerpt type="html">How we tapped the internal RS485 bus in a GRECELL H1200, decoded Modbus RTU traffic, and pulled real telemetry into Home Assistant.</excerpt>
   <content type="html">&lt;p&gt;I built an off-grid roadside camera relay for our neighborhood, and I needed one thing that the power station did not provide: data. The GRECELL H1200 had no app, no API, no Bluetooth, and no cloud integration. Just an LCD. Good enough for camping. Not good enough when you want proactive alerts before your cameras go dark.&lt;/p&gt;

&lt;p&gt;So I did what any reasonable engineer does after a Monster and a bad idea: opened it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/grecell_unit.jpeg&quot; alt=&quot;Inside the GRECELL H1200&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This is the story of how that turned into a full reverse-engineering rabbit hole.&lt;/p&gt;

&lt;h2 id=&quot;why-this-started&quot;&gt;Why This Started&lt;/h2&gt;

&lt;p&gt;Here is the practical problem. I had a remote camera system running from solar, and I needed confidence that power would hold overnight, through cloudy days, and through weather swings. The H1200 could show status on its built-in LCD, but I needed those metrics in Home Assistant so I could alert, trend, and automate.&lt;/p&gt;

&lt;p&gt;I wanted:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Pack voltage and current&lt;/li&gt;
  &lt;li&gt;Charge and load power&lt;/li&gt;
  &lt;li&gt;Output state flags&lt;/li&gt;
  &lt;li&gt;Temperatures&lt;/li&gt;
  &lt;li&gt;A reliable SOC estimate for alerting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words, I wanted operational telemetry, not a periodic walk to the mailbox and a squint at tiny digits.&lt;/p&gt;

&lt;h2 id=&quot;the-first-obvious-attempt-debug-headers&quot;&gt;The First Obvious Attempt: Debug Headers&lt;/h2&gt;

&lt;p&gt;Once I opened the case, two headers immediately looked like the easy path:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PJ3&lt;/code&gt; with markings that translated to production data collection&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;J2&lt;/code&gt; marked as flash/programming&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both had RX, TX, 3.3V, GND. It looked like a one-hour UART job.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Narrator: It was not a one-hour UART job.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;pj3-all-promise-no-payload&quot;&gt;PJ3: All Promise, No Payload&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/grecell_pj3.jpeg&quot; alt=&quot;PJ3 header&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I soldered in headers, connected USB-TTL, tested common baud rates, and tried both passive listening and active command probing.&lt;/p&gt;

&lt;p&gt;Nothing.&lt;/p&gt;

&lt;p&gt;The pins were electrically alive, but the firmware looked like it was keeping the port dormant unless some missing companion module is detected at boot. So the most obvious data port was basically a decorative feature in this configuration.&lt;/p&gt;

&lt;h3 id=&quot;j2-a-great-clue-but-still-a-dead-end&quot;&gt;J2: A Great Clue, but Still a Dead End&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/grecell_j2.jpeg&quot; alt=&quot;J2 header&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;J2&lt;/code&gt; was more interesting. At 9600 baud, it repeated frames like this:&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;~25004642E00200FD32\r
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That was a useful clue pointing toward a Pylon/PACE style exchange, but it turned out to be outbound polling from the MCU. I could hear the unit asking questions, but not the BMS answers that contained the actual values.&lt;/p&gt;

&lt;p&gt;So yes, this was progress. Also yes, still a dead end.&lt;/p&gt;

&lt;h2 id=&quot;signal-hunting-mode&quot;&gt;Signal Hunting Mode&lt;/h2&gt;

&lt;p&gt;At that point, I stopped assuming the labeled headers were my path and started following the real electrical path.&lt;/p&gt;

&lt;p&gt;Scope probes went on the board-to-board lines between the main controller and the BMS daughter board.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/grecell_bms_lines.jpeg&quot; alt=&quot;BMS board-to-board lines&quot; /&gt;&lt;/p&gt;

&lt;p&gt;What showed up was textbook differential behavior: one line rising while the other fell, clean mirrored waveforms, and timing that lined up around 9600 baud.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/grecell_diff_signal.jpeg&quot; alt=&quot;Differential signal capture&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That was the moment the project clicked.&lt;/p&gt;

&lt;p&gt;This was not TTL UART. This was RS485.&lt;/p&gt;

&lt;h2 id=&quot;the-breakthrough-tapping-the-actual-bus&quot;&gt;The Breakthrough: Tapping the Actual Bus&lt;/h2&gt;

&lt;p&gt;I swapped to an RS485 adapter and captured traffic directly on that link.&lt;/p&gt;

&lt;p&gt;I expected to confirm Pylon based on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;J2&lt;/code&gt; clue. Instead, I got this:&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;01 03 0F A0 00 29 C5 52
01 03 52 ...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is Modbus RTU. Cleanly.&lt;/p&gt;

&lt;p&gt;The polling loop was stable and repetitive:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Slave address &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x01&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Function &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x03&lt;/code&gt; (Read Holding Registers)&lt;/li&gt;
  &lt;li&gt;Start register &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x0FA0&lt;/code&gt; (4000)&lt;/li&gt;
  &lt;li&gt;Quantity &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0x0029&lt;/code&gt; (41 registers)&lt;/li&gt;
  &lt;li&gt;Valid CRC16 framing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Roughly one full cycle per second.&lt;/p&gt;

&lt;p&gt;At this point, I finally had the right bus, the right protocol, and repeatable captures.&lt;/p&gt;

&lt;p&gt;If you want specs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf&quot;&gt;Modbus Application Protocol Specification&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://modbus.org/docs/Modbus_over_serial_line_V1_02.pdf&quot;&gt;Modbus over Serial Line Specification&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;turning-raw-registers-into-real-metrics&quot;&gt;Turning Raw Registers Into Real Metrics&lt;/h2&gt;

&lt;p&gt;Finding traffic is the easy part. Decoding meaning is where the time goes.&lt;/p&gt;

&lt;p&gt;I used controlled stimulus tests and changed one thing at a time:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Add AC load and watch which registers jump&lt;/li&gt;
  &lt;li&gt;Toggle AC/DC output buttons and track state flips&lt;/li&gt;
  &lt;li&gt;Start charging and identify charge-related fields&lt;/li&gt;
  &lt;li&gt;Observe thermal changes over time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That method quickly confirmed core operational data such as output power, charge power, state flags, and temperatures.&lt;/p&gt;

&lt;p&gt;Then I expanded queries beyond the default polling block and found additional useful values, including pack voltage and signed battery current in extended ranges.&lt;/p&gt;

&lt;h2 id=&quot;the-annoying-twist-soc-was-missing&quot;&gt;The Annoying Twist: SOC Was Missing&lt;/h2&gt;

&lt;p&gt;I burned a lot of time chasing SOC candidates. Several registers looked convincing until load tests exposed the truth: they tracked voltage behavior, not true state-of-charge.&lt;/p&gt;

&lt;p&gt;The practical conclusion was:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The displayed SOC is likely computed inside the main MCU&lt;/li&gt;
  &lt;li&gt;That computed SOC is not published on the Modbus bus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I built SOC estimation using coulomb counting from current over time:&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;SOC(Ah) += current(A) * dt(s) / 3600
SOC(%) = SOC(Ah) / 26.25Ah * 100
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Seed from the LCD at startup, then recalibrate periodically. It is not mathematically perfect forever, but it is more than good enough for operational alerting.&lt;/p&gt;

&lt;h2 id=&quot;what-this-ended-up-looking-like&quot;&gt;What This Ended Up Looking Like&lt;/h2&gt;

&lt;p&gt;Hardware path:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ESP32-S3-Ethernet board&lt;/li&gt;
  &lt;li&gt;MAX485 transceiver&lt;/li&gt;
  &lt;li&gt;Passive tap onto RS485 lines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Software path:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ESPHome &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;modbus_controller&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Home Assistant entities and automations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/grecell_live_monitor.jpeg&quot; alt=&quot;Live telemetry in Home Assistant&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Useful references:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://esphome.io/components/modbus_controller.html&quot;&gt;ESPHome Modbus Controller&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.home-assistant.io/docs/energy/&quot;&gt;Home Assistant Energy Dashboard&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;Here is the lesson in one line: labeled ports are hints, not truth.&lt;/p&gt;

&lt;p&gt;Here is your action plan if you are doing similar reverse engineering:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Start with documented headers, but verify assumptions fast.&lt;/li&gt;
  &lt;li&gt;If data is partial or silent, follow physical traces and inspect waveforms.&lt;/li&gt;
  &lt;li&gt;Confirm physical layer first, protocol second.&lt;/li&gt;
  &lt;li&gt;Decode with controlled stimuli, not guesswork.&lt;/li&gt;
  &lt;li&gt;Validate every claim with repeatable behavior.&lt;/li&gt;
  &lt;li&gt;Plan for missing values by deriving what you need.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The fun part is that this started as a basic “I need battery alerts” task for a roadside camera setup and turned into protocol archaeology. The useful part is that it now produces reliable telemetry every day.&lt;/p&gt;
</content>
   
    <category term="devops" />
   
    <category term="automation" />
   
    <category term="hardware" />
   
    <category term="reverse-engineering" />
   
    <category term="solar" />
   
    <category term="modbus" />
   
    <category term="home-assistant" />
   
 </entry>
 
 <entry>
   <title>Building an Off-Grid Camera Relay System for a Rural Road</title>
   <link href="https://www.dxrf.com/blog/2026/04/28/building-an-offgrid-camera-relay-system/"/>
   <updated>2026-04-28T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/04/28/building-an-offgrid-camera-relay-system</id>
   <excerpt type="html">A practical build guide for a solar-powered roadside camera relay using Ubiquiti gear, proper solar components, and a Raspberry Pi monitoring stack publishing to Home Assistant via MQTT.</excerpt>
   <content type="html">&lt;p&gt;I live out on a dead-end country road. Most days it is quiet, and that is exactly why we like it. The downside is that quiet roads attract people who assume nobody is watching. We started seeing trash dumping, roadside drinking, and other late-night nonsense at the end of the road.&lt;/p&gt;

&lt;p&gt;Our neighbor group agreed we needed visibility, and as the neighborhood nerd, I decided to build a solution for us.&lt;/p&gt;

&lt;p&gt;This post is the story of turning that idea into a working off-grid camera relay - from early design choices through a full hardware revision driven by real-world reliability problems.&lt;/p&gt;

&lt;h2 id=&quot;the-brief-build-a-tiny-remote-site&quot;&gt;The Brief: Build a Tiny Remote Site&lt;/h2&gt;

&lt;p&gt;Here were the non-negotiables:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;No utility power at the install location&lt;/li&gt;
  &lt;li&gt;No trenching new cable&lt;/li&gt;
  &lt;li&gt;Reliable network path back to the house&lt;/li&gt;
  &lt;li&gt;Monitoring so we get alerts before downtime&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last one matters more than people think. A camera that silently died two days ago is basically decorative hardware.&lt;/p&gt;

&lt;h2 id=&quot;picking-the-network-stack&quot;&gt;Picking the Network Stack&lt;/h2&gt;

&lt;p&gt;Most of my gear is already Ubiquiti, so I stayed in that ecosystem and kept management simple.&lt;/p&gt;

&lt;p&gt;Core networking:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;2x &lt;a href=&quot;https://store.ui.com/us/en/category/wifi-bridging/products/udb-pro?variant=udb-pro-us&quot;&gt;Ubiquiti Device Bridge Pro&lt;/a&gt; for the point-to-point link&lt;/li&gt;
  &lt;li&gt;2x &lt;a href=&quot;https://store.ui.com/us/en/category/cameras-bullet/products/uvc-g5-bullet?variant=uvc-g5-bullet&quot;&gt;Ubiquiti G5 Bullet&lt;/a&gt; for coverage&lt;/li&gt;
  &lt;li&gt;1x &lt;a href=&quot;https://store.ui.com/us/en/category/switching-utility/products/usw-flex?variant=usw-flex&quot;&gt;Ubiquiti USW-Flex&lt;/a&gt; as the remote switch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Power system (more on the evolution of this later):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;2x 100W rigid solar panels in parallel&lt;/li&gt;
  &lt;li&gt;GoKWh 100Ah LiFePO4 battery&lt;/li&gt;
  &lt;li&gt;Renogy Wanderer 10A PWM charge controller&lt;/li&gt;
  &lt;li&gt;300W standalone inverter&lt;/li&gt;
  &lt;li&gt;Raspberry Pi 3 B+ running a custom MQTT monitoring stack&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The intent was simple: stable video path plus enough telemetry to know when something is drifting before it fails.&lt;/p&gt;

&lt;h2 id=&quot;the-moment-this-became-a-power-project&quot;&gt;The Moment This Became a Power Project&lt;/h2&gt;

&lt;p&gt;Stop me if you have heard this one. You start with “just two cameras” and suddenly you are doing energy math on a whiteboard.&lt;/p&gt;

&lt;p&gt;Estimated continuous load:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Device&lt;/th&gt;
      &lt;th&gt;Power&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;2 cameras&lt;/td&gt;
      &lt;td&gt;8W&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;USW-Flex&lt;/td&gt;
      &lt;td&gt;5W&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;bridge radio budget&lt;/td&gt;
      &lt;td&gt;~8W to 19W depending on model&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Total (typical)&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;strong&gt;~21W&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Daily consumption:&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;21W * 24h = 504Wh/day
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That single line drives almost every hardware choice after it.&lt;/p&gt;

&lt;p&gt;I went with two 100W rigid panels because they are easier to mount permanently, easier to angle correctly, and less awkward than giant folding panel formats on a roadside pole.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/solar_mockup.jpeg&quot; alt=&quot;System layout mockup&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;panel-and-enclosure-placement&quot;&gt;Panel and Enclosure Placement&lt;/h2&gt;

&lt;p&gt;At one point, we explored mounting solar on the existing nearby structure rather than a dedicated post. It sounds clever until geometry and shading show up to ruin your day.&lt;/p&gt;

&lt;p&gt;What made it a bad idea in practice:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;No clean flat surface for proper panel angle&lt;/li&gt;
  &lt;li&gt;Directional compromise from fixed orientation&lt;/li&gt;
  &lt;li&gt;Partial shading risks that can crush actual production&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The better answer was boring and effective:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Dedicated nearby post for the panels&lt;/li&gt;
  &lt;li&gt;Enclosure mounted directly to the same pole&lt;/li&gt;
  &lt;li&gt;Short cable runs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/solar_install_front.jpeg&quot; alt=&quot;Installed - front view&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/solar_install_side.jpeg&quot; alt=&quot;Installed - side view&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/public/img/solar_install_back.jpeg&quot; alt=&quot;Installed - back view&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;enclosure-reality-check&quot;&gt;Enclosure Reality Check&lt;/h2&gt;

&lt;p&gt;This was another area where theory and reality fought each other.&lt;/p&gt;

&lt;p&gt;The enclosure needed to hold the battery, charge controller, inverter, switch, and the Pi while still allowing airflow and maintenance access. You can absolutely fit this class of build into a 24 x 16 x 12 weatherproof enclosure, but only if you verify internal dimensions. Product pages often advertise external dimensions, and that mismatch can be painful.&lt;/p&gt;

&lt;p&gt;Quick checklist that saved headaches:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Cable glands for solar and Ethernet ingress&lt;/li&gt;
  &lt;li&gt;Clearance around the battery for airflow&lt;/li&gt;
  &lt;li&gt;Backplate layout for controller, inverter, and switch before drilling&lt;/li&gt;
  &lt;li&gt;Drip loops on every external cable entry&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the enclosure is sealed and sitting in the sun, heat management is real. The Pi now controls a 12V exhaust fan via relay, with the BME280 sensor inside the enclosure providing temperature feedback. The fan kicks on at 60°C and shuts off at 55°C, with a periodic keep-alive pulse to prevent stagnation even on cooler days.&lt;/p&gt;

&lt;h2 id=&quot;the-grecell-chapter-a-story-about-learning-the-hard-way&quot;&gt;The GRECELL Chapter (A Story About Learning the Hard Way)&lt;/h2&gt;

&lt;p&gt;Here is the thing: the original build used a GRECELL H1200 all-in-one power station. It seemed like the right call at the time - integrated BMS, inverter, display, the whole package in one box.&lt;/p&gt;

&lt;p&gt;The problem was reliability. The GRECELL had a habit of behaving unpredictably under sustained partial-state-of-charge cycling, which is exactly what a 24/7 outdoor load does to a battery. After enough headaches, I scrapped it and moved to proper solar components.&lt;/p&gt;

&lt;p&gt;If you want the full story of what I learned poking around inside that unit, I wrote a separate post: &lt;a href=&quot;/blog/2026/04/28/hacking-the-data-bus-in-a-chinese-solar-generator/&quot;&gt;Hacking the Data Bus in a Chinese Solar Generator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The replacement stack:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;GoKWh 100Ah LiFePO4&lt;/strong&gt; - dedicated battery with a TDT BMS accessible over Bluetooth LE&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Renogy Wanderer 10A PWM&lt;/strong&gt; - standalone charge controller with Modbus RTU over RS232&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;300W inverter&lt;/strong&gt; - dumb box, no data interface, just does its job&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each component is now independently monitored. If something drifts, I know exactly which piece is misbehaving.&lt;/p&gt;

&lt;h2 id=&quot;ac-injectors-vs-custom-dc-dc-poe-path&quot;&gt;AC Injectors vs Custom DC-DC PoE Path&lt;/h2&gt;

&lt;p&gt;We considered the classic efficiency question: should we convert battery DC up to 24V/48V and feed PoE directly?&lt;/p&gt;

&lt;p&gt;For this load, I chose AC injectors from the inverter and moved on with life.&lt;/p&gt;

&lt;p&gt;Why:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Simpler troubleshooting in the field&lt;/li&gt;
  &lt;li&gt;Fewer custom points of failure&lt;/li&gt;
  &lt;li&gt;Easy replacement with commodity parts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yes, there is a conversion-efficiency tax. No, it was not the bottleneck in this project.&lt;/p&gt;

&lt;h2 id=&quot;telemetry-the-difference-between-installed-and-operated&quot;&gt;Telemetry: The Difference Between “Installed” and “Operated”&lt;/h2&gt;

&lt;p&gt;This is where the project got interesting. After replacing the GRECELL, I had three separate devices that needed monitoring. An ESP32 was no longer going to cut it.&lt;/p&gt;

&lt;p&gt;The solution is a Raspberry Pi 3 B+ running a Python async service that publishes three independent devices to Home Assistant via MQTT auto-discovery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GoKWh Battery (Bluetooth LE)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The GoKWh uses a TDT BMS that communicates over BLE. The monitoring script does a full scan-connect-authenticate-read-disconnect cycle every 60 seconds, which keeps things clean and avoids fighting with the manufacturer’s phone app for the BLE link.&lt;/p&gt;

&lt;p&gt;Every poll publishes 19 entities to Home Assistant:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Pack voltage, current, power&lt;/li&gt;
  &lt;li&gt;State of charge and remaining capacity&lt;/li&gt;
  &lt;li&gt;Charge cycle count&lt;/li&gt;
  &lt;li&gt;Individual cell voltages (4 cells) and cell voltage delta&lt;/li&gt;
  &lt;li&gt;BMS temperatures (3 sensors)&lt;/li&gt;
  &lt;li&gt;Charge and discharge MOSFET state&lt;/li&gt;
  &lt;li&gt;Protection status&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cell delta metric is particularly useful. A healthy pack should have cells within a few millivolts of each other. Drift there is an early warning of balance issues long before you see anything wrong in aggregate voltage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Renogy Wanderer (RS232 Modbus RTU)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Wanderer talks Modbus RTU over RS232. Entities are registered in HA and will report solar panel voltage/current/power, battery voltage, charge state, controller temperature, and load state once the RS232 hardware is wired in. For now they show as unavailable, which is intentional - at least the plumbing is in place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pi Management (Local GPIO / I²C)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Pi itself reports:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Enclosure temperature, humidity, and barometric pressure (BME280 on I²C)&lt;/li&gt;
  &lt;li&gt;CPU temperature&lt;/li&gt;
  &lt;li&gt;Cooling fan state (relay-controlled 12V fan)&lt;/li&gt;
  &lt;li&gt;Enclosure door state (reed switch, normally-closed to GND)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The door sensor is surprisingly useful. It tells you immediately if someone opened the enclosure - whether that is you doing maintenance or something you did not expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reliability Under the Hood&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Pi 3 B+’s onboard Bluetooth is notoriously finnicky. The monitoring script handles this with an escalating reset sequence: btmgmt power cycle, then rfkill block/unblock plus bluetooth service restart, then full system reboot as a last resort. Five consecutive BLE failures trigger the first level. It has never had to go past level two in production.&lt;/p&gt;

&lt;p&gt;Each polling loop (battery, Pi, Renogy) runs as an independent async task with a supervisor that restarts dead tasks after 5 seconds. MQTT uses a Last Will and Testament so the battery shows as offline in HA if the script dies unexpectedly.&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.home-assistant.io/integrations/mqtt/&quot;&gt;Home Assistant MQTT Integration&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.home-assistant.io/docs/automation/&quot;&gt;Home Assistant Automations&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://bleak.readthedocs.io/&quot;&gt;Bleak BLE library&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://eclipse.dev/paho/index.php?page=clients/python/index.php&quot;&gt;paho-mqtt&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;lightning-and-surge-protection&quot;&gt;Lightning and Surge Protection&lt;/h2&gt;

&lt;p&gt;If your setup includes outdoor Ethernet and exposed metal structure, lightning planning is mandatory, not optional.&lt;/p&gt;

&lt;p&gt;Minimum baseline:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Bond exposed metal structures appropriately&lt;/li&gt;
  &lt;li&gt;Use outdoor-rated Ethernet surge suppression on exposed lines&lt;/li&gt;
  &lt;li&gt;Keep grounding and surge paths intentional and inspectable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Ubiquiti environments, the &lt;a href=&quot;https://store.ui.com/us/en/category/accessories-poe-power/collections/pro-store-poe-and-power-surge-protection-outdoor/products/ethernet-surge-protector?variant=eth-sp-g2&quot;&gt;Ethernet Surge Protector&lt;/a&gt; is a practical starting point.&lt;/p&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;The high-level lesson is straightforward: this was not a camera purchase, it was a small infrastructure project. The second lesson is that all-in-one “convenient” hardware can cost you more in debugging time than proper purpose-built components.&lt;/p&gt;

&lt;p&gt;Here is your action plan if you are building something similar:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Do the power budget first.&lt;/li&gt;
  &lt;li&gt;Use proper solar components (dedicated battery, dedicated charge controller) rather than all-in-one power stations.&lt;/li&gt;
  &lt;li&gt;Optimize panel placement for sun and maintainability, not cleverness.&lt;/li&gt;
  &lt;li&gt;Validate enclosure internals before buying - external dimensions lie.&lt;/li&gt;
  &lt;li&gt;Add thermal management to any sealed outdoor enclosure.&lt;/li&gt;
  &lt;li&gt;Build telemetry for every component independently, on day one.&lt;/li&gt;
  &lt;li&gt;Favor simple, serviceable power paths over maximum theoretical efficiency.&lt;/li&gt;
  &lt;li&gt;Treat surge and grounding as core design requirements.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Together, those choices gave us a system that is boring in the best possible way: it stays up, records reliably, and tells us exactly when it needs attention - before it silently fails.&lt;/p&gt;
</content>
   
    <category term="ubiquiti" />
   
    <category term="devops" />
   
    <category term="automation" />
   
    <category term="security" />
   
    <category term="solar" />
   
    <category term="off-grid" />
   
    <category term="home-assistant" />
   
    <category term="raspberry-pi" />
   
    <category term="mqtt" />
   
 </entry>
 
 <entry>
   <title>The Three Pillars of Metrics That Matter</title>
   <link href="https://www.dxrf.com/blog/2026/04/20/three-pillars-of-metrics-that-matter/"/>
   <updated>2026-04-20T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/04/20/three-pillars-of-metrics-that-matter</id>
   <excerpt type="html">Forget &apos;developer productivity.&apos; Forget ROI theater. Every metric worth tracking answers one of three simple questions: Are we shipping faster? Safer? Cheaper? That&apos;s it. That&apos;s the whole framework.</excerpt>
   <content type="html">&lt;p&gt;You’ve probably heard me say “metrics that matter” more than once. If you’ve been following along, you know I have &lt;a href=&quot;/blog/2026/01/19/youre-measuring-it-wrong/&quot;&gt;strong opinions about what most teams get wrong&lt;/a&gt;, &lt;a href=&quot;/blog/2026/01/21/the-lies-your-metrics-tell/&quot;&gt;a collection of autopsies on metrics that actively mislead&lt;/a&gt;, and &lt;a href=&quot;/blog/2026/01/23/metrics-that-actually-matter/&quot;&gt;a practical framework for what to measure instead&lt;/a&gt;. Today I want to zoom out even further.&lt;/p&gt;

&lt;p&gt;Because here’s the thing: frameworks are great, but they can get complicated fast. And complicated frameworks are easy to ignore.&lt;/p&gt;

&lt;p&gt;So let me give you the version you can write on a sticky note and put on your monitor.&lt;/p&gt;

&lt;h2 id=&quot;what-does-value-actually-mean&quot;&gt;What Does “Value” Actually Mean?&lt;/h2&gt;

&lt;p&gt;Every time a new buzzword hits the circuit - “developer productivity,” “engineering ROI,” “velocity” - someone inevitably asks: “How do we measure it?” And then we spend six months building dashboards that measure things no executive actually cares about.&lt;/p&gt;

&lt;p&gt;Let me be blunt. The business doesn’t care about your deployment frequency score. They don’t care that your DORA metrics are in the “Elite” tier. They care about one thing: &lt;strong&gt;does what you’re doing make the business more competitive?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s it. That’s value. That’s ROI. That’s productivity. Whichever word is trending this quarter, strip away the jargon and you’re left with the same question: &lt;strong&gt;how does what you’re doing affect the business?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here’s the uncomfortable truth: most of what we measure doesn’t answer that question at all.&lt;/p&gt;

&lt;p&gt;So I want to propose a simpler filter. Before any metric earns a spot on your dashboard, it needs to answer one of three questions:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Are we shipping &lt;strong&gt;faster&lt;/strong&gt;?&lt;/li&gt;
  &lt;li&gt;Are we shipping &lt;strong&gt;safer&lt;/strong&gt;?&lt;/li&gt;
  &lt;li&gt;Are we shipping &lt;strong&gt;cheaper&lt;/strong&gt;?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s the framework. Three pillars. Let’s dig in.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;graph TD
    subgraph FASTER[&quot;Pillar 1 - Faster&quot;]
        F1[Lead Time]
        F2[PR Lifespan]
        F3[CI/CD Run Time]
        F4[Cycle Time]
    end

    subgraph SAFER[&quot;Pillar 2 - Safer&quot;]
        S1[Defect Rate]
        S2[Pipeline Failure Rate]
        S3[Security Alert Volume]
        S4[MTTD and MTTR]
    end

    subgraph CHEAPER[&quot;Pillar 3 - Cheaper&quot;]
        C1[Pipeline Waste]
        C2[Runner Right-Sizing]
        C3[Redundant Workflows]
        C4[Idle Environments]
    end

    style FASTER fill:#1d3557,color:#fff
    style SAFER fill:#2d6a4f,color:#fff
    style CHEAPER fill:#6a2d2d,color:#fff
&lt;/code&gt;&lt;/pre&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;pillar-1-are-we-shipping-faster&quot;&gt;Pillar 1: Are We Shipping Faster?&lt;/h2&gt;

&lt;p&gt;Speed is competitive advantage. Full stop.&lt;/p&gt;

&lt;p&gt;When we ask “are we getting faster,” what we’re really asking is: &lt;strong&gt;are we getting our deliverables into customers’ hands faster than our competitors?&lt;/strong&gt; Not faster than last sprint. Not faster than some theoretical baseline. Faster than the alternative your customer might choose.&lt;/p&gt;

&lt;p&gt;This maps to metrics you’ve probably seen before:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Lead time&lt;/strong&gt; - from idea to production&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;PR lifespan&lt;/strong&gt; - how long code sits waiting for review or merge&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Workflow run times&lt;/strong&gt; - how long CI/CD actually takes&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Time to first commit&lt;/strong&gt; - how quickly new features start moving&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Cycle time&lt;/strong&gt; - time from active development to shipped&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal isn’t to watch these numbers go up or down in isolation. The goal is to understand where work gets stuck and eliminate those bottlenecks. A PR that sits for three days before review doesn’t just slow that feature down - it kills momentum, creates context-switching costs, and signals to engineers that their work doesn’t matter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick reference - fast shipping indicators:&lt;/strong&gt;&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Metric&lt;/th&gt;
      &lt;th&gt;What it signals&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Lead time &amp;lt; 1 week&lt;/td&gt;
      &lt;td&gt;Healthy flow from idea to production&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;PR lifespan &amp;lt; 24 hours&lt;/td&gt;
      &lt;td&gt;Active review culture, small PRs&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;CI run time &amp;lt; 10 minutes&lt;/td&gt;
      &lt;td&gt;Fast feedback loops&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Failed pipeline rate trending down&lt;/td&gt;
      &lt;td&gt;Stable build health&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Speed without safety is just recklessness. Which brings us to pillar two.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;pillar-2-are-we-shipping-safer&quot;&gt;Pillar 2: Are We Shipping Safer?&lt;/h2&gt;

&lt;p&gt;This one sounds obvious, but it trips teams up constantly because “safer” gets conflated with “slower.” It doesn’t have to.&lt;/p&gt;

&lt;p&gt;Shipping safer means: &lt;strong&gt;are we getting fewer defects, vulnerabilities, and surprises into production over time?&lt;/strong&gt; That’s really it. Not zero defects - that’s a fantasy. Fewer defects, trending down, over time.&lt;/p&gt;

&lt;p&gt;Here’s what you’re measuring:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Defect rate&lt;/strong&gt; - how many bugs make it to production per release&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Pipeline failure rate&lt;/strong&gt; - how often does CI/CD catch problems before they ship&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Code scanning alert volume&lt;/strong&gt; - how many security findings are being introduced vs. resolved&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Mean time to detect (MTTD)&lt;/strong&gt; - how quickly do we find problems after they ship&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Mean time to recover (MTTR)&lt;/strong&gt; - how quickly do we fix them&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last one is worth calling out specifically. No system is perfect. The teams that ship safely aren’t the ones who never break things - they’re the ones who find and fix things &lt;em&gt;fast&lt;/em&gt;. Build your monitoring, alerting, and incident response processes around that reality.&lt;/p&gt;

&lt;p&gt;The pipeline failure rate is especially underrated. Every time CI catches a bug before it hits production, that’s the system working. A healthy failure rate means your automated checks are meaningful. A failure rate near zero either means your code is perfect (sure) or your checks aren’t checking anything useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The goal:&lt;/strong&gt; ship with confidence, not with crossed fingers.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;pillar-3-are-we-shipping-cheaper&quot;&gt;Pillar 3: Are We Shipping Cheaper?&lt;/h2&gt;

&lt;p&gt;This is the sneaky one. Teams nail speed and safety and then leave a ton of money on the table because nobody’s watching the bill.&lt;/p&gt;

&lt;p&gt;Shipping cheaper means: &lt;strong&gt;are we being good stewards of the company’s money?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This isn’t about cutting corners. It’s about eliminating waste - the kind that accumulates quietly in the background while everyone’s focused on features.&lt;/p&gt;

&lt;p&gt;Here’s what waste looks like in practice:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Pipelines that always fail&lt;/strong&gt; - you’re paying for compute that never delivers value&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Pipelines that always time out&lt;/strong&gt; - same problem, worse UX&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Jobs running on oversized runners&lt;/strong&gt; - sure, a 32-core runner might finish 3 minutes faster, but does that 3 minutes justify 8x the compute cost?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Redundant workflows&lt;/strong&gt; - multiple pipelines doing the same work because nobody cleaned up after a migration&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Long-lived test environments&lt;/strong&gt; - infrastructure running 24/7 for workflows that only need it for 20 minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That runner example is worth sitting with. Let’s do the math. If a job takes 10 minutes on a 4-core runner and 7 minutes on a 32-core runner, the 32-core runner is 8x more expensive per minute and only saves you 3 minutes. Unless that job runs thousands of times a day, you’re hemorrhaging money for marginal velocity gains.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Questions to ask about every pipeline:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What happens if this fails? (Severity)&lt;/li&gt;
  &lt;li&gt;How often does it fail? (Reliability)&lt;/li&gt;
  &lt;li&gt;What does it cost per run? (Efficiency)&lt;/li&gt;
  &lt;li&gt;Does the runner size match the actual workload? (Fit)&lt;/li&gt;
  &lt;li&gt;Is this pipeline still needed? (Relevance)&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;flowchart LR
    Pipeline([Pipeline to Audit]) --&amp;gt; V{High Value?}

    V -- Yes --&amp;gt; Cost1{High Cost?}
    Cost1 -- Yes --&amp;gt; OPT[Optimize - Right-size the runner]
    Cost1 -- No --&amp;gt; KEEP[Keep As-Is]

    V -- No --&amp;gt; Cost2{High Cost?}
    Cost2 -- Yes --&amp;gt; ELIM[Eliminate]
    Cost2 -- No --&amp;gt; REVAL[Re-evaluate Purpose]

    style KEEP fill:#2d6a4f,color:#fff
    style OPT fill:#f4a261,color:#000
    style REVAL fill:#457b9d,color:#fff
    style ELIM fill:#e63946,color:#fff
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Efficiency reviews aren’t sexy, but they fund the work that is. The money you save from right-sizing infrastructure is money that can go toward tooling, training, or headcount.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;tying-it-together&quot;&gt;Tying It Together&lt;/h2&gt;

&lt;p&gt;So here’s the filter.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;flowchart TD
    A[Proposed Metric] --&amp;gt; B{Does it measure
shipping speed?}
    B -- Yes --&amp;gt; KEEP[Add to Dashboard]
    B -- No --&amp;gt; C{Does it measure
shipping safety?}
    C -- Yes --&amp;gt; KEEP
    C -- No --&amp;gt; D{Does it measure
shipping cost?}
    D -- Yes --&amp;gt; KEEP
    D -- No --&amp;gt; E[Diagnostic Signal Only]
    style KEEP fill:#2d6a4f,color:#fff
    style E fill:#6c757d,color:#fff
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every proposed metric goes through three questions:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Does it tell us if we’re shipping &lt;strong&gt;faster&lt;/strong&gt;?&lt;/li&gt;
  &lt;li&gt;Does it tell us if we’re shipping &lt;strong&gt;safer&lt;/strong&gt;?&lt;/li&gt;
  &lt;li&gt;Does it tell us if we’re shipping &lt;strong&gt;cheaper&lt;/strong&gt;?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the answer to all three is “no,” the metric doesn’t belong on your executive dashboard. Maybe it belongs on an engineering team dashboard as a diagnostic signal - but it shouldn’t be the thing you’re reporting up to leadership as evidence of value.&lt;/p&gt;

&lt;p&gt;This framework also has a useful side effect: it forces conversations about what “better” actually means. Faster for whom? Safer by what measure? Cheaper compared to what baseline? Those conversations are exactly the ones you should be having with your stakeholders before you pick up a single measurement tool.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;Here’s your sticky note version:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every metric worth tracking answers one of three questions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Faster&lt;/strong&gt; - are we reducing lead time, PR lifespan, and cycle time?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Safer&lt;/strong&gt; - are we reducing defects, pipeline failures, and security findings?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Cheaper&lt;/strong&gt; - are we eliminating waste, right-sizing infrastructure, and cutting unused pipelines?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a metric doesn’t connect to one of those three outcomes, it’s not a business metric - it’s a vanity metric.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your action plan:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Audit your current dashboard. For each metric, ask: faster, safer, or cheaper?&lt;/li&gt;
  &lt;li&gt;Flag anything that doesn’t fit. Not delete - flag. Understand why it’s there.&lt;/li&gt;
  &lt;li&gt;Identify the top one or two gaps. Where are you flying blind on speed, safety, or cost?&lt;/li&gt;
  &lt;li&gt;Build metrics to fill those gaps - and make sure stakeholders agree they’re meaningful.&lt;/li&gt;
  &lt;li&gt;Review quarterly. Metrics decay. What mattered six months ago might not matter today.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal was never to have a great dashboard. The goal was to ship great software, reliably, without wasting the company’s money. Measure that.&lt;/p&gt;
</content>
   
    <category term="metrics" />
   
    <category term="devops" />
   
    <category term="engineering" />
   
    <category term="leadership" />
   
    <category term="productivity" />
   
    <category term="value" />
   
    <category term="roi" />
   
    <category term="best-practices" />
   
 </entry>
 
 <entry>
   <title>Auto-Approving safe-settings PRs with OPA and Rego</title>
   <link href="https://www.dxrf.com/blog/2026/04/08/auto-approving-safe-settings-prs-with-opa-and-rego/"/>
   <updated>2026-04-08T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/04/08/auto-approving-safe-settings-prs-with-opa-and-rego</id>
   <excerpt type="html">Use OPA and Rego to validate safe-settings YAML configurations in PRs and automatically approve changes that conform to your organization&apos;s standards.</excerpt>
   <content type="html">&lt;p&gt;If you manage GitHub repositories at scale, you’ve probably found &lt;a href=&quot;https://github.com/github/safe-settings&quot;&gt;safe-settings&lt;/a&gt;. It lets you define your repository configurations – branch protections, team access, collaborators, labels, and more – as YAML files stored in a central &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; repository. Config-as-code for your GitHub org. Beautiful.&lt;/p&gt;

&lt;p&gt;Here’s the thing though: that &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; repo fills up with PRs fast. Developers, team leads, and platform engineers are constantly submitting changes to settings files. Most of those changes are completely fine – adding a new team, updating a description, tweaking a topic. But someone still has to review and approve them, and that rubber-stamp review process is exactly the kind of toil that should be automated.&lt;/p&gt;

&lt;p&gt;This post walks through using &lt;a href=&quot;https://www.openpolicyagent.org/&quot;&gt;Open Policy Agent (OPA)&lt;/a&gt; and its Rego policy language to automatically validate safe-settings YAML files and approve PRs that conform to your standards – no human reviewer required for the routine stuff.&lt;/p&gt;

&lt;h2 id=&quot;the-components&quot;&gt;The Components&lt;/h2&gt;

&lt;p&gt;Before building anything, let’s get everyone on the same page about what each piece does.&lt;/p&gt;

&lt;h3 id=&quot;safe-settings&quot;&gt;safe-settings&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/github/safe-settings&quot;&gt;safe-settings&lt;/a&gt; is a GitHub App that manages repository settings as policy-as-code. All configuration lives in an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; repository within your org, structured like this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;admin/
├── .github/
│   ├── settings.yml          # Org-wide defaults applied to every repo
│   ├── suborgs/              # Team or project-level overrides
│   │   └── platform-team.yml
│   └── repos/                # Repo-specific overrides
│       └── my-service.yml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The hierarchy is: &lt;strong&gt;org-level settings&lt;/strong&gt; form the baseline, &lt;strong&gt;suborg-level settings&lt;/strong&gt; override them for specific teams or projects, and &lt;strong&gt;repo-level settings&lt;/strong&gt; are the most specific. When a PR is opened against the default branch, safe-settings runs in dry-run mode and posts a check with what would change. Merge to default, and the settings are applied.&lt;/p&gt;

&lt;p&gt;A typical &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;settings.yml&lt;/code&gt; looks like this:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;repository&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;has_issues&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;allow_squash_merge&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;allow_merge_commit&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;false&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;delete_branch_on_merge&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;branches&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;default&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;protection&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;required_pull_request_reviews&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;required_approving_review_count&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;dismiss_stale_reviews&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;require_code_owner_reviews&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;required_status_checks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;strict&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;contexts&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;na&quot;&gt;enforce_admins&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;restrictions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;apps&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;na&quot;&gt;users&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;na&quot;&gt;teams&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;na&quot;&gt;teams&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;platform-admins&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;permission&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;admin&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;developers&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;permission&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;push&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;opa-and-rego&quot;&gt;OPA and Rego&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://www.openpolicyagent.org/&quot;&gt;Open Policy Agent (OPA)&lt;/a&gt; is a general-purpose, open source policy engine and a CNCF graduated project. You write policies in &lt;strong&gt;Rego&lt;/strong&gt; (pronounced “ray-go”) – a high-level declarative language purpose-built for expressing policies over structured data.&lt;/p&gt;

&lt;p&gt;The key insight: your safe-settings YAML files are just structured data. OPA doesn’t care whether it’s evaluating Kubernetes admission requests, Terraform plans, or safe-settings YAML. If it can be represented as JSON, OPA can reason about it.&lt;/p&gt;

&lt;p&gt;A simple Rego policy:&lt;/p&gt;

&lt;div class=&quot;language-rego 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;ow&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;ow&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rego&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contains&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;repository&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;visibility&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;public&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Repositories must not be public&quot;&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;OPA evaluates your YAML against these policies and returns either a clean result or a list of violations with descriptive messages.&lt;/p&gt;

&lt;h3 id=&quot;conftest&quot;&gt;conftest&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://www.conftest.dev/&quot;&gt;conftest&lt;/a&gt; is a command-line tool that bridges OPA and your config files. It handles parsing YAML (and HCL, JSON, Dockerfiles, and more), passes the parsed data to OPA, and returns structured results you can act on in CI.&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;conftest &lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt; .github/settings.yml &lt;span class=&quot;nt&quot;&gt;--policy&lt;/span&gt; policy/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;conftest looks for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;deny&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;warn&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;violation&lt;/code&gt; rules in your Rego policies. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;deny&lt;/code&gt; fails the check and sets a non-zero exit code (blocking the pipeline). &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;warn&lt;/code&gt; surfaces the issue but keeps the exit code clean.&lt;/p&gt;

&lt;h3 id=&quot;github-actions&quot;&gt;GitHub Actions&lt;/h3&gt;

&lt;p&gt;GitHub Actions is the orchestrator that ties everything together. When a PR is opened against the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; repo, a workflow:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Identifies which settings YAML files changed in the PR&lt;/li&gt;
  &lt;li&gt;Runs conftest against those files with your Rego policies&lt;/li&gt;
  &lt;li&gt;If every check passes, calls the GitHub API to auto-approve the PR&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;defining-your-policy-requirements&quot;&gt;Defining Your Policy Requirements&lt;/h2&gt;

&lt;p&gt;Before writing Rego, nail down what “conforming” actually means for your org. A solid starting baseline for safe-settings configurations:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Requirement&lt;/th&gt;
      &lt;th&gt;Why&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Branch protection enabled on default branch&lt;/td&gt;
      &lt;td&gt;Prevents direct pushes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Required reviewers &amp;gt;= 1&lt;/td&gt;
      &lt;td&gt;At least one approval before merge&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dismiss_stale_reviews&lt;/code&gt; is true&lt;/td&gt;
      &lt;td&gt;No merging after new commits bypass review&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;enforce_admins&lt;/code&gt; is true&lt;/td&gt;
      &lt;td&gt;Admins can’t bypass protections&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Teams can’t have &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; at the repo level&lt;/td&gt;
      &lt;td&gt;Only org-level teams should be admins&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Repository must not be public&lt;/td&gt;
      &lt;td&gt;Enforce private-by-default&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Now let’s translate those requirements into Rego.&lt;/p&gt;

&lt;h2 id=&quot;writing-the-rego-policies&quot;&gt;Writing the Rego Policies&lt;/h2&gt;

&lt;p&gt;Create a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;policy/&lt;/code&gt; directory in your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; repo. Each &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.rego&lt;/code&gt; file here will be evaluated by conftest.&lt;/p&gt;

&lt;h3 id=&quot;policysettingsrego&quot;&gt;policy/settings.rego&lt;/h3&gt;

&lt;div class=&quot;language-rego 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;ow&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;ow&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rego&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Repository must not be public&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contains&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;repository&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;visibility&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;public&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Repository visibility must not be &apos;public&apos; - use &apos;private&apos; or &apos;internal&apos;&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Branch protection must be configured for the default branch&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contains&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;branches&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&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;n&quot;&gt;b&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;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&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;m&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Branch protection must be configured for the &apos;default&apos; branch&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Required reviewers must be at least 1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contains&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;ow&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;branch&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;branches&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;branch&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;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;branch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;protection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;required_pull_request_reviews&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;required_approving_review_count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Default branch must require at least 1 approving review&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Stale reviews must be dismissed&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contains&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;ow&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;branch&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;branches&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;branch&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;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;branch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;protection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;required_pull_request_reviews&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dismiss_stale_reviews&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;kc&quot;&gt;true&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Default branch protection must dismiss stale reviews&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# enforce_admins must be true&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contains&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;ow&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;branch&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;branches&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;branch&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;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;branch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;protection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;enforce_admins&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;kc&quot;&gt;true&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Default branch protection must enforce rules for administrators&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# No team should have admin permission in a repo-level settings file&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contains&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;ow&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;team&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;teams&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;team&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;permission&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;admin&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sprintf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Team &apos;%v&apos; cannot be granted &apos;admin&apos; permission at the repo level&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;n&quot;&gt;team&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;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Warn (don&apos;t block) if strict status checks are disabled&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;warn&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contains&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;ow&quot;&gt;some&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;branch&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;branches&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;branch&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;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;branch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;protection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;required_status_checks&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;strict&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;kc&quot;&gt;true&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Consider enabling strict status checks to require branches be up to date before merging&quot;&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;A few notes on this Rego:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;import rego.v1&lt;/code&gt; uses modern Rego syntax, recommended for OPA v1.x+&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;deny contains msg if { ... }&lt;/code&gt; is a partial set rule – each matching condition adds a message to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;deny&lt;/code&gt; set&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;warn&lt;/code&gt; rules show violations in the output but don’t affect the exit code, so the auto-approval still proceeds for warnings&lt;/li&gt;
  &lt;li&gt;conftest evaluates the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt; package by default&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;testing-your-policies&quot;&gt;Testing Your Policies&lt;/h3&gt;

&lt;p&gt;Untested policies will surprise you in production. Create &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;policy/settings_test.rego&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;language-rego 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;ow&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;ow&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rego&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# A baseline config that should pass all checks&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;valid_config&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;s2&quot;&gt;&quot;repository&quot;&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;s2&quot;&gt;&quot;visibility&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;private&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;branches&quot;&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;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;protection&quot;&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;s2&quot;&gt;&quot;required_pull_request_reviews&quot;&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;s2&quot;&gt;&quot;required_approving_review_count&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;s2&quot;&gt;&quot;dismiss_stale_reviews&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
            &lt;span class=&quot;s2&quot;&gt;&quot;required_status_checks&quot;&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;s2&quot;&gt;&quot;strict&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;contexts&quot;&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;s2&quot;&gt;&quot;enforce_admins&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;s2&quot;&gt;&quot;restrictions&quot;&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;s2&quot;&gt;&quot;apps&quot;&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;s2&quot;&gt;&quot;users&quot;&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;s2&quot;&gt;&quot;teams&quot;&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;p&quot;&gt;}],&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;teams&quot;&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;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;developers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;permission&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;push&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;n&quot;&gt;test_valid_config_passes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deny&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;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;valid_config&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;test_public_repo_denied&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cfg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;patch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_config&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;s2&quot;&gt;&quot;op&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;replace&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/repository/visibility&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;o&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;s2&quot;&gt;&quot;Repository visibility must not be &apos;public&apos; - use &apos;private&apos; or &apos;internal&apos;&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cfg&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;test_insufficient_reviewers_denied&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cfg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;patch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_config&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;s2&quot;&gt;&quot;op&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;replace&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/branches/0/protection/required_pull_request_reviews/required_approving_review_count&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}])&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cfg&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;test_admin_team_denied&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cfg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;patch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_config&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;s2&quot;&gt;&quot;op&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;add&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/teams/-&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&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;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;some-team&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;permission&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;admin&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}])&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cfg&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;test_no_branch_protection_denied&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cfg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;patch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_config&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;s2&quot;&gt;&quot;op&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;replace&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;/branches&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&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;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cfg&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;Run them locally:&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;conftest verify &lt;span class=&quot;nt&quot;&gt;--policy&lt;/span&gt; policy/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Get into the habit of running this before every push to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; repo. It’s a two-second check that saves you from embarrassing validation gaps.&lt;/p&gt;

&lt;h2 id=&quot;the-github-actions-workflow&quot;&gt;The GitHub Actions Workflow&lt;/h2&gt;

&lt;p&gt;With policies written and tested, wire it all together. Create &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/workflows/validate-settings.yml&lt;/code&gt; in your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; repo:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Validate and Auto-Approve Settings PRs&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pull_request&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;paths&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;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.github/settings.yml&apos;&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;.github/repos/**&apos;&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;.github/suborgs/**&apos;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;read&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pull-requests&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;write&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;checks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;write&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;validate&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;Validate Settings&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;outputs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;all_passed&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;$&lt;/span&gt;

    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Checkout PR&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/checkout@v4&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;Install conftest&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;CONFTEST_VERSION=&quot;0.57.0&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;curl -sSL &quot;https://github.com/open-policy-agent/conftest/releases/download/v${CONFTEST_VERSION}/conftest_${CONFTEST_VERSION}_Linux_x86_64.tar.gz&quot; \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;| tar xz conftest&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;sudo mv conftest /usr/local/bin/&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;Get changed settings files&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;changed-files&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;files=$(git diff --name-only origin/$...HEAD \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;| grep -E &apos;^\.github/(settings\.yml|repos/|suborgs/)&apos; || true)&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;echo &quot;all_changed_files=$files&quot; &amp;gt;&amp;gt; &quot;$GITHUB_OUTPUT&quot;&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;Run OPA policy checks&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;check&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;all_passed=true&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;for file in $; do&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;Checking: $file&quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;if ! conftest test &quot;$file&quot; --policy policy/ --output github; then&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;all_passed=false&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;fi&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;done&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;echo &quot;all_passed=$all_passed&quot; &amp;gt;&amp;gt; &quot;$GITHUB_OUTPUT&quot;&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;auto-approve&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;Auto-Approve PR&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;needs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;validate&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;needs.validate.outputs.all_passed == &apos;true&apos;&lt;/span&gt;

    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Approve PR&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;actions/github-script@v7&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;github-token&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;$&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;script&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;await github.rest.pulls.createReview({&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;owner: context.repo.owner,&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;repo: context.repo.repo,&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;pull_number: context.issue.number,&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;event: &apos;APPROVE&apos;,&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;body: &apos;All settings files conform to OPA policy. Auto-approving.&apos;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A few things worth calling out explicitly:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;permissions&lt;/code&gt; block&lt;/strong&gt; – &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pull-requests: write&lt;/code&gt; is the minimum scope needed for the auto-approve step. Don’t grant more than necessary. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;checks: write&lt;/code&gt; lets conftest post inline annotations on the PR diff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;if&lt;/code&gt; condition on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;auto-approve&lt;/code&gt;&lt;/strong&gt; – The approval only triggers when every policy check passes. Any violation skips the job entirely. No approval, PR stays pending until the author fixes it and pushes a new commit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--output github&lt;/code&gt;&lt;/strong&gt; – Tells conftest to emit GitHub Actions annotations alongside the standard output. Failed checks show up as inline comments on the exact lines in the diff. Much cleaner than sifting through raw logs.&lt;/p&gt;

&lt;h2 id=&quot;what-happens-when-policies-fail&quot;&gt;What Happens When Policies Fail&lt;/h2&gt;

&lt;p&gt;When a PR violates a policy, the workflow posts inline annotations directly on the changed files, like:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FAIL - .github/repos/my-service.yml - Team &apos;some-team&apos; cannot be granted &apos;admin&apos; permission at the repo level
FAIL - .github/repos/my-service.yml - Default branch must require at least 1 approving review

2 tests, 0 passed, 0 warnings, 2 failures, 0 exceptions
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;No approval is granted. The PR author sees exactly what’s wrong, fixes it, and pushes. The workflow reruns automatically, and if everything passes, the auto-approval fires.&lt;/p&gt;

&lt;h2 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;/h2&gt;

&lt;p&gt;Before enabling this in production, think through a few things:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bot approval and branch protection&lt;/strong&gt; – Your branch protection requires N approvals before merge. This workflow’s auto-approval counts as one. If you only require 1 approval, a developer could push a conforming-but-questionable config, get auto-approved, and merge without human eyes. Consider requiring 2 approvals: one from the bot (mechanical correctness) and one from a human (reasonableness).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CODEOWNERS&lt;/strong&gt; – Use a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CODEOWNERS&lt;/code&gt; file in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; repo to require specific teams to review changes in specific paths. The bot handles “does this meet our schema standards?” while CODEOWNERS handles “is this a reasonable change for this team to make?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token scope&lt;/strong&gt; – The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GITHUB_TOKEN&lt;/code&gt; is scoped to the repository and expires after the workflow run. This is exactly right. Don’t use a PAT here unless you have a specific reason to, and if you do, give it the minimum required scopes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Policy coverage&lt;/strong&gt; – These policies catch structural issues. They do not catch semantic problems like “this team shouldn’t have push access to this particular service.” Keep humans in the loop for changes that touch permissions in sensitive repos.&lt;/p&gt;

&lt;h2 id=&quot;final-repository-structure&quot;&gt;Final Repository Structure&lt;/h2&gt;

&lt;p&gt;Here’s what your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;admin&lt;/code&gt; repo looks like when everything is wired up:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;admin/
├── .github/
│   ├── settings.yml              # Org-wide defaults
│   ├── suborgs/
│   │   └── platform-team.yml
│   ├── repos/
│   │   └── my-service.yml
│   └── workflows/
│       └── validate-settings.yml # The workflow
└── policy/
    ├── settings.rego             # The OPA policies
    └── settings_test.rego        # Policy unit tests
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A complete working example with all of this in place (including sample settings files and a full policy suite) is available at &lt;a href=&quot;https://github.com/jmassardo/safe-settings-opa-example&quot;&gt;github.com/jmassardo/safe-settings-opa-example&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;You now have a complete system: safe-settings manages your repo configs as code, OPA/Rego defines what “valid” looks like, conftest evaluates files against those policies in CI, and GitHub Actions auto-approves PRs that pass.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s your action plan:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Define your standards first&lt;/strong&gt; – Write down what a conforming settings file looks like before writing any Rego. What fields are required? What values are forbidden? Get agreement from your team before encoding it in policy.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Write and test your policies&lt;/strong&gt; – Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conftest verify&lt;/code&gt; locally before pushing. Untested policies will fire on things you didn’t intend.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Roll out with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;warn&lt;/code&gt; before &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;deny&lt;/code&gt;&lt;/strong&gt; – Introduce new requirements as warnings first. Watch what fires for a week or two, then promote to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;deny&lt;/code&gt; once you’ve verified the signal-to-noise ratio is acceptable.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Layer your approvals&lt;/strong&gt; – Use the bot approval for schema conformance and CODEOWNERS for semantic sign-off. Don’t eliminate all human review; eliminate the toil that doesn’t require human judgment.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Treat policies like code&lt;/strong&gt; – The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;policy/&lt;/code&gt; directory should go through the same PR review, testing, and change management process as everything else. Add a CODEOWNER for it.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result is a system where routine changes merge with zero manual review time, while genuinely interesting changes still land in front of the right people. That’s the goal: not removing humans from the loop, but removing them from the parts of the loop where they add no value.&lt;/p&gt;

&lt;h2 id=&quot;closing&quot;&gt;Closing&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Have questions or want to share how you’re using OPA for GitHub automation? Find me on &lt;a href=&quot;https://github.com/jmassardo&quot;&gt;GitHub&lt;/a&gt;, &lt;a href=&quot;https://www.linkedin.com/in/jenna-massardo/&quot;&gt;LinkedIn&lt;/a&gt;, or &lt;a href=&quot;https://bsky.app/profile/jmassardo.bsky.social&quot;&gt;Bluesky&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="devops" />
   
    <category term="automation" />
   
    <category term="security" />
   
    <category term="policy-as-code" />
   
    <category term="ci-cd" />
   
    <category term="opa" />
   
    <category term="rego" />
   
 </entry>
 
 <entry>
   <title>Identifying and Cleaning Up Stale GitHub Repos at Scale</title>
   <link href="https://www.dxrf.com/blog/2026/03/25/identifying-and-cleaning-up-stale-github-repos/"/>
   <updated>2026-03-25T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/03/25/identifying-and-cleaning-up-stale-github-repos</id>
   <excerpt type="html">A practical guide to auditing thousands of GitHub repositories, identifying what&apos;s truly stale, and safely archiving or cleaning up the ones you no longer need.</excerpt>
   <content type="html">&lt;p&gt;Stale repositories are the code equivalent of that pile of boxes in the corner of your garage. You haven’t touched them in years, but getting rid of them feels like work, so they just… sit there. The problem is that in GitHub, those boxes accumulate license seats, storage costs, security scanning noise, and cognitive overhead for your entire engineering team.&lt;/p&gt;

&lt;p&gt;Here’s the thing: identifying and cleaning up stale repos is an entirely automatable problem. Let’s talk about how to actually do it.&lt;/p&gt;

&lt;h2 id=&quot;what-makes-a-repository-stale&quot;&gt;What Makes a Repository “Stale”?&lt;/h2&gt;

&lt;p&gt;Before you start archiving things, define what stale actually means for your organization. There’s no universal answer, but here’s a useful framework:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Signal&lt;/th&gt;
      &lt;th&gt;What It Tells You&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;No pushes in 12+ months&lt;/td&gt;
      &lt;td&gt;Code isn’t actively changing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;No issue or PR activity in 12+ months&lt;/td&gt;
      &lt;td&gt;No one is engaging with it (see note below)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;No recent GitHub Actions runs&lt;/td&gt;
      &lt;td&gt;Nothing is being built or deployed&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;No recent clones or traffic&lt;/td&gt;
      &lt;td&gt;No one is consuming it&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Original team no longer exists&lt;/td&gt;
      &lt;td&gt;Ownership is unclear&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;No README or description&lt;/td&gt;
      &lt;td&gt;Possibly abandoned work-in-progress&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;A note on issue counts:&lt;/strong&gt; Don’t use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;open_issues_count&lt;/code&gt; as a staleness signal. A repo with zero open issues might just have a team that closes tickets promptly. What you actually want is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updated_at&lt;/code&gt; timestamp on the most recent issue or comment - that tells you when a human last engaged with the project.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A single signal isn’t enough. A repo with no commits might be an archived reference document that people read all the time. A repo with recent commits might be a bot pushing auto-generated content with zero human engagement. &lt;strong&gt;Combine signals&lt;/strong&gt; before you make decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recommended staleness criteria:&lt;/strong&gt; No pushes, no clones, no PR activity, and no CI runs in the last 12 months. That’s a pretty safe bar.&lt;/p&gt;

&lt;h2 id=&quot;step-1-audit-your-org-at-scale-with-the-api&quot;&gt;Step 1: Audit Your Org at Scale with the API&lt;/h2&gt;

&lt;p&gt;The GitHub REST API is your best friend here for a single-org cleanup. The key endpoint is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GET /orgs/{org}/repos&lt;/code&gt;, which returns all repos with metadata including &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pushed_at&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updated_at&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;archived&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;open_issues_count&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Enterprise scale reality check:&lt;/strong&gt; If you’re running a GitHub Enterprise with hundreds of organizations and tens of thousands of repos per org, the polling loop below will work - but it won’t scale well. Each org requires a separate paginated request cycle. Each signal you want to enrich (last push, last Actions run, last issue activity, traffic) multiplies that into potentially millions of API calls. You’ll hit rate limits, burn hours waiting on responses, and still end up with a point-in-time snapshot that’s stale by the time you act on it. &lt;strong&gt;The API approach is right for a one-time cleanup. The audit log stream is the right long-term answer for enterprises&lt;/strong&gt; - more on that at the end of this post.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s a shell script that pulls the data you need:&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;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# audit-repos.sh - list all org repos with staleness signals&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;ORG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;your-org-name&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;TOKEN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ghp_your_token&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;CUTOFF_DATE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;12 months ago&quot;&lt;/span&gt; +%Y-%m-%d 2&amp;gt;/dev/null &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v-12m&lt;/span&gt; +%Y-%m-%d&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;PAGE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;RESPONSE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;curl &lt;span class=&quot;nt&quot;&gt;-s&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;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;Accept: application/vnd.github+json&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;X-GitHub-Api-Version: 2022-11-28&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/orgs/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/repos?per_page=100&amp;amp;sort=pushed&amp;amp;direction=asc&amp;amp;page=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PAGE&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;# Check if we got results&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;COUNT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RESPONSE&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; | jq &lt;span class=&quot;s1&quot;&gt;&apos;length&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$COUNT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-eq&lt;/span&gt; 0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;break
  &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;# Output: name, pushed_at, archived, open_issues_count, visibility&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RESPONSE&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; | jq &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;.[] | [.name, .pushed_at, .archived, .open_issues_count, .visibility] | @csv&apos;&lt;/span&gt;
  
  &lt;span class=&quot;nv&quot;&gt;PAGE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$((&lt;/span&gt;PAGE &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Token scopes required:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo&lt;/code&gt; for private repos, or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;public_repo&lt;/code&gt; for public only. Fine-grained tokens need &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;read:org&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Contents: Read&lt;/code&gt; permissions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This gives you a CSV you can load into a spreadsheet or pipe into further processing.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Audit log alternative:&lt;/strong&gt; If you have &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise&quot;&gt;audit log streaming&lt;/a&gt; enabled (GitHub Enterprise Cloud), you can query &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.create&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.archived&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.destroy&lt;/code&gt; events directly from your stream instead of polling the REST API. This is more efficient at scale and gives you a persistent event history beyond what polling provides. More on this at the end of the post.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;step-2-enrich-with-activity-data&quot;&gt;Step 2: Enrich with Activity Data&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pushed_at&lt;/code&gt; alone won’t cut it (bots can inflate it). Cross-reference with actual human activity using the repo activity endpoint:&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;&lt;span class=&quot;c&quot;&gt;# Get recent push activity for a specific repo&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-s&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;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;Accept: application/vnd.github+json&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/activity?activity_type=push&amp;amp;per_page=5&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Audit log event:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git.push&lt;/code&gt; fires every time code is pushed to a repo. This event is only available via the REST API, audit log streaming, or JSON/CSV export - it does not appear in the web UI audit log view. If you’re streaming audit logs, filtering on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;action: git.push&lt;/code&gt; scoped to a specific repo gives you a continuous, low-latency record of actual push activity without polling.&lt;/p&gt;

&lt;p&gt;You can also check Actions runs - a repo with no recent workflow runs is likely dormant:&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;&lt;span class=&quot;c&quot;&gt;# Check for recent Actions runs&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-s&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;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;Accept: application/vnd.github+json&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/actions/runs?per_page=1&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | jq &lt;span class=&quot;s1&quot;&gt;&apos;.total_count, .workflow_runs[0].created_at&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Audit log events:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;workflows.created_workflow_run&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;workflows.completed_workflow_run&lt;/code&gt; are emitted for every workflow run. Like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git.push&lt;/code&gt;, these are stream/API/export-only - they don’t show in the web UI. If you’re streaming, filtering on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;action: workflows.completed_workflow_run&lt;/code&gt; gives you a continuous record of CI/CD activity per repo without polling the Actions API on a cron.&lt;/p&gt;

&lt;h3 id=&quot;check-issue-and-comment-activity-not-just-open-count&quot;&gt;Check Issue and Comment Activity (Not Just Open Count)&lt;/h3&gt;

&lt;p&gt;Here’s where a lot of audits go wrong: they look at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;open_issues_count&lt;/code&gt; and call it a day. That’s not the signal you want. Instead, check the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updated_at&lt;/code&gt; timestamp on the most recently touched issue - this captures comments, label changes, and assignee updates, not just new issue creation.&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;&lt;span class=&quot;c&quot;&gt;# Get the most recently updated issue or PR (includes comments)&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-s&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;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;Accept: application/vnd.github+json&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/issues?state=all&amp;amp;sort=updated&amp;amp;direction=desc&amp;amp;per_page=1&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | jq &lt;span class=&quot;s1&quot;&gt;&apos;.[0] | {number: .number, title: .title, updated_at: .updated_at, state: .state}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If that returns nothing, the repo has never had an issue. If it returns something, compare &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;updated_at&lt;/code&gt; against your staleness cutoff - not the issue state.&lt;/p&gt;

&lt;p&gt;For a more complete picture, also check the issue comments endpoint directly:&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;&lt;span class=&quot;c&quot;&gt;# Get the most recent comment across all issues&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-s&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;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;Accept: application/vnd.github+json&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/issues/comments?sort=updated&amp;amp;direction=desc&amp;amp;per_page=1&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | jq &lt;span class=&quot;s1&quot;&gt;&apos;.[0] | {issue_url: .issue_url, updated_at: .updated_at, user: .user.login}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;A repo where someone left a comment last week is not stale - even if the last code push was two years ago and there are zero open issues sitting in the queue.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;A note on audit log coverage for issues:&lt;/strong&gt; Regular issue activity - opening, closing, commenting, editing - is &lt;strong&gt;not&lt;/strong&gt; captured in the audit log. Only administrative actions appear there: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;issue.destroy&lt;/code&gt; (permanent deletion) and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;issue.pinned&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;issue.unpinned&lt;/code&gt;. The same is true for comments: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;issue_comment.destroy&lt;/code&gt; is in the audit log, but creating or editing a comment is not. For staleness detection based on issue engagement, &lt;strong&gt;the REST API approach above is the right tool&lt;/strong&gt; - the audit log won’t help you here.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;check-clones-and-traffic&quot;&gt;Check Clones and Traffic&lt;/h3&gt;

&lt;p&gt;Traffic data is a strong signal that a repo is being consumed even when no one is contributing to it. A package repo with zero commits in two years but 500 clones last week is very much alive.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Heads up on limitations:&lt;/strong&gt; GitHub’s traffic API only returns data for the &lt;strong&gt;last 14 days&lt;/strong&gt;, and it requires &lt;strong&gt;push access&lt;/strong&gt; to the repository. That means you can’t run this as a read-only audit across an entire org unless you have admin-level access to each repo. Plan accordingly.&lt;/p&gt;
&lt;/blockquote&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;&lt;span class=&quot;c&quot;&gt;# Get clone counts for the last 14 days&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-s&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;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;Accept: application/vnd.github+json&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/traffic/clones&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | jq &lt;span class=&quot;s1&quot;&gt;&apos;{total_clones: .count, unique_cloners: .uniques}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&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;&lt;span class=&quot;c&quot;&gt;# Get page view counts for the last 14 days&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-s&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;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;Accept: application/vnd.github+json&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/traffic/views&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | jq &lt;span class=&quot;s1&quot;&gt;&apos;{total_views: .count, unique_visitors: .uniques}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If both return &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0&lt;/code&gt; unique visitors and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0&lt;/code&gt; clones, that’s meaningful signal. If either shows consistent activity, take the repo off your archive list regardless of what the commit history looks like.&lt;/p&gt;

&lt;p&gt;Because the window is only 14 days, don’t use a single snapshot to make a permanent decision. If you’re running the monthly Actions workflow below, consider storing the traffic numbers each run so you can build a rolling 90-day picture over time.&lt;/p&gt;

&lt;h3 id=&quot;a-special-case-github-pages-sites&quot;&gt;A Special Case: GitHub Pages Sites&lt;/h3&gt;

&lt;p&gt;If a repo is serving a GitHub Pages site, the commit history is almost irrelevant - the site could be getting thousands of visits a week while the content hasn’t changed in years. That’s not stale, that’s stable.&lt;/p&gt;

&lt;p&gt;The problem is that GitHub has no API for Pages web traffic. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;traffic/views&lt;/code&gt; endpoint above reflects visits to the repo on github.com, not to the published Pages URL (e.g., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https://yourorg.github.io/project-name&lt;/code&gt;). There’s no GitHub-native way to see how many people are hitting the live site.&lt;/p&gt;

&lt;p&gt;What you can do is check whether Pages is even enabled before making any archiving decision:&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;&lt;span class=&quot;c&quot;&gt;# Check if GitHub Pages is enabled for a repo&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-s&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;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;Accept: application/vnd.github+json&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/pages&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  | jq &lt;span class=&quot;s1&quot;&gt;&apos;{status: .status, url: .html_url, custom_domain: .cname}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If this returns a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;404&lt;/code&gt;, Pages isn’t enabled. If it returns a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;status&lt;/code&gt; of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;built&lt;/code&gt;, there’s a live site. At that point, treat the repo as a &lt;strong&gt;manual review&lt;/strong&gt; item regardless of code activity. Check with the owning team, look at any analytics the site may have (Google Analytics, Plausible, etc.), and verify whether anyone depends on the URL before archiving.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Archiving a repo with GitHub Pages enabled will take the site offline. GitHub will stop serving the Pages content. If there are inbound links, SEO value, or users depending on that URL, that’s a real impact - not just a housekeeping decision.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Audit log events for Pages:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.pages_create&lt;/code&gt; fires when a Pages site is enabled on a repo, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.pages_destroy&lt;/code&gt; when it’s deleted, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.pages_source&lt;/code&gt; when the source branch or folder is changed. If you’re streaming audit logs, you can build a real-time inventory of Pages-enabled repos by watching for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.pages_create&lt;/code&gt; events - and automatically flag any future new repos that enable Pages for heightened staleness review.&lt;/p&gt;

&lt;h2 id=&quot;step-3-automate-the-audit-as-a-github-actions-workflow&quot;&gt;Step 3: Automate the Audit as a GitHub Actions Workflow&lt;/h2&gt;

&lt;p&gt;The best audits run automatically. Here’s a workflow that generates a stale repo report on a schedule and opens an issue (or comments on an existing one) with the findings:&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;# .github/workflows/stale-repo-audit.yml&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;Stale Repository Audit&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;schedule&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;na&quot;&gt;cron&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;0&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;*&apos;&lt;/span&gt;   &lt;span class=&quot;c1&quot;&gt;# First of every month, 8am UTC&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;workflow_dispatch&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;audit&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;permissions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;issues&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;write&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;steps&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;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Identify stale repos&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;find-stale&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;GH_TOKEN&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;$&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;ORG&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;$&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;CUTOFF=$(date -d &quot;12 months ago&quot; --iso-8601)&lt;/span&gt;
          
          &lt;span class=&quot;s&quot;&gt;# Pull all repos, filter to non-archived, pushed before cutoff&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;gh api \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;--paginate \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;&quot;/orgs/$ORG/repos?sort=pushed&amp;amp;direction=asc&quot; \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;--jq &quot;.[] | select(.archived == false) | select(.pushed_at &amp;lt; \&quot;$CUTOFF\&quot;) | \&lt;/span&gt;
                  &lt;span class=&quot;s&quot;&gt;\&quot;\(.name) | Last push: \(.pushed_at | split(\&quot;T\&quot;)[0]) | Open issues: \(.open_issues_count) | \(.visibility)\&quot;&quot; \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;&amp;gt; stale_repos.txt&lt;/span&gt;
          
          &lt;span class=&quot;s&quot;&gt;# Enrich with last issue activity (updated_at, not open count)&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;while IFS=&apos;|&apos; read -r name rest; do&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;name=$(echo &quot;$name&quot; | xargs)&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;LAST_ISSUE=$(gh api &quot;/repos/$ORG/$name/issues?state=all&amp;amp;sort=updated&amp;amp;direction=desc&amp;amp;per_page=1&quot; \&lt;/span&gt;
              &lt;span class=&quot;s&quot;&gt;--jq &apos;.[0].updated_at // &quot;none&quot;&apos; 2&amp;gt;/dev/null)&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;echo &quot;$name |$rest| Last issue activity: $LAST_ISSUE&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;done &amp;lt; stale_repos.txt &amp;gt; stale_repos_enriched.txt&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;mv stale_repos_enriched.txt stale_repos.txt&lt;/span&gt;
          
          &lt;span class=&quot;s&quot;&gt;COUNT=$(wc -l &amp;lt; stale_repos.txt)&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;echo &quot;count=$COUNT&quot; &amp;gt;&amp;gt; &quot;$GITHUB_OUTPUT&quot;&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;Create or update tracking issue&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;steps.find-stale.outputs.count &amp;gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;GH_TOKEN&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;$&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;run&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;COUNT=$&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;BODY=&quot;## Stale Repository Report - $(date +%Y-%m-%d)\n\n&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;BODY+=&quot;Found **$COUNT** repos with no pushes in the last 12 months:\n\n&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;BODY+=&quot;| Repo | Last Push | Open Issues | Visibility |\n&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;BODY+=&quot;|------|-----------|-------------|------------|\n&quot;&lt;/span&gt;
          
          &lt;span class=&quot;s&quot;&gt;while IFS=&apos;|&apos; read -r name pushed issues vis; do&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;BODY+=&quot;| $name |$pushed |$issues |$vis |\n&quot;&lt;/span&gt;
          &lt;span class=&quot;s&quot;&gt;done &amp;lt; stale_repos.txt&lt;/span&gt;
          
          &lt;span class=&quot;s&quot;&gt;BODY+=&quot;\n\nAction required: Review each repo and either archive or confirm it should remain active.&quot;&lt;/span&gt;
          
          &lt;span class=&quot;s&quot;&gt;echo -e &quot;$BODY&quot; | gh issue create \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;--repo &quot;$GITHUB_REPOSITORY&quot; \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;--title &quot;Stale Repo Audit: $COUNT repos need review ($(date +%Y-%m))&quot; \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;--label &quot;maintenance&quot; \&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;--body-file -&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Every month, you get a fresh issue with the current state of your org. No more mystery repos.&lt;/p&gt;

&lt;h2 id=&quot;step-4-categorize-before-you-act&quot;&gt;Step 4: Categorize Before You Act&lt;/h2&gt;

&lt;p&gt;Once you have your list, don’t just archive everything blindly. Run it through your team and categorize each repo:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Category&lt;/th&gt;
      &lt;th&gt;Action&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Actively used but rarely pushed (config, docs)&lt;/td&gt;
      &lt;td&gt;Mark with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;archive:keep&lt;/code&gt; topic, no action&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Project is genuinely complete&lt;/td&gt;
      &lt;td&gt;Archive&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Project was abandoned mid-work&lt;/td&gt;
      &lt;td&gt;Archive + document in README&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Looks like a test/personal sandbox&lt;/td&gt;
      &lt;td&gt;Delete (with approvals)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Unknown - original owner left&lt;/td&gt;
      &lt;td&gt;Assign a new owner for review&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Has known consumers (package, API)&lt;/td&gt;
      &lt;td&gt;Check dependents before archiving&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Pro tip:&lt;/strong&gt; Before taking action on anything, use the &lt;a href=&quot;https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository&quot;&gt;dependents graph&lt;/a&gt; to see if other repos depend on the one you’re considering cleaning up.&lt;/p&gt;

&lt;h2 id=&quot;step-5-archive-via-the-api&quot;&gt;Step 5: Archive via the API&lt;/h2&gt;

&lt;p&gt;Once you have a list of repos to archive, do it programmatically. One click at a time across 50 repos is not a workflow.&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;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# archive-repos.sh&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Usage: ./archive-repos.sh repos_to_archive.txt&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;TOKEN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ghp_your_token&quot;&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;ORG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;your-org-name&quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;IFS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; REPO&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Archiving &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;...&quot;&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;RESPONSE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /dev/null &lt;span class=&quot;nt&quot;&gt;-w&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%{http_code}&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; PATCH &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;Accept: application/vnd.github+json&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;X-GitHub-Api-Version: 2022-11-28&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&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;-d&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;{&quot;archived&quot;: true}&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RESPONSE&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-eq&lt;/span&gt; 200 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;  [OK] &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; archived&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;else
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;  [FAIL] &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; - HTTP &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RESPONSE&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
  
  &lt;span class=&quot;c&quot;&gt;# Be polite to the API&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;sleep &lt;/span&gt;0.5
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; &amp;lt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;What archiving does:&lt;/strong&gt; Sets the repo to read-only. All code, issues, PRs, and history remain intact. No one gets locked out - they just can’t push or create new issues. It’s reversible.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;What archiving does NOT do:&lt;/strong&gt; Delete the repo, free up storage (in most plans), or remove it from search results. It just signals “this is frozen.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Audit log event:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.archived&lt;/code&gt; fires when a repo is archived. If you’re streaming to a SIEM or data warehouse, you can use this event to trigger downstream cleanup automatically - notify the original team, remove the repo from active security scanning queues, update a CMDB, or kick off a documentation workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro tip - stamp the archive date with a custom property:&lt;/strong&gt; GitHub &lt;a href=&quot;https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization&quot;&gt;custom properties&lt;/a&gt; let you attach arbitrary metadata to a repo. Set an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;archived_date&lt;/code&gt; property (type: string, format: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;YYYY-MM-DD&lt;/code&gt;) at archive time so you have a queryable record of when it happened - not just that it happened.&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;&lt;span class=&quot;c&quot;&gt;# Set a custom property on a repo at archive time&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; PATCH &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;Accept: application/vnd.github+json&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;X-GitHub-Api-Version: 2022-11-28&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/properties/values&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;properties&quot;: [{&quot;property_name&quot;: &quot;archived_date&quot;, &quot;value&quot;: &quot;&apos;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt; +%Y-%m-%d&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;&quot;}]}&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can then query all repos with a given property value across your org - useful for compliance reporting (“show me everything archived in the last year”) or for automating deletion workflows after a retention window expires.&lt;/p&gt;

&lt;h2 id=&quot;step-6-transfer-to-an-archive-org-warm-storage&quot;&gt;Step 6: Transfer to an Archive Org (Warm Storage)&lt;/h2&gt;

&lt;p&gt;Archiving in place is the right first move - but some orgs go one step further before considering permanent deletion. The pattern: create a separate GitHub organization (e.g., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yourcompany-archive&lt;/code&gt;) and &lt;strong&gt;transfer&lt;/strong&gt; repos there before deleting them. Think of it as warm storage - the code still exists, it’s accessible if someone panics two months later, but it’s completely out of the way of your main org.&lt;/p&gt;

&lt;p&gt;This approach has real practical value:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Your primary org’s repo list stays clean without permanently destroying anything&lt;/li&gt;
  &lt;li&gt;You get a clear “last chance” window before deletion - set a policy like “repos transferred to the archive org are deleted after 12 months”&lt;/li&gt;
  &lt;li&gt;The archive org can have tighter access controls - no one except platform admins can poke around in there&lt;/li&gt;
  &lt;li&gt;It separates the decision to stop using something from the decision to destroy it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To transfer a repo 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;&lt;span class=&quot;c&quot;&gt;# Transfer a repo to an archive org&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; POST &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;Accept: application/vnd.github+json&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;X-GitHub-Api-Version: 2022-11-28&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/transfer&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;s2&quot;&gt;&quot;{&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;new_owner&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;yourcompany-archive&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;}&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Token requirements:&lt;/strong&gt; The token must have admin access to the source repo and either ownership or admin access on the destination org. Transfer will fail silently if the destination org hasn’t granted the token sufficient permissions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Audit log events:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.transfer_start&lt;/code&gt; fires when the transfer is initiated, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.transfer&lt;/code&gt; fires when the receiving org accepts it. If you’re streaming audit logs, you can watch &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.transfer&lt;/code&gt; events into the archive org as your signal to start the retention clock - and then automate deletion when that clock expires.&lt;/p&gt;

&lt;p&gt;A few things to validate before transferring:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Any deploy keys, webhooks, and GitHub Apps connected to the repo will &lt;strong&gt;not&lt;/strong&gt; carry over - they’ll need to be re-added if you ever restore the repo&lt;/li&gt;
  &lt;li&gt;Team access is lost on transfer. You may want to add the original team as collaborators in the archive org before transferring if you want them to still be able to read the code&lt;/li&gt;
  &lt;li&gt;If the repo has GitHub Packages published to it, packages stay in the source org - coordinate separately&lt;/li&gt;
  &lt;li&gt;GitHub Actions secrets and variables do &lt;strong&gt;not&lt;/strong&gt; transfer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This pattern works best when you have a clear retention policy attached to it. “Repos sit in the archive org for 180 days and are then deleted” is the kind of rule that’s easy to automate and easy to communicate.&lt;/p&gt;

&lt;h2 id=&quot;step-7-deletion-for-the-brave&quot;&gt;Step 7: Deletion (for the Brave)&lt;/h2&gt;

&lt;p&gt;Deletion is permanent. Only do this for repos you are 100% certain have no value and no consumers. Before deleting:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Check the dependency graph&lt;/li&gt;
  &lt;li&gt;Search your CI/CD config for any references to the repo name&lt;/li&gt;
  &lt;li&gt;Export an archive of the code via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GET /repos/{owner}/{repo}/tarball&lt;/code&gt; if you want a local backup&lt;/li&gt;
  &lt;li&gt;Get sign-off from leadership or the relevant team lead&lt;/li&gt;
&lt;/ul&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;&lt;span class=&quot;c&quot;&gt;# Export a backup before deletion&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-L&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;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;Accept: application/vnd.github+json&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/tarball&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;-backup.tar.gz&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then delete:&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; DELETE &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;Accept: application/vnd.github+json&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;X-GitHub-Api-Version: 2022-11-28&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;https://api.github.com/repos/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ORG&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REPO&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Note that deleting repos requires the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;delete_repo&lt;/code&gt; OAuth scope, or admin permissions on the org. If you transferred to an archive org first, run the delete script against that org, not the source.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Audit log event:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.destroy&lt;/code&gt; fires when a repo is permanently deleted. This is your paper trail - make sure your audit log stream is capturing this event before you run any bulk delete scripts. If a delete goes wrong, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.destroy&lt;/code&gt; is what you’ll search for first.&lt;/p&gt;

&lt;h2 id=&quot;operationalizing-this-process&quot;&gt;Operationalizing This Process&lt;/h2&gt;

&lt;p&gt;A one-time cleanup is great. A repeating process is better. Here’s your action plan for making stale repo hygiene a habit:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Immediate (one-time):&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Run the audit script against your org&lt;/li&gt;
  &lt;li&gt;Generate your initial stale repo list&lt;/li&gt;
  &lt;li&gt;Set a triage session with 2-3 senior engineers to categorize&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ongoing (quarterly):&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;The GitHub Actions workflow above handles monthly reporting automatically&lt;/li&gt;
  &lt;li&gt;Quarterly review sessions to act on the report&lt;/li&gt;
  &lt;li&gt;Archive or delete based on team input&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Preventive (policy):&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Require a README and CODEOWNERS for all new repos&lt;/li&gt;
  &lt;li&gt;Set a repo naming convention that includes the owning team&lt;/li&gt;
  &lt;li&gt;Consider using &lt;a href=&quot;https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics&quot;&gt;repository topics&lt;/a&gt; like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;status:archived&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;status:active&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;status:deprecated&lt;/code&gt; to track state explicitly&lt;/li&gt;
  &lt;li&gt;Use &lt;a href=&quot;https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization&quot;&gt;custom properties&lt;/a&gt; to capture structured metadata like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;owning_team&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;archived_date&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;review_due&lt;/code&gt; - unlike topics, custom properties are typed, can be required, and are queryable via the API across your entire org without parsing free-text strings&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;key-takeaways&quot;&gt;Key Takeaways&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Define staleness with multiple signals&lt;/strong&gt; - last push + no activity + no CI runs is a solid threshold&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Audit with the API, not by hand&lt;/strong&gt; - pagination + jq handles orgs of any size&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Categorize before acting&lt;/strong&gt; - not every old repo should be deleted or even archived&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Archive first, delete with caution&lt;/strong&gt; - archiving is reversible; deletion is not&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Automate the recurring audit&lt;/strong&gt; - a monthly GitHub Actions workflow keeps the list current without manual effort&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Document your decisions&lt;/strong&gt; - update READMEs to explain why a repo is archived or what happened to the project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal isn’t a perfectly pristine org with zero stale repos. The goal is that when your next new developer starts and browses your org, they can quickly tell what’s relevant, what’s dormant, and why.&lt;/p&gt;

&lt;h2 id=&quot;keeping-the-garage-clean-going-forward&quot;&gt;Keeping the Garage Clean Going Forward&lt;/h2&gt;

&lt;p&gt;If your organization has grown to the point where you have hundreds of orgs and tens (or hundreds) of thousands of repos, the API-based approach in this post is how you do the initial cleanup - but it’s not how you manage that scale going forward. Iterating through every org, paginating every repo list, and hitting enrichment endpoints for each one just to get a current view isn’t a system. It’s a chore. A slow, expensive, rate-limited chore.&lt;/p&gt;

&lt;p&gt;The audit log stream changes the equation. Every event in this post - every &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git.push&lt;/code&gt;, every &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.create&lt;/code&gt;, every &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.archived&lt;/code&gt; - is emitted to the stream in real time, across every org in your enterprise, without you having to ask for it. Instead of a monthly job asking “what’s stale right now?”, you get a continuous feed of what’s &lt;em&gt;happening&lt;/em&gt; right now. Process it once as it goes by, update a database, and you always have a current picture without polling anything.&lt;/p&gt;

&lt;p&gt;The initial cleanup is work. Getting to a clean state takes effort regardless of how you do it. But keeping it clean? That becomes a solved problem the moment you start treating the audit log as a data source rather than an audit trail. Everything above is a cleanup campaign - you’re going back to that pile of boxes and sorting through them. The audit log is what keeps new boxes from piling up in the first place.&lt;/p&gt;

&lt;p&gt;Every signal we’ve discussed throughout this post is also emitted to the &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise&quot;&gt;audit log stream&lt;/a&gt;. Instead of running a monthly cron job to ask “what’s stale right now?”, you can build a system that &lt;strong&gt;knows from the moment a repo is created&lt;/strong&gt; what governance it needs - and tracks its health continuously.&lt;/p&gt;

&lt;h3 id=&quot;intercept-repos-at-creation&quot;&gt;Intercept Repos at Creation&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.create&lt;/code&gt; fires the instant a new repository is created. Stream this event and you can trigger a provisioning workflow immediately:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Check for a README - if missing, open an issue or send a Slack message to the creator&lt;/li&gt;
  &lt;li&gt;Verify a CODEOWNERS file exists - if not, assign the repo to a default owner team&lt;/li&gt;
  &lt;li&gt;Apply a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;status:active&lt;/code&gt; topic automatically so the repo is searchable and categorized from day one&lt;/li&gt;
  &lt;li&gt;Record the repo in your inventory with metadata (creator, team, date, visibility)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A new repo that enters the org without a README, CODEOWNERS, and team topic is a future stale repo. Stop it there.&lt;/p&gt;

&lt;h3 id=&quot;build-a-living-activity-score&quot;&gt;Build a Living Activity Score&lt;/h3&gt;

&lt;p&gt;Instead of polling the API once a month, stream these events continuously and update a staleness score per repo in real time:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Audit Event&lt;/th&gt;
      &lt;th&gt;Signal&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git.push&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Code is actively changing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;workflows.completed_workflow_run&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;CI/CD is running&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pull_request.create&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pull_request.merge&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Humans are collaborating&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.pages_create&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;A live site is attached - flag for manual review&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.archived&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Explicitly marked frozen - remove from scan queues&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.destroy&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Permanently deleted - clean up downstream references&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A repo that hasn’t seen any of the first three events in 12 months is your stale candidate. No polling required.&lt;/p&gt;

&lt;h3 id=&quot;make-archiving-self-service&quot;&gt;Make Archiving Self-Service&lt;/h3&gt;

&lt;p&gt;One of the biggest reasons stale repos accumulate is friction. If archiving requires a ticket, a manager approval, and three Slack messages, people won’t do it. If there’s a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;make it easy&lt;/code&gt; button, they will.&lt;/p&gt;

&lt;p&gt;Consider adding a repository topic like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ready-to-archive&lt;/code&gt; as a self-service signal. A workflow watching &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;repo.add_topic&lt;/code&gt; events can detect this, run a final checklist (no open PRs, no active deployments, no Pages site), and automatically archive the repo - or open a tracking issue if the checklist fails.&lt;/p&gt;

&lt;p&gt;The goal is closing the loop: the audit log tells you what’s happening, the API gives you the data to evaluate it, and GitHub Actions does the work. Put those three things together and you’ve turned a reactive cleanup campaign into a system that maintains itself.&lt;/p&gt;

&lt;p&gt;That’s how you stop the boxes from piling up.&lt;/p&gt;

&lt;h2 id=&quot;useful-references&quot;&gt;Useful References&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/repositories/archiving-a-github-repository/archiving-repositories&quot;&gt;Archiving repositories&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/repos/repos#list-organization-repositories&quot;&gt;REST API - List organization repositories&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/repos/repos#update-a-repository&quot;&gt;REST API - Update a repository&lt;/a&gt; (for archiving)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/repos/repos#delete-a-repository&quot;&gt;REST API - Delete a repository&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/rest/repos/repos#list-repository-activities&quot;&gt;REST API - List repository activities&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://cli.github.com/manual/&quot;&gt;GitHub CLI (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gh&lt;/code&gt;) documentation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization&quot;&gt;Audit log events for your organization&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise&quot;&gt;Streaming the audit log&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
   
    <category term="github" />
   
    <category term="devops" />
   
    <category term="automation" />
   
    <category term="github-actions" />
   
    <category term="api" />
   
    <category term="best-practices" />
   
 </entry>
 
 <entry>
   <title>The Mana of Corporate Politics</title>
   <link href="https://www.dxrf.com/blog/2026/03/24/the-mana-of-corporate-politics/"/>
   <updated>2026-03-24T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/03/24/the-mana-of-corporate-politics</id>
   <excerpt type="html">Corporate politics explained through a gaming lens. Mana, spells, and why not all actions cost the same amount of political capital.</excerpt>
   <content type="html">&lt;p&gt;I was explaining corporate politics to a mentee recently and, somewhere in the middle of it, I started reaching for an analogy. I could have gone corporate-y about it, talked about stakeholder management or influence without authority, but we’re in tech and tech people are nerds. So let’s use a system nerds actually understand. Yes, this is silly. Yes, this is dorky. But it’s a good way to illustrate the concepts of working in the corporate environment.&lt;/p&gt;

&lt;p&gt;Welcome to corporate politics as a mana-based spell casting system.&lt;/p&gt;

&lt;h2 id=&quot;the-core-system&quot;&gt;The Core System&lt;/h2&gt;

&lt;p&gt;If you’ve played any card game, RPG, or strategy game in the last 30 years, you already get the basics. You have a pool of resources. Actions cost resources. Spend more than you have and bad things happen.&lt;/p&gt;

&lt;p&gt;Here’s the mapping:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mana = Political Capital&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Political capital is the trust, credibility, and goodwill you’ve accumulated with the people around you: peers, managers, stakeholders, skip-levels. It’s invisible, it’s not written down anywhere, and nobody will tell you your exact balance. But it’s very real, and it absolutely governs what you can do.&lt;/p&gt;

&lt;p&gt;You can gain it, you can spend it, but if you spend more than you have, you’ll take damage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spells = Your Actions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Spells are the things you do that require political capital to pull off. Pushing back on a leadership decision. Raising a concern in a public forum. Calling out a flawed process. Asking a pointed question in an all-hands. These all cost mana.&lt;/p&gt;

&lt;p&gt;The important thing to understand is that not every action costs the same. And not all spells are created equal.&lt;/p&gt;

&lt;h2 id=&quot;the-spell-book&quot;&gt;The Spell Book&lt;/h2&gt;

&lt;p&gt;Here’s where the analogy gets interesting. In most games, you have a variety of spells at different costs. Corporate life works the same way.&lt;/p&gt;

&lt;p&gt;Here’s a breakdown of some of the spells you’ll encounter; and probably cast; most often.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High-cost spells&lt;/strong&gt; - Your big plays. Vocally disagreeing with a senior leader in a meeting. Escalating an issue over your manager’s head. Formally objecting to a decision that has already been made. These can absolutely be the right move, but they’re expensive. You need the mana to back them up, and you need to be prepared for the cooldown period after you cast them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Low-cost spells&lt;/strong&gt; - Asking genuine clarifying questions. Offering a suggestion framed as “what if we also considered…” Volunteering for a task that nobody wants but that matters. These are your cantrips. They cost little and sometimes even generate mana.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Free spells&lt;/strong&gt; - Doing good work consistently. Showing up prepared. Following through on what you said you’d do. These don’t cost mana at all: in fact, they fill your mana pool over time. The boring stuff is the foundation everything else is built on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Buff&lt;/strong&gt; - Publicly championing someone else’s work or idea. One of the best mana generators in the game. It costs almost nothing and earns you credibility with everyone watching, including the person you’re buffing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summon&lt;/strong&gt; - Bringing in an executive sponsor or senior ally to back your position. Very high-cost, high-impact. Effective when cast at the right moment; burns a major relationship if overused or deployed too early.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Counterspell&lt;/strong&gt; - The “well, actually…” interrupt. Blocking or immediately rebutting someone else’s idea in the room. Costs mana and often generates animosity. Use sparingly and make sure you have something better to offer, not just a block.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AoE (Area of Effect)&lt;/strong&gt; - The reply-all email, the message in the company-wide Slack channel, the all-hands question that implicates multiple teams. Actions that touch many stakeholders at once. The radius multiplies both the impact and the mana cost. A missed AoE is very visible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pre-cast / Ward&lt;/strong&gt; - Pre-briefing key stakeholders before a meeting so nothing is a surprise. This converts what would be a high-cost public spell into a series of low-cost private ones. Underrated and underused. Walk people through your proposal one-on-one before the room fills up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time Stop&lt;/strong&gt; - Requesting more data, another review cycle, or another meeting to delay a decision you oppose. Cheap in the short term, but repeated casting signals that you’re stalling and people notice. Use it once to buy time for a real counter-proposal. Don’t make it a habit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debuff&lt;/strong&gt; - Subtly planting doubt about someone else’s work or credibility. Technically low mana cost, but carries enormous risk. If anyone notices, and someone usually does, the reputational blowback is severe and hard to reverse. This one lives in the dark arts category.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concealment&lt;/strong&gt; - Disguising a high-cost spell as a free one. The “clarifying question” that’s really a targeted critique. The “just thinking out loud” comment that’s a fully formed rebuttal in a trench coat. Everyone has seen this. The problem is it doesn’t always work, and it &lt;em&gt;always&lt;/em&gt; costs mana anyway. When it lands, people think you’re curious and collaborative. When it doesn’t, you’ve burned mana AND credibility. You spent twice. If you have a real concern, name it directly. Authentic is almost always cheaper than clever.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;True Sight&lt;/strong&gt; - Recognizing when someone else is casting on you. This is a passive skill, not an active one, but it’s one of the highest-value things you can develop. Once you can identify what spell is being cast and why, you can respond to the actual situation instead of the surface conversation.&lt;/p&gt;

&lt;h2 id=&quot;mana-regeneration&quot;&gt;Mana Regeneration&lt;/h2&gt;

&lt;p&gt;So how do you fill your mana pool back up?&lt;/p&gt;

&lt;p&gt;Mostly through the unsexy stuff. Delivering on commitments. Being the person who helps others without expecting an immediate return. Building genuine relationships before you need them. Sharing credit publicly. Taking ownership privately when things go sideways.&lt;/p&gt;

&lt;p&gt;You also regenerate mana when you cast expensive spells well. If you pushed back on that process rollout and you turned out to be right, your mana pool comes back bigger than before. Risk and reward.&lt;/p&gt;

&lt;p&gt;The people with massive mana pools didn’t hoard it; they spent it, built credibility from the outcomes, and let it refill.&lt;/p&gt;

&lt;h2 id=&quot;dont-go-negative&quot;&gt;Don’t Go Negative&lt;/h2&gt;

&lt;p&gt;Here’s the danger zone: spending past zero.&lt;/p&gt;

&lt;p&gt;Let’s say you have 5 mana and you cast a 3-cost spell (public pushback on a decision). You’re at 2. Fine. Now you keep pushing in the same meeting and there goes another 2 mana. You’re at zero. If you keep going after that, you’ve gone negative. And being negative on political capital is where careers stall.&lt;/p&gt;

&lt;p&gt;Going negative doesn’t mean you get fired (usually). It means people stop listening. It means your ideas get dismissed before you finish saying them. It means you’re no longer in the room when the important decisions get made.&lt;/p&gt;

&lt;p&gt;The move is not to never spend mana. The move is to know your current balance and choose your spells accordingly.&lt;/p&gt;

&lt;h2 id=&quot;playing-the-long-game&quot;&gt;Playing the Long Game&lt;/h2&gt;

&lt;p&gt;One of the most effective strategies I’ve seen is what I’d call mana stacking. It’s getting really good at building capital quickly so you can cast consistently without going dry.&lt;/p&gt;

&lt;p&gt;A few patterns that work:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Be generous with credit.&lt;/strong&gt; Publicly recognizing other people’s contributions costs nothing and earns you credibility with everyone watching.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Do the unglamorous work.&lt;/strong&gt; Volunteering for the task nobody wants is a consistent mana generator. People remember.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Be reliable at small things.&lt;/strong&gt; Before you try to influence big decisions, establish a track record of follow-through on small ones.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Time your big spells.&lt;/strong&gt; You don’t have to cast every time something bothers you. Choosing the right moment to spend your mana is its own skill.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;Corporate politics isn’t as mysterious as it seems once you have a mental model for it. The mana system isn’t perfect, but it’s close enough to be useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick reference:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Your mana pool is your political capital. It’s built over time through trust, credibility, and consistent performance&lt;/li&gt;
  &lt;li&gt;Every action in the political space has a cost, so you should know what you’re spending before you cast&lt;/li&gt;
  &lt;li&gt;Concealment spells are risky. Authentic is almost always cheaper than clever&lt;/li&gt;
  &lt;li&gt;Going to zero is fine; going negative is where it gets dangerous&lt;/li&gt;
  &lt;li&gt;The biggest mana generators are the boring ones: reliability, generosity, follow-through&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The people who navigate corporate environments well aren’t the ones playing dirty or the ones refusing to play at all. They’re the ones who understand the system, manage their resources deliberately, and know when a spell is worth casting.&lt;/p&gt;

&lt;p&gt;Now go refill your mana pool.&lt;/p&gt;

&lt;h2 id=&quot;closing&quot;&gt;Closing&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Have questions or want to share your experience navigating corporate politics? Find me on &lt;a href=&quot;https://github.com/jmassardo&quot;&gt;GitHub&lt;/a&gt;, &lt;a href=&quot;https://www.linkedin.com/in/jenna-massardo/&quot;&gt;LinkedIn&lt;/a&gt;, or &lt;a href=&quot;https://bsky.app/profile/jmassardo.bsky.social&quot;&gt;Bluesky&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
   
    <category term="career" />
   
    <category term="leadership" />
   
    <category term="mentorship" />
   
    <category term="soft-skills" />
   
    <category term="professional-development" />
   
 </entry>
 
 <entry>
   <title>Scaling GitHub Rulesets with Custom Properties: A Strategy for Enterprise Governance</title>
   <link href="https://www.dxrf.com/blog/2026/03/10/scaling-github-rulesets-with-custom-properties/"/>
   <updated>2026-03-10T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/03/10/scaling-github-rulesets-with-custom-properties</id>
   <excerpt type="html">Stop managing hundreds of one-off rulesets. Use custom properties to build a tiered governance model that scales across thousands of repos.</excerpt>
   <content type="html">&lt;p&gt;Stop me if you’ve heard this one: your enterprise has 100,000+ repositories spread across dozens of orgs, tens of thousands of developers, a compliance team breathing down your neck, and a patchwork of branch protection rules that nobody fully understands. Sound familiar?&lt;/p&gt;

&lt;p&gt;Here’s the thing - GitHub &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets&quot;&gt;repository rulesets&lt;/a&gt; are a massive upgrade over the old branch protection rules. They’re more flexible, they layer together, and they can be managed at the org level. But if you’re not thoughtful about &lt;em&gt;how&lt;/em&gt; you structure them, you’ll end up right back in the same mess - just with a fancier UI.&lt;/p&gt;

&lt;p&gt;The real power move? Combine rulesets with &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization&quot;&gt;custom properties&lt;/a&gt; to build a tiered governance model that scales across your entire enterprise without making your admin team lose their minds.&lt;/p&gt;

&lt;p&gt;Let’s talk about how to do that.&lt;/p&gt;

&lt;h2 id=&quot;two-schools-of-thought&quot;&gt;Two Schools of Thought&lt;/h2&gt;

&lt;p&gt;Before we get into the how, let’s talk strategy. There are fundamentally two ways to approach policy management with rulesets:&lt;/p&gt;

&lt;h3 id=&quot;option-1-one-ruleset-per-permutation&quot;&gt;Option 1: One Ruleset Per Permutation&lt;/h3&gt;

&lt;p&gt;Create a dedicated ruleset for every unique combination of rules you need. Need secrets protection for internal repos? That’s a ruleset. Need PR reviews for production repos? Another ruleset. Need code scanning for PCI repos? Yet another one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Simple to understand. Each ruleset is self-contained.&lt;/li&gt;
  &lt;li&gt;Easy to audit. You can read a single ruleset and know exactly what it does.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Permutation explosion. As your org grows, you end up with dozens (or hundreds (or thousands)) of nearly identical rulesets.&lt;/li&gt;
  &lt;li&gt;Maintenance nightmare. Changing a common rule means updating it in every ruleset that includes it.&lt;/li&gt;
  &lt;li&gt;Drift. Over time, those “identical” rulesets stop being identical. Someone updates one and forgets the others.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;option-2-composable-rulesets-with-custom-properties&quot;&gt;Option 2: Composable Rulesets with Custom Properties&lt;/h3&gt;

&lt;p&gt;Create a small set of modular rulesets, each focused on a specific policy concern (secrets, PR reviews, code scanning, etc.). Then use custom properties to tag repositories with their governance requirements. Rulesets target repos by property value, and the rules &lt;em&gt;stack automatically&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Scales beautifully. Add a new repo? Set its properties. Done. Whether it’s your 100th repo or your 100,000th.&lt;/li&gt;
  &lt;li&gt;DRY policy management. Each rule lives in exactly one place.&lt;/li&gt;
  &lt;li&gt;Consistent enforcement. No drift between similar repos, even across dozens of orgs.&lt;/li&gt;
  &lt;li&gt;API-driven. You can automate property assignment and ruleset deployment at enterprise scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Requires upfront design. You need to think about your property taxonomy and ruleset architecture before you start building.&lt;/li&gt;
  &lt;li&gt;Slightly more abstract. New admins need to understand how layering works.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s be real, if you’re reading this post, you’re probably managing (or about to manage) an enterprise with a boat load of developers and more repos than you can count. Option 1 will break you. &lt;strong&gt;Option 2 is the play.&lt;/strong&gt; Let’s dig in.&lt;/p&gt;

&lt;h2 id=&quot;the-building-blocks-custom-properties&quot;&gt;The Building Blocks: Custom Properties&lt;/h2&gt;

&lt;p&gt;Custom properties are metadata fields you define at the org level and assign to repositories. Think of them as labels with structure. Unlike topics (which are free-form), custom properties have defined types (text, single select, multi select, boolean) and can be required across all repos.&lt;/p&gt;

&lt;p&gt;The key insight: &lt;strong&gt;org-level rulesets can target repositories based on their custom property values.&lt;/strong&gt; This is what makes the whole composable model work.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Setting up custom properties:&lt;/strong&gt; For step-by-step instructions on creating properties and assigning values, see &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization&quot;&gt;Managing custom properties for repositories in your organization&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;designing-your-property-taxonomy&quot;&gt;Designing Your Property Taxonomy&lt;/h3&gt;

&lt;p&gt;Here’s your action plan for property design:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Keep it simple.&lt;/strong&gt; Start with the fewest properties you need. You can always add more later.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Use single-select for tiered models.&lt;/strong&gt; If a value can only be one thing (like a compliance level), enforce that at the property type level.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Make critical properties required.&lt;/strong&gt; If every repo needs a compliance classification, require it with a default value so nothing slips through.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Use descriptive names.&lt;/strong&gt; Your properties should make sense to someone who’s never seen your governance docs. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Regulatory Compliance&lt;/code&gt; is better than &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rc-level&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Document your values.&lt;/strong&gt; Use the description field. Future you will thank present you.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;building-a-tiered-governance-model&quot;&gt;Building a Tiered Governance Model&lt;/h2&gt;

&lt;p&gt;Let’s walk through a real-world example. Say your organization handles a mix of workloads - dev sandboxes, internal tools, production services, and systems that process PII or cardholder data. You need different levels of governance for each.&lt;/p&gt;

&lt;h3 id=&quot;step-1-define-your-custom-property&quot;&gt;Step 1: Define Your Custom Property&lt;/h3&gt;

&lt;p&gt;Create a single-select custom property at the org level:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Field&lt;/th&gt;
      &lt;th&gt;Value&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Regulatory Compliance&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Type&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Single select&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Values&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;none&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;low&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;medium&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Required&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Default&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;none&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Here’s what each tier maps to in practice:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Tier&lt;/th&gt;
      &lt;th&gt;Use Case&lt;/th&gt;
      &lt;th&gt;Examples&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;none&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Dev sandboxes, experiments, hackathon projects&lt;/td&gt;
      &lt;td&gt;Repos where speed matters more than ceremony&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;low&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Non-production environments, internal tools, staging&lt;/td&gt;
      &lt;td&gt;Repos that support production but don’t serve traffic directly&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;medium&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Production services that don’t handle sensitive data&lt;/td&gt;
      &lt;td&gt;APIs, front-end apps, infrastructure repos&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;high&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Systems handling PII, cardholder data, or regulated workloads&lt;/td&gt;
      &lt;td&gt;Payment processing, healthcare data, auth services&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;step-2-build-your-modular-rulesets&quot;&gt;Step 2: Build Your Modular Rulesets&lt;/h3&gt;

&lt;p&gt;Now, instead of creating one mega-ruleset per tier, you build small, focused rulesets that each address a specific concern. Each ruleset targets repos by property value.&lt;/p&gt;

&lt;p&gt;Here’s the architecture:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-mermaid&quot;&gt;graph LR
    A[&quot;Repo A&amp;lt;br/&amp;gt;Compliance = none&quot;] --&amp;gt; R1[&quot;Baseline Security&quot;]

    B[&quot;Repo B&amp;lt;br/&amp;gt;Compliance = low&quot;] --&amp;gt; R1
    B --&amp;gt; R2[&quot;Standard Dev Workflow&quot;]

    C[&quot;Repo C&amp;lt;br/&amp;gt;Compliance = medium&quot;] --&amp;gt; R1
    C --&amp;gt; R2
    C --&amp;gt; R3[&quot;Production Hardening&quot;]

    D[&quot;Repo D&amp;lt;br/&amp;gt;Compliance = high&quot;] --&amp;gt; R1
    D --&amp;gt; R2
    D --&amp;gt; R3
    D --&amp;gt; R4[&quot;Regulatory Compliance&quot;]

    style A fill:#2ea44f,color:#fff,stroke:#2ea44f
    style B fill:#0969da,color:#fff,stroke:#0969da
    style C fill:#bf8700,color:#fff,stroke:#bf8700
    style D fill:#cf222e,color:#fff,stroke:#cf222e
    style R1 fill:#333,color:#fff,stroke:#555
    style R2 fill:#333,color:#fff,stroke:#555
    style R3 fill:#333,color:#fff,stroke:#555
    style R4 fill:#333,color:#fff,stroke:#555
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Read the chart top to bottom: each tier inherits everything from the tiers below it. A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt; repo gets all four rulesets stacked together. A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;none&lt;/code&gt; repo gets only the baseline. The arrows show what each tier &lt;em&gt;adds&lt;/em&gt; on top of the previous one. Here are the details for each ruleset:&lt;/p&gt;

&lt;h4 id=&quot;ruleset-baseline-security-targets-none-low-medium-high&quot;&gt;Ruleset: Baseline Security (targets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;none&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;low&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;medium&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt;)&lt;/h4&gt;

&lt;p&gt;This applies to &lt;strong&gt;every repo in the org&lt;/strong&gt;. No exceptions.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Rule&lt;/th&gt;
      &lt;th&gt;Setting&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Secrets protection&lt;/td&gt;
      &lt;td&gt;Enabled (push protection)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Restrict deletions&lt;/td&gt;
      &lt;td&gt;Enabled on default branch&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; Secrets leaking into git history is a universal risk. Every repo gets this, full stop. Accidentally deleting the default branch on any repo is painful, so we prevent that everywhere too.&lt;/p&gt;

&lt;h4 id=&quot;ruleset-standard-development-workflow-targets-low-medium-high&quot;&gt;Ruleset: Standard Development Workflow (targets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;low&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;medium&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt;)&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Rule&lt;/th&gt;
      &lt;th&gt;Setting&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Require pull request before merging&lt;/td&gt;
      &lt;td&gt;1 reviewer required&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Block force pushes&lt;/td&gt;
      &lt;td&gt;Enabled on default branch&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Require status checks to pass&lt;/td&gt;
      &lt;td&gt;CI must pass before merge&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; Once a repo is supporting anything beyond personal experiments, you need basic code review hygiene. One reviewer, no force pushes, CI must be green.&lt;/p&gt;

&lt;h4 id=&quot;ruleset-production-hardening-targets-medium-high&quot;&gt;Ruleset: Production Hardening (targets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;medium&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt;)&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Rule&lt;/th&gt;
      &lt;th&gt;Setting&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Require pull request before merging&lt;/td&gt;
      &lt;td&gt;2 reviewers required&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Require code owner review&lt;/td&gt;
      &lt;td&gt;Enabled&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Require code scanning results&lt;/td&gt;
      &lt;td&gt;Security severity: high and above&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Dismiss stale reviews on new pushes&lt;/td&gt;
      &lt;td&gt;Enabled&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Require approval of most recent push&lt;/td&gt;
      &lt;td&gt;Enabled&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; Production repos need tighter controls. Multiple reviewers catch more issues. Code owners ensure the right people sign off. Code scanning catches vulnerabilities before they ship.&lt;/p&gt;

&lt;h4 id=&quot;ruleset-regulatory-compliance-targets-high&quot;&gt;Ruleset: Regulatory Compliance (targets &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt;)&lt;/h4&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Rule&lt;/th&gt;
      &lt;th&gt;Setting&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Require pull request before merging&lt;/td&gt;
      &lt;td&gt;3 reviewers required&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Require signed commits&lt;/td&gt;
      &lt;td&gt;Enabled&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Require code scanning results&lt;/td&gt;
      &lt;td&gt;Security severity: medium and above&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Require code quality results&lt;/td&gt;
      &lt;td&gt;Enabled&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Metadata restrictions&lt;/td&gt;
      &lt;td&gt;Commit message must reference ticket (e.g., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JIRA-\d+&lt;/code&gt;)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Required workflows&lt;/td&gt;
      &lt;td&gt;Compliance audit workflow must pass&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt; When you’re dealing with PCI, HIPAA, SOC 2, or similar frameworks, you need an airtight audit trail. Signed commits prove authorship. Metadata restrictions tie changes to tracked work items. Required workflows can enforce additional compliance checks that your auditors want to see.&lt;/p&gt;

&lt;h3 id=&quot;step-3-understand-how-stacking-works&quot;&gt;Step 3: Understand How Stacking Works&lt;/h3&gt;

&lt;p&gt;Here’s where the magic happens. GitHub rulesets use &lt;strong&gt;additive layering&lt;/strong&gt;. When multiple rulesets target the same repository and branch, &lt;strong&gt;all rules from all matching rulesets apply, and the most restrictive version of any overlapping rule wins.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So what does a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt; compliance repo actually experience? Let’s trace it:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Source Ruleset&lt;/th&gt;
      &lt;th&gt;Rules Applied&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Baseline Security&lt;/td&gt;
      &lt;td&gt;Secrets protection, restrict deletions&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Standard Development Workflow&lt;/td&gt;
      &lt;td&gt;PR required (1 reviewer), block force pushes, status checks&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Production Hardening&lt;/td&gt;
      &lt;td&gt;PR required (2 reviewers), code owner review, code scanning (high), dismiss stale reviews, approval of most recent push&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Regulatory Compliance&lt;/td&gt;
      &lt;td&gt;PR required (3 reviewers), signed commits, code scanning (medium), code quality, metadata restrictions, required workflows&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Effective policy for a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt; repo:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Secrets protection enabled&lt;/li&gt;
  &lt;li&gt;Restrict deletions on default branch&lt;/li&gt;
  &lt;li&gt;Pull requests required with &lt;strong&gt;3 reviewers&lt;/strong&gt; (most restrictive wins)&lt;/li&gt;
  &lt;li&gt;Block force pushes&lt;/li&gt;
  &lt;li&gt;Status checks must pass&lt;/li&gt;
  &lt;li&gt;Code owner review required&lt;/li&gt;
  &lt;li&gt;Code scanning required at &lt;strong&gt;medium severity and above&lt;/strong&gt; (most restrictive wins)&lt;/li&gt;
  &lt;li&gt;Code quality results required&lt;/li&gt;
  &lt;li&gt;Stale reviews dismissed on new pushes&lt;/li&gt;
  &lt;li&gt;Most recent push must be approved by someone other than the pusher&lt;/li&gt;
  &lt;li&gt;Signed commits required&lt;/li&gt;
  &lt;li&gt;Commit messages must reference a ticket&lt;/li&gt;
  &lt;li&gt;Compliance workflow must pass&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The bottom line:&lt;/strong&gt; The repo owner sees one coherent set of requirements. They don’t need to know that six different rulesets are contributing to that experience. They just know their repo is classified as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt; compliance and the rules reflect that.&lt;/p&gt;

&lt;h2 id=&quot;what-the-developer-experience-looks-like&quot;&gt;What the Developer Experience Looks Like&lt;/h2&gt;

&lt;p&gt;This is a critical point that’s easy to overlook. Your developers and repo owners don’t see rulesets. They see the &lt;em&gt;sum of what’s enforced&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;When a developer on a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt; compliance repo opens a pull request, they see:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;A required reviewers count of 3&lt;/li&gt;
  &lt;li&gt;A code scanning check that must pass&lt;/li&gt;
  &lt;li&gt;A code quality gate&lt;/li&gt;
  &lt;li&gt;A compliance workflow running&lt;/li&gt;
  &lt;li&gt;A reminder that their commit message needs a ticket reference&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They don’t know (or care) that these requirements come from four separate rulesets managed by different teams. And that’s exactly the point. &lt;strong&gt;The complexity lives on the admin side, not the developer side.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For repo owners, the experience is even simpler. When they look at their repo’s settings, they see a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Regulatory Compliance&lt;/code&gt; property set to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt;. If they need to understand what that means, you point them to a wiki page or internal doc that maps tiers to requirements. No need for them to parse ruleset configurations.&lt;/p&gt;

&lt;h2 id=&quot;deploying-properties-and-rulesets-at-scale&quot;&gt;Deploying Properties and Rulesets at Scale&lt;/h2&gt;

&lt;p&gt;The UI is fine for prototyping, but if you’re managing 100,000+ repos across dozens of orgs, you need automation. Let’s talk about how to deploy this model programmatically.&lt;/p&gt;

&lt;h3 id=&quot;automating-property-definitions&quot;&gt;Automating Property Definitions&lt;/h3&gt;

&lt;p&gt;Use the &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-properties&quot;&gt;REST API for custom properties&lt;/a&gt; to define your property schema consistently across every org. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATCH /orgs/{org}/properties/schema&lt;/code&gt; endpoint lets you create or update multiple properties in a single call:&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;-L&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; PATCH &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;Accept: application/vnd.github+json&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;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$GH_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;X-GitHub-Api-Version: 2022-11-28&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  https://api.github.com/orgs/my-org/properties/schema &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;properties&quot;: [
      {
        &quot;property_name&quot;: &quot;Regulatory_Compliance&quot;,
        &quot;value_type&quot;: &quot;single_select&quot;,
        &quot;required&quot;: true,
        &quot;default_value&quot;: &quot;none&quot;,
        &quot;description&quot;: &quot;Regulatory compliance tier for governance rulesets&quot;,
        &quot;allowed_values&quot;: [&quot;none&quot;, &quot;low&quot;, &quot;medium&quot;, &quot;high&quot;]
      }
    ]
  }&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Wrap this in a script that iterates over your list of orgs, and you’ve got consistent property definitions everywhere in minutes.&lt;/p&gt;

&lt;h3 id=&quot;bulk-assigning-property-values&quot;&gt;Bulk-Assigning Property Values&lt;/h3&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATCH /orgs/{org}/properties/values&lt;/code&gt; endpoint lets you set property values for up to &lt;strong&gt;30 repositories per request&lt;/strong&gt;. At enterprise scale, you’ll want to script this against your service catalog or CMDB:&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;-L&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; PATCH &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;Accept: application/vnd.github+json&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;Authorization: Bearer &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$GH_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;X-GitHub-Api-Version: 2022-11-28&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  https://api.github.com/orgs/my-org/properties/values &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;repository_names&quot;: [&quot;payment-service&quot;, &quot;auth-service&quot;, &quot;pii-handler&quot;],
    &quot;properties&quot;: [
      {
        &quot;property_name&quot;: &quot;Regulatory_Compliance&quot;,
        &quot;value&quot;: &quot;high&quot;
      }
    ]
  }&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For a real deployment, you’d pull your repo inventory and classifications from your system of record (ServiceNow, Backstage, a spreadsheet - we don’t judge) and batch these API calls in groups of 30. A simple Python or Bash script can tag thousands of repos in a few minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro tip:&lt;/strong&gt; Make the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Regulatory Compliance&lt;/code&gt; property &lt;strong&gt;required with a default value of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;none&lt;/code&gt;&lt;/strong&gt;. That way every new repo automatically gets baseline security rules from day one - no human intervention needed.&lt;/p&gt;

&lt;h3 id=&quot;importing-and-exporting-rulesets&quot;&gt;Importing and Exporting Rulesets&lt;/h3&gt;

&lt;p&gt;Here’s a feature that’s easy to overlook but critical for multi-org deployments: &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#importing-a-ruleset&quot;&gt;ruleset import and export&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can export any ruleset as a JSON file from the ruleset’s history menu, then import that JSON into another org. This means you can:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Build once, deploy everywhere.&lt;/strong&gt; Design your rulesets in a test org, validate them, then export and import across all your production orgs.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Version control your rulesets.&lt;/strong&gt; Export your rulesets to JSON, commit them to a config repo, and track changes over time. Now you have a full audit trail of your governance model.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Disaster recovery.&lt;/strong&gt; If someone accidentally deletes or misconfigures a ruleset, you can reimport from your last known good config in seconds.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Consistency across orgs.&lt;/strong&gt; When you update a ruleset, export the new version and import it everywhere. No manual recreation. No drift.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/rules&quot;&gt;REST API for rules&lt;/a&gt; also supports creating and managing rulesets programmatically. For true enterprise-scale automation, combine the API with your CI/CD pipeline: store your ruleset definitions as code, validate changes in a test org, then deploy across all orgs on merge.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The bypass list is excluded from exported JSON files. You’ll need to configure bypass permissions separately for each org after import, which is actually a good thing - bypass lists should be org-specific.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s what a deploy pipeline might look like:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Property definitions and ruleset configs live in a central Git repo&lt;/li&gt;
  &lt;li&gt;A PR triggers a deploy to your test org in Evaluate mode&lt;/li&gt;
  &lt;li&gt;You review Rule Insights to validate behavior&lt;/li&gt;
  &lt;li&gt;On merge to main, automation deploys properties and imports rulesets across all production orgs&lt;/li&gt;
  &lt;li&gt;Rulesets go active after a configurable bake-in period&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is governance-as-code. And it’s the only way to keep dozens of orgs consistent without an army of admins.&lt;/p&gt;

&lt;h2 id=&quot;best-practices-for-enterprise-scale&quot;&gt;Best Practices for Enterprise Scale&lt;/h2&gt;

&lt;p&gt;After walking through the model, here are the patterns that work well at scale:&lt;/p&gt;

&lt;h3 id=&quot;start-with-evaluate-mode&quot;&gt;Start with “Evaluate” Mode&lt;/h3&gt;

&lt;p&gt;Every new ruleset should start in &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets#using-ruleset-enforcement-statuses&quot;&gt;Evaluate mode&lt;/a&gt;. This lets you see what &lt;em&gt;would&lt;/em&gt; be blocked without actually blocking anything. Use &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets&quot;&gt;Rule Insights&lt;/a&gt; to monitor the impact, then flip to Active once you’re confident.&lt;/p&gt;

&lt;h3 id=&quot;use-bypass-lists-sparingly&quot;&gt;Use Bypass Lists Sparingly&lt;/h3&gt;

&lt;p&gt;Rulesets support &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/creating-rulesets-for-repositories-in-your-organization&quot;&gt;bypass permissions&lt;/a&gt; for specific roles, teams, or GitHub Apps. Use these for break-glass scenarios, not for convenience. Every bypass is a hole in your governance model.&lt;/p&gt;

&lt;p&gt;Quick checklist for bypass configuration:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Do&lt;/strong&gt; grant bypass to a dedicated “release engineering” team for emergency hotfixes&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Do&lt;/strong&gt; grant bypass to specific GitHub Apps that need to push directly (e.g., Dependabot, release automation)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Don’t&lt;/strong&gt; grant bypass to “repository admins” by default - that defeats the purpose of org-level rulesets&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Don’t&lt;/strong&gt; grant bypass without a corresponding audit trail&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;layer-properties-for-complex-scenarios&quot;&gt;Layer Properties for Complex Scenarios&lt;/h3&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Regulatory Compliance&lt;/code&gt; property handles one dimension. You might need others. For example:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Property&lt;/th&gt;
      &lt;th&gt;Type&lt;/th&gt;
      &lt;th&gt;Values&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Regulatory Compliance&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Single select&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;none&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;low&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;medium&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;high&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Environment Type&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Single select&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sandbox&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;staging&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;production&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Data Classification&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Single select&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;public&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;internal&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;confidential&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;restricted&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;You can then create rulesets that target combinations: “All repos where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Environment Type&lt;/code&gt; is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;production&lt;/code&gt; AND &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Data Classification&lt;/code&gt; is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;restricted&lt;/code&gt;.” This gives you incredible granularity without creating a ruleset for every permutation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Word of caution:&lt;/strong&gt; Don’t go overboard. Two or three well-chosen properties cover most use cases. Every property you add is one more thing someone has to set and maintain.&lt;/p&gt;

&lt;h3 id=&quot;automate-property-assignment&quot;&gt;Automate Property Assignment&lt;/h3&gt;

&lt;p&gt;We covered this in detail in the deployment section above, but it bears repeating: at enterprise scale, you don’t want humans manually tagging repos. Use the &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-properties&quot;&gt;REST API for custom properties&lt;/a&gt; to automate property assignment based on your existing metadata. Pull from your CMDB, service catalog, or whatever system of record you already trust. Better yet, integrate property assignment into your repo provisioning workflow so new repos are classified correctly from the moment they’re created.&lt;/p&gt;

&lt;h3 id=&quot;document-your-governance-model&quot;&gt;Document Your Governance Model&lt;/h3&gt;

&lt;p&gt;Create an internal reference that maps:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Each property value to its intended use case&lt;/li&gt;
  &lt;li&gt;Each ruleset to the rules it enforces&lt;/li&gt;
  &lt;li&gt;The effective policy for each tier (the stacked result)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This doc becomes your single source of truth when onboarding new admins, answering developer questions, or responding to audit requests.&lt;/p&gt;

&lt;h3 id=&quot;monitor-with-rule-insights&quot;&gt;Monitor with Rule Insights&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets&quot;&gt;Rule Insights&lt;/a&gt; show you every action that passed, failed, or bypassed a ruleset. Review these regularly. They’ll tell you:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;If a ruleset is too restrictive (lots of bypasses)&lt;/li&gt;
  &lt;li&gt;If a ruleset isn’t catching anything (maybe it’s not needed, or repos are miscategorized)&lt;/li&gt;
  &lt;li&gt;If developers are hitting unexpected friction (time to improve docs or tooling)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;pitfalls-to-avoid&quot;&gt;Pitfalls to Avoid&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Don’t migrate everything at once.&lt;/strong&gt; Start with one org. Get it right. Then expand to the next one. At 100k+ repos, a phased rollout isn’t optional - it’s survival.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Don’t forget about rule layering behavior.&lt;/strong&gt; Remember, the most restrictive version of any overlapping rule wins. Test your stacks before going active.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Don’t skip the developer communication.&lt;/strong&gt; Engineers hate surprises. Tell them what’s changing, why, and what they need to do differently. At enterprise scale, this probably means partnering with your internal dev experience team.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Don’t ignore the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;none&lt;/code&gt; tier.&lt;/strong&gt; Even your least-regulated repos should have secrets protection. That’s non-negotiable.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Don’t set it and forget it.&lt;/strong&gt; Compliance requirements evolve. Review your tier definitions at least quarterly.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Don’t manually manage rulesets across orgs.&lt;/strong&gt; Export, version control, and automate. If you’re clicking through the UI to replicate rulesets across 20 orgs, you’re doing it wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;Rulesets and custom properties together give you a composable, scalable governance model for GitHub Enterprise Cloud. Instead of managing hundreds of bespoke rulesets across dozens of orgs, you define a small set of modular policies, tag repos with properties, and let GitHub’s rule layering do the heavy lifting. Add API automation and ruleset import/export, and you’ve got a governance-as-code pipeline that works at true enterprise scale.&lt;/p&gt;

&lt;p&gt;Here’s your action plan:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Audit your current state.&lt;/strong&gt; What branch protection rules and rulesets do you have today? What patterns emerge across your orgs?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Design your property taxonomy.&lt;/strong&gt; Start with one property (like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Regulatory Compliance&lt;/code&gt;) and define clear tiers.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Build modular rulesets.&lt;/strong&gt; One ruleset per policy concern, not per repo or permutation.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Automate deployment.&lt;/strong&gt; Use the REST API to push property definitions and values. Export rulesets as JSON and store them in a config repo.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Deploy in Evaluate mode.&lt;/strong&gt; Use Rule Insights to validate before enforcing.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Communicate the change.&lt;/strong&gt; Give developers a clear reference for what each tier means.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Roll out org by org.&lt;/strong&gt; Start with a pilot org, validate, then expand across the enterprise.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Iterate quarterly.&lt;/strong&gt; Review your tier definitions, check Rule Insights for friction, and update as compliance requirements evolve.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal isn’t just compliance - it’s compliance that doesn’t slow your teams down. Custom properties and layered rulesets let you get there without drowning in administrative overhead.&lt;/p&gt;

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

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets&quot;&gt;About rulesets&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets&quot;&gt;Available rules for rulesets&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization&quot;&gt;Managing custom properties for repositories in your organization&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization&quot;&gt;Managing rulesets for repositories in your organization&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-organization-settings/creating-rulesets-for-repositories-in-your-organization&quot;&gt;Creating rulesets for repositories in your organization&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-properties&quot;&gt;REST API endpoints for custom properties&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/rules&quot;&gt;REST API endpoints for organization rules&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
   
    <category term="github" />
   
    <category term="security" />
   
    <category term="devops" />
   
    <category term="best-practices" />
   
    <category term="governance" />
   
    <category term="compliance" />
   
    <category term="enterprise" />
   
 </entry>
 
 <entry>
   <title>The Eligibility Exercise: A Practical Framework for Your Next Promotion</title>
   <link href="https://www.dxrf.com/blog/2026/03/05/the-eligibility-exercise/"/>
   <updated>2026-03-05T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/03/05/the-eligibility-exercise</id>
   <excerpt type="html">Before you ask for a promotion, do the homework. Here&apos;s a simple framework to build your case and identify your gaps.</excerpt>
   <content type="html">&lt;p&gt;I guess it’s the season, but I’ve had multiple folks ask me for guidance on promotions lately. I always ask the same question first:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have you done an eligibility exercise?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yup. They make the same face you just made, then ask “WTF is that?!?”&lt;/p&gt;

&lt;p&gt;Here’s the thing - most people walk into a promotion conversation armed with vibes and a vague (or fierce) sense that they “deserve it.” That’s not a strategy. That’s a wish. Let me show you a better way.&lt;/p&gt;

&lt;h2 id=&quot;what-is-an-eligibility-exercise&quot;&gt;What Is an Eligibility Exercise?&lt;/h2&gt;

&lt;p&gt;An eligibility exercise is the process of taking the &lt;strong&gt;next level up&lt;/strong&gt; job description and documenting how you meet (or exceed) every single requirement. The idea is simple:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Get the job description for the role you want&lt;/li&gt;
  &lt;li&gt;Copy it into a document&lt;/li&gt;
  &lt;li&gt;Add notes under each requirement explaining how you already meet or exceed it&lt;/li&gt;
  &lt;li&gt;Identify any gaps where you fall short&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s it. No fancy frameworks. No career coaching certifications required. Just honest self-assessment against a concrete target.&lt;/p&gt;

&lt;h2 id=&quot;why-this-works&quot;&gt;Why This Works&lt;/h2&gt;

&lt;p&gt;Let’s be real - most promotion conversations fail for one of two reasons:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;You can’t articulate your case.&lt;/strong&gt; You &lt;em&gt;feel&lt;/em&gt; ready, but when your manager asks “why?”, you fumble through a highlight reel that sounds more like a Thanksgiving dinner speech than a business case.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;You’re not actually ready.&lt;/strong&gt; And that’s okay! But it’s way better to figure that out on your own terms than to hear it in a meeting you hyped yourself up for.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The eligibility exercise solves both problems. If you’re ready, you’ll have a clear, evidence-based case. If you’re not, you’ll have a targeted development plan. Either way, you win.&lt;/p&gt;

&lt;h2 id=&quot;a-worked-example&quot;&gt;A Worked Example&lt;/h2&gt;

&lt;p&gt;Let’s walk through this with a real(ish) scenario. Say you’re currently a &lt;strong&gt;Software Developer&lt;/strong&gt; and you’re eyeing a &lt;strong&gt;Senior Software Engineer&lt;/strong&gt; role. Here’s a typical job description for that senior role, followed by the kind of notes you’d add during your eligibility exercise.&lt;/p&gt;

&lt;h3 id=&quot;job-description-senior-software-engineer&quot;&gt;Job Description: Senior Software Engineer&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;About the Role&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We’re looking for a Senior Software Engineer to join our platform team. You’ll design, build, and maintain scalable backend services while mentoring junior engineers and driving technical excellence across the organization.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;requirements-and-your-evidence&quot;&gt;Requirements and Your Evidence&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;7+ years of professional software development experience&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I have 11 years of active experience as a software developer on both large and small teams. I started as an intern at Acme Corp in 2015, moved into a full-time dev role in 2016, and have been shipping production code continuously since then across three different companies.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Experience serving as a technical lead throughout the full software development lifecycle&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;My most recent experience as a tech lead was with the WidgetMaker project. I oversaw the work of a product manager, a project manager, and 10 developers. I was the primary point person for issues that arose in the development process. I also worked across various peer teams to facilitate the security and production deployment paths for the application. Under my guidance, we shipped the app on time and under budget.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Strong proficiency in one or more backend languages (e.g., Go, Python, Java, C#)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I’m highly proficient in Python and Go. Python has been my primary language for 8 years - I’ve built REST APIs, CLI tools, data pipelines, and automation frameworks with it. I picked up Go three years ago and have since built two production microservices that handle 50k+ requests per minute. I also contribute to our team’s internal Go library for shared middleware.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Experience designing and building distributed systems at scale&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I was the lead designer on our event-driven order processing system, which handles roughly 2 million events per day across 12 microservices. I authored the original architecture proposal, led the design review with our principal engineers, and implemented three of the core services. I also designed our retry and dead-letter strategy, which reduced failed message rates by 94%.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Demonstrated ability to mentor and grow junior engineers&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I’ve been the onboarding buddy for our last four new hires. I run a weekly “office hours” session where junior devs can bring questions or code for review. Two engineers I mentored have since been promoted to mid-level roles. I also created our team’s “First 90 Days” onboarding guide, which has been adopted by three other teams in the org.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Experience with CI/CD pipelines and DevOps practices&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I built and maintain our team’s GitHub Actions CI/CD pipeline, which runs linting, unit tests, integration tests, and deploys to staging automatically on every PR merge. I also implemented our blue-green deployment strategy on Kubernetes, which cut our rollback time from 30 minutes to under 2 minutes. I’ve given two internal tech talks on CI/CD best practices.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Excellent communication skills with the ability to explain technical concepts to non-technical stakeholders&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I present our quarterly technical roadmap to the VP of Product and their leadership team. I write weekly engineering updates that go out to the broader org, translating complex technical work into business-impact language. My manager has specifically called out my communication skills in my last three performance reviews as a key strength.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Bachelor’s degree in Computer Science or equivalent practical experience&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I have a Bachelor’s degree in Information Systems from State University (2015). I also hold AWS Solutions Architect and Kubernetes (CKA) certifications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;preferred-qualifications&quot;&gt;Preferred Qualifications&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Experience with cloud platforms (AWS, GCP, or Azure)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Our entire stack runs on AWS. I have hands-on experience with EC2, ECS, Lambda, S3, DynamoDB, SQS, SNS, CloudWatch, and IAM. I’m the team’s go-to person for AWS architecture questions and I hold the AWS Solutions Architect Associate certification.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Familiarity with observability tools (Datadog, Prometheus, Grafana)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;⚠️ &lt;strong&gt;GAP IDENTIFIED&lt;/strong&gt; - I have basic experience with CloudWatch and some exposure to Grafana dashboards, but I haven’t worked deeply with Datadog or Prometheus. I’d want to spend some time getting hands-on with our observability stack before stepping into this role.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Experience with database design and optimization (PostgreSQL, Redis, DynamoDB)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I’ve designed schemas for three production PostgreSQL databases and implemented query optimizations that reduced our slowest API endpoint response time from 1200ms to 180ms. I also introduced Redis caching to our most-hit endpoints, reducing database load by 40%.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Contributions to open-source projects or technical communities&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;⚠️ &lt;strong&gt;GAP IDENTIFIED&lt;/strong&gt; - I don’t have meaningful open-source contributions yet. I’ve filed a few issues and one small documentation PR, but nothing substantial. This is an area I could start building toward.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;notice-the-gaps&quot;&gt;Notice the Gaps?&lt;/h2&gt;

&lt;p&gt;See those “GAP IDENTIFIED” flags? That’s the real magic of this exercise. You’re never going to be a perfect match for every line item, and that’s fine. The point is that you &lt;strong&gt;know&lt;/strong&gt; where the gaps are so you can:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Build a plan to close them&lt;/strong&gt; before your promotion conversation&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Proactively address them&lt;/strong&gt; when you make your case (“I know observability is an area where I’m still growing, and here’s what I’m doing about it…”)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Decide if the gap is a dealbreaker&lt;/strong&gt; or just a nice-to-have&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A hiring manager (or your current manager) is going to be way more impressed by someone who says “I’ve identified two growth areas and here’s my plan” than someone who hand-waves and says “yeah, I can figure that out.”&lt;/p&gt;

&lt;h2 id=&quot;how-to-run-your-own-eligibility-exercise&quot;&gt;How to Run Your Own Eligibility Exercise&lt;/h2&gt;

&lt;p&gt;Here’s your action plan:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Get the job description.&lt;/strong&gt; Ask your manager, check internal job boards, or look at external postings for similar roles at your company’s level. If your company uses a career ladder or leveling guide, even better.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Copy it into a doc.&lt;/strong&gt; Google Docs, Notion, a markdown file - whatever works for you. Just get it somewhere you can annotate.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Go line by line.&lt;/strong&gt; For each requirement, write 2-4 sentences explaining how you meet it. Be specific. Use project names, metrics, timelines, and outcomes. “I’m good at this” is not evidence. “I reduced deploy time by 80% on Project X” is.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Flag your gaps honestly.&lt;/strong&gt; Don’t skip requirements you can’t answer. Mark them clearly and start thinking about how to close them.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Share it with your manager.&lt;/strong&gt; This is optional but powerful. Walking into a 1:1 with a completed eligibility exercise tells your manager three things: you’re serious, you’re self-aware, and you’ve done the work. It also gives them a concrete document to advocate with when they go to bat for you.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;quick-reference-good-vs-bad-evidence&quot;&gt;Quick Reference: Good vs. Bad Evidence&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Weak Evidence&lt;/th&gt;
      &lt;th&gt;Strong Evidence&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;“I’m a good communicator”&lt;/td&gt;
      &lt;td&gt;“I present quarterly roadmaps to VP-level stakeholders”&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;“I know Python”&lt;/td&gt;
      &lt;td&gt;“I’ve built three production services in Python over 8 years”&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;“I help junior devs”&lt;/td&gt;
      &lt;td&gt;“Two engineers I mentored were promoted within 18 months”&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;“I do DevOps stuff”&lt;/td&gt;
      &lt;td&gt;“I built our CI/CD pipeline that runs 200+ deploys per month”&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;“I’m ready for more responsibility”&lt;/td&gt;
      &lt;td&gt;“Here’s a doc showing I meet 11 of 13 requirements for the role”&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;the-three-things-every-promotion-needs&quot;&gt;The Three Things Every Promotion Needs&lt;/h2&gt;

&lt;p&gt;Before you march into your manager’s office with your shiny new eligibility document, let’s talk about how promotions actually work at most companies. There are three things that need to align:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Personal Eligibility&lt;/strong&gt; - Do you meet or exceed all of the requirements for the next level?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Business Need&lt;/strong&gt; - Is there a business need for another staff member at that higher level?&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Budget&lt;/strong&gt; - Is there money available to fund the higher salary?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s the uncomfortable truth: &lt;strong&gt;you can only control the first one.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s exactly why we spend so much time on the eligibility exercise. It’s also listed first for a reason. It doesn’t matter how much budget is available or how many open spots there are. If you aren’t qualified, you aren’t qualified. Full stop.&lt;/p&gt;

&lt;p&gt;Business need and budget are leadership decisions that happen above your pay grade (literally). Reorgs happen. Headcount freezes happen. Fiscal years end at inconvenient times. None of that is in your control, and burning energy worrying about it is wasted effort.&lt;/p&gt;

&lt;p&gt;But here’s what you &lt;em&gt;can&lt;/em&gt; do: make sure that when the business need exists and the budget is there, &lt;strong&gt;you’re the obvious choice.&lt;/strong&gt; That means being undeniably ready, with the documentation to prove it. When your manager goes into a planning meeting and someone says “do we have anyone ready for a senior role?”, you want your name to come out of their mouth without hesitation.&lt;/p&gt;

&lt;h2 id=&quot;starting-the-conversation-with-your-manager&quot;&gt;Starting the Conversation with Your Manager&lt;/h2&gt;

&lt;p&gt;So you’ve done the exercise. You’ve mapped your evidence. You’ve flagged your gaps (and ideally started closing them). Now what?&lt;/p&gt;

&lt;p&gt;You need to have a conversation with your manager, and how you frame it matters. This isn’t a “give me a promotion” meeting. This is a &lt;strong&gt;calibration conversation.&lt;/strong&gt; You’re checking whether your self-assessment matches their perspective.&lt;/p&gt;

&lt;p&gt;Here’s a template to get you started:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Hey [manager], I’d like to discuss my career growth at [company]. I’ve been reviewing the qualifications for the [target role] and I believe I meet all of them. I’ve put together some documentation mapping my experience to each requirement, and I’d love to review it with you to make sure we’re on the same page.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Notice what this does:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;It signals intent&lt;/strong&gt; without making a demand&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;It shows preparation&lt;/strong&gt; - you’ve already done the work&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;It invites collaboration&lt;/strong&gt; - you’re asking for their perspective, not arguing yours&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;It’s professional and low-pressure&lt;/strong&gt; - easy for your manager to say yes to&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your manager might agree with your assessment. They might push back on a few areas. Either way, you’ve started a productive conversation grounded in specifics instead of feelings.&lt;/p&gt;

&lt;h3 id=&quot;once-youre-aligned-its-not-about-you-anymore&quot;&gt;Once You’re Aligned, It’s Not About You Anymore&lt;/h3&gt;

&lt;p&gt;This is the part most people miss. Once you and your manager &lt;strong&gt;confirm that you meet the requirements&lt;/strong&gt;, the conversation shifts. It’s no longer about whether you’re ready. It’s about business need and budget, and that’s your manager’s problem to solve, not yours.&lt;/p&gt;

&lt;p&gt;Your job at that point is to:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Keep performing at the higher level&lt;/strong&gt; (you’ve already proven you can)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ask your manager what the timeline looks like&lt;/strong&gt; and what factors are in play&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Check in periodically&lt;/strong&gt; without being pushy (quarterly is reasonable)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Stay patient but not passive&lt;/strong&gt; - continue building your case and closing any remaining gaps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The worst thing you can do is nail the eligibility conversation and then coast. Keep the momentum going. Keep updating your document. Keep collecting evidence. When the stars align on business need and budget, you want to be so far past the bar that approval is a formality.&lt;/p&gt;

&lt;h2 id=&quot;summary-and-key-takeaways&quot;&gt;Summary and Key Takeaways&lt;/h2&gt;

&lt;p&gt;Promotions aren’t about tenure or good vibes. They’re about &lt;strong&gt;demonstrating readiness&lt;/strong&gt; with evidence, and then being patient while the business catches up. The eligibility exercise gives you a structured, honest way to build your case (or identify what you need to work on first).&lt;/p&gt;

&lt;p&gt;Here’s what to remember:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Get the job description&lt;/strong&gt; for the role you want, not the role you have&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Document your evidence&lt;/strong&gt; with specifics - projects, metrics, outcomes&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Flag your gaps&lt;/strong&gt; honestly and make a plan to close them&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Promotions need three things:&lt;/strong&gt; personal eligibility, business need, and budget - you control only the first&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Start a calibration conversation&lt;/strong&gt; with your manager using your eligibility doc&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Once aligned, shift focus&lt;/strong&gt; - your readiness is confirmed, now it’s about timing and business factors&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Stay ready&lt;/strong&gt; so that when the opportunity opens, you’re the obvious choice&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stop guessing whether you’re ready. Do the exercise. The answer will be right there in front of you.&lt;/p&gt;

&lt;h2 id=&quot;closing&quot;&gt;Closing&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Have questions or want to share your eligibility exercise experience? Find me on &lt;a href=&quot;https://github.com/jmassardo&quot;&gt;GitHub&lt;/a&gt;, &lt;a href=&quot;https://www.linkedin.com/in/jenna-massardo/&quot;&gt;LinkedIn&lt;/a&gt;, or &lt;a href=&quot;https://bsky.app/profile/jmassardo.bsky.social&quot;&gt;Bluesky&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
   
    <category term="career" />
   
    <category term="leadership" />
   
    <category term="professional-development" />
   
    <category term="best-practices" />
   
 </entry>
 
 <entry>
   <title>Copilot CLI Skills: A Practical Guide With Examples for Every Role</title>
   <link href="https://www.dxrf.com/blog/2026/03/03/copilot-cli-skills-practical-guide/"/>
   <updated>2026-03-03T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/03/03/copilot-cli-skills-practical-guide</id>
   <excerpt type="html">Skills are how you teach Copilot CLI to do your job your way. This guide covers what skills are, how to build them, and includes ready-to-use examples for developers, data engineers, DBAs, project managers, and technical writers.</excerpt>
   <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;If you have been using &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started&quot;&gt;GitHub Copilot CLI&lt;/a&gt; for a while, you have probably noticed something: Copilot is smart, but it does not know &lt;em&gt;your&lt;/em&gt; workflow. It does not know that your team uses a specific PR template, that your database migrations follow a naming convention, or that your release notes always need a “Breaking Changes” section.&lt;/p&gt;

&lt;p&gt;That is where &lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/about-agent-skills&quot;&gt;skills&lt;/a&gt; come in. Skills are on-demand playbooks that teach Copilot how to handle specific tasks the way &lt;em&gt;you&lt;/em&gt; want them handled. They are not always-on like custom instructions. They load only when they are relevant, which keeps Copilot’s context window focused on the work at hand.&lt;/p&gt;

&lt;p&gt;The best part? Skills are just Markdown files. No SDK. No API integration. No deployment pipeline. If you can write a README, you can write a skill.&lt;/p&gt;

&lt;p&gt;This guide covers what skills are, how to create them, and then walks through practical examples across multiple roles. Not everyone who benefits from Copilot CLI is a developer, so we will cover skills for technical writers, project managers, data scientists, DBAs, and developers alike.&lt;/p&gt;

&lt;!-- more --&gt;

&lt;h2 id=&quot;what-is-a-skill&quot;&gt;What Is a Skill?&lt;/h2&gt;

&lt;p&gt;A skill is a folder containing a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SKILL.md&lt;/code&gt; file and optionally supporting resources (scripts, templates, config files). The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SKILL.md&lt;/code&gt; file has two parts:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;YAML frontmatter&lt;/strong&gt; with a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;name&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;description&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Markdown body&lt;/strong&gt; with the instructions Copilot should follow&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When Copilot decides a skill is relevant to your prompt (based on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;description&lt;/code&gt;), it loads the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SKILL.md&lt;/code&gt; into its context and follows the instructions. You can also invoke a skill explicitly with a slash command.&lt;/p&gt;

&lt;p&gt;Here is the minimal structure:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;.github/skills/my-skill/
  SKILL.md
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the minimal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SKILL.md&lt;/code&gt;:&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;nn&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;my-skill&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Does a specific thing. Use this when asked to do that specific thing.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

Instructions for Copilot go here. Be specific. Be prescriptive.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That is it. Copilot handles the rest.&lt;/p&gt;

&lt;h2 id=&quot;where-skills-live&quot;&gt;Where Skills Live&lt;/h2&gt;

&lt;p&gt;Skills can be stored in two places:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Scope&lt;/th&gt;
      &lt;th&gt;Location&lt;/th&gt;
      &lt;th&gt;Applies to&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Project&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.claude/skills/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Current repository only&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Personal&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.copilot/skills/&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.claude/skills/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;All projects on your machine&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Project skills are great for team conventions. Personal skills are great for your own workflows that you use everywhere. Organization-level and enterprise-level skill support is &lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/about-agent-skills&quot;&gt;coming soon&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;creating-a-skill-step-by-step&quot;&gt;Creating a Skill: Step by Step&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Create the directory.&lt;/strong&gt; Each skill gets its own folder under a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;skills&lt;/code&gt; parent. Use lowercase names with hyphens.&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;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; .github/skills/my-new-skill
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Create the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SKILL.md&lt;/code&gt; file.&lt;/strong&gt; The file &lt;em&gt;must&lt;/em&gt; be named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SKILL.md&lt;/code&gt; (case-sensitive).&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;&lt;span class=&quot;nb&quot;&gt;touch&lt;/span&gt; .github/skills/my-new-skill/SKILL.md
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Write the frontmatter.&lt;/strong&gt; Two fields are required:
    &lt;ul&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;name&lt;/code&gt;: Unique identifier, lowercase with hyphens. Should match the directory name.&lt;/li&gt;
      &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;description&lt;/code&gt;: Tells Copilot &lt;em&gt;what&lt;/em&gt; the skill does and &lt;em&gt;when&lt;/em&gt; to use it. This is the most important part for auto-invocation. Write it like you are telling a new hire when to reach for this playbook.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Write the instructions.&lt;/strong&gt; Be prescriptive. Tell Copilot exactly what steps to follow, what tools to use, what format to produce, and what to avoid.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Optionally, add supporting files.&lt;/strong&gt; Scripts, templates, example outputs, or reference docs can live in the same directory. Reference them in your instructions.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Test the skill.&lt;/strong&gt; In a Copilot CLI session:&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;/skills list          # Verify it shows up
/skills info          # See details and location
/my-new-skill test    # Invoke it explicitly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;If you created the skill during an active session, reload with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/skills reload&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;skills-vs-custom-instructions-when-to-use-which&quot;&gt;Skills vs. Custom Instructions: When to Use Which&lt;/h2&gt;

&lt;p&gt;This trips people up, so let’s be clear:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt; &lt;/th&gt;
      &lt;th&gt;Custom Instructions&lt;/th&gt;
      &lt;th&gt;Skills&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Loaded&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Always, every session&lt;/td&gt;
      &lt;td&gt;On-demand, when relevant&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;General guidance (coding standards, team conventions)&lt;/td&gt;
      &lt;td&gt;Specific task playbooks&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Scope&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Everything Copilot does&lt;/td&gt;
      &lt;td&gt;One type of task&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Context cost&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Always consuming tokens&lt;/td&gt;
      &lt;td&gt;Only when active&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Rule of thumb:&lt;/strong&gt; If it applies to &lt;em&gt;every&lt;/em&gt; task, put it in custom instructions. If it applies to &lt;em&gt;one type of task&lt;/em&gt;, make it a skill.&lt;/p&gt;

&lt;p&gt;For a deeper comparison of all customization options, see &lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-cli/comparing-cli-features&quot;&gt;Comparing GitHub Copilot CLI customization features&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;writing-effective-skill-descriptions&quot;&gt;Writing Effective Skill Descriptions&lt;/h2&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;description&lt;/code&gt; field in your frontmatter is how Copilot decides whether to auto-invoke your skill. A vague description means Copilot will rarely pick it up. A specific description with trigger words means it fires reliably.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weak:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Helps with documentation.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Strong:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-yaml 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;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Generates and updates user-facing documentation when frontend components are added or modified. Use this when asked to write docs, update docs, or when frontend code changes require documentation updates.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Include action verbs, the &lt;em&gt;type&lt;/em&gt; of work, and explicit trigger scenarios. If your team uses a specific keyword (like “doccheck” or “releasenotes”), mention it in the description.&lt;/p&gt;

&lt;h2 id=&quot;example-skills&quot;&gt;Example Skills&lt;/h2&gt;

&lt;p&gt;Now for the good stuff. Here are practical, ready-to-use skills organized by persona. Copy them, modify them, ship them.&lt;/p&gt;

&lt;h3 id=&quot;non-developer-personas&quot;&gt;Non-Developer Personas&lt;/h3&gt;

&lt;p&gt;These skills are for the people who are not writing application code but absolutely benefit from Copilot CLI. Project managers, technical writers, and team leads all have repetitive, structured tasks that skills can standardize.&lt;/p&gt;

&lt;h4 id=&quot;skill-release-notes-drafter-project-managers--release-engineers&quot;&gt;Skill: Release Notes Drafter (Project Managers / Release Engineers)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/release-notes-drafter/SKILL.md&lt;/code&gt;&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;nn&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;release-notes-drafter&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Drafts release notes by analyzing recent commits and pull requests. Use this when asked to create release notes, write a changelog, or prepare a release summary.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Generate release notes for the specified version or date range. Follow these steps:
&lt;span class=&quot;p&quot;&gt;
1.&lt;/span&gt; Use the GitHub MCP server tools to list merged pull requests since the last release tag.
&lt;span class=&quot;p&quot;&gt;2.&lt;/span&gt; Categorize changes into the following sections (skip empty sections):
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Breaking Changes**&lt;/span&gt; - Any changes that break backwards compatibility
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**New Features**&lt;/span&gt; - New functionality
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Bug Fixes**&lt;/span&gt; - Defect corrections
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Performance**&lt;/span&gt; - Performance improvements
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Documentation**&lt;/span&gt; - Docs-only changes
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Dependencies**&lt;/span&gt; - Dependency updates
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Internal**&lt;/span&gt; - Refactoring, CI changes, test improvements
&lt;span class=&quot;p&quot;&gt;3.&lt;/span&gt; For each entry, include:
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; A one-line summary written for end users (not developers)
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; The PR number as a link
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; The author&apos;s GitHub handle
&lt;span class=&quot;p&quot;&gt;4.&lt;/span&gt; Include a &quot;Contributors&quot; section at the bottom listing all unique contributors.
&lt;span class=&quot;p&quot;&gt;5.&lt;/span&gt; Write the output in Markdown format suitable for a GitHub Release.

&lt;span class=&quot;gu&quot;&gt;## Formatting Rules&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;
-&lt;/span&gt; Use past tense (&quot;Added&quot;, &quot;Fixed&quot;, &quot;Removed&quot;)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Do not include commit hashes in the user-facing notes
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; If a PR title is unclear, read the PR description to write a better summary
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Group related PRs under a single bullet when they are part of the same feature
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Invocation:&lt;/strong&gt;&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;/release-notes-drafter Draft release notes for everything since v2.4.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;skill-meeting-notes-structurer-team-leads&quot;&gt;Skill: Meeting Notes Structurer (Team Leads)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.copilot/skills/meeting-notes/SKILL.md&lt;/code&gt;&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;nn&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;meeting-notes&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Structures raw meeting notes into a formatted summary with action items. Use this when asked to clean up meeting notes, format meeting notes, or organize notes from a meeting.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Take the raw meeting notes provided and restructure them into the following format:

&lt;span class=&quot;gu&quot;&gt;### Output Format&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Meeting: [Topic]&lt;/span&gt;
&lt;span class=&quot;gs&quot;&gt;**Date:**&lt;/span&gt; [date]
&lt;span class=&quot;gs&quot;&gt;**Attendees:**&lt;/span&gt; [list]

&lt;span class=&quot;gu&quot;&gt;### Summary&lt;/span&gt;
[2-3 sentence executive summary of the meeting]

&lt;span class=&quot;gu&quot;&gt;### Key Discussion Points&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [Bullet points of major topics discussed]

&lt;span class=&quot;gu&quot;&gt;### Decisions Made&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [Numbered list of decisions with brief rationale]

&lt;span class=&quot;gu&quot;&gt;### Action Items&lt;/span&gt;
| Owner | Action | Due Date | Priority |
|-------|--------|----------|----------|
| @name | task   | date     | H/M/L    |

&lt;span class=&quot;gu&quot;&gt;### Open Questions&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [Items that need follow-up or were unresolved]

&lt;span class=&quot;gu&quot;&gt;### Next Meeting&lt;/span&gt;
[Date/time if discussed]

&lt;span class=&quot;gu&quot;&gt;## Rules&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;
-&lt;/span&gt; Extract action items even if they are buried in discussion text
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; If an owner is not explicitly assigned, note it as &quot;TBD&quot;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; If no due date is mentioned, leave the field as &quot;TBD&quot;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Prioritize decisions and action items over general discussion
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Keep the summary concise. The reader should understand the meeting outcome in 30 seconds.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;skill-adr-writer-technical-writers--architects&quot;&gt;Skill: ADR Writer (Technical Writers / Architects)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/adr-writer/SKILL.md&lt;/code&gt;&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;nn&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;adr-writer&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Creates Architecture Decision Records (ADRs) following the team&apos;s standard template. Use this when asked to write an ADR, document an architecture decision, or create a decision record.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Create an Architecture Decision Record using the following template. Save the file as &lt;span class=&quot;sb&quot;&gt;`docs/adr/NNNN-title.md`&lt;/span&gt; where NNNN is the next sequential number. Check existing files in &lt;span class=&quot;sb&quot;&gt;`docs/adr/`&lt;/span&gt; to determine the next number.

&lt;span class=&quot;gu&quot;&gt;### Template&lt;/span&gt;

&lt;span class=&quot;gh&quot;&gt;# ADR-NNNN: [Title]&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Status&lt;/span&gt;
[Proposed | Accepted | Deprecated | Superseded by ADR-XXXX]

&lt;span class=&quot;gu&quot;&gt;## Context&lt;/span&gt;
[What is the issue? What forces are at play? Be specific about constraints,
requirements, and the problem being solved.]

&lt;span class=&quot;gu&quot;&gt;## Decision&lt;/span&gt;
[What is the change being proposed or decided? State it clearly in one sentence,
then elaborate.]

&lt;span class=&quot;gu&quot;&gt;## Alternatives Considered&lt;/span&gt;
&lt;span class=&quot;gu&quot;&gt;### [Alternative 1]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Pros:**&lt;/span&gt; ...
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Cons:**&lt;/span&gt; ...

&lt;span class=&quot;gu&quot;&gt;### [Alternative 2]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Pros:**&lt;/span&gt; ...
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Cons:**&lt;/span&gt; ...

&lt;span class=&quot;gu&quot;&gt;## Consequences&lt;/span&gt;
&lt;span class=&quot;gu&quot;&gt;### Positive&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [What becomes easier?]

&lt;span class=&quot;gu&quot;&gt;### Negative&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [What becomes harder? What are the tradeoffs?]

&lt;span class=&quot;gu&quot;&gt;### Neutral&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [What changes that is neither good nor bad?]

&lt;span class=&quot;gu&quot;&gt;## References&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [Links to relevant docs, RFCs, discussions, or prior ADRs]

&lt;span class=&quot;gu&quot;&gt;## Rules&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;
-&lt;/span&gt; Always check the &lt;span class=&quot;sb&quot;&gt;`docs/adr/`&lt;/span&gt; directory for existing ADRs before choosing a number
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Status should default to &quot;Proposed&quot; unless told otherwise
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Include at least two alternatives. &quot;Do nothing&quot; counts as an alternative.
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Consequences must include at least one negative consequence. Every decision has tradeoffs. If you cannot identify one, think harder.
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Write for a reader six months from now who has no context on this decision
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;data-science--dba-personas&quot;&gt;Data Science / DBA Personas&lt;/h3&gt;

&lt;p&gt;These skills target people who spend their time in databases, data pipelines, and analytical workflows.&lt;/p&gt;

&lt;h4 id=&quot;skill-sql-migration-generator-dbas&quot;&gt;Skill: SQL Migration Generator (DBAs)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/sql-migration/SKILL.md&lt;/code&gt;&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;nn&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;sql-migration&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Generates database migration files following team conventions. Use this when asked to create a migration, alter a table, add a column, create an index, or make any schema change.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Generate a database migration following these project conventions:

&lt;span class=&quot;gu&quot;&gt;### File Naming&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Pattern: &lt;span class=&quot;sb&quot;&gt;`migrations/YYYYMMDDHHMMSS_description.sql`&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Use the current timestamp for the filename
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Description should be snake_case and descriptive (e.g., &lt;span class=&quot;sb&quot;&gt;`add_index_users_email`&lt;/span&gt;)

&lt;span class=&quot;gu&quot;&gt;### Migration Structure&lt;/span&gt;
Every migration file must contain both an UP and DOWN section:

&lt;span class=&quot;p&quot;&gt;```&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;sql
&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;-- migrate:up&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- Description: [what this migration does]&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- Author: [GitHub handle]&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- Ticket: [ticket ID if provided]&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;SQL&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;statements&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;here&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;-- migrate:down&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;-- WARNING: This will [describe what rollback does]&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Rollback&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SQL&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;statements&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;here&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;gu&quot;&gt;### Rules&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;1.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Never**&lt;/span&gt; use &lt;span class=&quot;sb&quot;&gt;`DROP TABLE`&lt;/span&gt; or &lt;span class=&quot;sb&quot;&gt;`DROP DATABASE`&lt;/span&gt; without explicit user confirmation
&lt;span class=&quot;p&quot;&gt;2.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Always**&lt;/span&gt; include a rollback in the down section. If a rollback is destructive (data loss), add a comment warning about it.
&lt;span class=&quot;p&quot;&gt;3.&lt;/span&gt; Use &lt;span class=&quot;sb&quot;&gt;`IF NOT EXISTS`&lt;/span&gt; / &lt;span class=&quot;sb&quot;&gt;`IF EXISTS`&lt;/span&gt; where supported by the target database
&lt;span class=&quot;p&quot;&gt;4.&lt;/span&gt; For adding columns, always specify a DEFAULT value or explicitly note that NULL is intentional
&lt;span class=&quot;p&quot;&gt;5.&lt;/span&gt; For creating indexes, use &lt;span class=&quot;sb&quot;&gt;`CREATE INDEX CONCURRENTLY`&lt;/span&gt; on PostgreSQL to avoid table locks
&lt;span class=&quot;p&quot;&gt;6.&lt;/span&gt; Include a comment block at the top explaining the purpose of the migration
&lt;span class=&quot;p&quot;&gt;7.&lt;/span&gt; If the migration modifies data (not just schema), add a count query before and after to verify the expected number of rows were affected

&lt;span class=&quot;gu&quot;&gt;### Common Patterns&lt;/span&gt;

&lt;span class=&quot;gs&quot;&gt;**Adding a column:**&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;```&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;sql
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;table_name&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ADD&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;COLUMN&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;column_name&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;DEFAULT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&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;gs&quot;&gt;**Adding an index:**&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;```&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;sql
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;CONCURRENTLY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;idx_table_column&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;table_name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;column_name&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;gs&quot;&gt;**Renaming a column:**&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;```&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;sql
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TABLE&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;table_name&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;RENAME&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;COLUMN&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;old_name&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;new_name&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;&lt;strong&gt;Invocation:&lt;/strong&gt;&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;/sql-migration Add a composite index on users table for email and created_at
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;skill-data-pipeline-validator-data-engineers&quot;&gt;Skill: Data Pipeline Validator (Data Engineers)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/pipeline-validator/SKILL.md&lt;/code&gt;&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;nn&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;pipeline-validator&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Validates data pipeline configurations and suggests improvements. Use this when asked to review a pipeline, validate ETL config, check a DAG, or audit data pipeline code.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Review the specified data pipeline configuration or code and check for the following:

&lt;span class=&quot;gu&quot;&gt;### Validation Checklist&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;
1.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Schema validation**&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are input and output schemas explicitly defined?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are data types specified for all fields?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are nullable fields documented?
&lt;span class=&quot;p&quot;&gt;
2.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Error handling**&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Is there a dead letter queue or error output for failed records?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are retries configured with backoff?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Is there alerting on pipeline failure?
&lt;span class=&quot;p&quot;&gt;
3.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Idempotency**&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Can the pipeline be re-run safely without duplicating data?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are there deduplication keys defined?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Is there a watermark or checkpoint mechanism?
&lt;span class=&quot;p&quot;&gt;
4.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Performance**&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are partitioning keys appropriate for the data volume?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are there any full table scans that could be filtered?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Is incremental processing used where possible?
&lt;span class=&quot;p&quot;&gt;
5.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Data quality**&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are there null checks on required fields?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are there range/format validations on critical fields?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Is there row count validation between source and target?
&lt;span class=&quot;p&quot;&gt;
6.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Security**&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are credentials stored in a secret manager (not hardcoded)?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Is data encrypted in transit and at rest?
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Are PII fields identified and handled appropriately?

&lt;span class=&quot;gu&quot;&gt;### Output Format&lt;/span&gt;

For each issue found, report:
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Severity:**&lt;/span&gt; Critical / Warning / Suggestion
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Location:**&lt;/span&gt; File and line reference
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Issue:**&lt;/span&gt; What is wrong
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Fix:**&lt;/span&gt; Specific recommended change

End with a summary: total issues by severity and an overall assessment.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;skill-jupyter-notebook-cleaner-data-scientists&quot;&gt;Skill: Jupyter Notebook Cleaner (Data Scientists)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.copilot/skills/notebook-cleaner/SKILL.md&lt;/code&gt;&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;nn&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;notebook-cleaner&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Cleans and standardizes Jupyter notebooks for sharing or review. Use this when asked to clean a notebook, prepare a notebook for review, or standardize notebook formatting.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Clean the specified Jupyter notebook (.ipynb file) by performing the following:

&lt;span class=&quot;gu&quot;&gt;### Cleanup Steps&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;
1.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Remove outputs**&lt;/span&gt; - Clear all cell outputs and execution counts. Notebooks should be committed clean.
&lt;span class=&quot;p&quot;&gt;2.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Order imports**&lt;/span&gt; - Ensure all import statements are in the first code cell, organized as:
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Standard library imports
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Third-party imports
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Local/project imports
&lt;span class=&quot;p&quot;&gt;3.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Add section headers**&lt;/span&gt; - Ensure the notebook has Markdown cells with headers that follow this structure:
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`# Title`&lt;/span&gt; - Notebook purpose
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`## Setup`&lt;/span&gt; - Imports and configuration
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`## Data Loading`&lt;/span&gt; - Where data is read
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`## Analysis`&lt;/span&gt; or &lt;span class=&quot;sb&quot;&gt;`## Processing`&lt;/span&gt; - The main work
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`## Results`&lt;/span&gt; or &lt;span class=&quot;sb&quot;&gt;`## Output`&lt;/span&gt; - Findings or outputs
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`## Conclusions`&lt;/span&gt; (if applicable)
&lt;span class=&quot;p&quot;&gt;4.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Check for hardcoded paths**&lt;/span&gt; - Flag any absolute file paths. Suggest using relative paths or environment variables.
&lt;span class=&quot;p&quot;&gt;5.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Check for credentials**&lt;/span&gt; - Flag any API keys, passwords, or tokens. Suggest using environment variables or a &lt;span class=&quot;sb&quot;&gt;`.env`&lt;/span&gt; file.
&lt;span class=&quot;p&quot;&gt;6.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Add docstrings**&lt;/span&gt; - Ensure any function definitions have docstrings explaining parameters and return values.
&lt;span class=&quot;p&quot;&gt;7.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Remove dead code**&lt;/span&gt; - Flag commented-out code blocks and empty cells.

&lt;span class=&quot;gu&quot;&gt;### Output&lt;/span&gt;

Provide a summary of changes made and any items that need manual attention.

&lt;span class=&quot;gu&quot;&gt;### Rules&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Do not modify the analytical logic or results
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Preserve all Markdown explanations
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; If the notebook is too large to process in one pass, work section by section
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;developer-personas&quot;&gt;Developer Personas&lt;/h3&gt;

&lt;p&gt;These skills target application developers doing everyday engineering work.&lt;/p&gt;

&lt;h4 id=&quot;skill-pr-review-checklist-all-developers&quot;&gt;Skill: PR Review Checklist (All Developers)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/pr-review/SKILL.md&lt;/code&gt;&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;nn&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;pr-review&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Performs a structured code review against team standards. Use this when asked to review a PR, review code changes, do a code review, or check a pull request.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Review the code changes using the following structured checklist. Use the GitHub MCP server tools to read the PR diff and details.

&lt;span class=&quot;gu&quot;&gt;### Review Checklist&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;#### Correctness&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Does the code do what the PR description says it does?
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Are edge cases handled?
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Are error paths handled gracefully?
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Are there any obvious bugs or logic errors?

&lt;span class=&quot;gu&quot;&gt;#### Tests&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Are there tests for new functionality?
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Do existing tests still pass?
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Are edge cases tested?
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Is test coverage adequate for the change size?

&lt;span class=&quot;gu&quot;&gt;#### Security&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] No secrets or credentials in the diff
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] User inputs are validated and sanitized
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] No SQL injection vectors
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] No XSS vectors in frontend code
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Dependencies added are from trusted sources

&lt;span class=&quot;gu&quot;&gt;#### Performance&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] No N+1 query patterns
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] No unnecessary loops over large datasets
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] No blocking calls in async code paths
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Database queries use appropriate indexes

&lt;span class=&quot;gu&quot;&gt;#### Maintainability&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Code is readable without extensive comments
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Functions are appropriately sized
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] No duplicated logic that should be extracted
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; [ ] Naming is clear and consistent

&lt;span class=&quot;gu&quot;&gt;### Output Format&lt;/span&gt;

For each item, mark it as:
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; PASS - No issues
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; WARN - Minor concern, non-blocking
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; FAIL - Must be addressed before merge
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; N/A - Not applicable to this change

End with a summary: overall recommendation (Approve / Request Changes / Comment) with rationale.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Invocation:&lt;/strong&gt;&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;/pr-review Review #142
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;skill-test-generator-backend-developers&quot;&gt;Skill: Test Generator (Backend Developers)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/test-generator/SKILL.md&lt;/code&gt;&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;nn&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;test-generator&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Generates test files with comprehensive test cases following project conventions. Use this when asked to write tests, generate tests, add test coverage, or create unit tests.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Generate tests for the specified code. Follow these rules:

&lt;span class=&quot;gu&quot;&gt;### Test Structure&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;1.&lt;/span&gt; Read the source file to understand the public API
&lt;span class=&quot;p&quot;&gt;2.&lt;/span&gt; Determine the test framework by checking existing test files in the project:
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; JavaScript/TypeScript: look for jest.config, vitest.config, or .mocharc
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Python: look for pytest.ini, pyproject.toml, or setup.cfg
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Go: use the standard testing package
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Ruby: look for .rspec or Gemfile for rspec/minitest
&lt;span class=&quot;p&quot;&gt;3.&lt;/span&gt; Create the test file in the corresponding test directory following existing project patterns
&lt;span class=&quot;p&quot;&gt;4.&lt;/span&gt; Name the test file to match the source file (e.g., &lt;span class=&quot;sb&quot;&gt;`user_service.py`&lt;/span&gt; -&amp;gt; &lt;span class=&quot;sb&quot;&gt;`test_user_service.py`&lt;/span&gt;)

&lt;span class=&quot;gu&quot;&gt;### Test Cases to Generate&lt;/span&gt;

For each public function or method, generate:
&lt;span class=&quot;p&quot;&gt;
1.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Happy path**&lt;/span&gt; - Normal expected input and output
&lt;span class=&quot;p&quot;&gt;2.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Edge cases**&lt;/span&gt; - Empty inputs, boundary values, nil/null/undefined
&lt;span class=&quot;p&quot;&gt;3.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Error cases**&lt;/span&gt; - Invalid inputs, expected exceptions
&lt;span class=&quot;p&quot;&gt;4.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Type variations**&lt;/span&gt; (where applicable) - Different valid types that the function accepts

&lt;span class=&quot;gu&quot;&gt;### Rules&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; One assertion per test (prefer focused, descriptive tests)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Use descriptive test names: &lt;span class=&quot;sb&quot;&gt;`test_create_user_with_duplicate_email_raises_conflict`&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Do not mock what you do not own (mock your interfaces, not third-party libraries)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Set up test data in each test or use a shared fixture. Do not rely on test execution order.
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; If the function has side effects (database, file system, network), note which tests need mocking
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Include at least one integration test suggestion as a comment at the bottom of the file
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;skill-api-endpoint-scaffolder-full-stack-developers&quot;&gt;Skill: API Endpoint Scaffolder (Full-Stack Developers)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/api-scaffolder/SKILL.md&lt;/code&gt;&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;nn&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;api-scaffolder&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Scaffolds new REST API endpoints with validation, error handling, and tests. Use this when asked to create an API endpoint, add a new route, scaffold a REST endpoint, or build a CRUD API.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Scaffold a new API endpoint by generating the following files. Detect the project&apos;s framework and language by reading existing route/controller files.

&lt;span class=&quot;gu&quot;&gt;### Files to Generate&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;
1.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Route/Controller**&lt;/span&gt; - The endpoint handler with:
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Input validation (reject bad requests early)
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Authentication check (verify the user is authenticated)
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Authorization check (verify the user has permission)
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Business logic call (delegate to a service layer)
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Structured error responses with appropriate HTTP status codes
&lt;span class=&quot;p&quot;&gt;   -&lt;/span&gt; Request/response logging
&lt;span class=&quot;p&quot;&gt;
2.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Service layer**&lt;/span&gt; (if the project uses one) - Business logic separated from HTTP concerns
&lt;span class=&quot;p&quot;&gt;
3.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Input validation schema**&lt;/span&gt; - Define expected request body, query params, and path params with types and constraints
&lt;span class=&quot;p&quot;&gt;
4.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Tests**&lt;/span&gt; - Use the /test-generator skill patterns for the generated code
&lt;span class=&quot;p&quot;&gt;
5.&lt;/span&gt; &lt;span class=&quot;gs&quot;&gt;**Route registration**&lt;/span&gt; - Add the route to the existing router/app configuration

&lt;span class=&quot;gu&quot;&gt;### Error Response Format&lt;/span&gt;

All error responses must follow this structure:

&lt;span class=&quot;p&quot;&gt;```&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;json
&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;error&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;code&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;DESCRIPTIVE_ERROR_CODE&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;message&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;Human readable message&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;details&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;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;p&quot;&gt;```&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;### HTTP Status Code Guide&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 200: Success (GET, PUT, PATCH)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 201: Created (POST that creates a resource)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 204: No Content (DELETE)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 400: Bad Request (validation failure)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 401: Unauthorized (no/invalid auth)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 403: Forbidden (valid auth, insufficient permissions)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 404: Not Found
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 409: Conflict (duplicate resource)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 422: Unprocessable Entity (valid syntax, semantic error)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; 500: Internal Server Error (catch-all, should be rare)

&lt;span class=&quot;gu&quot;&gt;### Rules&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Never return 200 for errors
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Always validate input before processing
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Sanitize user input before database queries
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Do not expose internal error details to the client in production
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Include rate limiting considerations as a comment if the endpoint is public
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Invocation:&lt;/strong&gt;&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;/api-scaffolder Create a POST /api/v1/users endpoint for user registration
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;skill-git-commit-message-standardizer-all-developers&quot;&gt;Skill: Git Commit Message Standardizer (All Developers)&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location:&lt;/strong&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.copilot/skills/commit-message/SKILL.md&lt;/code&gt;&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;nn&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;commit-message&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Generates standardized commit messages from staged changes. Use this when asked to write a commit message, generate a commit message, or create a conventional commit.&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;## Instructions&lt;/span&gt;

Analyze the currently staged changes (use &lt;span class=&quot;sb&quot;&gt;`git diff --staged`&lt;/span&gt;) and generate a commit message following the Conventional Commits specification.

&lt;span class=&quot;gu&quot;&gt;### Format&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;```&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;
&lt;/span&gt;&amp;lt;type&amp;gt;(&amp;lt;scope&amp;gt;): &amp;lt;subject&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;footer&amp;gt;
&lt;span class=&quot;p&quot;&gt;```&lt;/span&gt;

&lt;span class=&quot;gu&quot;&gt;### Types&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`feat`&lt;/span&gt;: New feature
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`fix`&lt;/span&gt;: Bug fix
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`docs`&lt;/span&gt;: Documentation only
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`style`&lt;/span&gt;: Formatting, whitespace (no logic change)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`refactor`&lt;/span&gt;: Code change that neither fixes a bug nor adds a feature
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`perf`&lt;/span&gt;: Performance improvement
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`test`&lt;/span&gt;: Adding or updating tests
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`build`&lt;/span&gt;: Build system or dependencies
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`ci`&lt;/span&gt;: CI/CD changes
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`chore`&lt;/span&gt;: Maintenance tasks

&lt;span class=&quot;gu&quot;&gt;### Rules&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Subject line: max 72 characters, imperative mood (&quot;Add&quot; not &quot;Added&quot; or &quot;Adds&quot;), no period at the end
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Scope: the module, component, or area affected (optional but preferred)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Body: explain &lt;span class=&quot;ge&quot;&gt;*what*&lt;/span&gt; and &lt;span class=&quot;ge&quot;&gt;*why*&lt;/span&gt;, not &lt;span class=&quot;ge&quot;&gt;*how*&lt;/span&gt;. Wrap at 80 characters.
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; Footer: reference issue/ticket numbers if applicable (e.g., &lt;span class=&quot;sb&quot;&gt;`Closes #123`&lt;/span&gt;)
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; If the staged changes span multiple concerns, suggest splitting into multiple commits
&lt;span class=&quot;p&quot;&gt;-&lt;/span&gt; If the changes are a breaking change, add &lt;span class=&quot;sb&quot;&gt;`BREAKING CHANGE:`&lt;/span&gt; in the footer

&lt;span class=&quot;gu&quot;&gt;### Output&lt;/span&gt;
Provide the commit message in a code block, ready to copy. If you suggest splitting the commit, provide commands for each partial commit.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;managing-skills-in-the-cli&quot;&gt;Managing Skills in the CLI&lt;/h2&gt;

&lt;p&gt;Once you have skills in place, here are the commands you will use day-to-day:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Command&lt;/th&gt;
      &lt;th&gt;Purpose&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/skills list&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;List all available skills&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/skills&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Toggle skills on/off interactively&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/skills info&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;View skill details and file location&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/skills add&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Add an alternative skills directory&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/skills reload&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Reload skills without restarting the CLI&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/skills remove SKILL-DIR&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Remove a manually added skill&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/my-skill-name prompt&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Invoke a skill explicitly&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Copilot also auto-invokes skills when it detects a match, so you do not always need the slash command. If your description is well-written, just describe the task naturally and Copilot will pick the right skill.&lt;/p&gt;

&lt;h2 id=&quot;tips-for-building-great-skills&quot;&gt;Tips for Building Great Skills&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Write the description like a trigger.&lt;/strong&gt; Include the action verbs and keywords that someone would naturally use when asking for this task. “Use this when asked to…” is a powerful pattern.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Be prescriptive in instructions.&lt;/strong&gt; Vague instructions produce vague results. Tell Copilot the exact steps, the exact format, and the exact constraints.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Include examples in the skill.&lt;/strong&gt; If you want a specific output format, show Copilot what it looks like. Templates embedded in the instructions are extremely effective.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Add supporting scripts.&lt;/strong&gt; If a workflow involves running a shell script (linting, formatting, validation), include the script in the skill directory and reference it in the instructions.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Test with edge cases.&lt;/strong&gt; Invoke the skill with unusual inputs to see how Copilot interprets your instructions. Refine the instructions based on what breaks.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Keep skills focused.&lt;/strong&gt; One skill, one job. If your skill is trying to do five different things, split it into five skills.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Version them with your code.&lt;/strong&gt; Project skills in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/&lt;/code&gt; are version-controlled with your repo. Treat them like code: review changes, iterate, and improve over time.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;tldr&quot;&gt;TL;DR&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Skills&lt;/strong&gt; are on-demand Markdown playbooks that teach Copilot CLI how to handle specific tasks.&lt;/li&gt;
  &lt;li&gt;They live in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/skills/&lt;/code&gt; (project) or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.copilot/skills/&lt;/code&gt; (personal).&lt;/li&gt;
  &lt;li&gt;Each skill is a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SKILL.md&lt;/code&gt; file with YAML frontmatter (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;name&lt;/code&gt; + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;description&lt;/code&gt;) and Markdown instructions.&lt;/li&gt;
  &lt;li&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;description&lt;/code&gt; field is critical because it is how Copilot decides whether to auto-invoke the skill.&lt;/li&gt;
  &lt;li&gt;Use custom instructions for always-on guidance. Use skills for specific, repeatable workflows.&lt;/li&gt;
  &lt;li&gt;Skills are not just for developers. Project managers, technical writers, DBAs, and data scientists all have repetitive structured tasks that skills can standardize.&lt;/li&gt;
  &lt;li&gt;Include templates, checklists, and explicit step-by-step instructions for the best results.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;sources&quot;&gt;Sources&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/about-agent-skills&quot;&gt;Official docs: About agent skills&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-skills&quot;&gt;Official docs: Creating agent skills for Copilot CLI&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-cli/comparing-cli-features&quot;&gt;Official docs: Comparing CLI customization features&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/agentskills/agentskills&quot;&gt;Agent Skills open standard&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/github/awesome-copilot&quot;&gt;GitHub Awesome Copilot&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/anthropics/skills&quot;&gt;Anthropic skills repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;closing&quot;&gt;Closing&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Have questions about Copilot CLI skills or want to share one you have built? Find me on &lt;a href=&quot;https://github.com/jmassardo&quot;&gt;GitHub&lt;/a&gt;, &lt;a href=&quot;https://www.linkedin.com/in/jenna-massardo/&quot;&gt;LinkedIn&lt;/a&gt;, or &lt;a href=&quot;https://bsky.app/profile/jmassardo.bsky.social&quot;&gt;Bluesky&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="copilot" />
   
    <category term="cli" />
   
    <category term="ai" />
   
    <category term="skills" />
   
    <category term="automation" />
   
    <category term="devops" />
   
 </entry>
 
 <entry>
   <title>GitHub Copilot CLI: Senior Developer Reference</title>
   <link href="https://www.dxrf.com/blog/2026/03/02/github-copilot-cli-tldr-howto/"/>
   <updated>2026-03-02T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/03/02/github-copilot-cli-tldr-howto</id>
   <excerpt type="html">A reference-style guide for senior developers using Copilot CLI (GA). Focus on agent runtime architecture, composition patterns, autopilot mode, memory, programmatic automation, and team-scale governance.</excerpt>
   <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;GitHub Copilot CLI &lt;a href=&quot;https://github.blog/changelog/2026-02-25-github-copilot-cli-is-now-generally-available/&quot;&gt;went GA on February 25, 2026&lt;/a&gt; and is available with all Copilot plans (Free, Pro, Pro+, Business, Enterprise). It is an agent runtime, not a chatbot. If you are a senior engineer evaluating it for org-scale use or building automation around it, skip the marketing sprints and learn the actual surface: modes, tool governance, composition model, memory, and how subagents work.&lt;/p&gt;

&lt;p&gt;This is reference material for staff and principal engineers who ship code at scale and care about reproducibility, audit trails, and control.&lt;/p&gt;

&lt;!-- more --&gt;

&lt;h2 id=&quot;the-architecture-you-need-to-understand&quot;&gt;The Architecture You Need to Understand&lt;/h2&gt;

&lt;p&gt;Copilot CLI runs an agentic loop: sense, plan, execute, iterate. You interact with it through two interfaces (interactive and programmatic) and you can customize behavior through a layered composition model: instructions, skills, agents, hooks, MCP servers, and plugins.&lt;/p&gt;

&lt;p&gt;The power is not in asking it questions. The power is in delegating work while keeping governance sane.&lt;/p&gt;

&lt;h2 id=&quot;modes-and-entry-points&quot;&gt;Modes and Entry Points&lt;/h2&gt;

&lt;h3 id=&quot;interactive-mode&quot;&gt;Interactive mode&lt;/h3&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;copilot
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Default loop mode: ask, review, approve/reject, iterate. Press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Shift+Tab&lt;/code&gt; to cycle between three modes:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Ask mode&lt;/strong&gt; (default): Execute immediately, asking for approval on tool use.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-best-practices#2-plan-before-you-code&quot;&gt;Plan mode&lt;/a&gt;&lt;/strong&gt;: Copilot analyzes your request, asks clarifying questions, and builds a structured implementation plan before writing code. Review and approve the plan, then watch it execute.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-cli/autopilot&quot;&gt;Autopilot mode&lt;/a&gt;&lt;/strong&gt;: Copilot works fully autonomously—executing tools, running commands, and iterating without stopping for approval. When prompted, choose a permission level for the session.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;programmatic-mode&quot;&gt;Programmatic mode&lt;/h3&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;copilot &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;your task here&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;approval flags]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Single-shot execution. The agent completes the task and exits. Useful for CI pipelines, scripts, or workflows.&lt;/p&gt;

&lt;p&gt;For autopilot in programmatic mode:&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;copilot &lt;span class=&quot;nt&quot;&gt;--autopilot&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--yolo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--max-autopilot-continues&lt;/span&gt; 10 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Run the full test suite, fix any failures, and commit&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;piping&quot;&gt;Piping&lt;/h3&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;./generate-options.sh | copilot
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Script outputs options, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;copilot&lt;/code&gt; consumes them. Enables complex automation patterns.&lt;/p&gt;

&lt;h3 id=&quot;background-delegation&quot;&gt;Background delegation&lt;/h3&gt;

&lt;p&gt;Prefix a prompt with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;amp;&lt;/code&gt; or use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/delegate&lt;/code&gt; to push work to the Copilot coding agent in the cloud:&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;&amp;amp; complete the API integration tests and fix any failing edge cases
/delegate complete the API integration tests and fix any failing edge cases
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Copilot commits unstaged changes as a checkpoint, creates a branch, opens a draft PR, and works in the background. Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/resume&lt;/code&gt; to switch between local and remote coding agent sessions.&lt;/p&gt;

&lt;h3 id=&quot;session-resume&quot;&gt;Session resume&lt;/h3&gt;

&lt;p&gt;Pick up where you left off:&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;copilot &lt;span class=&quot;nt&quot;&gt;--resume&lt;/span&gt;    &lt;span class=&quot;c&quot;&gt;# Select from previous sessions (local and remote)&lt;/span&gt;
copilot &lt;span class=&quot;nt&quot;&gt;--continue&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;# Resume the most recently closed local session&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Inside an interactive session, use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/resume&lt;/code&gt; to browse and resume any session, including Copilot coding agent sessions running on GitHub.&lt;/p&gt;

&lt;h2 id=&quot;approval-and-permission-model&quot;&gt;Approval and Permission Model&lt;/h2&gt;

&lt;p&gt;This is the security model. Understand it before deploying.&lt;/p&gt;

&lt;h3 id=&quot;per-invocation-approvals&quot;&gt;Per-invocation approvals&lt;/h3&gt;

&lt;p&gt;Default behavior in interactive mode. The agent asks before using tools that modify or execute. You have three choices per request:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;1. Yes (this command only)
2. Yes, and approve TOOL for the rest of this session
3. No, and tell Copilot what to do differently (Esc)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Choosing option 2 for a tool family (like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;shell&lt;/code&gt;) grants broad permission for that tool class in the current session only.&lt;/p&gt;

&lt;h3 id=&quot;headless-approval-flags&quot;&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/configure-copilot-cli#setting-allowed-tools&quot;&gt;Headless approval flags&lt;/a&gt;&lt;/h3&gt;

&lt;dl&gt;
  &lt;dt&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allow-all-tools&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;The agent can use any tool without asking. High risk.&lt;/dd&gt;
  &lt;dt&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allow-tool &apos;shell(git)&apos;&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Allow specific tools. Combine multiple times.&lt;/dd&gt;
  &lt;dt&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allow-tool &apos;shell&apos;&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Allow all shell commands.&lt;/dd&gt;
  &lt;dt&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allow-tool &apos;write&apos;&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Allow all file modifications.&lt;/dd&gt;
  &lt;dt&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allow-tool &apos;MCP_SERVER_NAME&apos;&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Allow tools from a specific MCP server.&lt;/dd&gt;
  &lt;dt&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--deny-tool &apos;shell(rm)&apos;&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Deny specific tools. Takes precedence over allow flags.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h3 id=&quot;real-world-pattern-for-automation&quot;&gt;Real-world pattern for automation&lt;/h3&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;copilot &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Revert the last commit and push the branch&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--allow-all-tools&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--deny-tool&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;shell(rm)&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--deny-tool&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;shell(git push --force)&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This approves everything except destructive commands. Safer than yolo-mode, still risky. Test in containers first.&lt;/p&gt;

&lt;h2 id=&quot;the-composition-model-how-to-reach-team-scale&quot;&gt;The Composition Model: How to Reach Team Scale&lt;/h2&gt;

&lt;p&gt;This is where Copilot CLI goes from personal productivity to org-level tool.&lt;/p&gt;

&lt;h3 id=&quot;layer-1-custom-instructions&quot;&gt;Layer 1: &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions&quot;&gt;Custom Instructions&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Files in default search paths:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/copilot-instructions.md&lt;/code&gt; (&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions#repository-wide-custom-instructions&quot;&gt;repository-wide&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/instructions/**/*.instructions.md&lt;/code&gt; (&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions#creating-path-specific-custom-instructions&quot;&gt;path-specific&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;AGENTS.md&lt;/code&gt; (&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions#agent-instructions&quot;&gt;agent instructions&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$HOME/.copilot/copilot-instructions.md&lt;/code&gt; (&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions#local-instructions&quot;&gt;user-level&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use for persistent, always-on guidance: coding standards, repo conventions, team preferences. All instruction files now merge instead of using priority fallback.&lt;/p&gt;

&lt;p&gt;Skip loading them with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--no-custom-instructions&lt;/code&gt;. Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/init&lt;/code&gt; to auto-generate instructions tailored to your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use&lt;/strong&gt;: You want defaults to apply across all sessions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When not to use&lt;/strong&gt;: You have workflow-specific or high-volume instructions. Use skills instead.&lt;/p&gt;

&lt;h3 id=&quot;layer-2-skills&quot;&gt;Layer 2: &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-skills&quot;&gt;Skills&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Discrete, reusable playbooks for specific tasks. A skill is minimally a Markdown file with instructions; it can optionally include scripts, configs, or resources in a directory.&lt;/p&gt;

&lt;p&gt;Discovery and invocation:&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;/skills list                  # List all available skills
/SkillName do-something      # Invoke skill directly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Copilot CLI also auto-invokes relevant skills when it detects a matching task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use&lt;/strong&gt;: You need a repeatable workflow (release notes, docs checks, code review criteria) that isn’t always relevant. Skills are loaded on-demand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When not to use&lt;/strong&gt;: You want always-on behavior. Use custom instructions.&lt;/p&gt;

&lt;h3 id=&quot;layer-3-custom-agents&quot;&gt;Layer 3: &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli&quot;&gt;Custom Agents&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Specialized personas defined in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.agent.md&lt;/code&gt; files (&lt;a href=&quot;https://docs.github.com/en/copilot/reference/custom-agents-configuration&quot;&gt;configuration reference&lt;/a&gt;) with YAML frontmatter:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;A description and expertise area&lt;/li&gt;
  &lt;li&gt;Tool permission constraints (which tools it can use)&lt;/li&gt;
  &lt;li&gt;Optional MCP server access&lt;/li&gt;
  &lt;li&gt;Optional auto-inference flag (when &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;infer: true&lt;/code&gt;, Copilot may auto-delegate matching work)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Copilot CLI ships with &lt;strong&gt;built-in agents&lt;/strong&gt; that it auto-delegates to:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Agent&lt;/th&gt;
      &lt;th&gt;Purpose&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Explore&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Fast codebase analysis without polluting main context&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Task&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Runs builds and tests; brief summaries on success, full output on failure&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;General-purpose&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Complex, multi-step tasks with full toolset in a separate context&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Code-review&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Reviews changes, surfaces genuine issues, minimizes noise&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Plan&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Implementation planning and scoping&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Multiple built-in agents can run in parallel.&lt;/p&gt;

&lt;p&gt;Define your own at three levels:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Scope&lt;/th&gt;
      &lt;th&gt;Location&lt;/th&gt;
      &lt;th&gt;Applies to&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli#creating-a-custom-agent&quot;&gt;User&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.copilot/agents/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;All projects&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli#creating-a-custom-agent&quot;&gt;Repository&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/agents/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Current project&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/reference/custom-agents-configuration&quot;&gt;Org/Enterprise&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github-private/agents/&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;All projects in the org/enterprise&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Naming conflicts resolve: system &amp;gt; repository &amp;gt; organization.&lt;/p&gt;

&lt;p&gt;Invoke custom agents three ways:&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;&lt;span class=&quot;c&quot;&gt;# Interactive: browse available agents&lt;/span&gt;
/agent

&lt;span class=&quot;c&quot;&gt;# Natural language (Copilot infers the agent)&lt;/span&gt;
Use the refactoring agent to refactor this code block

&lt;span class=&quot;c&quot;&gt;# Explicit CLI flag&lt;/span&gt;
copilot &lt;span class=&quot;nt&quot;&gt;--agent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;refactor-agent &lt;span class=&quot;nt&quot;&gt;--prompt&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Refactor this code block&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;When to use&lt;/strong&gt;: You need a specialist role with constrained permissions (security auditor, release manager, frontend reviewer).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When not to use&lt;/strong&gt;: You just need guidance text (skills are simpler) or the default agent already works well.&lt;/p&gt;

&lt;h3 id=&quot;layer-4-hooks&quot;&gt;Layer 4: &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-hooks&quot;&gt;Hooks&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Programmable lifecycle events that execute shell commands:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;preToolUse&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;postToolUse&lt;/code&gt;: Before/after any tool runs&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;userPromptSubmitted&lt;/code&gt;: When user submits input&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sessionStart&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sessionEnd&lt;/code&gt;: Session lifecycle&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;errorOccurred&lt;/code&gt;: On errors&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;agentStop&lt;/code&gt;: When main agent completes&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;subagentStop&lt;/code&gt;: When subagent finishes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Configuration in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hooks.json&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.github/hooks.json&lt;/code&gt;. See the &lt;a href=&quot;https://docs.github.com/en/copilot/reference/hooks-configuration&quot;&gt;hooks configuration reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use case examples&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Enforce guardrails: block file edits to protected paths unless a ticket ID is mentioned&lt;/li&gt;
  &lt;li&gt;Log every tool invocation to an audit sink&lt;/li&gt;
  &lt;li&gt;Validate tool output before returning to the user&lt;/li&gt;
  &lt;li&gt;Auto-retry on specific errors with capped retry count&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use&lt;/strong&gt;: You need enforced policy, not just suggestions. Hooks are where guardrails become real.&lt;/p&gt;

&lt;h3 id=&quot;layer-5-mcp-servers&quot;&gt;Layer 5: &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers&quot;&gt;MCP Servers&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.github.com/en/copilot/concepts/about-mcp&quot;&gt;Model Context Protocol&lt;/a&gt;. Adds external data sources and tools.&lt;/p&gt;

&lt;p&gt;GitHub always includes the GitHub MCP server by default. You can add:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Custom internal services (ticketing, incident management, knowledge bases)&lt;/li&gt;
  &lt;li&gt;Public MCP servers (calendar, email, databases)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Manage them inside interactive mode:&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;/mcp               # List configured servers
/mcp add           # Interactive wizard to add a server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Server configs are stored in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.copilot/mcp-config.json&lt;/code&gt; (customizable via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;XDG_CONFIG_HOME&lt;/code&gt;).&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Known limitation&lt;/strong&gt;: Copilot CLI does not currently support organization-level MCP server policies (the “MCP servers in Copilot” and “MCP Registry URL” settings).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;When to use&lt;/strong&gt;: Built-in tools (read, write, shell, git) are insufficient. You need integration with external systems.&lt;/p&gt;

&lt;h3 id=&quot;layer-6-plugins&quot;&gt;Layer 6: &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/plugins-finding-installing&quot;&gt;Plugins&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Distributable packages that bundle customizations: skills, agents, hooks, MCP configs, LSP configs. Single installation unit.&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;/plugin install copilot-plugins/my-plugin
/plugin list
/plugin update my-plugin
/plugin uninstall my-plugin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Default marketplaces:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;copilot-plugins&lt;/code&gt; (official GitHub plugins)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;awesome-copilot&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to use&lt;/strong&gt;: You want to ship a team-wide customization bundle without manual copy/paste.&lt;/p&gt;

&lt;h2 id=&quot;delegation-and-subagents&quot;&gt;Delegation and Subagents&lt;/h2&gt;

&lt;p&gt;When you ask Copilot CLI to do complex work, it can spin up subagents:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;For codebase exploration&lt;/strong&gt;: Map dependencies, find endpoints, model the structure&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;For builds/tests&lt;/strong&gt;: Run a test suite, parse failures, report&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;For code review&lt;/strong&gt;: Analyze staged changes, find issues&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;For multi-step features&lt;/strong&gt;: Implement across files, test, commit&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;For custom agents&lt;/strong&gt;: If you’ve defined a custom agent with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;infer: true&lt;/code&gt;, Copilot may auto-delegate matching work to that subagent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each subagent has its own context window, so it doesn’t bloat the main session. Multiple built-in agents can &lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-cli/fleet&quot;&gt;run in parallel&lt;/a&gt;. This is where the tool shifts from chatbot to actual system.&lt;/p&gt;

&lt;h3 id=&quot;steering-while-thinking&quot;&gt;Steering while thinking&lt;/h3&gt;

&lt;p&gt;You can interact with Copilot while it’s processing:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Enqueue messages&lt;/strong&gt;: Send follow-up prompts to steer direction or queue additional instructions for after the current response.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Inline rejection feedback&lt;/strong&gt;: When you reject a tool permission request, provide inline feedback so Copilot can adapt without stopping entirely.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;context-management-for-long-sessions&quot;&gt;Context Management for Long Sessions&lt;/h2&gt;

&lt;h3 id=&quot;auto-compaction&quot;&gt;Auto-compaction&lt;/h3&gt;

&lt;p&gt;When your conversation token usage approaches 95% of the limit, Copilot automatically compresses history in the background without stopping you.&lt;/p&gt;

&lt;h3 id=&quot;manual-control&quot;&gt;Manual control&lt;/h3&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;/context          # Show detailed token usage breakdown
/compact          # Force compression (press Esc to cancel)
/usage            # Session stats: premium requests used, duration, lines edited, tokens per model
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This enables virtually infinite sessions. Useful for multi-day tasks or CI jobs that run for hours.&lt;/p&gt;

&lt;h3 id=&quot;copilot-memory-repository-memory&quot;&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-memory&quot;&gt;Copilot Memory&lt;/a&gt; (Repository Memory)&lt;/h3&gt;

&lt;p&gt;Copilot Memory is a persistent, repository-scoped knowledge system. As Copilot works on your codebase, it stores “memories”—tightly scoped facts about conventions, patterns, and preferences it discovers. Memories:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Persist across sessions (auto-expire after 28 days if unused)&lt;/li&gt;
  &lt;li&gt;Are validated against the current codebase before use (stale memories are ignored)&lt;/li&gt;
  &lt;li&gt;Are shared across Copilot surfaces (CLI, coding agent, code review)&lt;/li&gt;
  &lt;li&gt;Are repository-scoped, not user-scoped&lt;/li&gt;
  &lt;li&gt;Require write permission to the repo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means if Copilot coding agent discovers how your repo handles database connections, Copilot code review can later apply that knowledge to spot inconsistencies in a PR.&lt;/p&gt;

&lt;p&gt;Copilot Memory is off by default. Enable it in enterprise, organization, or personal Copilot settings. Repository owners can review and delete stored memories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use&lt;/strong&gt;: You want Copilot to learn your codebase over time without maintaining elaborate custom instruction files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When not to use&lt;/strong&gt;: You need deterministic, version-controlled behavior. Use custom instructions instead.&lt;/p&gt;

&lt;h2 id=&quot;review-diff-and-undo&quot;&gt;Review, Diff, and Undo&lt;/h2&gt;

&lt;p&gt;GA added dedicated workflows for reviewing and reverting changes:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Command&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/diff&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Review all session changes with syntax-highlighted inline diffs. Add line-specific comments as structured feedback. Toggle between session changes and branch diffs.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/review&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Analyze staged or unstaged code changes for a quick sanity check before committing.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Esc&lt;/code&gt;-&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Esc&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Rewind file changes to any previous snapshot in the session.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;prompt-helpers&quot;&gt;Prompt Helpers&lt;/h2&gt;

&lt;h3 id=&quot;file-references&quot;&gt;File references&lt;/h3&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;@&lt;/code&gt; followed by a relative path to include a file’s contents as context:&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;Explain @config/ci/ci-required-checks.yml
Fix the bug in @src/app.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Tab-completion works on file paths.&lt;/p&gt;

&lt;h3 id=&quot;direct-shell-execution&quot;&gt;Direct shell execution&lt;/h3&gt;

&lt;p&gt;Prefix with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;!&lt;/code&gt; to run shell commands directly, without a model call:&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;!git clone https://github.com/github/copilot-cli
!npm test
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;reasoning-visibility&quot;&gt;Reasoning visibility&lt;/h3&gt;

&lt;p&gt;Press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl+T&lt;/code&gt; to show or hide the model’s reasoning process. This setting persists across sessions.&lt;/p&gt;

&lt;h3 id=&quot;longer-prompts&quot;&gt;Longer prompts&lt;/h3&gt;

&lt;p&gt;Press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl+X&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl+E&lt;/code&gt; to open your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$EDITOR&lt;/code&gt; for composing multi-line prompts.&lt;/p&gt;

&lt;h3 id=&quot;working-directory-management&quot;&gt;Working directory management&lt;/h3&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;/add-dir /path/to/directory    # Add a trusted directory mid-session
/cd /path/to/directory         # Switch working directory without restarting
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;programmatic-integration-ci-webhooks-automation&quot;&gt;Programmatic Integration: CI, Webhooks, Automation&lt;/h2&gt;

&lt;h3 id=&quot;in-ci-pipelines&quot;&gt;In CI pipelines&lt;/h3&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;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
copilot &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Run tests, report coverage&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--allow-tool&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;shell(npm)&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--allow-tool&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;shell(git)&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--deny-tool&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;shell(git push)&apos;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--allow-tool&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;write&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For fully autonomous CI runs:&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;copilot &lt;span class=&quot;nt&quot;&gt;--autopilot&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--yolo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--max-autopilot-continues&lt;/span&gt; 10 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Run the full test suite and fix any failures&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;error-handling&quot;&gt;Error handling&lt;/h3&gt;

&lt;p&gt;Combine with exit codes and conditional logic:&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;&lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;copilot &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Does this PR pass security checks?&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--allow-tool&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;shell&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Security checks passed&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;else
  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Security issue detected&quot;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;1
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;via-acp-agent-client-protocol&quot;&gt;Via ACP (Agent Client Protocol)&lt;/h3&gt;

&lt;p&gt;Copilot CLI runs an ACP server, so compatible tools, IDEs, and automation systems can invoke it as an agent. See the &lt;a href=&quot;https://docs.github.com/en/copilot/reference/acp-server&quot;&gt;Copilot CLI ACP reference&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;trusted-directories-and-risk-mitigation&quot;&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/configure-copilot-cli#setting-trusted-directories&quot;&gt;Trusted Directories&lt;/a&gt; and Risk Mitigation&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Treat trusted directories seriously.&lt;/strong&gt; You should only launch &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;copilot&lt;/code&gt; from directories you trust.&lt;/p&gt;

&lt;p&gt;Do not:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Launch from your home directory&lt;/li&gt;
  &lt;li&gt;Launch in directories with executables you can’t verify&lt;/li&gt;
  &lt;li&gt;Launch in directories with sensitive data you don’t want modified&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On first launch, you’ll confirm trust. Scoping is heuristic; GitHub does not guarantee files outside trusted directories are protected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For higher-risk automation&lt;/strong&gt;, run Copilot CLI in a restricted environment: container, VM, or isolated system with tight file permissions and network policy. This confines blast radius if something goes wrong.&lt;/p&gt;

&lt;h2 id=&quot;team-rollout-pattern-conservative-to-bold&quot;&gt;Team Rollout Pattern (Conservative to Bold)&lt;/h2&gt;

&lt;h3 id=&quot;phase-1-baseline&quot;&gt;Phase 1: Baseline&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;copilot&lt;/code&gt; locally with default settings&lt;/li&gt;
  &lt;li&gt;Test in interactive mode with manual approvals&lt;/li&gt;
  &lt;li&gt;Use only built-in tools and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/review&lt;/code&gt; command&lt;/li&gt;
  &lt;li&gt;Monitor token usage with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usage&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;phase-2-lightweight-governance&quot;&gt;Phase 2: Lightweight Governance&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Add custom instructions (coding standards, test requirements)&lt;/li&gt;
  &lt;li&gt;Run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/init&lt;/code&gt; to bootstrap repo-specific instructions&lt;/li&gt;
  &lt;li&gt;Create one skill for a high-value workflow (e.g., release notes)&lt;/li&gt;
  &lt;li&gt;Enable Copilot Memory for persistent codebase learning&lt;/li&gt;
  &lt;li&gt;Still use manual approvals&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;phase-3-specialist-delegation&quot;&gt;Phase 3: Specialist Delegation&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Create a custom agent with constrained tools (e.g., read-only security auditor)&lt;/li&gt;
  &lt;li&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;infer: true&lt;/code&gt; to enable auto-delegation for security reviews&lt;/li&gt;
  &lt;li&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/delegate&lt;/code&gt; to offload longer tasks to Copilot coding agent&lt;/li&gt;
  &lt;li&gt;Monitor which work gets delegated&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;phase-4-programmatic-automation&quot;&gt;Phase 4: Programmatic Automation&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Use programmatic mode in CI scripts&lt;/li&gt;
  &lt;li&gt;Test autopilot mode (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--autopilot&lt;/code&gt;) in isolated environments&lt;/li&gt;
  &lt;li&gt;Add hooks for policy enforcement (e.g., audit logging)&lt;/li&gt;
  &lt;li&gt;Start with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allow-tool&lt;/code&gt; for specific, safe tools&lt;/li&gt;
  &lt;li&gt;Never use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--allow-all-tools&lt;/code&gt; unless you have strict environment isolation&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;phase-5-distribution&quot;&gt;Phase 5: Distribution&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Package all customizations as a plugin&lt;/li&gt;
  &lt;li&gt;Distribute to team via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/plugin install&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Version and update centrally&lt;/li&gt;
  &lt;li&gt;Gather feedback, iterate&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;model-selection&quot;&gt;Model Selection&lt;/h2&gt;

&lt;p&gt;The default model is Claude Sonnet 4.6. Available models at GA include:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Claude Opus 4.6&lt;/strong&gt;, &lt;strong&gt;Claude Sonnet 4.6&lt;/strong&gt; (Anthropic)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;GPT-5.3-Codex&lt;/strong&gt; (OpenAI)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Gemini 3 Pro&lt;/strong&gt; (Google)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Claude Haiku 4.5&lt;/strong&gt; (fast tasks)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;GPT-5 mini&lt;/strong&gt; and &lt;strong&gt;GPT-4.1&lt;/strong&gt; are included at no additional premium request cost.&lt;/p&gt;

&lt;p&gt;Switch mid-session with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/model&lt;/code&gt; or at launch with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--model&lt;/code&gt;. Each prompt submission counts as one &lt;a href=&quot;https://docs.github.com/en/copilot/concepts/billing/copilot-requests&quot;&gt;premium request&lt;/a&gt;, multiplied by the model’s multiplier (shown in the model list).&lt;/p&gt;

&lt;h2 id=&quot;enterprise-features&quot;&gt;Enterprise Features&lt;/h2&gt;

&lt;p&gt;For org-scale deployment:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Organization policies&lt;/strong&gt;: Administrators control model availability and Copilot CLI enablement via Copilot policy settings.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Proxy support&lt;/strong&gt;: HTTPS proxy for environments behind corporate firewalls.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Authentication&lt;/strong&gt;: OAuth device flow, GitHub CLI token reuse, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GITHUB_ASKPASS&lt;/code&gt; for CI/CD.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-hooks&quot;&gt;Hook-based policy enforcement&lt;/a&gt;&lt;/strong&gt;: Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;preToolUse&lt;/code&gt; hooks to enforce file access policies, argument sanitization, and custom approval workflows.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/configure-copilot-cli&quot;&gt;Configuration&lt;/a&gt;&lt;/strong&gt;: Adjust settings in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.copilot/config.json&lt;/code&gt; (customizable via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;XDG_CONFIG_HOME&lt;/code&gt;). Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;copilot help config&lt;/code&gt; for details.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Copilot Business and Enterprise subscribers, an administrator must enable Copilot CLI from the Policies page.&lt;/p&gt;

&lt;h2 id=&quot;key-slash-commands-reference&quot;&gt;Key Slash Commands Reference&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Command&lt;/th&gt;
      &lt;th&gt;Purpose&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/login&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Authenticate with GitHub&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/model&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Switch models (Claude Sonnet 4.6, GPT-5.3-Codex, etc.)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/agent&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Browse and select available custom agents&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/init&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Auto-generate custom instructions for the current project&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/context&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Show token usage breakdown&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/compact&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Manually compress session context&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usage&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Session stats: requests used, duration, lines edited, tokens per model&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/diff&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Review session changes with inline diffs and comments&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/review&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Analyze staged/unstaged changes before committing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/delegate&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Push work to Copilot coding agent in the cloud&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/resume&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Browse and resume previous sessions (local and remote)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/skills list&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;List available skills&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/SkillName args&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Invoke a skill&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/mcp&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;List/manage MCP servers&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/mcp add&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Interactive wizard to add an MCP server&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/plugin install PKG&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Install a plugin&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/plugin list&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;List plugins&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/plugin update PKG&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Update a plugin&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/add-dir PATH&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Add a trusted directory mid-session&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/cd PATH&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Change working directory without restarting&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/theme&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Choose from built-in themes (GitHub Dark, Light, colorblind variants)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/experimental&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Toggle experimental features (e.g., alt-screen mode)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/allow-all&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Allow all tools for the session&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/yolo&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Alias for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/allow-all&lt;/code&gt; (shorthand, same risk)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/feedback&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Send feedback survey to GitHub&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;?&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Show all available commands and keyboard shortcuts&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;key-keyboard-shortcuts&quot;&gt;Key Keyboard Shortcuts&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Shortcut&lt;/th&gt;
      &lt;th&gt;Action&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Shift+Tab&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Cycle modes: Ask → Plan → Autopilot&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Esc&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Stop current operation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Esc&lt;/code&gt;-&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Esc&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Rewind/undo to a previous snapshot&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl+T&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Toggle reasoning visibility (persists across sessions)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl+X&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl+E&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Open &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$EDITOR&lt;/code&gt; for longer prompts&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl+Z&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Suspend/resume Copilot CLI&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl+A/E/W/U/K&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Standard UNIX line editing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Alt+arrows&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Word-level cursor movement&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;?&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Quick help overlay&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;final-thought&quot;&gt;Final Thought&lt;/h2&gt;

&lt;p&gt;Copilot CLI is operationally useful when you treat it as a runtime, not a toy. The composition model (instructions, skills, agents, hooks, MCP, plugins) is deep. You can build real governance, audit trails, and team standardization on top of it.&lt;/p&gt;

&lt;p&gt;The real leverage is not in asking it to write code. It’s in delegating work while staying in control.&lt;/p&gt;

&lt;h2 id=&quot;sources&quot;&gt;Sources&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.blog/changelog/2026-02-25-github-copilot-cli-is-now-generally-available/&quot;&gt;GA announcement (Feb 25, 2026)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/features/copilot/cli&quot;&gt;GitHub Copilot CLI feature page&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/github/copilot-cli&quot;&gt;GitHub Copilot CLI repository&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-copilot-cli&quot;&gt;Official docs: About Copilot CLI&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli&quot;&gt;Official docs: Using Copilot CLI&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started&quot;&gt;Official docs: Getting started&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/configure-copilot-cli&quot;&gt;Official docs: Configure Copilot CLI&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions&quot;&gt;Official docs: Custom instructions&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli&quot;&gt;Official docs: Custom agents&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-skills&quot;&gt;Official docs: Skills&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-hooks&quot;&gt;Official docs: Hooks&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers&quot;&gt;Official docs: MCP servers&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/plugins-finding-installing&quot;&gt;Official docs: Plugins&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-cli/autopilot&quot;&gt;Official docs: Autopilot mode&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-cli/comparing-cli-features&quot;&gt;Official docs: Comparing CLI customization features&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-cli-plugins&quot;&gt;Official docs: About CLI plugins&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/concepts/agents/copilot-memory&quot;&gt;Official docs: About Copilot Memory&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-best-practices&quot;&gt;Official docs: Best practices&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/reference/cli-command-reference&quot;&gt;Official docs: CLI command reference&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/reference/custom-agents-configuration&quot;&gt;Official docs: Custom agents configuration&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/reference/hooks-configuration&quot;&gt;Official docs: Hooks configuration&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://docs.github.com/en/copilot/reference/acp-server&quot;&gt;Copilot CLI ACP server reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;closing&quot;&gt;Closing&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Have questions about Copilot CLI or agent runtimes? Find me on &lt;a href=&quot;https://github.com/jmassardo&quot;&gt;GitHub&lt;/a&gt;, &lt;a href=&quot;https://www.linkedin.com/in/jenna-massardo/&quot;&gt;LinkedIn&lt;/a&gt;, or &lt;a href=&quot;https://bsky.app/profile/jmassardo.bsky.social&quot;&gt;Bluesky&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="copilot" />
   
    <category term="cli" />
   
    <category term="ai" />
   
    <category term="agents" />
   
    <category term="automation" />
   
    <category term="governance" />
   
 </entry>
 
 <entry>
   <title>Locking Down MCP: Setting Up a Registry and Enforcing Server Access</title>
   <link href="https://www.dxrf.com/blog/2026/02/26/mcp-registry-setup-and-enforcement/"/>
   <updated>2026-02-26T15:00:00+00:00</updated>
   <id>https://www.dxrf.com/blog/2026/02/26/mcp-registry-setup-and-enforcement</id>
   <excerpt type="html">A practical guide to setting up an MCP registry, enforcing server access policies across IDEs, and understanding the current limitations you need to plan around.</excerpt>
   <content type="html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;Model Context Protocol (MCP) servers are one of the most powerful ways to extend AI-assisted development. They let your coding assistants reach out to databases, APIs, file systems, and all sorts of external tooling. That power is incredible for productivity, but if you’re responsible for security or governance in your organization, it probably also made your eye twitch a little.&lt;/p&gt;

&lt;p&gt;The good news: you can set up a curated MCP registry and enforce policies that restrict which servers your developers can actually use. The less good news: enforcement is still maturing, and there are caveats you need to understand before you rely on it as a hard security boundary.&lt;/p&gt;

&lt;p&gt;This post walks through the end-to-end process of setting up an MCP registry, configuring allowlist policies at the organization and enterprise level, enforcing those policies across different IDEs, and understanding the gaps that still exist.&lt;/p&gt;

&lt;h2 id=&quot;what-is-an-mcp-registry&quot;&gt;What Is an MCP Registry?&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://modelcontextprotocol.io/registry&quot;&gt;MCP Registry&lt;/a&gt; is a centralized metadata repository for publicly accessible MCP servers. Think of it as a catalog that tells IDEs where to find servers, how to install them, and what they do. The official public registry is backed by major contributors like Anthropic, GitHub, PulseMCP, and Microsoft.&lt;/p&gt;

&lt;p&gt;Key things to understand about the registry ecosystem:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;The registry hosts metadata, not code.&lt;/strong&gt; The actual server packages live on npm, PyPI, Docker Hub, etc. The registry just points to them.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;The official public registry uses namespace authentication&lt;/strong&gt; to verify that servers come from their claimed sources. Server names follow a reverse DNS format (e.g., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;io.github.username/server-name&lt;/code&gt;) tied to verified GitHub accounts or domains. This prevents impersonation on the public registry, but does not apply when you host your own.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;The public registry is not designed for private servers.&lt;/strong&gt; If your MCP servers are internal-only, you need to host your own registry.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For enterprise and organizational use, the real value is in creating your own private registry that contains only the servers you have vetted and approved. This becomes the foundation for enforcement.&lt;/p&gt;

&lt;h2 id=&quot;step-1-create-your-mcp-registry&quot;&gt;Step 1: Create Your MCP Registry&lt;/h2&gt;

&lt;p&gt;You have two main options for hosting a registry.&lt;/p&gt;

&lt;h3 id=&quot;option-a-self-host-a-registry&quot;&gt;Option A: Self-Host a Registry&lt;/h3&gt;

&lt;p&gt;At its core, an MCP registry is a set of HTTPS endpoints that serve metadata about included MCP servers. You can stand one up by:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Forking the official open-source registry&lt;/strong&gt; from the &lt;a href=&quot;https://github.com/modelcontextprotocol/registry&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;modelcontextprotocol/registry&lt;/code&gt;&lt;/a&gt; repository and hosting it yourself.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Running the registry locally with Docker&lt;/strong&gt; for testing.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Building a custom implementation&lt;/strong&gt; that conforms to the v0.1 specification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your self-hosted registry must support these endpoints:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Endpoint&lt;/th&gt;
      &lt;th&gt;Purpose&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GET /v0.1/servers&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Returns a list of all included MCP servers&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GET /v0.1/servers/{serverName}/versions/latest&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Returns the latest version of a specific server&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GET /v0.1/servers/{serverName}/versions/{version}&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Returns the details for a specific version of a server&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;You also need CORS headers on all &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/v0.1/servers&lt;/code&gt; endpoints so Copilot can make cross-origin requests from the IDE:&lt;/p&gt;

&lt;div class=&quot;language-http 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;err&quot;&gt;Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Headers: Authorization, Content-Type
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Use the v0.1 specification. The original v0 is now considered unstable and should not be implemented.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;option-b-use-azure-api-center&quot;&gt;Option B: Use Azure API Center&lt;/h3&gt;

&lt;p&gt;If you are already in the Azure ecosystem, &lt;a href=&quot;https://learn.microsoft.com/azure/api-center/register-discover-mcp-server&quot;&gt;Azure API Center&lt;/a&gt; provides a fully managed MCP registry with automatic CORS configuration and built-in governance features. It offers a free tier for basic cataloging and discovery.&lt;/p&gt;

&lt;p&gt;To use it:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Complete the initial setup in Azure following the &lt;a href=&quot;https://learn.microsoft.com/azure/api-center/register-discover-mcp-server&quot;&gt;Azure API Center MCP docs&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Include any local MCP servers in your registry with their correct server IDs.&lt;/li&gt;
  &lt;li&gt;Enable anonymous access in the visibility settings so Copilot can fetch the registry.&lt;/li&gt;
  &lt;li&gt;Copy your API Center endpoint URL for policy configuration.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; When configuring the registry URL later, use only the base URL for your API Center. Including route suffixes like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/v0.1/servers&lt;/code&gt; will cause errors.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;step-2-configure-access-policies&quot;&gt;Step 2: Configure Access Policies&lt;/h2&gt;

&lt;p&gt;Once your registry is up, you need to set GitHub Enterprise policies that point developers to it and (optionally) restrict them to only the servers it contains.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you are using other AI tools, you’ll have to review the docs for them to see if they have enforcement options. Also note that some IDEs currently only support manual configuration of the registry. See the IDE section below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;enterprise-level-configuration&quot;&gt;Enterprise-Level Configuration&lt;/h3&gt;

&lt;p&gt;Enterprise-level policies override organization-level settings and apply uniformly across all orgs in the enterprise.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Navigate to your profile picture &amp;gt; &lt;strong&gt;Enterprise&lt;/strong&gt; &amp;gt; &lt;strong&gt;AI controls&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;In the sidebar, click &lt;strong&gt;MCP&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Set &lt;strong&gt;MCP servers in Copilot&lt;/strong&gt; to &lt;strong&gt;Enabled everywhere&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Enter your registry URL in the &lt;strong&gt;MCP Registry URL&lt;/strong&gt; field and click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Under &lt;strong&gt;Restrict MCP access to registry servers&lt;/strong&gt;, choose:
    &lt;ul&gt;
      &lt;li&gt;&lt;strong&gt;Allow all&lt;/strong&gt; - No restrictions. All MCP servers can be used.&lt;/li&gt;
      &lt;li&gt;&lt;strong&gt;Registry only&lt;/strong&gt; - Only servers from your registry may run.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;organization-level-configuration&quot;&gt;Organization-Level Configuration&lt;/h3&gt;

&lt;p&gt;If your enterprise does not set a blanket policy, or if you are managing a standalone organization:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Navigate to &lt;strong&gt;Organization Settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Copilot&lt;/strong&gt; &amp;gt; &lt;strong&gt;Policies&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Set &lt;strong&gt;MCP servers in Copilot&lt;/strong&gt; to &lt;strong&gt;Enabled&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Enter your registry URL in the &lt;strong&gt;MCP Registry URL (optional)&lt;/strong&gt; field and click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Under &lt;strong&gt;Restrict MCP access to registry servers&lt;/strong&gt;, choose &lt;strong&gt;Allow all&lt;/strong&gt; or &lt;strong&gt;Registry only&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The policy takes effect immediately for developers in the scope.&lt;/p&gt;

&lt;h3 id=&quot;policy-resolution-for-multiple-seats&quot;&gt;Policy Resolution for Multiple Seats&lt;/h3&gt;

&lt;p&gt;If a developer has Copilot seats from multiple organizations or enterprises, GitHub resolves conflicts automatically:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Scope wins&lt;/strong&gt; - Enterprise policies override organization policies.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Strictness wins&lt;/strong&gt; - “Registry only” &lt;a href=&quot;https://docs.github.com/en/enterprise-cloud@latest/copilot/reference/mcp-allowlist-enforcement#policy-resolution-for-users-with-multiple-seats&quot;&gt;takes precedence&lt;/a&gt; over “Allow all.”&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Recency breaks ties&lt;/strong&gt; - If scope and strictness match, the most recently uploaded registry is applied.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;step-3-ide-specific-enforcement&quot;&gt;Step 3: IDE-Specific Enforcement&lt;/h2&gt;

&lt;p&gt;MCP registry and policy support varies by IDE. Here is the current state of support and the minimum versions required.&lt;/p&gt;

&lt;h3 id=&quot;minimum-version-requirements&quot;&gt;Minimum Version Requirements&lt;/h3&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;IDE&lt;/th&gt;
      &lt;th&gt;Minimum Version&lt;/th&gt;
      &lt;th&gt;Registry Support&lt;/th&gt;
      &lt;th&gt;Notes&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;VS Code&lt;/td&gt;
      &lt;td&gt;1.99+&lt;/td&gt;
      &lt;td&gt;Full (gallery + manual config)&lt;/td&gt;
      &lt;td&gt;Supports &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatMCP&lt;/code&gt; enterprise policy for source restrictions&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Visual Studio&lt;/td&gt;
      &lt;td&gt;17.14+&lt;/td&gt;
      &lt;td&gt;Manual config + OAuth servers&lt;/td&gt;
      &lt;td&gt;Registry configuration via MCP settings&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;JetBrains IDEs&lt;/td&gt;
      &lt;td&gt;Latest with Copilot plugin&lt;/td&gt;
      &lt;td&gt;Registry + manual config&lt;/td&gt;
      &lt;td&gt;IntelliJ, PyCharm, WebStorm, GoLand, Rider, and more&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Eclipse&lt;/td&gt;
      &lt;td&gt;2024-09+&lt;/td&gt;
      &lt;td&gt;Registry + manual config&lt;/td&gt;
      &lt;td&gt;Registry browsing via Copilot Chat MCP icon&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Xcode&lt;/td&gt;
      &lt;td&gt;Copilot for Xcode extension&lt;/td&gt;
      &lt;td&gt;Registry + manual config&lt;/td&gt;
      &lt;td&gt;Registry URL configurable in settings &amp;gt; Tools tab&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&quot;vs-code-enterprise-policy-enforcement&quot;&gt;VS Code: Enterprise Policy Enforcement&lt;/h3&gt;

&lt;p&gt;VS Code has the most mature enforcement story. IT administrators can deploy the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatMCP&lt;/code&gt; enterprise policy via device management (MDM, GPO, etc.) to control which sources MCP servers can be installed from:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Policy Value&lt;/th&gt;
      &lt;th&gt;Behavior&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;allowed&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Developers can run MCP servers from any source&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;registryOnly&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Developers can only run MCP servers from the configured registry&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;off&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;MCP server support is disabled entirely&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;You can also override the default gallery URL using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;McpGalleryServiceUrl&lt;/code&gt; policy to point at your private registry. When configured, developers see your curated server list when they search &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;@mcp&lt;/code&gt; in the Extensions view.&lt;/p&gt;

&lt;p&gt;Additional VS Code policies worth configuring alongside MCP:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatToolsAutoApprove&lt;/code&gt;&lt;/strong&gt; (set to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;false&lt;/code&gt;): Prevents “YOLO mode” where all tools run without approval prompts. Highly recommended.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatToolsEligibleForAutoApproval&lt;/code&gt;&lt;/strong&gt;: Granularly control which tools can or cannot be auto-approved.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatAgentExtensionTools&lt;/code&gt;&lt;/strong&gt; (set to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;false&lt;/code&gt;): Blocks extension-contributed tools while still allowing built-in and MCP tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;jetbrains-ides&quot;&gt;JetBrains IDEs&lt;/h3&gt;

&lt;p&gt;In JetBrains IDEs, developers access the MCP Registry via the MCP icon in the Copilot Chat window. From there they can browse and install servers from whichever registry is configured. Manual configuration goes into an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mcp.json&lt;/code&gt; file accessible from the chat tools settings.&lt;/p&gt;

&lt;p&gt;The GitHub org/enterprise-level “MCP servers in Copilot” policy gates whether MCP is available at all in JetBrains, but the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatMCP&lt;/code&gt; device-level policy is VS Code-specific.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Config file location:&lt;/strong&gt; The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mcp.json&lt;/code&gt; lives under the IDE’s configuration directory, which varies by OS and product:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;OS&lt;/th&gt;
      &lt;th&gt;Default Path&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;macOS&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/Library/Application Support/JetBrains/&amp;lt;product&amp;gt;&amp;lt;version&amp;gt;/&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Windows&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%APPDATA%\JetBrains\&amp;lt;product&amp;gt;&amp;lt;version&amp;gt;\&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Linux&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.config/JetBrains/&amp;lt;product&amp;gt;&amp;lt;version&amp;gt;/&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;product&amp;gt;&amp;lt;version&amp;gt;&lt;/code&gt; with the specific IDE and version (e.g., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IntelliJIdea2025.3&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PyCharm2025.3&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Desktop management:&lt;/strong&gt; JetBrains offers &lt;a href=&quot;https://www.jetbrains.com/toolbox-enterprise/&quot;&gt;IDE Provisioner&lt;/a&gt; (part of JetBrains IDE Services, paid product) which can propagate global IDE settings, restrict plugins, and push configurations to developer machines via the Toolbox App. There is no MDM/GPO-style policy framework equivalent to VS Code’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatMCP&lt;/code&gt;, but you could pre-deploy the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mcp.json&lt;/code&gt; file to the correct path using your desktop management tool. Just be aware that this path changes with each major IDE version, so your deployment automation would need to account for that.&lt;/p&gt;

&lt;h3 id=&quot;eclipse&quot;&gt;Eclipse&lt;/h3&gt;

&lt;p&gt;Eclipse supports MCP registry browsing via the Copilot Chat MCP icon. Manual configuration is available through &lt;strong&gt;Edit Preferences&lt;/strong&gt; &amp;gt; &lt;strong&gt;GitHub Copilot&lt;/strong&gt; &amp;gt; &lt;strong&gt;MCP&lt;/strong&gt;. Like JetBrains, it respects the GitHub-level MCP policy but does not have VS Code-style device policies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Config file location:&lt;/strong&gt; Eclipse stores its preferences (including MCP server configurations) as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.prefs&lt;/code&gt; files under the workspace metadata directory:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;workspace&amp;gt;/.metadata/.plugins/org.eclipse.core.runtime/.settings/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Desktop management:&lt;/strong&gt; Eclipse does not have a formal enterprise policy framework for MCP or AI settings. You could pre-seed the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.prefs&lt;/code&gt; files via desktop management tooling, but this path is workspace-specific and not centralized per user. It is less practical than the VS Code or JetBrains approaches.&lt;/p&gt;

&lt;h3 id=&quot;visual-studio&quot;&gt;Visual Studio&lt;/h3&gt;

&lt;p&gt;Visual Studio 17.14+ supports MCP servers configured via the chat panel’s tools icon. It supports both remote (HTTP/SSE with OAuth) and local (stdio) servers. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mcp.json&lt;/code&gt; configuration is accessible through the Visual Studio UI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Config file location:&lt;/strong&gt; Visual Studio stores MCP configuration in an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mcp.json&lt;/code&gt; file. When configured at the project level, this lives in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.vs/&lt;/code&gt; directory of the solution. User-level configuration is stored under the Visual Studio configuration directory (typically &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%LOCALAPPDATA%\Microsoft\VisualStudio\&amp;lt;version&amp;gt;\&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Desktop management:&lt;/strong&gt; Visual Studio supports Group Policy and the Visual Studio Administrative Templates for enterprise configuration. However, MCP-specific policies (like VS Code’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatMCP&lt;/code&gt;) are not available in Visual Studio at this time. You can pre-deploy an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mcp.json&lt;/code&gt; file to the appropriate path via your desktop management tool.&lt;/p&gt;

&lt;h3 id=&quot;xcode&quot;&gt;Xcode&lt;/h3&gt;

&lt;p&gt;Xcode requires the GitHub Copilot for Xcode extension. MCP registry browsing is accessed via &lt;strong&gt;Settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Tools&lt;/strong&gt; tab &amp;gt; &lt;strong&gt;Browse MCP Servers&lt;/strong&gt; next to the MCP Registry URL field. Manual configuration is in the &lt;strong&gt;MCP&lt;/strong&gt; tab under &lt;strong&gt;Edit Config&lt;/strong&gt;.&lt;/p&gt;

&lt;h2 id=&quot;the-caveats-read-this-section-carefully&quot;&gt;The Caveats (Read This Section Carefully)&lt;/h2&gt;

&lt;p&gt;Here is where we get real. Before you go all-in on MCP governance, you need to understand that some of the gaps you will encounter are not bugs in any particular tool. MCP is an emerging protocol. It was designed to make connecting AI models to external tools as simple and flexible as possible, and it accomplished that goal. What it did not ship with is built-in governance, access control, or enforcement. Those are being layered on by the ecosystem now, and they are still maturing.&lt;/p&gt;

&lt;p&gt;The limitations below are a mix of “the protocol does not define this yet” and “the current tooling has not closed this gap.” Knowing which is which will help you set realistic expectations.&lt;/p&gt;

&lt;h3 id=&quot;limitations-inherent-to-mcp&quot;&gt;Limitations Inherent to MCP&lt;/h3&gt;

&lt;p&gt;These apply regardless of which AI coding tool you are using. If it speaks MCP, these limitations come along for the ride.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;MCP has no built-in governance layer.&lt;/strong&gt; The protocol itself defines how models talk to tools. Period. It does not define registries, allowlists, access control, or enforcement. Everything in this post about registries and policies? That is ecosystem tooling built on top of MCP by GitHub, Microsoft, and others. It is not baked into the protocol.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Local config files are user-editable.&lt;/strong&gt; Every MCP host application (Copilot, Claude Desktop, Cursor, Windsurf, Codex, etc.) uses local JSON config files to define which servers to connect to. If a developer has access to their machine, they can edit those files. This is not a bug. It is just how computers work. No IDE policy can fully prevent a local user from modifying files they own.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Enforcement is name-based, not cryptographic.&lt;/strong&gt; The allowlist mechanisms that do exist match on server name or ID. There is no cryptographic signing or attestation in the MCP spec that ties a server name to a specific verified binary or endpoint. A determined user could point a recognized server name at different code.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Strict prevention of non-registry servers does not exist yet.&lt;/strong&gt; There is no mechanism in any MCP host today that makes it truly impossible to add an unapproved server. The “Registry only” style policies tell the IDE to restrict what it offers, but they cannot make the underlying config file read-only.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;limitations-specific-to-github-copilot-policies&quot;&gt;Limitations Specific to GitHub Copilot Policies&lt;/h3&gt;

&lt;p&gt;These are boundaries of the current Copilot policy system, not MCP itself.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;The org/enterprise MCP policy only governs Copilot Business and Enterprise seats.&lt;/strong&gt; Users on Copilot Free, Copilot Pro, or Copilot Pro+ are not subject to organizational MCP policies. If your team includes mixed subscription types, some users will not be covered.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;The policy does not reach third-party host applications.&lt;/strong&gt; The “MCP servers in Copilot” policy controls Copilot’s behavior. It has no effect on other MCP-capable tools like Cursor, Windsurf, Claude Desktop, or OpenAI Codex. If your developers use those tools alongside Copilot, you need separate governance for each.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;limitations-specific-to-vs-code&quot;&gt;Limitations Specific to VS Code&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Device policies are VS Code-only.&lt;/strong&gt; The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatMCP&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;McpGalleryServiceUrl&lt;/code&gt; enterprise policies are deployed through VS Code’s policy framework (MDM/GPO). They do not apply to JetBrains, Visual Studio, Eclipse, or Xcode. Those IDEs rely on the GitHub org-level policy, which is less granular.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chat.mcp.discovery.enabled&lt;/code&gt; can discover external configs.&lt;/strong&gt; If a developer has MCP servers configured in Claude Desktop, enabling this VS Code setting will auto-discover and import those server configurations, potentially bypassing your registry restrictions.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;what-you-can-do-today&quot;&gt;What You Can Do Today&lt;/h3&gt;

&lt;p&gt;The governance story is clearly “version 1.0” territory, but that does not mean you are helpless. Most of these mitigations are solid for practical purposes. Remember, you are not trying to stop nation-state actors from bypassing your MCP registry. You are trying to keep well-intentioned developers from accidentally connecting to unvetted tools.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Use “Registry only” as a strong signal&lt;/strong&gt;, not a hard security boundary. It will prevent casual or accidental use of unapproved servers by the vast majority of developers, and that is the actual risk for most organizations.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Disable MCP entirely&lt;/strong&gt; if your security posture requires strict enforcement until better controls are available. This is the safest option for high-compliance environments.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Disable global auto-approval&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatToolsAutoApprove = false&lt;/code&gt;) so even approved tools require explicit confirmation before executing.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Combine with device management.&lt;/strong&gt; Use MDM/GPO to deploy VS Code enterprise policies. This is more resistant to casual circumvention than GitHub-level policies alone.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Account for your full tool landscape.&lt;/strong&gt; If your developers use Cursor, Windsurf, Claude, Codex, or any other MCP-capable tool, each one needs its own governance approach. A Copilot-only policy leaves gaps.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Monitor and audit.&lt;/strong&gt; Keep an eye on what MCP servers are being used. Even without strict enforcement, visibility is valuable.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Educate your developers.&lt;/strong&gt; Make it clear which servers are approved, why the policy exists, and what the risks are. Most people are not trying to bypass security controls; they just need to know what the rules are.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;tldr&quot;&gt;TL;DR&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Step&lt;/th&gt;
      &lt;th&gt;Action&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Create a registry&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Self-host from the open-source repo, or use Azure API Center&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Configure policies&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Set your registry URL and “Registry only” at the enterprise or org level in GitHub&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Enforce in VS Code&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Deploy &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ChatMCP&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;McpGalleryServiceUrl&lt;/code&gt; enterprise policies via MDM&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Enforce in other IDEs&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Enable the “MCP servers in Copilot” org/enterprise policy; IDE-specific device policies are limited to VS Code&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Understand the gaps&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Enforcement is name-based, local configs are editable, and some subscription types and third-party tools are not covered&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;Mitigate&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;Disable auto-approval, combine GitHub policies with device management, monitor usage, and consider disabling MCP if strict enforcement is required&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;MCP governance is clearly an area under active development. The bones are there, and for most organizations the current tooling is sufficient to establish meaningful guardrails. Just don’t mistake “Registry only” for “impossible to bypass” yet. Keep an eye on the &lt;a href=&quot;https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-mcp-usage/configure-mcp-server-access&quot;&gt;GitHub docs&lt;/a&gt; and the &lt;a href=&quot;https://docs.github.com/en/copilot/reference/mcp-allowlist-enforcement&quot;&gt;MCP allowlist enforcement reference&lt;/a&gt; for updates as strict enforcement matures.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;Questions about MCP governance or registry setup? Find me on &lt;a href=&quot;https://www.linkedin.com/in/jenna-massardo/&quot;&gt;LinkedIn&lt;/a&gt;, &lt;a href=&quot;https://bsky.app/profile/jmassardo.bsky.social&quot;&gt;Bluesky&lt;/a&gt;, or &lt;a href=&quot;https://github.com/jmassardo&quot;&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
   
    <category term="github" />
   
    <category term="copilot" />
   
    <category term="mcp" />
   
    <category term="security" />
   
    <category term="devops" />
   
    <category term="ai" />
   
    <category term="enterprise" />
   
 </entry>
 

</feed>
