

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345# Code Review Branch Strategy Guide67This guide helps GitHub Copilot provide appropriate feedback when reviewing code changes, particularly distinguishing between issues that should be fixed in the current branch versus the default branch.89## Purpose1011When reviewing pull requests, especially those targeting release branches, it's important to identify whether an issue should be fixed in:12- **The current PR/branch** - Release-specific fixes or backports13- **The default branch first** - General bugs that exist in the main codebase1415## Branch Types and Fix Strategy1617### Release Branches (e.g., `release/v7.5`, `release/v7.4`)1819**Purpose:** Contain release-specific changes and critical backports2021**Should contain:**22- Release-specific configuration changes23- Critical bug fixes that are backported from the default branch24- Release packaging/versioning adjustments2526**Should NOT contain:**27- New general bug fixes that haven't been fixed in the default branch28- Refactoring or improvements that apply to the main codebase29- Workarounds for issues that exist in the default branch3031### Default/Main Branch (e.g., `master`, `main`)3233**Purpose:** Primary development branch for all ongoing work3435**Should contain:**36- All general bug fixes37- New features and improvements38- Refactoring and code quality improvements39- Fixes that will later be backported to release branches4041## Identifying Issues That Belong in the Default Branch4243When reviewing a PR targeting a release branch, look for these indicators that suggest the fix should be in the default branch first:4445### 1. The Root Cause Exists in Default Branch4647If the underlying issue exists in the default branch's code, it should be fixed there first.4849**Example:**50```yaml51# PR changes this in release/v7.5:52- $metadata = Get-Content "$repoRoot/tools/metadata.json" -Raw | ConvertFrom-Json53+ $metadata = Get-Content "$(Build.SourcesDirectory)/PowerShell/tools/metadata.json" -Raw | ConvertFrom-Json54```5556**Analysis:** If `$repoRoot` is undefined because the template doesn't include its dependencies in BOTH the release branch AND the default branch, the fix should address the root cause in the default branch first.5758### 2. The Fix is a Workaround Rather Than a Proper Solution5960If the change introduces a workaround (hardcoded paths, special cases) rather than fixing the underlying design issue, it likely belongs in the default branch as a proper fix.6162**Example:**63- Using hardcoded paths instead of fixing variable initialization64- Adding special cases instead of fixing the logic65- Duplicating code instead of fixing shared dependencies6667### 3. The Issue Affects General Functionality6869If the issue affects general functionality not specific to a release, it should be fixed in the default branch.7071**Example:**72- Template dependencies that affect all pipelines73- Shared utility functions74- Common configuration issues7576## Providing Code Review Feedback7778### For Issues in the Current Branch7980When an issue is specific to the current branch or is a legitimate fix for the branch being targeted, **use the default code review feedback format** without any special branch-strategy commentary.8182### For Issues That Belong in the Default Branch83841. **Provide the code review feedback**852. **Explain why it should be fixed in the default branch**863. **Provide an issue template** in markdown format8788**Example:**8990```markdown91The `channelSelection.yml` template relies on `$repoRoot` being set by `SetVersionVariables.yml`, but doesn't declare this dependency. This issue exists in both the release branch and the default branch.9293**This should be fixed in the default branch first**, then backported if needed. The proper fix is to ensure template dependencies are correctly declared, rather than using hardcoded paths as a workaround.9495---9697**Suggested Issue for Default Branch:**9899### Issue Title100`channelSelection.yml` template missing dependency on `SetVersionVariables.yml`101102### Description103The `channelSelection.yml` template uses the `$repoRoot` variable but doesn't ensure it's set beforehand by including `SetVersionVariables.yml`.104105**Current State:**106- `channelSelection.yml` expects `$repoRoot` to be available107- Not all pipelines that use `channelSelection.yml` include `SetVersionVariables.yml` first108- This creates an implicit dependency that's not enforced109110**Expected State:**111Either:1121. `channelSelection.yml` should include `SetVersionVariables.yml` as a dependency, OR1132. `channelSelection.yml` should be refactored to not depend on `$repoRoot`, OR1143. Pipelines using `channelSelection.yml` should explicitly include `SetVersionVariables.yml` first115116**Files Affected:**117- `.pipelines/templates/channelSelection.yml`118- `.pipelines/templates/package-create-msix.yml`119- `.pipelines/templates/release-SetTagAndChangelog.yml`120121**Priority:** Medium122**Labels:** `Issue-Bug`, `Area-Build`, `Area-Pipeline`123```124125## Issue Template Format126127When creating an issue template for the default branch, use this structure:128129```markdown130### Issue Title131[Clear, concise description of the problem]132133### Description134[Detailed explanation of the issue]135136**Current State:**137- [What's happening now]138- [Why it's problematic]139140**Expected State:**141- [What should happen]142- [Proposed solution(s)]143144**Files Affected:**145- [List of files]146147**Priority:** [Low/Medium/High/Critical]148**Labels:** [Suggested labels like `Issue-Bug`, `Area-*`]149150**Additional Context:**151[Any additional information, links to related issues, etc.]152```153154## Common Scenarios155156### Scenario 1: Template Dependency Issues157158**Indicators:**159- Missing template includes160- Undefined variables from other templates161- Assumptions about pipeline execution order162163**Action:** Suggest fixing template dependencies in the default branch.164165### Scenario 2: Hardcoded Values166167**Indicators:**168- Hardcoded paths replacing variables169- Environment-specific values in shared code170- Magic strings or numbers171172**Action:** Suggest proper variable/parameter usage in the default branch.173174### Scenario 3: Logic Errors175176**Indicators:**177- Incorrect conditional logic178- Missing error handling179- Race conditions180181**Action:** Suggest fixing the logic in the default branch unless it's release-specific.182183### Scenario 4: Legitimate Release Branch Fixes184185**Indicators:**186- Version-specific configuration187- Release packaging changes188- Backport of already-fixed default branch issue189190**Action:** Provide normal code review feedback for the current PR.191192## Best Practices1931941. **Always check if the issue exists in the default branch** before suggesting a release-branch-only fix1952. **Prefer fixing root causes over workarounds**1963. **Provide clear rationale** for why a fix belongs in the default branch1974. **Include actionable issue templates** so users can easily create issues1985. **Be helpful, not blocking** - provide the feedback even if you can't enforce where it's fixed199200## Examples of Good vs. Bad Approaches201202### ❌ Bad: Workaround in Release Branch Only203204```yaml205# In release/v7.5 only206- pwsh: |207 $metadata = Get-Content "$(Build.SourcesDirectory)/PowerShell/tools/metadata.json" -Raw208```209210**Why bad:** Hardcodes path to work around missing `$repoRoot`, doesn't fix the default branch.211212### ✅ Good: Fix in Default Branch, Then Backport213214```yaml215# In default branch first216- template: SetVersionVariables.yml@self # Ensures $repoRoot is set217- template: channelSelection.yml@self # Now can use $repoRoot218```219220**Why good:** Fixes the root cause by ensuring dependencies are declared, then backport to release if needed.221222## When in Doubt223224If you're unsure whether an issue should be fixed in the current branch or the default branch, ask yourself:2252261. Does this issue exist in the default branch?2272. Is this a workaround or a proper fix?2283. Will other branches/releases benefit from this fix?229230If the answer to any of these is "yes," suggest fixing it in the default branch first.231
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| PowerShell/PowerShell.github/instructions/build-and-packaging-steps.instructions.md · 55k | Copilot instructions | buildagent-behaviour | 58/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/build-checkout-prerequisites.instructions.md · 55k | Copilot instructions | setupbuildstylearch+1 | 81/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/instruction-file-format.instructions.md · 55k | Copilot instructions | buildlint-formatstylearch+3 | 76/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/log-grouping-guidelines.instructions.md · 55k | Copilot instructions | buildtestdo-not | 77/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-condition-syntax.instructions.md · 55k | Copilot instructions | buildstylearchdeployment+1 | 73/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-restore-phase-pattern.instructions.md · 55k | Copilot instructions | arch | 54/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-signing-configuration.instructions.md · 55k | Copilot instructions | buildstyledeployment | 62/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-module-organization.instructions.md · 55k | Copilot instructions | buildteststylearch+2 | 69/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-parameter-naming.instructions.md · 55k | Copilot instructions | styledo-not | 65/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/publishing-pester-result.instructions.md · 55k | Copilot instructions | testlint-formatstylearch+3 | 69/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/script-module-file-format.instructions.md · 55k | Copilot instructions | lint-format | 54/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/start-native-execution.instructions.md · 55k | Copilot instructions | buildstylearchgit+1 | 86/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/start-psbuild-basics.instructions.md · 55k | Copilot instructions | buildtesting-strategydeploymentagent-behaviour | 54/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/troubleshooting-builds.instructions.md · 55k | Copilot instructions | buildgitdeployment | 54/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/build-configuration-guide.instructions.md · 55k | Copilot instructions | buildteststyletesting-strategy+2 | 74/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/pester-set-itresult-pattern.instructions.md · 55k | Copilot instructions | setupstylearch | 62/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-automatic-variables.instructions.md · 55k | Copilot instructions | stylearchgitdeployment+1 | 69/100 | 14 days ago | |
| PowerShell/PowerShell.github/instructions/pester-test-status-and-working-meaning.instructions.md · 55k | Copilot instructions | teststyle | 54/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 14 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | 7 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 13 days ago | |
| rtk-ai/rtk.github/copilot-instructions.md · 75k | Copilot instructions | buildtestlint-formatstyle+2 | 97/100 | 14 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/powershell-powershell-github-instructions-code-review-branch-strategy-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.