ckaserer.dev Blog
website·Indexed 31 days ago
https://ckaserer.dev/Technical blog by an engineering leader and Azure architect focusing on AI-first delivery, cloud architecture, and DevOps practices. Topics include Git worktrees for coding agents, squash-merging in trunk-based development, and Copilot enablement workshops.
What's inside ckaserer.dev
- When creating Copilot training materials, experts often overlook basic steps or terms (the 'curse of knowledge'). To fix this, use 'singing-and-clapping validation': run the material by someone with zero prior exposure to the topic. If the core idea cannot be conveyed without relying on unstated terms or prior steps, the material requires further simplification.
Best practices for facilitating GitHub Copilot enablement workshops
To ensure a successful hands-on GitHub Copilot workshop, focus on pre-session validation of technical prerequisites and audience segmentation. Many critical failures (network blocks, missing licenses, or skill gaps) do not manifest as 'raised hands' during the session, meaning they must be addressed before the workshop begins.Prevent agent race conditions using Git worktrees
When running multiple coding agents (e.g., background subagents, interactive sessions, or automation) against a single repository, using a shared checkout creates a race condition on the
.gitindex. Because a checkout has only one index and oneHEAD, one agent's uncommitted edits or checkouts can silently overwrite another's without warnings or merge conflicts.To ensure isolation, every task should be assigned its own
git worktree. Git enforces this isolation by refusing to check out a branch that is already checked out in another worktree.Implement Any Decision Records (ADR) to prevent AI agent regressions
Any Decision Records (ADRs) are used to document non-trivial, hard-to-reverse decisions (e.g., deployment mechanisms, framework choices, storage layouts, or versioning policies). By storing these in a dedicated directory (typicallydocs/adr/), developers provide a guardrail for AI coding agents. Without this rationale, agents may perceive intentional trade-offs as 'bugs' or 'messy code' and attempt to 'fix' or 'simplify' them away. A structured ADR ensures the agent understands why a specific path was chosen and why alternatives were rejected.Determine when to create a Decision Record
Not every choice requires a record. Use the following criteria to decide if a decision earns an ADR file:
- Create a record if: The decision is non-trivial, hard to reverse, or if the question 'why not the obvious alternative?' is likely to be asked again.
- Skip the record if: The choice is a reversible, low-stakes preference (these belong in a style guide or rule file).
- The Litmus Test: If this record were deleted, would a future human or AI agent plausibly make a different, worse choice? If yes, write the record.
Prepare GitHub Copilot workshop logistics and prerequisites
Avoid common failure points by implementing the following checks before the workshop starts:
- License Verification: Do not assume participants have licenses based on the invite. Send a confirmation email a few days prior to verify provisioning.
- Network Validation: Test the actual network path. Corporate proxies may block Copilot traffic even if general Wi-Fi is available.
- Facilitator Ratio: For hands-on sessions, maintain a ratio of approximately 4–5 participants per facilitator to ensure individuals don't get stuck.
- Audience Segmentation: Use a one-line self-assessed skill question during sign-up. If the skill range is wide, split the group into different tracks to prevent beginners from disengaging while advanced users dominate the conversation.
Implement squash-merge enforcement for trunk-based development
When using trunk-based development (singlemainbranch, short-lived PR branches), enforce a 'squash-merge only' policy in repository settings. This ensures that messy iterations, failed attempts, and AI-generated noise within a branch are collapsed into a single coherent commit onmain. This is critical for maintaining a linear history, which is required for reliablegit bisectoperations and prevents delivery instability caused by large, fragmented AI-authored diffs.# Check if your main branch has non-linear history (commits with more than one parent) git log --pretty="%P" # Every line should have exactly one parent hash for a perfectly linear historyConfigure Claude Code worktree paths
For Claude Code, worktrees should be located at.claude/worktrees/<branch-slug>and added to.gitignore. This specific path aligns with Claude Code's nativeEnterWorktreeandExitWorktreetooling, allowing the agent to create and remove worktrees without requiring extra confirmation prompts.# Example path for a task-specific worktree .claude/worktrees/feature-branch-namePrevent OneDrive and SharePoint from syncing .git folders
Git repositories generate high file churn within the.gitfolder, which can overwhelm the OneDrive sync engine and cause instability or sync conflicts. To resolve this, you can implement a machine-level OneDrive policy that instructs the sync engine to ignore folders named.git. This allows the working files to be synced to SharePoint/OneDrive while ensuring the Git remote remains the sole authoritative source of history.# Requires an elevated (Administrator) PowerShell session New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive\EnableODIgnoreFolderListFromGPO' -Force New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive\EnableODIgnoreFolderListFromGPO' ` -Name '1' -PropertyType String -Value '.git' -ForceCaveats for OneDrive .git exclusion policy
When using the
EnableODIgnoreFolderListFromGPOregistry key to ignore.gitfolders, keep the following constraints in mind:- Scope: The policy is machine-local. On centrally managed workstations, this may need to be deployed via Group Policy or Intune.
- Existing Data: This policy will not remove
.gitmetadata that has already been uploaded to the cloud. - Backup: This does not make SharePoint a Git remote. Unpushed branches are not backed up; only a pushed remote ensures history is safe.
Trade-offs of using one worktree per agent task
While providing necessary isolation, the one-worktree-per-task approach has the following costs:
- Dependency Overhead: Dependencies are not shared between worktrees; each requires its own installation.
- Disk Usage: Disk space increases as each worktree duplicates the working tree.
- Visibility: Reading an in-progress branch from another agent requires creating a separate worktree for that branch.
Trade-offs of using squash-merge for PRs
Using squash-merge as the exclusive merge strategy involves specific trade-offs:
- Loss of Granularity: Individual commits within a PR are not available for
git blameon themainbranch; only the final squashed diff and the PR description remain. - PR Atomicity: If a PR contains several independent changes that might need to be reverted separately, they must be split into separate PRs rather than relying on individual commits within a single PR.
- Restriction: Disabling merge-commits and rebase-merges in repository settings removes those options for all contributors.
- Loss of Granularity: Individual commits within a PR are not available for