AGENT SKILL

github-mention-safety

Prevent tagging wrong GitHub users by always resolving usernames from git log or team membership before @-mentioning anyone in GitHub comments, PRs, or issues.

License 许可
MIT
所属仓库
gethamster/skills
最近更新
2026-11-05
Stars
★ 4
Forks
0

01 前言 Front Matter

name
github-mention-safety
version
1.0.0
description
Prevent tagging wrong GitHub users by always resolving usernames from git log or team membership before @-mentioning anyone in GitHub comments, PRs, or issues.

03 SKILL.md 正文

GitHub Mention Safety

Goal

Never tag a GitHub user who is not a verified member of the team. Searching GitHub by name returns arbitrary public users who share a name — do not use search results as a source of truth for usernames.

Hard Rules

  1. Never use mcp__github__search_users to derive a username for @-mention. Search results match arbitrary public accounts by name — the top result is not necessarily a team member.
  2. Always resolve a contributor's GitHub username from git history before mentioning them:
git log --all --format='%ae %an' | sort -u | grep -i <name>

The noreply email format <id>+<login>@users.noreply.github.com gives the exact login.

  1. If git history has no noreply email, fall back to mcp__github__get_team_members to enumerate actual org members, then match by name.
  2. If neither source confirms the login, do not @-mention the person by username. Reference them by name only (e.g. "Edwin Chow (chowed)") or omit the mention entirely.

Lookup Protocol (run before every @-mention)

# Step 1: Check git log for noreply email (most reliable)
git log --all --format='%ae %an' | sort -u | grep -i "<name>"
# Pattern: <id>+<login>@users.noreply.github.com  →  login is the GitHub handle

# Step 2: If not found, list org team members
# mcp__github__get_team_members({ org: "gethamster", team_slug: "<team>" })

# Step 3: Only @-mention if login is confirmed by one of the above

Examples

# ✅ CORRECT — username confirmed from git noreply email
git log --all --format='%ae' | grep -i edwin
# → 29315749+chowed@users.noreply.github.com
# → safe to mention @chowed

# ❌ WRONG — username from GitHub user search
mcp__github__search_users({ query: "edwin hamster" })
# → returns EdwinTannn (unrelated public user)
# → do NOT mention this person

If a Wrong Mention Was Already Posted

  1. Immediately post a correction comment on the same PR/issue.
  2. Explicitly apologize to the incorrectly tagged person.
  3. Post a corrected mention using the verified username.

04 同仓库更多 Skills