Repository navigation
perf(pr-management): trim the family's skills without changing behaviour - #1390
Conversation
51475d1 to
327c0f6
Compare
Body tokens across the eight pr-management skills drop from 54,714 to 34,298 (-37.3%), all inside the 5,000-token body budget and the 500-line cap, with all always-on frontmatter budgets met. - Trim every skill's frontmatter under the 200-token always-on budget (7 of 8 skills were over). - Move sub-action-specific sections and individual sub-action golden rules into sibling files byte-for-byte and repoint their references, the same technique as the setup-family PRs (apache#1353): 16 new sibling files, no section left in two places. - Tighten remaining prose to SemBr one-sentence-per-line, keeping headings, golden-rule headlines, code blocks, tables and the generated pre-flight block byte-identical. - Fix one stale pointer per the apache#1353 precedent: pr-triage's moved Step 6b block in session-history.md anchored [Parameters] at the sibling itself. - Regenerate docs/mode-economics.md via skill-token-count --write. Verification: skill-token-count --check passes against the regenerated table; all 22 eval step-config.json extraction targets across the suites touching this family resolve to their exact heading in the exact file they point to; check-shared-blocks in sync across all 65 skills; check-duplication reports 0 pairs above the fail threshold; skill-evals pytest runs 174 tests with no new failures vs the untouched baseline; skill-and-tool-validate reports no findings in the touched plugin. Closes apache#1346. Part of apache#1342. Generated-by: GLM-5.3-Flash
- markdownlint: drop a double blank line in pr-triage SKILL.md, insert blank lines before thematic breaks that parsed as setext headings (quick-merge fetch-and-screen, stats classify/fetch/render), and promote the moved Step 6b section to h2 in session-history.md so heading levels increment. - Anchors: repoint six links whose SKILL.md targets moved into sibling files (pr-triage actions/classify-and-act/interaction-loop/ prerequisites, quick-merge present-and-handoff, and the projects/_template config), keeping every fragment slug identical. - docs/setup/marketplace.md: refresh the family's declared always-on tokens to ~0.8k after the frontmatter trim. - Regenerate docs/mode-economics.md and docs/vendor-neutrality.md. Verification: skill-token-count --check passes; check-shared-blocks in sync (65 skills); check-duplication 0 pairs above threshold; skill-evals pytest 174 tests with no new failures vs the untouched baseline; every eval step-config extraction target still resolves; all six repointed anchors verified against the headings now holding them. Generated-by: GLM-5.3-Flash
327c0f6 to
21ba99b
Compare
…on and catch-all trigger The trim dropped "in this session" from Golden rule 1, loosening the confirmation requirement, and the "any variation on proposing a first reviewer" catch-all from when_to_use, which routes paraphrased requests to the skill. Restore both. Re-stamp measured_tokens after rebasing onto the per-skill token stamps. Generated-by: Claude Opus 5
|
Rebased onto latest The only conflict was the generated token-count table in The workflows will need a fresh approval for the new head. Thanks! |
21ba99b to
e918ce7
Compare
potiuk
left a comment
There was a problem hiding this comment.
Thanks — this is a careful refactor. I rebased it onto current main (including #1394, which moves token counts into each skill's frontmatter) and pushed one fixup commit. Checks done:
- Moved, not changed — verified mechanically. Per skill, the multiset of words across all its files is unchanged except the declared SemBr tightening and repointed anchors. In
pr-triageI traced each safety rule individually: the real-CI guard (now inactions.md, with its row-14a / promotion-sweep coverage and agent-guard note), the prompt-injection examples, "never mutates without explicit confirmation", and the fetch-step "don't read bodies/diffs" rule all survived. - Fixup (e918ce7). Two wording changes in
reviewer-routingaltered behaviour, so I restored them: "in this session" in Golden rule 1 (confirmation must come from the current session), and the "find the best reviewer for this change" / "any variation on proposing a first reviewer" triggers inwhen_to_use. The skill stays inside its budgets (4,931 body tokens); the description's token table is updated accordingly. - Rebase. The
docs/mode-economics.mdconflict dissolved with #1394;measured_tokensis re-stamped for all eight skills. - Hooks / checks.
prek run --all-files: all 36 hooks pass;skill-token-count --checkpasses;surface_hashin sync. - Evals. All eight suites run against the rebased tree (275 cases,
claude -p, haiku grader): 261 passed on the first run. Every failure was re-run on both this branch andmain: each is either failing onmaintoo or flaky in both directions, exceptpr-management-triage/pre-filter/case-6-viewer-is-author, where the decision fields match on every run and only the free-textreasonnow mentions filter ordering — not a behaviour change. The grader flakiness itself is being addressed separately.
This review was drafted by an AI-assisted tool and confirmed by an Apache Magpie maintainer. The maintainer approving this PR has read the findings and signed off. If something feels off, please reply on the PR and a maintainer will follow up.
More on how Apache Magpie handles maintainer review: CONTRIBUTING.md.
…rect answers (#1398) Most eval flakiness was the grading, not the model: in 14 cases that flaked on #1390, the decision fields matched on every run and the failure came from the haiku grader rejecting a correct free-text explanation, or from a regex check on prose. - Grader rubric (single and batch): a candidate reaching the same conclusion is a match even when it adds correct detail, omits secondary detail, names the rule differently, or explains the decision without restating it (the decision is compared exactly in its own fields). Answer false only on a different or contradictory conclusion. A negative control of contradicting explanations still grades NO. - mentor tone-checks case-14: assert the quote contains "towncrier" (regex) instead of exact equality; case-10: drop has_author_tag_issue, whose regex cannot match a missing-tag violation and which rule/result already pin. - pr-stale-sweep step-7-recap: drop "note is absent" regex checks where the exact count is 0; a recap that says "Maintainer-court PRs: none" is correct but matched the regex. - reviewer-routing: output-spec now says signals_shown is false when no reviewer is proposed. Generated-by: Claude Opus 5
Pick up today's merges (apache#1390, apache#1391-apache#1394, apache#1398, apache#1399) in a fresh marketplace build. pyproject.toml, uv.lock and every generated plugin/marketplace manifest move from 0.9.0.dev202609251939. Generated-by: Claude Opus 5
Summary
Apply the setup-family optimization recipe (umbrella #1342) to the
pr-managementfamily (#1346).(7 of 8 skills were over).
rules into sibling files byte-for-byte, and repoint their references —
the same technique as perf(setup): trim the setup family skills without changing behaviour #1353 for the setup family. 16 new sibling
files; no section remains in two places.
headings, golden-rule headlines, code blocks, tables and the
generated pre-flight block byte-identical.
pr-triage's moved Step 6b block insession-history.mdanchored[Parameters]at the sibling itself.measured_tokensfrontmatter viaskill-token-count --write(per-skill stamps since fix(skill-token-count): stamp token counts into each SKILL.md instead of a shared table #1394, whichreplaced the shared table in
docs/mode-economics.md).Body tokens across the eight skills (cl100k_base, whole SKILL.md):
All eight skills are now inside the 5,000-token body budget and the
500-line cap; all always-on frontmatter budgets are met.
Maintainer note: counts re-stamped after rebasing onto #1394 and the
reviewer-routingfixup (restored "in this session" in Golden rule 1 andthe catch-all
when_to_usetrigger).Behaviour
step-config.jsonextraction targets across theeval suites touching this family resolve to their exact heading in
the exact file they point to after the edit.
surface_hashre-stamped withtools/dev/skill-surface-hash.py --fix(heading moves change thefingerprint; prose rewording does not).
check-shared-blocks.py: pre-flight blocks in sync across all 65skills.
check-duplication.py: 0 pairs above the fail threshold.move-not-copy checked by grep for each moved heading.
Test plan
skill-token-count --checkpasses against the re-stamped countstools/skill-evalspytest: 174 tests, no new failures vs. theuntouched baseline (13 environment-related failures on this
Windows machine — symlink/wsl artifacts — identical before and
after)
skill-and-tool-validate: no findings in the touched pluginCloses #1346. Part of #1342.