From freenet-freenet-agent-skills
Build decentralized applications on Freenet using river as a template. Guides through designing contracts (shared state), delegates (private state), and UI. Use when user wants to create a new Freenet dApp, design contract state, implement delegates, or build a Freenet-connected UI.
npx claudepluginhub freenet/freenet-agent-skills --plugin freenetThis skill uses the workspace's default tool permissions.
Build decentralized applications on Freenet following the architecture patterns established in River (decentralized chat).
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Build decentralized applications on Freenet following the architecture patterns established in River (decentralized chat).
Freenet is a platform for building decentralized applications that run without centralized servers. Apps rely on a global, peer-to-peer Key-Value Store where the "Keys" are cryptographic contracts.
The "Key" for any piece of data is the cryptographic hash of the WebAssembly (WASM) code that controls it.
Freenet solves "Eventual Consistency" using a specific mathematical requirement:
Commutative Monoid: The function that merges updates must be a commutative monoid.
Efficiency: Peers exchange Summaries (compact representations) and Deltas (patches/diffs) rather than re-downloading full state.
Follow these phases in order:
Start by defining what state needs to be shared across all users.
Key questions:
Implementation steps:
#[composable] macro from freenet-scaffoldComposableState trait for each componentContractInterface trait for the contractOptionalUpgrade pointer in state, keep serialization backwards-compatible, and maintain a legacy_contracts.toml migration registry. See contract-patterns.md "Contract WASM Upgrade & State Migration".Reference: references/contract-patterns.md
Determine what private data each user needs stored locally.
Key questions:
Implementation steps:
DelegateInterface traitExportSecrets handler from v1 -- when delegate WASM changes, the delegate key changes and all stored secrets become inaccessible. The old delegate must be able to hand over its secrets to the new version. See delegate-patterns.md for the authorized migration pattern.Reference: references/delegate-patterns.md
Build the user interface connecting to contracts and delegates.
Key questions:
Implementation steps:
Reference: references/ui-patterns.md
Set up the build system, CI, and deployment pipeline.
Implementation steps:
Makefile.toml with build tasks for contract, delegate, and UIpreflight task that runs fmt, clippy, tests, and migration checks before publishReference: references/build-system.md
my-dapp/
├── common/ # Shared types between contract/delegate/UI
│ └── src/
│ ├── lib.rs
│ └── state/ # State definitions
├── contracts/
│ └── my-contract/
│ ├── Cargo.toml
│ └── src/lib.rs # ContractInterface implementation
├── delegates/
│ └── my-delegate/
│ ├── Cargo.toml
│ └── src/lib.rs # DelegateInterface implementation
├── ui/
│ ├── Cargo.toml
│ ├── Dioxus.toml
│ └── src/
│ ├── main.rs
│ └── components/
├── Cargo.toml # Workspace root
└── Makefile.toml # cargo-make build tasks
River demonstrates all patterns:
contracts/room-contract/delegates/chat-delegate/ui/common/Track the versions River (the reference dApp) uses. Mismatched versions cause deserialization failures, missing features, and "variant index out of range" errors. Check River's workspace Cargo.toml before pinning.
As of April 2026 (River main):
# Workspace-wide (Cargo.toml)
freenet-stdlib = { version = "0.6.0", features = ["contract"] }
freenet-scaffold = "0.2.2"
freenet-scaffold-macro = "0.2.2"
# UI crate (ui/Cargo.toml): enables WebApi/WebSocket helpers
freenet-stdlib = { workspace = true, features = ["net"] }
# UI framework
dioxus = { version = "0.7.3", features = ["web"] }
The contract feature is required for contract and delegate crates targeting
wasm32-unknown-unknown. The net feature pulls in WebApi for the UI.
This skill is designed to be self-improving. When encountering issues while using this skill, agents should file GitHub issues or submit PRs to improve it.
File an issue at freenet/freenet-agent-skills when:
gh issue create --repo freenet/freenet-agent-skills \
--title "dapp-builder: <brief description>" \
--body "## Problem
<describe what was unclear or incorrect>
## Context
<what were you trying to accomplish>
## Suggested Improvement
<optional: how the skill could be improved>"
For concrete improvements:
# Clone and create branch
gh repo clone freenet/freenet-agent-skills
cd freenet-agent-skills
git checkout -b improve-<topic>
# Make changes to dapp-builder/SKILL.md or references/*.md
# ... edit files ...
# Submit PR
git add -A && git commit -m "dapp-builder: <description>"
gh pr create --title "dapp-builder: <description>" \
--body "## Changes
<describe improvements>
## Reason
<why this helps>"