Repository Admin reference: Workflow
In the kit: .github/skills/repo-admin/references/workflow.md.
-
This file as plain text, at
https://letitglow.app/ahg/kit/raw/.github/skills/repo-admin/references/workflow.md - Everything in the kit
Copy it into ChatGPT or another assistant
Read the plain text first
Repository Admin reference: Workflow
Part of the repo-admin skill. Read this only when the task reaches these sections.
Workflow
Step 1: Identify User & Scope
- Call #tool:mcp_github_github_get_me to get the authenticated username.
- Detect the workspace repo from the current directory.
- Load preferences from
.github/accessibility-agents/preferences.md(the user creates it fromdocs/reference/preferences.example.md) if available:- If that file does not exist, read
.github/agents/preferences.md(the older location) and suggest moving it: VS Code loads every.mdfile in.github/agents/as a custom agent. - Read
repos.includefor the set of repos the user cares about (used for bulk operations). - Read
repos.excludefor repos to skip. - Read
admin.label_template_repofor the canonical label source (default: the workspace repo). - Read
admin.default_branch_protectionfor the team's standard branch protection template.
- If that file does not exist, read
- Parse the user's request into one of the operation modes below.
Step 2: Operation Modes
Mode A: Add Collaborator
Flow:
Identify the repo and username from the request.
Determine the permission level requested. If not specified, ask:
- Read -- can view and clone
- Triage -- can manage issues and PRs, cannot push
- Write -- can push (recommended for contributors)
- Maintain -- can manage non-destructive repo settings
- Admin -- full access including destructive actions
Check if the user is already a collaborator (#tool:mcp_github_github_list_repository_collaborators or equivalent).
If already a collaborator, show current role and ask if they want to change it.
Preview action:
About to add @{username} to {owner}/{repo} with {permission} access. This will send them an invitation email. Proceed? [Yes / Change role / Cancel]On confirmation, add the collaborator.
Confirm: "Invitation sent to @{username} for {owner}/{repo} ({permission}). They'll need to accept before gaining access."
Bulk Add (multiple repos or multiple users):
- List all the proposed additions in a preview table.
- Single confirmation to proceed with all.
- Execute sequentially, reporting success/failure for each.
Mode B: Remove Collaborator
Flow:
Identify the repo and username.
Verify they are currently a collaborator and show their current role.
Preview action with explicit warning:
About to remove @{username} from {owner}/{repo}. Current role: {permission} This will immediately revoke their access. They will lose the ability to push, comment, and view private content in this repo. This cannot be undone without sending a new invitation. Proceed? [Yes, remove / Cancel]On confirmation, remove the collaborator.
Confirm with timestamp: "@{username} removed from {owner}/{repo} at {time}."
Bulk Remove (offboarding workflow):
- If the user says "remove @alice from all my repos":
- Search all repos where @alice is a collaborator.
- Show the complete list with roles.
- Single confirmation to remove from all.
- Execute and report results.
Mode C: Access Audit
Flow:
- Determine scope: single repo, a list, or all repos the user owns/admins.
- For each repo in scope, fetch all collaborators with their permission levels.
- Cross-reference with team membership if the user is in an org.
- Generate a structured report showing:
- Each repo with its collaborator list and roles
- Users with Admin access (flag for review)
- Users who appear in only one repo (possible one-off grants)
- Users with no activity in the last 90 days (stale access)
- Repos with no protection on the default branch
- Save the report as a workspace document:
.github/reviews/audits/access-audit-{YYYY-MM-DD}.md.github/reviews/audits/access-audit-{YYYY-MM-DD}.html
Audit Report Format:
# Repository Access Audit -- {date}
## Summary
| Stat | Value |
|------|-------|
| Repos audited | {count} |
| Total collaborators | {count} |
| Admin-level users | {count} |
| Stale access (90+ days inactive) | {count} |
| Repos without branch protection | {count} |
## Flags Requiring Review
- @user has Admin access to 5 repos -- verify this is intentional
- @user has had no activity in {repo} for 120 days
- {repo} has no branch protection on `main`
## Repos & Collaborators
### {owner}/{repo}
| User | Role | Last Active | Notes |
|------|------|-------------|-------|
| @user | Admin | 2 days ago | Owner |
| @other | Write | 90 days ago | Stale -- consider review |Mode D: Branch Protection
Flow:
- Identify the repo and branch (default:
mainor default branch). - Show current protection rules first.
- Show a menu of settings to configure:
- Require pull request before merging (min reviewers: 1/2/custom)
- Require status checks to pass (list available checks)
- Require conversation resolution
- Require signed commits
- Require linear history
- Do not allow bypassing the above settings (apply the rules to admins too;
enforce_adminsin the REST API) - Restrict who can push (specific users/teams)
- Allow force pushes (off by default -- warn if enabling)
- Allow deletions (off by default -- warn if enabling)
- If the user says "apply standard protection" -- use the template from
admin.default_branch_protectionin preferences, or a sensible default:- Require 1 reviewer
- Require CI to pass (if workflows exist)
- Do not allow bypassing the above settings
- No force pushes
- No deletions
- Preview the full ruleset before applying.
- Apply on confirmation.
Mode E: Repository Settings
Flow:
- Show current settings for the repo.
- Allow the user to change:
- Visibility: public <-> private <-> internal (warn on public -> private)
- Merge strategies: allow merge, squash, rebase (check/uncheck)
- Automatically delete head branches after merge
- Features: Issues on/off, Wiki on/off, Projects on/off, Discussions on/off
- Default branch: rename or change
- Archive repository: marks repo as read-only, disabling pushes and most mutations (warn before enabling)
- Preview changes before applying.
- Apply and confirm.
Mode F: Label Synchronization
Flow:
Identify the source repo (template for labels) and target repos.
Fetch all labels from the source repo.
For each target repo, compare labels:
- Missing -- in source, not in target (will be created)
- Color mismatch -- same name, different color (will be updated)
- Extra -- in target, not in source (user chooses: keep or delete)
Show a diff preview:
Label sync: template-repo -> [repo-a, repo-b, repo-c] Will CREATE (5): bug (#d73a4a) -> repo-a, repo-b, repo-c enhancement (#a2eeef) -> repo-b, repo-c ... Will UPDATE (2): documentation: #0075ca -> #cfd3d7 in repo-a ... Will SKIP extra labels (3) -- found only in targets: repo-specific-label (repo-a) -- keepingConfirm -> execute -> report results.
Delete extra labels (if requested):
- List labels that exist in targets but not source.
- Warn: "Deleting a label removes it from every issue and pull request it is applied to."
- Confirm per-repo before deleting extras.
Mode G: Milestone Management
Flow:
- List current milestones across repos with due dates and progress.
- Support operations:
- Create milestone: title, description, due date
- Update milestone: change due date, description, title
- Close milestone: marks as closed, optional closing comment
- Copy milestones: copy a milestone definition from one repo to another
- Preview and confirm all state changes.
Mode H: Webhook Management
Flow:
- List all webhooks on a repo with their URLs, events, and active status.
- Support:
- Add webhook: URL, content type, events to subscribe, enable/disable
- Update webhook: change events, URL, or active state
- Delete webhook: confirm before deleting, non-recoverable
- Test webhook: trigger a ping event
- Never expose webhook secrets in the UI.