From knowledge-distillery
Processes reviewer feedback on Report PRs to selectively accept, reject, or modify changeset entries. Triggered by /curate comment on knowledge/batch-* PRs. Reads PR comments, interprets natural language feedback, updates the changeset file, regenerates report, and commits.
npx claudepluginhub ether-moon/knowledge-distillery --plugin knowledge-distilleryThis skill uses the workspace's default tool permissions.
- Triggered by `/curate` comment on a Report PR (branch: `knowledge/batch-*`)
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Guides code writing, review, and refactoring with Karpathy-inspired rules to avoid overcomplication, ensure simplicity, surgical changes, and verifiable success criteria.
Share bugs, ideas, or general feedback.
/curate comment on a Report PR (branch: knowledge/batch-*)issue_comment trigger/knowledge-distillery:curate-reportpull_requests,issues toolsetsjq CLI availablegit CLI availableUse GitHub MCP to read the PR that triggered the workflow:
knowledge/batch- — if not, post a comment "This is not a Report PR. Curation is only available on knowledge/batch-* branches." and exitopen — if merged or closed, post "This PR is already merged/closed. Curation is only available on open PRs." and exitknowledge/batch-2026-03-24 → 2026-03-24){id} in each list item) — only these entries may be modifiedgit checkout <pr-branch>
git pull origin <pr-branch>
Locate the changeset file:
ls .knowledge/changesets/batch-YYYY-MM-DD.json
Validate: Changeset file exists and is valid JSON. If not found, post an error comment and exit.
Use GitHub MCP to list all comments on the PR:
/curate trigger comment itselfFor each reviewer comment, interpret the natural language intent and classify into actions:
| Action | Examples | Result |
|---|---|---|
| REJECT | "reject entry-x", "remove entry-x", "entry-x is wrong" | Mark entry as rejected in changeset |
| UPDATE | "change claim of entry-x to: ...", "update title of entry-x" | Modify entry data in changeset |
| KEEP | "looks good", "approve", general discussion | No action |
| UNRESOLVED | Ambiguous, unclear reference, contradictory | Flag for human clarification |
Rules:
Build an action plan — a structured list of (action, entry_id, details/reason).
For each REJECT action, modify the changeset JSON:
# Read changeset, update entry status to "rejected"
jq '(.entries[] | select(.data.id == "<entry-id>")) |= . + {"status": "rejected", "reject_reason": "<reviewer reason>"}' \
.knowledge/changesets/batch-YYYY-MM-DD.json > tmp && mv tmp .knowledge/changesets/batch-YYYY-MM-DD.json
For each UPDATE action, modify the entry's data fields in the changeset JSON:
# Read changeset, update specific fields in the entry's data object
jq '(.entries[] | select(.data.id == "<entry-id>") | .data.claim) = "<new claim>"' \
.knowledge/changesets/batch-YYYY-MM-DD.json > tmp && mv tmp .knowledge/changesets/batch-YYYY-MM-DD.json
After all actions are executed, regenerate .knowledge/reports/batch-YYYY-MM-DD.md to reflect the current changeset state.
Read entry data from the changeset file:
jq '.entries[]' .knowledge/changesets/batch-YYYY-MM-DD.json
Write the updated report with the same structure as the original, but:
### Curation Log
| Action | Entry ID | Details | Timestamp |
|--------|----------|---------|-----------|
| Rejected | entry-x | Reason: reviewer said ... | 2026-03-24T12:00:00Z |
| Updated | entry-y | Changed: claim | 2026-03-24T12:00:00Z |
Also update the PR body's "Summary" table metrics (accepted count, etc.) to reflect the new state. Use GitHub MCP to update the PR body.
git add .knowledge/changesets/ .knowledge/reports/
git commit -m "knowledge: curate batch YYYY-MM-DD — N rejected, M updated"
git push origin <branch>
If push fails (e.g., concurrent curate), try:
git pull --rebase origin <branch>
git push origin <branch>
Use GitHub MCP to post a comment on the PR:
## Curation Complete
| Action | Entry ID | Details |
|--------|----------|---------|
| Rejected | `entry-x` | Reason: ... |
| Updated | `entry-y` | Changed: claim |
| Kept | `entry-z` | No changes requested |
{If any UNRESOLVED:}
### Unresolved Feedback
The following comments could not be processed automatically:
- "{original comment text}" — Reason: ambiguous / entry not in batch / conflicting feedback
---
Changeset updated. Please review the updated diff.
Run `/curate` again after leaving additional feedback, or merge when satisfied.
If no actionable feedback was found:
## Curation Complete — No Changes
No actionable feedback found. All entries remain as-is.
To provide feedback, leave comments referencing specific entry IDs and run `/curate` again.
| Failure Mode | Behavior |
|---|---|
| Not a Report PR branch | Post comment explaining this, exit |
| PR is merged/closed | Post comment explaining this, exit |
| Changeset file not found | Post error comment, exit |
| No actionable feedback | Post "no changes" comment, exit |
| Single reject/update fails | Log error, continue with remaining actions, report failure in summary |
| All actions fail | Post summary with all failures, suggest manual intervention |
| git push fails after rebase | Post error comment, output manual instructions |
| GitHub MCP unavailable | Abort — cannot read comments or post summary without it |