AGENT SKILL

manage-codeowners

Bootstrap, view, and maintain a repo's .github/CODEOWNERS file — create one seeded with the repo owner as a catch-all if it doesn't exist yet, add/update/remove path-owner entries, and validate syntax. Use when asked to set up CODEOWNERS, add a codeowner, check who owns a file/path, or when merge-pr reports no CODEOWNERS file exists.

License 许可
Apache-2.0
最近更新
2026-11-15
Stars
★ 0
Forks
0

01 前言 Front Matter

name
manage-codeowners
description
Bootstrap, view, and maintain a repo's .github/CODEOWNERS file — create one seeded with the repo owner as a catch-all if it doesn't exist yet, add/update/remove path-owner entries, and validate syntax. Use when asked to set up CODEOWNERS, add a codeowner, check who owns a file/path, or when merge-pr reports no CODEOWNERS file exists.
allowed-tools
Bash(gh repo view:*), Read, Write, Edit

02 资源文件 1

03 SKILL.md 正文

Manage CODEOWNERS

Create and maintain .github/CODEOWNERS. This file is a load-bearing dependency for merge-pr's rights check (Tier 2) — without it, merge-pr fails closed and only the repo owner can ever merge anything.

Instructions

  1. Check existence: Read .github/CODEOWNERS.
  2. If missing — bootstrap: get the repo owner via gh repo view --json owner --jq '.owner.login'. Use AskUserQuestion to confirm before writing: show the proposed content (a single catch-all line, * @<owner>) and explain why — merge-pr's CODEOWNERS check fails closed with no file, so this line means "only the repo owner can merge until more entries are added." On confirmation, Write .github/CODEOWNERS with that single line plus a short header comment explaining the file's purpose.
  3. If it exists — show current content, then ask what the user wants to do:
    • Add/update an entry: ask for the path pattern and owner(s) (@username or @org/team). Append (or Edit an existing matching line) — CODEOWNERS resolves ownership by last matching line wins, so note that a newly appended pattern will only take precedence over earlier lines if it comes after them in the file; if the intent is to override an earlier broader pattern, place the new line below it.
    • Remove an entry: ask which line, confirm via AskUserQuestion before deleting (removing a CODEOWNERS line can silently drop someone's merge rights via merge-pr's Tier 2 check).
    • Validate syntax: each non-comment, non-blank line must be <path-pattern> <@owner-or-team>... — at least one owner token per line, each starting with @. Flag any line missing an owner token or using a bare username without @.
  4. Report the resulting file content and path after any write.

Boundaries

  • Only writes .github/CODEOWNERS — never touches branch protection rules or repo collaborator settings (those are separate GitHub concepts this skill doesn't manage).
  • Bootstrap always asks first — never silently creates the file.
  • Does not verify that a listed @username/@org/team actually exists or has repo access — GitHub itself surfaces that mismatch in its UI; duplicating that check here would need extra API calls for a low-value guard.

Testing & Validation

Verify this skill activates on:

  • "set up a CODEOWNERS file for this repo"
  • "add a codeowner for the /docs path"
  • "who owns this file/path"
  • "merge-pr says there's no CODEOWNERS file, can you create one"

Verify it does NOT activate on:

  • "check if I have merge rights on this PR" → merge-pr
  • "who can review this PR" → collaborating-on-a-pr
  • "look up repo settings via the API" → gh-operations
  • "start a new branch for this" → starting-work

Quality gates:

  • [ ] Bootstrap (file missing) always confirms via AskUserQuestion before writing — never silently creates the file
  • [ ] Bootstrap always seeds a single catch-all line (* @<owner>) using the actual repo owner from gh repo view, plus an explanatory header comment
  • [ ] Add/update always accounts for "last matching line wins" — flags when a new pattern needs to go below an earlier broader one to take precedence
  • [ ] Remove always confirms via AskUserQuestion before deleting a line — never removes silently
  • [ ] Validate syntax always flags a line missing an owner token or using a bare username without @
  • [ ] Never touches branch protection rules or repo collaborator settings — CODEOWNERS file only
  • [ ] Never verifies that a listed @username/@org/team actually exists or has access — documented as an intentional non-check, not a gap

04 同仓库更多 Skills

AndreHahm
AndreHahm/andres-cc-marketplace

demo

Fixture skill used by scripts.marketplace_ci sync tests.

★ 0
AndreHahm
AndreHahm/andres-cc-marketplace

export-demo

Fixture skill used by scripts.marketplace_ci export tests.

★ 0
AndreHahm
AndreHahm/andres-cc-marketplace

work-to-development

Validate an accepted Linear Issue's readiness for implementation (criteria, dependencies, duplicate/existing artifacts) and request governed branch/worktree creation through git-kit:starting-work — recording work-started Git/GitHub evidence and a deliberate Linear Started transition only after Git identity is read back and verified. Use when asked to start work on a Linear issue, begin development for an accepted issue, or prepare an accepted issue for implementation. Never creates a branch directly — always delegates to git-kit.

★ 0
AndreHahm
AndreHahm/andres-cc-marketplace

work-linking

Create and maintain stable cross-system links and authority labels between Notion and Linear records, and detect/repair drift between them. Use when asked to link a Notion record to a Linear record, check for drift between Notion and Linear, or repair a broken/stale link. Repairs only the bounded non-authoritative copy or link — never chooses by newest timestamp, and never creates a reverse-write loop against either system's own authority.

★ 0
AndreHahm
AndreHahm/andres-cc-marketplace

status-and-learning

Produce a dated, explicitly non-live Linear-to-Notion progress summary, or capture an outcome/learning after work completes. Use when asked to summarize progress to Notion, report portfolio status, or capture what was learned from a completed piece of work — not to disposition open follow-up items (see open-item-management for that). Never runs automatically or continuously — every summary is a deliberate, approved snapshot, not a live sync.

★ 0
AndreHahm
AndreHahm/andres-cc-marketplace

repository-gates

Discover, delegate, record, and invalidate this repository's actual Git/GitHub lifecycle gates (pre-commit, pre-push, PR required checks, Codex delta review, review requirements, merge rights) and the repository-policy provider profile that maps governed operations to git-kit. Use when asked what gates apply to this repository, to discover repository policy before starting Wave 2 work, or to check whether prior gate evidence is still valid after new commits. Discovery and delegation only — never executes a gate's own internal logic, and never invents a gate the repository doesn't actually define (in particular, never assumes a "Review Changes" gate exists).

★ 0