Repo Skill Generator
Overview
Generate two repo-local skills from repository history:
- A
codingskill derived from Git commits and diffs. - A
reviewskill derived from GitHub PR review activity.
Generated artifacts are installed into:
./.agents/skills/as the canonical repo-local source../.claude/skillsas a symlink pointing to./.agents/skills.
All generated content is in English.
Hard Gates
- IF the target
repo-rootis not a Git repository, THEN terminate. FIX:cdto a valid Git repository or pass--repo-rootpointing to one. - IF
ghis missing when generating review data, THEN terminate. FIX: Install GitHub CLI (refer to https://cli.github.com/). - IF
ghis unauthenticated, THEN terminate. ACTION: Rungh auth statusbefore generating review data. If not logged in, rungh auth login. - IF the install target is unwritable, THEN terminate. FIX: Check directory permissions or use
--install-rootto specify a writable path. - Do not modify skills outside generator-managed coding/review skill names.
- Do not generate a review skill if review evidence is insufficient. The generator enforces minimum thresholds for effective reviews, unique human reviewers, and substantive review excerpts.
Default Workflow
1) Pre-flight checks
- Execute
gh auth status. - IF
ghis not authenticated, THEN instruct the user to rungh auth login.
2) Generate skills
Execute the command that matches the use case:
# Current repo
python3 skills/repo-skill-generator/scripts/generate_repo_skills.py
# Different repo
python3 skills/repo-skill-generator/scripts/generate_repo_skills.py \
--repo-root /path/to/repo
# Module-level coding skill only
python3 skills/repo-skill-generator/scripts/generate_repo_skills.py \
--repo-root /path/to/repo \
--module src/router
# Safe install root for testing
python3 skills/repo-skill-generator/scripts/generate_repo_skills.py \
--repo-root /path/to/repo \
--install-root /tmp/repo-skill-generator-smoke
# Solo-repo preset (sparse review activity)
python3 skills/repo-skill-generator/scripts/generate_repo_skills.py \
--repo-root /path/to/repo \
--review-evidence-preset solo
# Strict preset (heavier review history expected)
python3 skills/repo-skill-generator/scripts/generate_repo_skills.py \
--repo-root /path/to/repo \
--review-evidence-preset strict
# Override preset thresholds (advanced)
python3 skills/repo-skill-generator/scripts/generate_repo_skills.py \
--repo-root /path/to/repo \
--min-effective-reviews 12 \
--min-unique-human-reviewers 3 \
--min-substantive-excerpts 6
3) Verify output
After generation completes, confirm all three conditions:
generator-meta.jsonexists in each generated skill directory..repo-skill-generator-manifest.jsonexists at the skill root..claude/skillssymlink points to.agents/skills/.
IF any check fails, THEN review the script's stderr for the erroring step and re-run from step 2.
What The Script Produces
For each generated skill:
SKILL.mdprofiles/*.jsonprofiles/*-summary.mdreferences/evidence.mdreferences/anti-patterns.mdorreferences/blocking-patterns.mdreferences/examples.mdgenerator-meta.json
At the skill root:
.repo-skill-generator-manifest.json
Notes
- The generator collects Git and GitHub review evidence before producing skills.
- Review skill generation is gated by evidence sufficiency. Repositories with weak review evidence may produce only a coding skill.
- Review sufficiency presets:
default:8effective reviews,2unique human reviewers,5substantive excerpts.solo:3effective reviews,1unique human reviewer,2substantive excerpts.strict:20effective reviews,3unique human reviewers,10substantive excerpts.
- The script writes repo-local skill directories and installs the
.claude/skillssymlink. - The analyzer is conservative when evidence is weak and indicates this through the generated evidence layer.
References
- Output contract: references/output-contract.md
- Profile fields: references/profile-fields.md