rea-ci-tests-audit
MOmorluto/rea485k近 7 天新增 7,690 个 star
Improve an open-source GitHub skill and open a friendly suggestion PR upstream: fork, run skill-creator's retrofit, attach asm eval before/after metrics. Don't use for local-only skills, authoring from scratch, bulk repos, or registry publish.
You are contributing quality improvements to someone else's open-source skill. The workflow is: fork → clone → improve via skill-creator's retrofit loop → push to fork → open a friendly suggestion PR upstream. You do not own the target repo. Every step assumes you are a polite contributor, not a maintainer.
Before any modification to the cloned fork, pull the latest from the fork's tracked branch:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"
If tracked files are modified (git status --porcelain --untracked-files=no prints anything): git stash push without -u, sync, then git stash pop. Untracked files stay in place; other sessions may own them. If origin is missing or conflicts occur: stop and ask the user. A stale fork that PRs yesterday's tree is worse than no PR.
asm eval and the user wants the upstream author to benefitDo not trigger for: editing a local skill with no upstream, authoring a brand-new skill, publishing to the ASM registry, or bulk-improving many repos in one pass. One skill → one PR.
Verify each before cloning anything. Stop and tell the user if any fails.
asm on PATH (command -v asm)gh on PATH and authenticated (gh auth status)git on PATHThis skill invokes skill-creator, declared in frontmatter dependencies: Phase 2 runs its retrofit loop. Verify asm first:
command -v asm >/dev/null || {
echo "Missing installer: npm install -g agent-skill-manager" >&2
exit 1
}
asm deps discover skill-upstream-pr --json
Before Phase 0 — the fork is the first public action, and a miss found after it would leave a fork with nothing to propose — the main agent runs:
asm deps acquire skill-creator --session <caller-session-id> --json
<caller-session-id> is a unique id the main agent picks once per run, e.g. skill-upstream-pr-<epoch-seconds>; reuse it for the release. Set SKILL_CREATOR_DIR to the directory holding the returned skillMdPath. If the acquire fails, stop before Phase 0 and report its error.
The main agent releases the lease from its own finally/shutdown handling — after Phase 6, or at any earlier stop:
asm deps release --session <caller-session-id> --json
The user provides a GitHub reference to a skill. Accept any of:
https://github.com/owner/repohttps://github.com/owner/repo/tree/<branch>/<path/to/skill>github:owner/repo[#ref][:path]Normalize to owner, repo, optional ref, optional path. If path is not given and the repo has multiple SKILL.md files, ask the user which one.
Execute phases in order. Do not skip or reorder.
cd "$(mktemp -d)"
gh repo fork "$OWNER/$REPO" --clone --remote
cd "$REPO"
# If a ref was provided:
git checkout "$REF"
gh repo fork --clone --remote creates the fork under your account, clones it locally, sets origin to your fork and upstream to the original repo. Verify with git remote -v before continuing.
Create a dedicated branch for the improvement:
git checkout -b "skill-upstream-pr/improve-$(date +%Y%m%d-%H%M%S)"
If the user gave a path, use it. Otherwise:
find . -maxdepth 5 -name "SKILL.md" -type f
If more than one match and no path was given, list the candidates and ask the user to pick. Never guess — a wrong PR is worse than a delayed one.
Set SKILL_PATH to the directory containing the chosen SKILL.md (not the file itself) — asm eval takes a directory.
This skill does not reimplement the improvement loop, and it reads that loop only now, so the loop's references stay out of the context budget until Phase 2. Follow $SKILL_CREATOR_DIR/references/retrofit-loop.md (acquired in the Dependency Preflight) with $SKILL_PATH as the target:
.asm-improver/baseline.jsonasm eval --fix plus frontmatter normalization.asm-improver/report.mdIf the baseline already passes both gates, stop and tell the user — no PR needed for a skill that already meets the floor. Offer to find a different skill or a different target.
Read two files produced by the retrofit loop:
.asm-improver/baseline.json — the before snapshot.asm-improver/iter-N.json — the after snapshotExtract for both:
overallScore, gradecategories[] entry's name and scoretopSuggestions summary (for context, not quoted verbatim)Compute deltas. If the overall score did not improve by at least 3 points and no category moved from below 8 to at least 8, stop and tell the user — the change isn't meaningful enough to justify a PR. Offer the retrofit report as feedback they can share informally instead.
Read references/pr-template.md and fill it in; it defines the PR body's sections (What I suggested, the before/after table covering overallScore, grade, and every categories[] entry, Files touched — every modified path under $SKILL_PATH, How to verify locally, Why these changes, Notes) and enforces the friendly, suggestion-style tone. Report the iterations taken (N of 8 from the retrofit loop) under the metrics table.
Tone rules (read references/tone-guide.md):
Opening a PR on someone else's repo is public and hard to reverse. Before pushing anything, show the user:
The PR title
The full PR body (rendered markdown)
The exact change set. Stage it first, so the preview equals what Phase 6 commits:
git add -A
# SKILL.md.bak (written by asm eval --fix) never ships; unstage it but keep it
# on disk so the user can still restore from it during review
git rm --cached -q --ignore-unmatch "${SKILL_PATH:?}/SKILL.md.bak"
git status --short
git diff --cached upstream/<default-branch>
The commands you are about to run
Ask the user to confirm. If they want edits, apply them and re-preview. Do not push until the user says "go" or equivalent.
After approval:
# Commit the changes — $COMMIT_SUBJECT names what the retrofit actually changed
# (the same summary as the PR body's "What I suggested")
: "${COMMIT_SUBJECT:?set it to the one-line summary of what the retrofit changed}"
rm -f "${SKILL_PATH:?}/SKILL.md.bak" # approved; the restore copy is no longer needed
git add -A
git commit -m "$COMMIT_SUBJECT" \
-m "Suggested via skill-upstream-pr. See PR body for before/after metrics."
# Push to the fork
git push -u origin "$(git rev-parse --abbrev-ref HEAD)"
# Open the PR upstream
gh pr create \
--repo "$OWNER/$REPO" \
--title "$PR_TITLE" \
--body-file .asm-improver/pr-body.md
Never push to upstream. Never use --no-verify or other hook-skip flags. If gh pr create fails, stop and report — do not retry in a loop.
Print the PR URL returned by gh pr create so the user can open it.
Emit a compact status block after each phase:
◆ Phase N — [phase name] ([N of 6])
··································································
[check 1]: √ pass
[check 2]: √ pass (note if relevant)
[check 3]: × fail — [reason]
Criteria: √ M/K met
______________________________
Result: PASS | FAIL | PARTIAL
Checks per phase:
skill-creator acquired, Fork created, Clone succeeded, Branch created, Remotes correctSKILL.md located, Path unambiguousBaseline captured, Retrofit loop ran, Final score > 85, All categories >= 8Before/after delta >= 3 points OR category promotedPR body rendered, Tone checks passedUser approvedPush succeeded, PR opened, URL printed, Lease releasedEnd every run with a short report the user can read without scrolling back:
PR opened with its URL, stopped at Phase N (the skill already passes both gates (Gate 1 and 85/8), the improvement is too small, or the user declined the preview), or blocked at Phase N with the reason.overallScore and minimum category from baseline.json and the last iter-N.json, the files changed, and the fork branch.asm eval scores structure, not behavior: the improved skill was not run, and the maintainer has not reviewed it.gh repo fork --clone --remote — never a direct clone of upstream.asm-improver/references/pr-template.md with the full before/after tablegit push targets origin (the fork), never upstreamgh pr create --repo $OWNER/$REPO used — the PR targets the upstream repoWhen reviewing a run's output (by eval or by a human), also check that a reader can:
PR opened, stopped, or blocked.asm eval scores are distinct from the untested runtime behavior of the improved skill.baseline.json and the last iter-N.json; "PR opened" maps to the printed URL.An agent's own review cannot confirm human understanding. A reviewer who received no human feedback records understanding as unconfirmed.
$OWNER/$REPO$OWNER/$REPO with a before/after metrics table and friendly tone.asm-improver/ directory with baseline, iterations, report, and pr-body.mdgh repo fork --clone --remote reuses it; rebase on upstream's default branch before editingasm eval --fix writes changes you disagree with — restore SKILL.md from SKILL.md.bak (it stays on disk until Phase 6 deletes it after approval) and do targeted edits only; don't ship the auto-fix if it harms the skillskill-creator cannot be acquired — stop before Phase 0 and report the asm deps acquire error; nothing has been forked yetOptional and propose-only. After the run's result is delivered, run this check:
gh, the fork's remotes, or the upstream default branch differed from what this skill assumed, and a workaround worked.references/ (the directory holding this SKILL.md). Bump the patch number of metadata.version. If the skill is an installed copy or tracked in git, say so. Commit nothing unless the user asks.Off — the user opted out.references/pr-template.md — PR title + body template with before/after tablereferences/tone-guide.md — wording patterns for friendly, suggestion-style contributions$SKILL_CREATOR_DIR/references/retrofit-loop.md — the improvement loop this skill delegates to (acquired at run time)asm eval --help — flag reference for the evaluatorMOmorluto/rea485k近 7 天新增 7,690 个 star
MOmorluto/rea485k近 7 天新增 7,690 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star