using-git-worktrees
OBobra/superpowers298k近 7 天新增 2,631 个 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 the working tree is dirty: stash, sync, pop. 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 PATHThe 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. Follow skills/skill-creator/references/retrofit-loop.md 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[].score (7 categories)topSuggestions summary (for context, not quoted verbatim)Compute deltas. If the overall score did not improve by at least 3 points or 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. The template enforces friendly, suggestion-style tone. Key sections:
$SKILL_PATHasm eval command the maintainer can run locallyTone 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:
git diff upstream/<default-branch>)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
git add -A
git commit -m "$(cat <<'EOF'
improve SKILL.md: clarify triggers, add acceptance criteria, fix frontmatter
Suggested via skill-upstream-pr. See PR body for before/after metrics.
EOF
)"
# 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:
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 printedgh 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 repo$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 — revert SKILL.md.bak and do targeted edits only; don't ship the auto-fix if it harms the skillreferences/pr-template.md — PR title + body template with before/after tablereferences/tone-guide.md — wording patterns for friendly, suggestion-style contributionsskills/skill-creator/references/retrofit-loop.md — the improvement loop this skill delegates toasm eval --help — flag reference for the evaluatorOBobra/superpowers298k近 7 天新增 2,631 个 star
OBobra/superpowers298k近 7 天新增 2,631 个 star
OBobra/superpowers298k近 7 天新增 2,631 个 star
MAmattpocock/skills288k近 7 天新增 10,178 个 star
MAmattpocock/skills288k近 7 天新增 10,178 个 star
MAmattpocock/skills288k近 7 天新增 10,178 个 star