From principled-github
Generate or update a CODEOWNERS file from the repository's module structure and git history. Maps module boundaries to code ownership using principled documentation structure as the guide. Use when setting up or refreshing code ownership rules.
How this skill is triggered — by the user, by Claude, or both
Slash command
/principled-github:gen-codeownersThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate or update a `.github/CODEOWNERS` file from the repository's module structure and git history.
Generate or update a .github/CODEOWNERS file from the repository's module structure and git history.
/gen-codeowners [--modules-dir <path>] [--output <path>] [--dry-run]
| Argument | Required | Description |
|---|---|---|
--modules-dir <path> | No | Root directory containing modules. Defaults to auto-detection. |
--output <path> | No | Output path. Defaults to .github/CODEOWNERS. |
--dry-run | No | Print the generated CODEOWNERS without writing. |
Detect modules. Scan for directories containing CLAUDE.md, docs/, or package.json:
bash scripts/detect-modules.sh [--modules-dir <path>]
Returns a list of module paths.
Analyze ownership. For each module, determine primary contributors:
bash scripts/analyze-ownership.sh --module <module-path>
Uses git shortlog -sne on the module directory to rank contributors by commit count.
Read existing CODEOWNERS. If .github/CODEOWNERS exists, parse it to preserve:
# manual comment)Generate CODEOWNERS. Read templates/codeowners.txt as a structural guide and produce:
docs/ directories)Write or display. Based on flags:
--dry-run: write to output path--dry-run: display generated contentReport results. Summary of:
scripts/detect-modules.sh --- Find module directories in the repositoryscripts/analyze-ownership.sh --- Determine code ownership from git historytemplates/codeowners.txt --- Structural template for CODEOWNERS filenpx claudepluginhub alexnodeland/principled --plugin principled-githubRoutes work to the right people using CodeScene ownership data. Connects files or directories to likely reviewers and domain experts.
Analyzes git repos to map security ownership (people-to-files), compute bus factor/sensitive-code risks, build co-change clusters, export CSV/JSON/GraphML for visualization.
Guides setting up GitHub community health files (README, LICENSE, CODE_OF_CONDUCT, CONTRIBUTING, issue/PR templates, SECURITY.md) and repo configuration for open-source projects.