From knowledge-skills
Scan merged PRs and propose updates to AI context files (CLAUDE.md, AGENTS.md) as a git-apply-able patch. Non-interactive.
How this skill is triggered — by the user, by Claude, or both
Slash command
/knowledge-skills:knowledge.repoThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Scan merged PRs from the last N days, extract knowledge relevant to AI agent
Scan merged PRs from the last N days, extract knowledge relevant to AI agent
context, and propose updates to context files as a git apply-able patch.
Parse $ARGUMENTS for:
--days N (default: 7) — how far back to scan merged PRsExecute these phases in order. Exit early where indicated.
Run bash $SKILL_DIR/scripts/detect-forge.sh and capture the output.
github or gitlab)Create the artifacts directory structure:
mkdir -p artifacts/pr-data artifacts/pr-extractions
Run bash $SKILL_DIR/scripts/list-context-files.sh artifacts/context-file-list.txt
echo '{"early_exit":"no_context_files","prs_scanned":0}' > artifacts/run-report.json
Run:
python3 $SKILL_DIR/scripts/fetch-prs.py --forge {forge} --repo {slug} --days {days}
Count the fetched PR files:
ls artifacts/pr-data/*.json 2>/dev/null | wc -l
If zero, write this run report and STOP:
echo '{"early_exit":"no_prs","prs_scanned":0}' > artifacts/run-report.json
For each .json file in artifacts/pr-data/:
123.json → 123).$SKILL_DIR/prompts/extract-agent.md.{ID} with the actual PR ID.Dispatch in waves of up to 10 agents. After dispatching a wave:
artifacts/pr-extractions/{id}.md)After all waves complete, check if any extraction file contains knowledge items.
Read each artifacts/pr-extractions/*.md file and look for content under the
## Knowledge Items heading beyond just the heading itself.
If NO extraction file contains any knowledge items, write this run report and STOP:
echo '{"early_exit":"no_knowledge","prs_scanned":N,"prs_with_knowledge":0}' > artifacts/run-report.json
(Replace N with the actual count of PR data files.)
Read $SKILL_DIR/prompts/synthesize-agent.md.
Dispatch a foreground Agent with the prompt, using model opus.
After the agent completes, check for changes:
git diff --stat
If the diff is empty (no tracked files were modified), write this run report and STOP:
echo '{"early_exit":"no_changes","prs_scanned":N,"prs_with_knowledge":M,"changes_proposed":0}' > artifacts/run-report.json
Save the diff for the review agent:
git diff > artifacts/proposed-diff.txt
$SKILL_DIR/prompts/review-agent.md.artifacts/review.md and parse the verdict
from the YAML frontmatter.If the review verdict is PASS, skip this phase entirely.
If the verdict is REVISE:
$SKILL_DIR/prompts/revise-agent.md.Capture the final patch:
git diff > artifacts/proposed-updates.patch
Reset the working tree:
git checkout -- .
Write artifacts/run-report.json with these fields:
forge: the detected forge typerepo: the owner/repo slugdate_range: {"from": "YYYY-MM-DD", "to": "YYYY-MM-DD"}prs_scanned: count of files in artifacts/pr-data/prs_with_knowledge: count of extraction files with non-empty knowledge itemsknowledge_items: {"high": N, "medium": N, "low": N} counts from extractionschanges_proposed: count of changes listed in artifacts/changes-summary.mdreview_verdict: the verdict from artifacts/review.mdpatch_file: "artifacts/proposed-updates.patch"Build these counts by reading the extraction and summary files.
Print: "Knowledge sync complete. Artifacts written to artifacts/"
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub opendatahub-io/skills-registry --plugin knowledge-skills