Agent同步
- 作者仓库星标 282
- 许可证 MIT
- 作者更新于 实时读取
- 作者仓库 asm
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 94 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @luongnv89 · MIT
- Token 消耗评级
- 中等消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skill-upstream-pr
description: Improve an open-source GitHub skill and open a friendly suggestion PR upstream: fork, run skill-…
category: 工程开发
runtime: 无特殊运行时
---
# skill-upstream-pr 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Repo Sync Before Edits (mandatory) / When to Use / Prerequisites”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Repo Sync Before Edits (mandatory) / When to Use / Prerequisites”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Repo Sync Before Edits (mandatory) / When to Use / Prerequisites”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skill-upstream-pr
description: Improve an open-source GitHub skill and open a friendly suggestion PR upstream: fork, run skill-…
category: 工程开发
source: luongnv89/asm
---
# skill-upstream-pr
## 什么时候使用
- 把工程方向的常用动作沉淀成 Agent 可调用的技能 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Repo Sync Before Edits (mandatory) / When to Use / Prerequisites」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skill-upstream-pr" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Repo Sync Before Edits (mandatory) / When to Use / Prerequisites
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Skill Upstream PR
You are contributing quality improvements to someone else's open-source skill. The workflow is: fork → clone → improve via skill-auto-improver → 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.
Repo Sync Before Edits (mandatory)
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.
When to Use
- User shares a GitHub URL to a public skill repo and asks to "improve", "level up", or "contribute to" it
- User says "open a PR to this skill" or "suggest improvements upstream"
- The target skill scores below 85/8 on
asm evaland the user wants the upstream author to benefit
Do 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.
Prerequisites
Verify each before cloning anything. Stop and tell the user if any fails.
asmon PATH (command -v asm)ghon PATH and authenticated (gh auth status)giton PATH- Network access to GitHub
- Write access to your own GitHub account (for the fork)
Input
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.
Workflow
Execute phases in order. Do not skip or reorder.
Phase 0 — Fork and clone
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)"
Phase 1 — Locate the target SKILL.md
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.
Phase 2 — Delegate to skill-auto-improver
This skill does not reimplement the improvement loop. Follow the workflow in skills/skill-auto-improver/SKILL.md with $SKILL_PATH as the target:
- Phase 0 of that skill: capture
.asm-improver/baseline.json - Phase 1:
asm eval --fix - Phases 2-4: category-by-category loop with the 85/8 floor
- Phase 5:
.asm-improver/report.md
If the baseline already passes 85/8, 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.
Phase 3 — Harvest metrics for the PR
Read two files produced by the auto-improver:
.asm-improver/baseline.json— the before snapshot- The latest
.asm-improver/iter-N.json— the after snapshot
Extract for both:
overallScore,grade- Every
categories[].score(7 categories) topSuggestionssummary (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 auto-improver report as feedback they can share informally instead.
Phase 4 — Build the PR body
Read references/pr-template.md and fill it in. The template enforces friendly, suggestion-style tone. Key sections:
- What changed — one-sentence summary
- Before/after metrics — table with overallScore, grade, and all 7 categories
- Files touched — list every modified path under
$SKILL_PATH - Iterations taken — N of 8 from the auto-improver loop
- How to verify — the
asm evalcommand the maintainer can run locally
Tone rules (read references/tone-guide.md):
- Lead with "Hi — noticed X, wanted to share Y"
- Frame as a suggestion, not a fix: "happy to adjust if the direction doesn't fit"
- Never imply the maintainer did something wrong
- Thank them for open-sourcing the skill
- Close with "no obligation to merge — totally fine to close if this isn't the right direction"
Phase 5 — Last-mile confirmation (mandatory)
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 diff (
git diff 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.
Phase 6 — Push and open the PR
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.
Step Completion Reports (mandatory)
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:
- Phase 0 —
Fork created,Clone succeeded,Branch created,Remotes correct - Phase 1 —
SKILL.md located,Path unambiguous - Phase 2 —
Baseline captured,Auto-improver ran,Final score >= 85,All categories >= 8 - Phase 3 —
Before/after delta >= 3 points OR category promoted - Phase 4 —
PR body rendered,Tone checks passed - Phase 5 —
User approved - Phase 6 —
Push succeeded,PR opened,URL printed
Acceptance Criteria
- Fork + clone done via
gh repo fork --clone --remote— never a direct clone of upstream - Dedicated feature branch created before any edits
skill-auto-improverworkflow run on the target; baseline + final JSON captured under.asm-improver/- Overall score improved by ≥ 3 points, OR at least one category moved from below 8 to ≥ 8
- PR body built from
references/pr-template.mdwith the full before/after table - User explicitly approved the PR preview before push
git pushtargetsorigin(the fork), neverupstreamgh pr create --repo $OWNER/$REPOused — the PR targets the upstream repo- PR URL printed to the user at the end
Expected output
- A new branch on the user's fork of
$OWNER/$REPO - A public PR on
$OWNER/$REPOwith a before/after metrics table and friendly tone - A local
.asm-improver/directory with baseline, iterations, report, andpr-body.md
Edge Cases
- Skill already passes 85/8 — stop at Phase 2; do not open a PR for a skill that already meets the floor
- Improvement too small (< 3 point overall delta AND no category promoted) — stop at Phase 3; offer the auto-improver report as informal feedback instead
- Multiple SKILL.md files in the repo — ask the user which one; never batch
- Fork already exists from a prior run —
gh repo fork --clone --remotereuses it; rebase on upstream's default branch before editing - Upstream force-pushed or rewrote history — stop and ask the user; do not force-push the fork to "catch up"
asm eval --fixwrites changes you disagree with — revertSKILL.md.bakand do targeted edits only; don't ship the auto-fix if it harms the skill- Maintainer has a CONTRIBUTING.md or PR template — read it before Phase 4 and align the PR body with their conventions; their template wins over ours
References
references/pr-template.md— PR title + body template with before/after tablereferences/tone-guide.md— wording patterns for friendly, suggestion-style contributionsskills/skill-auto-improver/SKILL.md— the improvement loop this skill delegates toasm eval --help— flag reference for the evaluator
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核