skillpack-harvest
Original:🇺🇸 English
Translated
Lift a proven skill from a host repo (e.g. your OpenClaw fork) back into gbrain's bundle so other clients can scaffold it. Editorial workflow: the CLI does the file copy + privacy lint; this skill drives the judgment-heavy genericization (scrub real names, generalize triggers, lift fork-specific conventions to references).
4installs
Sourcegarrytan/gbrain
Added on
NPX Install
npx skill4agent add garrytan/gbrain skillpack-harvestTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →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 . Scaffold ships
skills downstream (gbrain → host). Harvest lifts proven patterns
upstream (host → gbrain) so they become references every other client
can scaffold.
gbrain skillpack scaffoldContract
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).
- previewed the file set.
gbrain skillpack harvest --dry-run - The real succeeded with
gbrain skillpack harvest <slug> --from <host>(no privacy-lint hits).status: harvested - passes on the new
bun test test/skills-conformance.test.ts.skills/<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:
- (and any sibling files like
skills/<harvested-slug>/SKILL.md)routing-eval.jsonl - Paired source files at their mirror paths (e.g.
) when the host SKILL.md declared them in frontmatter
src/commands/<slug>.tssources: - An updated with the new slug added to
openclaw.plugin.json(sorted)skills:
The session output to the user is a one-line success summary plus
a list of files written. JSON mode () returns the full
shape for machine consumption.
--jsonHarvestResultAnti-Patterns
- Skipping the dry-run. Always preview first. Files land in
gbrain's working tree; cleanup is a away, but you shouldn't need to.
git checkout - 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 without justification. The lint exists for a reason. If you bypass it, document why in the commit.
--no-lint - 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 the source after harvesting.
rm -rf - 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. Recentcases pass; the skill has been used in production at least a few times.
routing-eval.jsonl -
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. , not
~/git/wintermute.)~/git/wintermute/skills/foo - Should paired source files come along? (Check the host SKILL.md's
frontmatter array.)
sources:
Phase 2 — Dry-run + privacy-lint preview
Run the CLI with :
--dry-runbash
gbrain skillpack harvest <slug> --from <host-repo-root> --dry-runThe 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
files and apply this checklist. If anything matches, edit the host
file FIRST, then run harvest.
skills/<slug>/-
Fork-specific names → generic phrasing
- →
Wintermute(oryour OpenClaw)OpenClaw deployment - ,
Neuromancer,Zion→ same treatment<personal-fork-name> - Personal first names (,
garry, etc.) →jane/the user/ a generic placeholderyou
-
Real entities → placeholders
- Real people, companies, deals, funds → placeholder slugs
(,
alice-example,acme-example, etc.)fund-a - Email addresses → strip entirely OR use
example@example.com - Internal Slack channels → or strip
#some-channel - Specific tracker IDs / Linear ticket numbers → strip
- Real people, companies, deals, funds → placeholder slugs
(
-
Fork-specific conventions → references
- Mentions of files → either lift the doc into gbrain OR replace with a generic placeholder explanation
<host-repo>/docs/... - Mentions of → either decide to harvest that one too, or replace with a generic pattern reference
<host-repo>/skills/<other-fork-only-skill>
- Mentions of
-
Triggers array generalizes
- Read every entry in frontmatter . None should reference the user's name, fork name, or internal tools.
triggers: - "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 . Every
skills/<slug>/routing-eval.jsonlfield gets the same scrub asintent.triggers:
- 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:
bash
gbrain skillpack harvest <slug> --from <host-repo-root>Default behavior:
- Path-confinement + symlink rejection at file copy
- Privacy linter runs against (plus built-in defaults:
~/.gbrain/harvest-private-patterns.txt, email, Slack channels)\bWintermute\b - On any match → rollback (delete the harvested files) + exit non-zero
- updated to add the slug, sorted
openclaw.plugin.json
Outcomes:
- — success, manifest updated, files in gbrain's tree
harvested - — privacy linter caught something. Go back to Phase 3, scrub the host file, retry.
lint_failed - — gbrain already has a skill at that slug. Either use a different slug, or pass
slug_collisionif you really mean to replace.--overwrite-local
Phase 5 — Verify in gbrain
After a successful harvest:
- — confirms the new SKILL.md meets the frontmatter contract.
bun test test/skills-conformance.test.ts - — confirms no drift between bundle and gbrain's own checkout.
gbrain skillpack check --strict - — confirms the slug shows up in the bundle.
gbrain skillpack list - 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 under "Skills added" for the next release
CHANGELOG.md - Tag the user / contributor in the PR if the skill came from someone outside the core team
Bypass: --no-lint
--no-lintThe 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-lintbash
gbrain skillpack harvest <slug> --from <host-repo-root> --no-lintDocument 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 stays in place.
skills/<slug>/ - 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 (no batch harvest). One skill at a time keeps the editorial review tractable.
--all
Files this skill touches
- gbrain's — every file in the host skill dir (copy)
skills/<slug>/ - gbrain's mirror path for declared paired sources
(e.g. if the host SKILL.md declares it in frontmatter)
src/commands/<slug>.ts - gbrain's — adds the slug to
openclaw.plugin.jsonarray, sorted alphabeticallyskills: