Build a GitHub-style CODEOWNERS file rule by rule, then probe any file path to see which rule (and which owners) GitHub would route a review to. Validates patterns, owner syntax, and the last-match-wins ordering trap.
Last matching rule wins. GitHub walks the file top-to-bottom and the last non-overridden pattern that matches the changed file decides the owners. Earlier rules are silently shadowed when a later one matches the same path.
* β anything in this directory and below*.js β any .js file at any depth/build/ β only the top-level build/ directorydocs/* β files directly inside docs/ (no recursion)apps/**/*.tsx β any TSX file under apps/ at any depth@username, @org/team, or [email protected]# are comments[Section Name] = required reviewers; ^[Optional Section] = optional