qv-holepunch-dev
Skill697 starsChanged 18 days agoApache-2.0View on GitHub
Guides discovery and development with Holepunch ecosystem libraries. Use when working with P2P stack (Hypercore, Hyperswarm, Autobase, Hyperdb, Corestore), Bare runtime (bare-* modules like bare-fs), or Pear app framework (pear-* modules). Teaches on-the-fly API discovery via docs.pears.com and gh CLI.
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
When you need to learn about a Holepunch library, follow these steps in order.
- Very specific: line 111
When README is insufficient, read index.js or lib/ directly:
- Very specific: line 161
Autobase addWriter/removeWriter: Only callable from within apply(), not from regular code.
- Very specific: line 163
Autobase indexer key access: Use indexer.core.key, not indexer.key.
- Very specific: line 169
b4a over Buffer: Use b4a (buffer-to-anything) instead of Node.js Buffer for cross-runtime compatibility.
- Distinctive: line 176
If a section starts looking like a paraphrase of an upstream README or the docs.pears.com index, delete it.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Holepunch Development
Ecosystem navigator for Holepunch/Bare/Pear development. Teaches the agent to discover APIs on-the-fly rather than carrying static knowledge dumps.
Canonical Index: docs.pears.com
https://docs.pears.com is the curated, always-current index for the entire ecosystem. Prefer it over any static list in this skill. Relevant anchors:
#p2p-modules— Building-block libraries (hypercore, hyperbee, hyperdrive, autobase, hyperdht, hyperswarm) and helpers (corestore, localdrive, mirror-drive, secret-stream, compact-encoding, protomux).#bare-modules— Allbare-*runtime modules with stability indicators and platform support. Most are Node.js standard-library equivalents (bare-fs≈fs,bare-crypto≈crypto,bare-tcp≈net,bare-subprocess≈child_process). Node.js-compat shims live inbare-node.#pear-modules—pear-*modules grouped by role (Application, UI, Common, Developer, Integration). Largest surface:pear-electron(100+ methods for desktop UI — fetch its README). Lifecycle commands:pear init/run/stage/seed/release.
P2P Stack by Purpose
docs.pears.com groups P2P libraries as "building-block vs helper". This table groups by purpose and includes libraries used widely across Holepunch-based applications (Keet, PearPass/autopass, QVAC registry-server, WDK, etc.) that are not on the docs.pears.com index page:
| Layer | Libraries |
| Networking | hyperswarm, hyperdht |
| Core Data | hypercore, corestore |
| KV Database | hyperbee |
| Schema DB | hyperdb, hyperschema, hyperdispatch |
| Files | hyperdrive, localdrive, mirror-drive |
| Multi-writer | autobase |
| Pairing | blind-pairing, blind-peering |
| Connection | protomux, protomux-rpc, @hyperswarm/secret-stream |
| Encoding | compact-encoding, b4a |
| Utilities | ready-resource, safety-catch, protomux-wakeup |
Repo-name anomaly: @hyperswarm/secret-stream ships from the holepunchto/hyperswarm-secret-stream repo.
Discovery Playbook
When you need to learn about a Holepunch library, follow these steps in order. Do not stop at the first source if the API surface is still unclear.
Step 1: docs.pears.com
Navigation hub and canonical module index. How-to guides contain working executable examples.
- Module index: https://docs.pears.com/ (see anchors above)
- Building blocks overview: https://docs.pears.com/index.html#building-blocks
- How-tos (real code):
- https://docs.pears.com/howto/connect-two-peers-by-key-with-hyperdht.html
- https://docs.pears.com/howto/connect-to-many-peers-by-topic-with-hyperswarm.html
- https://docs.pears.com/howto/replicate-and-persist-with-hypercore.html
- https://docs.pears.com/howto/work-with-many-hypercores-using-corestore.html
- https://docs.pears.com/howto/share-append-only-databases-with-hyperbee.html
- https://docs.pears.com/howto/create-a-full-peer-to-peer-filesystem-with-hyperdrive.html
Step 2: GitHub README
Primary API documentation lives in README files:
gh api repos/holepunchto/{repo}/readme --jq .content | base64 -dStep 3: Test files
Holepunch repos have excellent tests that show real usage patterns:
gh api repos/holepunchto/{repo}/contents/test
# Then fetch specific test files for usage examplesStep 4: Example repos
For higher-level integration patterns:
gh api repos/holepunchto/examples/contentsStep 5: Workshop repos
Guided tutorials for specific topics (HyperDB, Autobase multi-writer, Pear apps):
gh api "search/repositories?q=org:holepunchto+workshop+in:name" --jq '.items[] | "\(.full_name) - \(.description)"'Known workshops: pear-workshop, hyperdb-workshop, hyperdb-autobase-workshop.
Step 6: Dependency traversal
Holepunch dependency trees are deep. When a library references another holepunch library, follow the chain:
gh api repos/holepunchto/{repo}/contents/package.json --jq .content | base64 -d \
| jq '.dependencies // {} | keys[] | select(test("hyper|autobase|corestore|protomux|blind-|compact-encoding|b4a|ready-resource|safety-catch"))'Recursively fetch READMEs/tests for any holepunch dependency relevant to the current task. Do not stop at the first library; trace the dependency graph until the needed API surface is understood.
Step 7: Keet repos (optional, requires access)
For bleeding-edge patterns not yet in dedicated libraries. These repos may be private; skip gracefully on 404:
gh api "search/repositories?q=org:holepunchto+keet+in:name" --jq '.items[].full_name'Step 8: Source code
When README is insufficient, read index.js or lib/ directly:
gh api repos/holepunchto/{repo}/contents/index.js --jq .content | base64 -d
gh api repos/holepunchto/{repo}/contents/lib --jq '.[].name'Composition Patterns
P2P KV Database (simplest)
Corestore + Hyperswarm + Hyperbee:
const store = new Corestore(storage)
const core = store.get({ name: 'my-db' })
const db = new Hyperbee(core, { keyEncoding: 'utf-8', valueEncoding: 'utf-8' })
await store.ready()
const swarm = new Hyperswarm()
swarm.on('connection', conn => store.replicate(conn))
swarm.join(core.discoveryKey)P2P Multi-writer DB
Corestore + Hyperswarm + Autobase + HyperDB + Hyperschema + Hyperdispatch. Full schema pipeline: define schema in Hyperschema, build collections with HyperDB builder, define routes in Hyperdispatch. Autobase open() returns HyperDB.bee instance; apply() dispatches operations via router; call view.flush() after batch.
P2P File Sharing
Corestore + Hyperswarm + Hyperdrive:
const store = new Corestore(storage)
const drive = new Hyperdrive(store)
await drive.ready()
const swarm = new Hyperswarm()
swarm.on('connection', conn => drive.replicate(conn))
swarm.join(drive.discoveryKey)Verified Gotchas
Policy: Only document verified facts. Each gotcha below is observed in real Holepunch-based production systems and re-verifiable via the Discovery Playbook (upstream README, tests, and source). Do not invent or speculate. Add new gotchas only when encountered and verified in practice.
- Protomux/RPC registration order: Register RPC handler BEFORE
store.replicate(conn).store.replicate()creates a Protomux and immediately processes buffered stream data. If the remote's "open session" message arrives before the protocol handler is registered, Protomux rejects the session → CHANNEL_CLOSED error. - Corestore storage locking: RocksDB acquires an exclusive lock per directory. Each writer needs its own storage path.
- Autobase addWriter/removeWriter: Only callable from within
apply(), not from regular code. Append an operation and handle it in apply. - Autobase indexer key access: Use
indexer.core.key, notindexer.key. An indexer is a writer that also materializes the view. - ReadyResource pattern: Extend
ready-resourcefor classes managing resources or state. Implement_open()for initialization and_close()for cleanup. - Schema build pipeline order: Hyperschema first, then HyperDB builder, then Hyperdispatch. All reference the
./spec/directory. Regenerate after schema changes. - b4a over Buffer: Use
b4a(buffer-to-anything) instead of Node.js Buffer for cross-runtime compatibility.
Scope Boundaries
- Static content in this skill is limited to non-fetchable knowledge: the QVAC-oriented P2P taxonomy (extends docs.pears.com with libraries QVAC uses), repo-name anomalies, composition patterns across multiple libraries, and verified production gotchas. Anything discoverable via docs.pears.com or a single
gh apiREADME fetch does not belong here. - Project-specific gotchas belong in a project-scoped skill (for example,
.agents/skills/qv-registry-autobase-patterns/) or the nearest scopedAGENTS.md, not in this skill. - This skill covers ecosystem-level knowledge and discovery strategy only.
- If a section starts looking like a paraphrase of an upstream README or the docs.pears.com index, delete it.
In this repository56 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/agent-integrations.mdcCursor rule
- .cursor/rules/cpp/string-api-conventions.mdcCursor rule
- .cursor/rules/devops/main.mdcCursor rule
- .cursor/rules/no-remote-code-execution.mdcCursor rule
- .cursor/rules/qip-triage.mdcCursor rule
- .cursor/rules/sdk/commit-and-pr-format.mdcCursor rule
- .cursor/rules/sdk/error-handling.mdcCursor rule
- .cursor/rules/sdk/first-class-product-parity.mdcCursor rule
- .cursor/rules/sdk/main.mdcCursor rule
- .cursor/rules/sdk/public-constants-contract.mdcCursor rule
- .cursor/rules/sdk/request-lifecycle-primitives.mdcCursor rule
- .cursor/rules/sdk/sdk-pod-packages.mdcCursor rule
- .cursor/rules/sdk/skill-authoring-guidelines.mdcCursor rule
- cpp-string-api-reviewSkill
- qv-addon-changelogSkill
- qv-addon-pr-createSkill
- qv-addon-release-notesSkill
- qv-agent-stack-syncSkill
- qv-asana-syncSkill
- qv-daily-work-updateSkill
- qv-dev-diary-setupSkill
- qv-dev-diarySkill
- qv-devops-daily-updateSkill
- qv-devops-pr-createSkill
- qv-devops-pr-reviewSkill
- qv-devops-pr-statusSkill
- qv-devops-runner-queueSkill
- qv-devops-why-my-pr-notSkill
- qv-docs-solution-createSkill
- qv-docs-updateSkill
- qv-merge-guard-wireSkill
- qv-mobile-test-dispatchSkill
- qv-notice-generateSkill
- qv-pr-mineSkill
- qv-pr-reviewSkill
- qv-pr-testSkill
- qv-qip-createSkill
- qv-qip-reviewSkill
- qv-qip-triageSkill
- qv-quality-reportingSkill
- qv-registry-autobase-patternsSkill
- qv-release-trainSkill
- qv-sdk-backmergeSkill
- qv-sdk-changelogSkill
- qv-sdk-e2e-createSkill
- qv-sdk-inference-versionSkill
- qv-sdk-pr-createSkill
- qv-sdk-pr-statusSkill
- qv-sdk-update-modelsSkill
- qv-skill-listSkill
- setupSkill
- setupSkill
- qv-nx-ciSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

