branch-policies
Skill0 starsChanged 27 days agoMITView on GitHub
Review and set branch policies on Azure Repos or GitHub through an interview, including relaxing approval rules for a solo developer with no one to approve their PRs. Use when the user mentions branch policies, branch protection, required reviewers, or working alone on a repo.
In this repository10 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- ado-implementSkill
- grillingSkill
- grill-meSkill
- implementSkill
- lintSkill
- pr-reviewSkill
- prSkill
- spec-kitSkill
- teachSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Run the preflight and postflight as the other skills do (check.sh pre|post branch-policies), and show each table.
- Distinctive: line 26
When a second person joins, switch back to team.
- Very specific: line 43
Azure Repos, solo: update the minimum-reviewers policy with az repos policy approver-count update --id <policy-id> --minimum-approver-count …
- Very specific: line 45
Azure Repos, both profiles: create any missing policy the profile requires, for example az repos policy work-item-linking create and az …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Branch policies are shared infrastructure. Show every change as before and after, apply it only on the user's yes, and leave the user able to revert it. Changing policies needs admin rights: Edit policies on the Azure Repos repository, or admin on the GitHub repository.
Run the preflight and postflight as the other skills do (check.sh pre|post branch-policies), and show each table. Use the interview mode from implement, with each gate a round in that format.
Profiles
| Policy on the default branch | Team | Solo |
| Changes arrive through a pull request | required | required |
| Minimum approvers | 1+, the author's vote doesn't count | Azure Repos: 1, the author's own vote counts. GitHub: 0 (GitHub never lets authors approve) |
| Reset approvals on new pushes | on | on |
| Build validation / required status checks | required | required |
| Linked work item (Azure Repos only, if enabled by the repo) | required | required |
| Comments resolved before merge | required | required |
| Force pushes and branch deletion | blocked | blocked |
Solo relaxes only who approves. Everything that catches mistakes stays. In return, the kit adds controls:
- The PR, Security, and Privacy reviewers act as the second reviewer. Their merged findings are posted on the PR as its review record.
- An
escalatefinding has no sign-off team, so the user acknowledges each one in a PR comment before completing. - When a second person joins, switch back to team.
1. Read the current state
- Azure Repos: get the repository ID with
az repos show --repository <name> --query id -o tsv, thenaz repos policy list --repository-id <id> --branch <branch>. - GitHub:
gh api repos/<owner>/<repo>/branches/<branch>/protection(a 404 means unprotected) andgh api repos/<owner>/<repo>/rulesets. Count who else could approve withgh api repos/<owner>/<repo>/collaborators --jq length.
Done when every policy on the branch is listed with its current values.
2. Choose the profile
Gate: recommend solo when the user is the only one who can approve, otherwise team. Show a table of each policy (current value, target value) and the exact commands from step 3. Write down the revert commands (the current values) to include in the report.
3. Apply
On the user's yes:
- Azure Repos, solo: update the minimum-reviewers policy with
az repos policy approver-count update --id <policy-id> --minimum-approver-count 1 --creator-vote-counts true --reset-on-source-push true. If none exists, create one withaz repos policy approver-count create --repository-id <id> --branch <branch> --blocking true --enabled true --minimum-approver-count 1 --creator-vote-counts true --allow-downvotes false --reset-on-source-push true. - Azure Repos, team: the same command with
--creator-vote-counts falseand the team's approver count. - Azure Repos, both profiles: create any missing policy the profile requires, for example
az repos policy work-item-linking createandaz repos policy comment-required create, each with--repository-id <id> --branch <branch> --blocking true --enabled true. Build validation needs a pipeline ID (az repos policy build create --build-definition-id <id> ...); offer it only when a pipeline exists. - GitHub, branch protection:
gh api -X PATCH repos/<owner>/<repo>/branches/<branch>/protection/required_pull_request_reviews -F required_approving_review_count=<0 for solo, 1+ for team>. - GitHub, rulesets: fetch the ruleset, change
required_approving_review_countin itspull_requestrule, andgh api -X PUT repos/<owner>/<repo>/rulesets/<id> --input .git/agentic-dev-kit/tmp/ruleset.json.
Branch policies are never bypassed and never disabled wholesale. The guardrail hook asks before every policy change.
4. Verify and report
Re-read the policies (step 1). Done when they match the target. Report before and after, the revert commands, and what the profile means day to day: in solo, implement posts the reviewers' findings on each PR and asks before the user approves their own.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

