测试抓取
- 作者仓库星标 18,413
- 作者更新于 实时读取
- 作者仓库 gbrain
- 领域
- 通用
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 92 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @garrytan · v0.33.0 · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skillpack-harvest
description: | This skill is the inverse of gbrain skillpack scaffold. Scaffold ships skills downstream (gbra…
category: 通用
runtime: 无特殊运行时
---
# skillpack-harvest 输出预览
## PART A: 任务判断
- 适用问题:通用任务拆解、检查和交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Contract / Output Format / Anti-Patterns”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于通用任务拆解、检查和交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Contract / Output Format / Anti-Patterns”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Contract / Output Format / Anti-Patterns”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skillpack-harvest
description: | This skill is the inverse of gbrain skillpack scaffold. Scaffold ships skills downstream (gbra…
category: 通用
source: garrytan/gbrain
---
# skillpack-harvest
## 什么时候使用
- 把通用方向的常用动作沉淀成 Agent 可调用的技能 适合处理通用任务拆解、检查、交付和复盘,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需要额外…
- 面向通用任务拆解、检查和交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Contract / Output Format / Anti-Patterns」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skillpack-harvest" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Contract / Output Format / Anti-Patterns
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} skillpack-harvest — Editorial workflow for lifting host skills into gbrain
Convention: see _brain-filing-rules.md for file placement rules. This skill writes into gbrain's own tree, not the brain repo's notes.
This skill is the inverse of gbrain skillpack scaffold. Scaffold ships
skills downstream (gbrain → host). Harvest lifts proven patterns
upstream (host → gbrain) so they become references every other client
can scaffold.
Contract
A harvest is "properly done" when:
- The host skill is mature (used in production, recent routing-eval cases pass).
- The editorial genericization in Phase 3 has scrubbed every fork-specific reference (names, real entities, internal channels).
gbrain skillpack harvest --dry-runpreviewed the file set.- The real
gbrain skillpack harvest <slug> --from <host>succeeded withstatus: harvested(no privacy-lint hits). bun test test/skills-conformance.test.tspasses on the newskills/<slug>/SKILL.md.- The user has reviewed the diff in gbrain and explicitly approved the commit.
If any of these is incomplete, the skill is NOT yet harvested — the files may sit in gbrain's working tree, but they're not landed.
Output Format
This skill produces three artifacts in gbrain's working tree:
skills/<harvested-slug>/SKILL.md(and any sibling files likerouting-eval.jsonl)- Paired source files at their mirror paths (e.g.
src/commands/<slug>.ts) when the host SKILL.md declared them in frontmattersources: - An updated
openclaw.plugin.jsonwith the new slug added toskills:(sorted)
The session output to the user is a one-line success summary plus
a list of files written. JSON mode (--json) returns the full
HarvestResult shape for machine consumption.
Anti-Patterns
- Skipping the dry-run. Always preview first. Files land in
gbrain's working tree; cleanup is a
git checkoutaway, but you shouldn't need to. - Trusting the linter alone. The default regex set catches the common cases. It doesn't catch every proper noun. Phase 3 (the editorial pass) is the primary defense.
- Harvesting
--no-lintwithout justification. The lint exists for a reason. If you bypass it, document why in the commit. - Harvesting a skill that's still in flux. Wait until the host version stabilizes. Otherwise you'll harvest, then re-harvest, then re-harvest, and that churns gbrain's bundle for no benefit.
- Moving files instead of copying. Harvest is a copy. The host
retains its skill. Don't
rm -rfthe source after harvesting. - Harvesting batch (multiple skills at once). Not supported, and for good reason — the editorial review per skill is real work.
When to invoke
- The user developed a skill in their host fork (Wintermute, Neuromancer, Zion, etc.) and wants other gbrain clients to be able to use it
- A skill has proven itself in production and is ready to generalize
- The user explicitly asks to "harvest" or "publish" a skill upstream
Do NOT invoke when:
- The skill is still in flux locally — let it stabilize first
- The skill references private content that can't be generalized
- The user just wants to share a one-off draft (use a gist instead)
Preconditions
Before running this skill, confirm:
The skill is mature. Recent
routing-eval.jsonlcases pass; the skill has been used in production at least a few times.The skill is generalizable. Strip-test in your head: replace every fork-specific name. Does it still make sense as a skill?
The user owns the gbrain checkout. The harvest writes into gbrain's working tree. They'll review and commit. Don't harvest into a checkout the user doesn't intend to commit from.
Workflow
Phase 1 — Plan
Ask the user:
- What slug should the harvested skill have? (Slugs must be kebab-case, globally unique in the gbrain bundle.)
- Which host repo is the source? (Path to repo root, not to the skill
directory — e.g.
~/git/wintermute, not~/git/wintermute/skills/foo.) - Should paired source files come along? (Check the host SKILL.md's
frontmatter
sources:array.)
Phase 2 — Dry-run + privacy-lint preview
Run the CLI with --dry-run:
gbrain skillpack harvest <slug> --from <host-repo-root> --dry-run
The output shows:
- Which files would land in gbrain's tree
- Whether paired sources are included
- (Implicit) The skill's frontmatter triggers — read them and check they generalize
Do not skip the dry-run. The privacy linter only runs on a real harvest, but the dry-run preview lets you see the files before they land. Spot-check the SKILL.md and any paired source for things the linter might miss (proper nouns, internal project names, etc.).
Phase 3 — Genericization checklist (the editorial pass)
Before running the real harvest, walk the host's skills/<slug>/
files and apply this checklist. If anything matches, edit the host
file FIRST, then run harvest.
Fork-specific names → generic phrasing
Wintermute→your OpenClaw(orOpenClaw deployment)Neuromancer,Zion,<personal-fork-name>→ same treatment- Personal first names (
garry,jane, etc.) →the user/you/ a generic placeholder
Real entities → placeholders
- Real people, companies, deals, funds → placeholder slugs
(
alice-example,acme-example,fund-a, etc.) - Email addresses → strip entirely OR use
example@example.com - Internal Slack channels →
#some-channelor strip - Specific tracker IDs / Linear ticket numbers → strip
- Real people, companies, deals, funds → placeholder slugs
(
Fork-specific conventions → references
- Mentions of
<host-repo>/docs/...files → either lift the doc into gbrain OR replace with a generic placeholder explanation - Mentions of
<host-repo>/skills/<other-fork-only-skill>→ either decide to harvest that one too, or replace with a generic pattern reference
- Mentions of
Triggers array generalizes
- Read every entry in frontmatter
triggers:. None should reference the user's name, fork name, or internal tools. - "Have garry sign off on it" → "have the user sign off on it"
- Read every entry in frontmatter
routing-eval.jsonl examples are scrubbed
- Open
skills/<slug>/routing-eval.jsonl. Everyintentfield gets the same scrub astriggers:.
- Open
Code comments + log strings
- If a paired source is going to be harvested, walk it for the same private-pattern leaks. Comments are the most common hiding spot.
Phase 4 — Real harvest
Once Phase 3 is complete, run the real harvest:
gbrain skillpack harvest <slug> --from <host-repo-root>
Default behavior:
- Path-confinement + symlink rejection at file copy
- Privacy linter runs against
~/.gbrain/harvest-private-patterns.txt(plus built-in defaults:\bWintermute\b, email, Slack channels) - On any match → rollback (delete the harvested files) + exit non-zero
openclaw.plugin.jsonupdated to add the slug, sorted
Outcomes:
harvested— success, manifest updated, files in gbrain's treelint_failed— privacy linter caught something. Go back to Phase 3, scrub the host file, retry.slug_collision— gbrain already has a skill at that slug. Either use a different slug, or pass--overwrite-localif you really mean to replace.
Phase 5 — Verify in gbrain
After a successful harvest:
bun test test/skills-conformance.test.ts— confirms the new SKILL.md meets the frontmatter contract.gbrain skillpack check --strict— confirms no drift between bundle and gbrain's own checkout.gbrain skillpack list— confirms the slug shows up in the bundle.- Review the diff:
cd <gbrainRoot> && git diff -- skills/<slug>/ - Commit the additions in gbrain (do NOT commit any leftover files in the host repo — harvest is a copy, not a move).
Phase 6 — Downstream announcement (optional)
If other gbrain clients should pick up the new skill:
- Note it in
CHANGELOG.mdunder "Skills added" for the next release - Tag the user / contributor in the PR if the skill came from someone outside the core team
Bypass: --no-lint
The privacy linter is the safety net. The editorial pass is the
primary defense. If you've completed Phase 3 thoroughly and the
linter is still firing on a false positive, use --no-lint:
gbrain skillpack harvest <slug> --from <host-repo-root> --no-lint
Document the bypass in the commit message. Future maintainers should be able to see WHY the lint was bypassed (e.g. "Wintermute appears in a citation, not a real reference — verified manually").
Never bypass the linter on a casual basis. The whole point of the default-on lint is that real names occasionally slip through the editorial pass.
What harvest does NOT do
- It does NOT move files (it copies). The host's
skills/<slug>/stays in place. - It does NOT auto-scrub names. The editorial pass is human-driven.
- It does NOT publish to npm or a remote bundle. It writes to gbrain's working tree; the user commits + ships via the normal gbrain release process.
- It does NOT support
--all(no batch harvest). One skill at a time keeps the editorial review tractable.
Files this skill touches
- gbrain's
skills/<slug>/— every file in the host skill dir (copy) - gbrain's mirror path for declared paired sources
(e.g.
src/commands/<slug>.tsif the host SKILL.md declares it in frontmatter) - gbrain's
openclaw.plugin.json— adds the slug toskills:array, sorted alphabetically
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核