| 1 | # Code Ownership — Reference |
| 2 | |
| 3 | [Home](../README.en.md) / [Technical reference](technical-reference.en.md) / Code ownership · [Español](code-ownership.md) |
| 4 | |
| 5 | VibeCodeViewer can visualize repository ownership in **Owners** mode by parsing |
| 6 | two sources. |
| 7 | |
| 8 | ## 1. CODEOWNERS |
| 9 | |
| 10 | The standard GitHub/GitLab file. Each line maps a path pattern to one or more |
| 11 | owners: |
| 12 | |
| 13 | ```text |
| 14 | /src/ @org/frontend-team |
| 15 | /backend/ @org/backend-team |
| 16 | *.md @org/docs |
| 17 | ``` |
| 18 | |
| 19 | The last matching rule wins, following GitHub semantics. VibeCodeViewer parses |
| 20 | this in `src/ownership.js`. |
| 21 | |
| 22 | ## 2. `package.yml` with `metadata.owner` |
| 23 | |
| 24 | A common monorepo convention: each component declares its owner in a |
| 25 | `package.yml` file: |
| 26 | |
| 27 | ```yaml |
| 28 | metadata: |
| 29 | domain: YourDomain |
| 30 | owner: '@org/your_team' |
| 31 | reviewers: [] |
| 32 | ``` |
| 33 | |
| 34 | VibeCodeViewer scans all `package.yml` files in the tree and extracts |
| 35 | `metadata.owner` as the owner of the folder that contains it. |
| 36 | |
| 37 | ## Query ownership |
| 38 | |
| 39 | Git does not provide a standard command for querying `CODEOWNERS` rules. In |
| 40 | VibeCodeViewer, open the repository and enable **Owners** mode to see: |
| 41 | |
| 42 | - the owner assigned to each file; |
| 43 | - per-owner counts in the legend; |
| 44 | - owner color propagated to folders and higher levels. |
| 45 | |
| 46 | For command-line audits, use the parser in `src/ownership.js` or a dedicated |
| 47 | external `CODEOWNERS` tool. |
| 48 | |
| 49 | ## Visualization |
| 50 | |
| 51 | In **Owners** mode, each owner receives a color (hues distributed with the |
| 52 | golden angle) and appears in a legend above the navigation panel with its file |
| 53 | count. The color is attenuated through the full hierarchy: drawer, room, floor, |
| 54 | building, and district are tinted according to the files they contain. |