agentleFS
LedgerHQLedgerHQ/ledger-live/.agents/skills/codeownership/SKILL.md

codeownership

Skill627 starsChanged 7 days agoMITView on GitHub

Maintain CODEOWNERS file and team directories. Provides resolve-codeowners.js to annotate files with their owner team — useful to split a large PR by team. Use when working with "**/team-*/**" or splitting monolithic files.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use resolve-codeowners.js to annotate any list of files with their CODEOWNERS team — handy when splitting a large PR by team owner.

    line 21
  2. Very specific:

    After editing CODEOWNERS, or moving or deleting files it names, run the CI check locally:

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Codeownership

Why

  • To reduce cross-team review bottlenecks

What

  • Make ownership of team specific directories clear
  • Organise some directories into team-specific sub-directories
  • Maintain CODEOWNERS files when team specific directories are added or removed
  • Split monolithic files or folders that have been identified as being touched by too many teams

Resolving ownership for a list of files

Use resolve-codeowners.js to annotate any list of files with their CODEOWNERS team — handy when splitting a large PR by team owner. It uses the same matcher as the CI check in validate-codeowners, so it resolves exactly as GitHub does (case-sensitive, no install needed).

# From a git diff
git diff --name-only HEAD~1 | node .agents/skills/codeownership/resolve-codeowners.js

# Explicit file list
node .agents/skills/codeownership/resolve-codeowners.js apps/ledger-live-desktop/src/foo.ts libs/env/src/bar.ts

# Override CODEOWNERS location
node .agents/skills/codeownership/resolve-codeowners.js --codeowners /path/to/CODEOWNERS <files...>

Output format (same columns as CODEOWNERS, but resolved to actual files):

apps/ledger-live-desktop/src/main/index.ts  @ledgerhq/platform
apps/ledger-live-desktop/src/renderer/foo.ts  @ledgerhq/wallet-xp
.github/workflows/e2e.yml  @ledgerhq/wallet-ci @ledgerhq/qaa
random/unknown/file.xyz  (no owner)

Semantics: last-rule-wins; ownerless entries appear as (no owner).

Checking CODEOWNERS before pushing

After editing CODEOWNERS, or moving or deleting files it names, run the CI check locally:

node .agents/skills/codeownership/resolve-codeowners.js --check

It fails on rules that match no file, never take effect, re-own narrower rules from a later position, or use an unanchored name that matches in several places. Put defaults such as **/tsconfig* near the top; team-specific rules come after them.

Target

Splitting a monolithic file

  • Split [foo].ts into [foo]/team-[name]/*.ts

Maintaining team specific directories

Example

/shared/feature-flags/src/flags/ contains team-coin-integration, team-engagement, team-live-devices, etc.

CODEOWNERS defines the owner for each of these:

**/team-coin-integration/         @ledgerhq/coin-integration
**/team-engagement/               @ledgerhq/engagement
**/team-live-devices/             @ledgerhq/live-devices

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.