/who - Ownership & Authorship Discovery
Find who owns, wrote, maintains, approved, or should review code, components, and projects.
System Prompt
⚠️ EXECUTION DIRECTIVE: When the user invokes this command, you MUST:
- IMMEDIATELY execute - no questions, no explanations first
- Parse the query to determine ownership type
- Run appropriate lookup (git blame, CODEOWNERS, frontmatter)
- Display results in box format
DO NOT:
- Ask for clarification - infer from context
- Skip execution even if query is broad
The user invoking the command IS the confirmation.
Usage
/who <query>
Query Types
| Query Pattern | Purpose | Method |
|---|---|---|
/who owns <path> | Find CODEOWNER | Parse CODEOWNERS file |
/who wrote <path> | Find author | git log --follow --format='%an' <path> |
/who maintains <component> | Find maintainer | Check frontmatter maintainer: field |
/who approved <path> | Find approver | git log --format='%an' --merges <path> |
/who should review <path> | Suggest reviewers | CODEOWNERS + recent contributors |
/who created <component> | Find creator | Frontmatter author: or first commit |
/who last touched <path> | Last modifier | git log -1 --format='%an' <path> |
Execution Steps
Step 1: Parse Query
# Extract query type and target
QUERY_TYPE=$(echo "$QUERY" | grep -oE '(owns|wrote|maintains|approved|review|created|touched)')
TARGET=$(echo "$QUERY" | sed 's/.*\(owns\|wrote\|maintains\|approved\|review\|created\|touched\)\s*//')
Step 2: Lookup Based on Type
# For ownership (CODEOWNERS)
if [ "$QUERY_TYPE" = "owns" ]; then
# Check .github/CODEOWNERS or CODEOWNERS
CODEOWNERS=$(cat .github/CODEOWNERS CODEOWNERS 2>/dev/null | grep -v '^#' | grep -v '^$')
# Match path against patterns
fi
# For authorship (git blame)
if [ "$QUERY_TYPE" = "wrote" ]; then
git log --follow --format='%an <%ae>' "$TARGET" | sort | uniq -c | sort -rn | head -5
fi
# For maintainers (frontmatter)
if [ "$QUERY_TYPE" = "maintains" ]; then
grep -r "^maintainer:" "$TARGET" 2>/dev/null || \
grep -r "^author:" "$TARGET" 2>/dev/null
fi
# For reviewers (combined)
if [ "$QUERY_TYPE" = "review" ]; then
# 1. Check CODEOWNERS
# 2. Find top 3 recent contributors
git shortlog -sn --since="6 months ago" -- "$TARGET" | head -3
fi
Step 3: Check Component Frontmatter
# For CODITECT components, check frontmatter
python3 -c "
import yaml
import sys
with open('$TARGET', 'r') as f:
content = f.read()
if content.startswith('---'):
fm = yaml.safe_load(content.split('---')[1])
if 'author' in fm: print(f\"Author: {fm['author']}\")
if 'maintainer' in fm: print(f\"Maintainer: {fm['maintainer']}\")
if 'owner' in fm: print(f\"Owner: {fm['owner']}\")
"
Response Format
┌─────────────────────────────────────────────────────────────────┐
│ /who: <query> │
├─────────────────────────────────────────────────────────────────┤
│ OWNERSHIP RESULTS │
│ ───────────────── │
│ │
│ Primary Owner: @username (from CODEOWNERS) │
│ Author: Full Name <email> │
│ Last Modified By: Full Name (2026-02-03) │
│ │
│ Top Contributors: │
│ 1. Full Name (45 commits) │
│ 2. Full Name (23 commits) │
│ 3. Full Name (12 commits) │
│ │
│ Suggested Reviewers: │
│ • @codeowner1 (CODEOWNER) │
│ • @contributor1 (recent contributor) │
│ │
├─────────────────────────────────────────────────────────────────┤
│ Source: CODEOWNERS, git log, frontmatter │
└─────────────────────────────────────────────────────────────────┘
Examples
Find Component Owner
/who owns agents/senior-architect.md
Output: Shows CODEOWNER assignment, author from frontmatter, git log contributors.
Find Who Wrote Code
/who wrote scripts/component-indexer.py
Output: Shows all contributors with commit counts, original author, last modifier.
Get Reviewer Suggestions
/who should review commands/
Output: Lists CODEOWNERS for path + top recent contributors as suggested reviewers.
Find Maintainer
/who maintains skills/moe-task-execution
Output: Checks skill frontmatter for maintainer: field, falls back to author.
Last Touch
/who last touched hooks/task-tracking-enforcer.py
Output: Shows most recent commit author with date and commit message.
Related Commands
| Command | Purpose |
|---|---|
/what <component> | Discover what a component is |
/where <component> | Find where a component is located |
/when <component> | Find when a component was created/modified |
/why <component> | Understand why a component exists |
/which <task> | Find which agent/skill to use |
/how <task> | Get guidance on how to do something |
Success Output
✅ COMMAND COMPLETE: /who
Query: <query>
Results: <count> owner(s) found
Primary: <primary owner/author>
Source: <CODEOWNERS | git log | frontmatter>
Completion Checklist
Before marking complete:
- Query type identified
- Appropriate lookup executed
- Results formatted in box
- Sources cited
Failure Indicators
This command has FAILED if:
- ❌ No query provided
- ❌ Target path does not exist
- ❌ No ownership information found
- ❌ Results not displayed
When NOT to Use
Do NOT use when:
- Looking for component documentation (use
/what) - Need to find a file location (use
/where) - Want to understand purpose (use
/why)
Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|---|---|---|
| No target specified | Can't lookup | Always include path/component |
| Assuming single owner | May have multiple | Show all relevant owners |
| Skip CODEOWNERS | Miss team ownership | Always check CODEOWNERS first |
Principles
This command embodies:
- #6 Clear, Understandable - Box format with clear attribution
- #3 Complete Execution - Full ownership chain shown
- #9 Based on Facts - Uses git history and CODEOWNERS
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Action Policy
<default_behavior> This command executes immediately upon invocation:
- Parses query to determine ownership type
- Runs appropriate git/file lookups
- Displays results in box format
- Cites sources (CODEOWNERS, git log, frontmatter) </default_behavior>
Version: 1.0.0 Created: 2026-02-04 Author: CODITECT Team Framework: 5W+H Question Framework