ワンクリックで
build-app
Scaffold a Swarm app or add bee-js to an existing project, with core upload/download patterns and node-compatibility guidance.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Scaffold a Swarm app or add bee-js to an existing project, with core upload/download patterns and node-compatibility guidance.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Guide to Swarm ACT encryption and access control: create grantees, upload protected data, grant/revoke access, and troubleshoot not-found/history issues.
Build and publish a Swarm blog with a permanent feed-manifest URL, post management workflow, and optional ENS domain mapping.
Answer Swarm conceptual questions from official docs with source links; use for APIs, behavior, configuration, and architecture clarifications.
Create and manage Swarm feeds for stable, updateable URLs using bee-js or swarm-cli, including manifest creation and feed updates.
Deploy and update static websites on Swarm via one-off or feed-based publishing, with optional ENS integration and stamp lifecycle notes.
Show all Swarm skills, check node status, and route developers to setup, storage, website, app, security, messaging, or troubleshooting flows.
| name | build-app |
| description | Scaffold a Swarm app or add bee-js to an existing project, with core upload/download patterns and node-compatibility guidance. |
| user-invocable | true |
Guide a developer through scaffolding and building an app that uses Swarm for decentralized storage.
When presenting to the user, use consistent labels before each code block:
filename: — file contents the user should write to diskAdd a --- horizontal rule before each labeled code block to visually separate it from surrounding text.
Silently check node status (curl -s http://localhost:1633/node). If the node is down, offer to walk through /setup-bee-interactive (a node is required to test uploads, though scaffolding can proceed without one).
Also check for an existing project (test -f package.json on Linux/macOS/WSL, or Test-Path package.json in PowerShell):
package.json exists: Default to adding bee-js. Ask: "I see you already have a project here. Want me to add bee-js to it, or scaffold a separate Swarm project?"Scaffolds a working project with bee-js wired up, ready to hack.
npm init swarm-app@latest my-app <type>
cd my-app
npm install
npm start
| Type | What you get |
|---|---|
node | Node.js + CommonJS |
node-esm | Node.js + ES Modules |
node-ts | Node.js + TypeScript |
vite-tsx | React + Vite + TypeScript (browser app) |
npm init swarm-app@latest my-app node-ts --host http://localhost:1633 --auth <API_KEY>
--host <url> — Bee node URL (default: http://localhost:1633)--auth <key> — Bee node API key (if required)config.ts (or config.js) with the Bee host URLimport { Bee, Size, Duration } from '@ethersphere/bee-js'
import { BEE_HOST } from './config'
const bee = new Bee(BEE_HOST)
// Auto-find usable stamp or buy a new one
const batches = await bee.getPostageBatches()
const usable = batches.find(x => x.usable)
const batchId = usable ? usable.batchID : await bee.buyStorage(Size.fromGigabytes(1), Duration.fromDays(1))
// Upload
const uploadResult = await bee.uploadData(batchId, 'Hello, world!')
console.log('Swarm hash', uploadResult.reference.toHex())
// Download
const downloadResult = await bee.downloadData(uploadResult.reference)
console.log('Downloaded:', downloadResult.toUtf8())
npm install @ethersphere/bee-js
import { Bee } from '@ethersphere/bee-js'
const bee = new Bee('http://localhost:1633')
// Check connection
const connected = await bee.isConnected()
console.log('Connected:', connected)
Upload data:
const { reference } = await bee.uploadData(batchId, 'my data')
Upload file (Node.js):
import { readFile } from 'node:fs/promises'
const data = await readFile('./photo.png')
const { reference } = await bee.uploadFile(batchId, data, 'photo.png', {
contentType: 'image/png'
})
Upload file (Browser):
const { reference } = await bee.uploadFile(batchId, file) // File object from input
Download:
const file = await bee.downloadFile(reference)
console.log(file.data.toUtf8())
Auto-find or buy a stamp:
import { Bee, Size, Duration } from '@ethersphere/bee-js'
const bee = new Bee('http://localhost:1633')
const batches = await bee.getPostageBatches()
const usable = batches.find(x => x.usable)
const batchId = usable ? usable.batchID : await bee.buyStorage(Size.fromGigabytes(1), Duration.fromDays(1))
Not all features work on all node types:
| Feature | Ultra-light | Light | Full |
|---|---|---|---|
| Download data | Yes | Yes | Yes |
| Upload data | No | Yes | Yes |
| Feeds | No | Yes | Yes |
| Buy stamps | No | Yes | Yes |
| ACT (access control) | No | Yes | Yes |
| PSS send | No | Yes | Yes |
| PSS subscribe | No | No | Yes |
| Staking | No | No | Yes |
Once the app is running, the developer can add:
/upload-download/feed/host-website/act/messagingFor any conceptual or technical question not covered by the steps above, invoke /docs to find the relevant authoritative source rather than answering from prior knowledge.