.opencode/commands/find-owner.md
Find code owners for: $ARGUMENTS
Steps:
Identify the current user. Load the identify-reviewer skill and run its identity detection steps (gh auth status, git config) to determine the current user's GitHub handle, name, and email.
Resolve the path. If the argument is a symbol name, find its file first. If it's a directory, analyze the directory as a whole.
Recent commit activity. Run:
git log --format='%aN <%aE>' --since='6 months ago' -- <path> | sort | uniq -c | sort -rn | head -10
This shows who has been most active recently.
Blame analysis. For individual files, run:
git blame --line-porcelain <file> | grep '^author ' | sort | uniq -c | sort -rn | head -10
This shows who wrote the most lines currently in the file.
Check for CODEOWNERS. Look for a CODEOWNERS or .github/CODEOWNERS file that may define ownership rules.
Output: