---
name: code-ownership-map
description: "Shows who owns each part of a codebase and where nobody does, so reviews and incidents reach a person instead of a shrug. Use when a repository has no clear owners per directory and reviews, pages or questions keep landing on the wrong person. Do not use for assigning people to a sprint or drawing an org chart. Related topics: coding, business."
---

# Code Ownership Map

Shows who owns each part of a codebase and where nobody does, so reviews and incidents reach a person instead of a shrug.

## When to use

Use this skill when a repository has no clear owners per directory and reviews, pages or questions keep landing on the wrong person. Do not use it for assigning people to a sprint or drawing an org chart.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Split the repository into areas of a size one team could own, and list each with its path so every file falls under exactly one area.
3. Record the declared owner for each area from the ownership evidence, and write none where the evidence is silent.
4. Compare declared owners with recent commit and review activity inside the chosen window, so each area has a real owner or an explicit gap.
5. Label every area Clear, Disputed, Shared or Orphaned using the stated rules and attach a one-line risk.
6. Propose the three ownership-file edits that resolve the most ambiguity, each naming the path and the suggested owner.

## Inputs

- **Repository layout** (longer free text)
- **Ownership evidence** (longer free text)
- **Teams and people** (longer free text)
- **Time window for activity** (choose one: Last 3 months, Last 6 months, Last year, All history)
- **Include dependencies** (choose one: Yes, No)

## Output

A table of areas with declared owner, real owner, status and risk, then the orphaned and disputed areas with suggested owners, then three concrete ownership-file edits.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### Code Ownership Map

Build an ownership map for this codebase.

- Repository layout: {{Repository layout}}
- Ownership evidence: {{Ownership evidence}}
- Teams and people: {{Teams and people}}
- Time window for activity: {{Time window for activity}}
- Include dependencies: {{Include dependencies}}

Work area by area, not file by file. For each top-level area, name the declared owner from the evidence, then compare it with who actually commits and reviews there. Mark each area as Clear, Disputed (declared and real owners differ), Shared (three or more active authors with no lead), or Orphaned (no declared owner and no recent activity). Treat a departed person as no owner. Present a table with area, declared owner, real owner, status and risk, then list the orphaned and disputed areas first with a suggested owner and the reason. When dependencies are included, add the vendored or third-party code nobody maintains. End with the three smallest edits to the ownership file that would remove the most ambiguity.

## Pitfalls

- Treating the top committer as the owner when they only reformat or bump versions, which hides the person who understands the design.
- Trusting a stale ownership file that still names someone who left, so alerts keep routing to nobody.
- Mapping at file level, which produces hundreds of rows no one reads instead of a handful of areas someone can claim.
