home / skills / ntaksh42 / agents / azure-repos-helper
This skill helps you manage Azure Repos by handling branches, PRs, reviews, and policy enforcement for efficient repository operations.
npx playbooks add skill ntaksh42/agents --skill azure-repos-helperReview the files below or copy the command above to add this skill to your agents.
---
name: azure-repos-helper
description: Manage Azure Repos including branches, pull requests, and code reviews. Use when working with Azure Repos or managing repository operations.
---
# Azure Repos Helper Skill
Azure Reposでのリポジトリ管理を支援するスキルです。
## 主な機能
- **リポジトリ操作**: クローン、プッシュ、プル
- **ブランチポリシー**: PR必須、レビュー必須
- **コードレビュー**: PR作成、レビュー
- **ブランチ管理**: ブランチ戦略
- **Git操作**: Azure DevOps特有の操作
## ブランチポリシー設定
### main ブランチ保護
```json
{
"isEnabled": true,
"isBlocking": true,
"type": {
"id": "fa4e907d-c16b-4a4c-9dfa-4906e5d171dd"
},
"settings": {
"minimumApproverCount": 2,
"creatorVoteCounts": false,
"allowDownvotes": false,
"resetOnSourcePush": true,
"requireVoteOnLastIteration": true,
"blockLastPusherVote": true
}
}
```
### ビルド検証
```json
{
"isEnabled": true,
"isBlocking": true,
"type": {
"id": "0609b952-1397-4640-95ec-e00a01b2c241"
},
"settings": {
"buildDefinitionId": 123,
"displayName": "PR Build Validation",
"validDuration": 720,
"queueOnSourceUpdateOnly": true
}
}
```
## PR作成(Azure CLI)
```bash
# PR作成
az repos pr create \
--repository MyRepo \
--source-branch feature/new-feature \
--target-branch main \
--title "新機能: ユーザー認証" \
--description "JWT認証を実装しました" \
--reviewers [email protected] [email protected] \
--work-items 123 456
# PRリスト取得
az repos pr list \
--repository MyRepo \
--status active
# PR承認
az repos pr update \
--id 123 \
--status approved
# PRマージ
az repos pr update \
--id 123 \
--status completed \
--merge-commit-message "Merged PR 123: Add user authentication"
```
## .gitattributes
```
# Auto detect text files and perform LF normalization
* text=auto
# Source code
*.cs text diff=csharp
*.java text diff=java
*.py text diff=python
*.js text
*.ts text
# Binary files
*.png binary
*.jpg binary
*.dll binary
*.exe binary
```
## バージョン情報
- Version: 1.0.0
This skill helps manage Azure Repos operations including branches, pull requests, and code reviews. It provides guidance and examples for branch policies, PR workflows, Git attributes, and Azure CLI commands. Use it to standardize repo protection, automate validation, and streamline reviewer workflows.
The skill inspects common repo management tasks and provides configuration snippets and CLI examples for Azure Repos. It shows branch policy settings (approvals, build validation), sample .gitattributes for normalization, and az repos commands for creating, listing, approving, and merging PRs. Apply the provided JSON and CLI patterns directly to enforce policies and automate PR operations.
Can I enforce build validation only for PRs?
Yes. Configure a build validation policy with queueOnSourceUpdateOnly and isBlocking true so the build runs and blocks merges only for PR updates.
How do I prevent the PR author from counting as an approver?
Set creatorVoteCounts to false in the branch policy to ensure the author’s vote does not satisfy approval requirements.
What happens when source branch is pushed after approval?
Enable resetOnSourcePush to invalidate previous approvals so reviewers must re-evaluate changes after new commits.