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.txtautomatically, 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
- •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 runaz login. - •Run
pip install -q -r $UVBOT_DIR/requirements.txtto 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:
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:
# 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:
- •Quantify: Count total comments, PRs reviewed, and repos covered.
- •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).
- •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
- •Characterize communication style: How do they phrase feedback? Do they use questions, directives, suggestions? Are they terse or detailed? Do they explain rationale?
- •Identify anti-patterns: What do they consistently reject or push back on?
- •Note domain expertise: What technologies, frameworks, and architectural patterns do they demonstrate deep knowledge of?
- •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:
# <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-reviewskill to conduct reviews using these personas.