AgentSkillsCN

build-team-personas

通过收集团队在 Azure DevOps 中的 PR 审查评论并生成详细的个人角色档案,为团队构建 AI 代码审查员角色。在被要求构建审查员角色、分析团队的审查风格,或设置基于团队的代码审查时,可运用此技能。

SKILL.md
--- frontmatter
name: build-team-personas
description: >
  Build AI code reviewer personas for a team by collecting their Azure DevOps PR review comments
  and generating detailed persona profiles. Use this skill when asked to build reviewer personas,
  analyze a team's review style, or set up team-based code reviews.

Build Team Personas

You will build detailed AI code reviewer personas for each team member by analyzing their real PR review comments from Azure DevOps.

Step 0: Locate UVBot

The uvbot project directory is: {{UVBOT_HOME}}

Store this as UVBOT_DIR. All paths below (config/, data/, personas/, collect.py) are relative to UVBOT_DIR.

Workflow

Step 1: Determine Who to Build

The user may specify member names directly in their prompt (e.g., "Build persona for Alice Smith and Bob Jones").

  • If names are provided: Use those names. Validate they exist in $UVBOT_DIR/config/team.txt.
  • If a name is provided but NOT in team.txt: Add them to $UVBOT_DIR/config/team.txt automatically, then proceed.
  • If no names provided: Read $UVBOT_DIR/config/team.txt, list all members, and ask the user to pick who to build personas for (allow selecting specific members or "all").

Step 2: Skip Already-Built Personas

For each selected member, check if $UVBOT_DIR/personas/<member_slug>.md already exists.

  • If it exists: Skip that member and inform the user (e.g., "✅ Alice Smith — persona already exists, skipping").
  • If the user explicitly asks to rebuild (e.g., "rebuild persona for Alice"): Regenerate even if it exists.

If all selected members already have personas, inform the user and stop.

Step 3: Verify Prerequisites

  1. Confirm the user is authenticated to Azure DevOps by running: az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv. If this fails, tell the user to run az login.
  2. Run pip install -q -r $UVBOT_DIR/requirements.txt to ensure dependencies are installed.

Step 3.5: Confirm Repos to Collect From

Read $UVBOT_DIR/config/repos.txt and show the user which repos will be scanned:

code
I'll collect review comments from these repos:
  1. MyService.Api
  2. MyService.Worker

Want to add more repos before I start? (The more repos, the richer the persona.)

Always ask this. Personas built from a single repo will be narrow. If the user wants to add repos, append them to $UVBOT_DIR/config/repos.txt and proceed. If they're happy with the list, continue.

Step 4: Collect Review Comments

Run the data collection script for the members that need personas built:

bash
# Single member:
cd $UVBOT_DIR && python3 collect.py --member "Name"

# All members:
cd $UVBOT_DIR && python3 collect.py

This produces $UVBOT_DIR/data/<member_name>_comments.json for each team member.

Step 5: Generate Persona for Each Member

For each member that needs a persona built, read their $UVBOT_DIR/data/<member_slug>_comments.json file and analyze all their review comments to generate a comprehensive persona markdown file at $UVBOT_DIR/personas/<member_slug>.md.

Analysis process — for each member's comment data:

  1. Quantify: Count total comments, PRs reviewed, and repos covered.
  2. Identify patterns: What does this reviewer care about most? Look for recurring themes across their comments (e.g., error handling, performance, naming, testing, security, observability).
  3. Extract principles: Derive 3-7 core review principles from their comment patterns. Each principle should have:
    • A clear rule statement
    • Sub-rules with quoted examples from their actual comments
    • Explanation of why they care about this
  4. Characterize communication style: How do they phrase feedback? Do they use questions, directives, suggestions? Are they terse or detailed? Do they explain rationale?
  5. Identify anti-patterns: What do they consistently reject or push back on?
  6. Note domain expertise: What technologies, frameworks, and architectural patterns do they demonstrate deep knowledge of?
  7. Capture review process: How do they mentally approach a PR? What do they look at first?

Persona File Structure

Each persona file in $UVBOT_DIR/personas/<member_slug>.md MUST follow this structure:

markdown
# <Full Name> — Code Review Persona

> **What this is**: A comprehensive AI persona prompt that captures the code review
> mindset, technical depth, domain expertise, and communication patterns of <Name>.
> Synthesized from **<N> real review comments** across **<M> pull requests** in
> <K> repositories.
>
> **How to use**: Provide this prompt as a system instruction to an AI model when
> you want <Name>-quality code reviews.

---

## Role Definition

You are **<Full Name>**, a code reviewer on the team. Do NOT assume or infer job titles, seniority levels (e.g., "senior", "staff", "lead", "principal"), or leadership roles — only describe their review focus areas and demonstrated expertise.
You have deep expertise in:

- **<Area 1>**: <specific knowledge demonstrated in their comments>
- **<Area 2>**: ...
- ...

You review code in:
- `<Repo 1>` — <brief description>
- ...

---

## Review Philosophy

<Summarize their overall review philosophy in 2-3 sentences, derived from comment patterns>

<List their top 3 non-negotiables>

---

## Core Principles

### Principle 1: <Title>

**The rule**: <Clear statement>

**Sub-rules you enforce**:

#### 1a. <Sub-rule>
> *"<Actual quote from their comment>"*

<Explanation>

...

---

## Communication Style Guide

<How they phrase different types of feedback: blocking issues, suggestions, questions, praise>
<Include real quote examples>

---

## Anti-Patterns You Always Reject

<List with examples>

---

## Things You Praise & Approve

<What makes them happy in a PR>

---

## Domain-Specific Knowledge

<Technologies and concepts they demonstrate expertise in>

---

## How to Review (Your Mental Process)

<Step-by-step description of how they approach a PR, inferred from their patterns>

Step 6: Summary

After generating all personas, print a summary:

  • List each member, their comment count, and the path to their persona file.
  • Remind the user they can now use the team-review skill to conduct reviews using these personas.