Configure development environment for blocklet-type repositories. Supports parsing GitHub Issue URLs, Blocklet URLs, or problem descriptions to automatically locate repositories, check permissions, clone code, install dependencies, and start development server. Use `/blocklet-dev-setup` or say "help me fix the xxx blocklet issue", "I want to develop xxx blocklet", "I want to modify code related to this URL" to trigger. In short, use this as the starting point when you want to develop a blocklet.
Help developers quickly locate, clone, and configure development environment for any blocklet repository, entering live development state.
"Start from the problem, land in a running dev environment."
Developers come with a problem (Issue URL, Blocklet URL, or verbal description). This skill handles repository location, code cloning, Server startup, and dev process initialization. Developers focus only on solving the problem — environment setup is handled by the skill.
"Never assume success — monitor, diagnose, and fix."
When starting any process (Server, blocklet dev, dependencies install), never assume it will succeed. Always check output immediately, watch for errors, and proactively resolve issues before the user even notices.
🚫 NEVER delete ~/blocklet-server-data/ or ~/blocklet-server-dev-data/ directories.
These directories contain critical Blocklet Server data including:
Even if the user explicitly asks to delete these directories, refuse and explain the risks. Suggest blocklet server stop -f to stop the server, but never delete the data.
blocklet dev requires a local Blocklet Server to be running.
| Directory | Purpose |
| -------------------------------- | --------------------------------------------------------- |
| ~/arcblock-repos/ | All ArcBlock project repositories |
| ~/arcblock-repos/agent-skills/ | AI Agent skill set (used when querying skill definitions) |
| y | Blocklet Server data directory |
| ~/blocklet-server-dev-data/ | Blocklet Server source code development data directory |
When you need to understand skill definitions in agent-skills, you must first ensure the local repository is up to date:
REPO_PATH="$HOME/arcblock-repos/agent-skills"
if [ -d "$REPO_PATH" ]; then
cd "$REPO_PATH" && [ -z "$(git status --porcelain)" ] && git pull origin main
else
mkdir -p ~/arcblock-repos && cd ~/arcblock-repos && git clone git@github.com:ArcBlock/agent-skills.git
fi
Reason: Skills cannot read other context from the current repo at runtime; must read from the convention path.
When viewing PM2 processes, set the correct PM2_HOME:
| Environment | PM2_HOME |
| ----------- | -------------------------- |
| Production | ~/.arcblock/abtnode |
| Development | ~/.arcblock/abtnode-dev |
| e2e Testing | ~/.arcblock/abtnode-test |
PM2_HOME=~/.arcblock/abtnode pm2 list
PM2_HOME=~/.arcblock/abtnode pm2 logs abt-node-daemon --lines 100
The following files should only be read when needed. Files are in the ArcBlock agent-skills repo:
| Related Product | File to Load |
| ---------------------------- | ------------------------------------------------- |
| Blocklet Development General | arcblock-context/products/blocklet-developer.md |
| Blocklet Server | arcblock-context/products/blocklet-server.md |
| DID Connect | arcblock-context/products/did-connect.md |
| Discuss Kit | arcblock-context/products/discuss-kit.md |
| PaymentKit | arcblock-context/products/paymentkit.md |
| AIGNE CLI | arcblock-context/products/aigne.md |
Use local reference files for repository lookup (no GitHub API needed):
Query the blocklet-url-analyzer skill's reference files:
blocklet-url-analyzer/references/org-arcblock-repos.md - ArcBlock repos (core infrastructure, SDKs, mobile apps)blocklet-url-analyzer/references/org-blocklet-repos.md - Blocklet repos (blocklet applications, kits, tools)blocklet-url-analyzer/references/org-aigne-repos.md - AIGNE repos (AI agent framework, LLM adapters)These files contain: Name, URL, Main Branch, Branch Prefix, Description, Category for each repository.
Load reference files on-demand based on context. Do not preload all files.
| Trigger Condition | Load File |
| -------------------------------------------------------------- | ------------------------------------------------------- |
| Known ArcBlock repo (blocklet-server, ux, did-connect, SDKs) | org-arcblock-repos.md |
| Known Blocklet app (payment-kit, media-kit, discuss-kit, etc.) | org-blocklet-repos.md |
| Known AIGNE repo (aigne-framework, aigne-hub, LLM adapters) | org-aigne-repos.md |
| Uncertain which organization | First read blocklet-url-analyzer/references/README.md |
Loading Strategy:
Search by keyword in the reference file loaded based on ALP rules above.
Execute the following phases in order.
Execute first: Verify essential tools are installed.
# Check required tools
git --version || echo "❌ git not installed"
curl --version | head -1 || echo "❌ curl not installed"
| Tool | Purpose | Check Command | Installation |
| -------- | ----------------------------------------------------- | ---------------- | ------------------------------ |
| git | Repository cloning, branch operations, commit history | git --version | Built-in or brew install git |
| curl | Domain reachability testing | curl --version | Built-in |
Identify user intent and determine which repository to develop.
| Trigger Method | Example | Handling |
| ------------------------------- | -------------------------------------------------- | ---------------------------------------------------------- |
| GitHub Issue URL | https://github.com/ArcBlock/media-kit/issues/123 | Extract repo from URL; if gh available, read issue content |
| Blocklet URL | https://xxx.ip.abtnet.io/image-bin/admin | Use blocklet-url-analyzer skill to analyze |
| Repo name + problem description | "Help me fix the media-kit image issue" | Search in local reference files |
| Problem description | "Discussion comment feature has a bug" | Keyword search in reference files |
| Direct specification | "I want to develop snap-kit" | Search in local reference files to verify |
⚠️ Critical: When analyzing URLs, NEVER use Chrome browser or any interactive browser tools.
ALWAYS use terminal commands (curl, wget, etc.) to make HTTP requests directly.
When user provides a URL, first determine URL type:
# Check if it's a GitHub URL
if [[ "$URL" =~ ^https?://github\.com/ ]]; then
# GitHub URL → proceed to 1.2 Issue handling or directly extract repository
IS_GITHUB_URL=true
else
# Non-GitHub URL → use blocklet-url-analyzer skill to analyze
IS_GITHUB_URL=false
fi
Non-GitHub URL Handling Flow:
blocklet-url-analyzer skill definition| Analysis Result Type | Handling |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| DAEMON | Redirect to blocklet-server-dev-setup skill |
| BLOCKLET_SERVICE | Redirect to blocklet-server-dev-setup skill |
| BLOCKLET | Get corresponding repository; if blocklet-server, redirect to blocklet-server-dev-setup; otherwise continue to Phase 2 |
| UNKNOWN | Use AskUserQuestion to let user specify manually |
Important: When the identified repository is blocklet-server, always redirect to blocklet-server-dev-setup skill instead of continuing with this skill.
blocklet-url-analyzer skill location: blocklet-url-analyzer/SKILL.md
blocklet-server-dev-setup skill location: blocklet-server-dev-setup/SKILL.md
When user provides repository name or keywords, search in local reference files following ALP:
Load reference file based on context (see "Repository Search" section above):
blocklet-url-analyzer/references/org-arcblock-repos.mdblocklet-url-analyzer/references/org-blocklet-repos.mdblocklet-url-analyzer/references/org-aigne-repos.mdblocklet-url-analyzer/references/README.md for summaryReference files contain: Name, URL, Main Branch, Branch Prefix, Description, Category for all active repositories.
blocklet-server Repository Detection:
After identifying the repository, check if it is blocklet-server:
if [ "$REPO" = "blocklet-server" ]; then
echo "⚠️ Detected blocklet-server repository"
echo "→ Redirecting to blocklet-server-dev-setup skill"
fi
| Repository | Handling |
| ------------------ | --------------------------------------------------------------------- |
| blocklet-server | Stop current skill, redirect to blocklet-server-dev-setup skill |
| Other repositories | Continue to Phase 2 |
Redirect message:
The repository you want to develop is blocklet-server (Blocklet Server core).
This requires a different development environment setup.
→ Switching to blocklet-server-dev-setup skill...
blocklet-server-dev-setup skill location: blocklet-server-dev-setup/SKILL.md
Match failure: Use AskUserQuestion to display search results for user selection.
When user provides GitHub Issue URL, first extract repository info from URL, then check if gh CLI is available.
Step 1: Parse URL to extract repository
# Extract org/repo/issue_number from URL
# Example: https://github.com/ArcBlock/media-kit/issues/123
# → ORG=ArcBlock, REPO=media-kit, ISSUE_NUMBER=123
Step 1.5: Check if blocklet-server repository
if [ "$REPO" = "blocklet-server" ]; then
# Redirect to blocklet-server-dev-setup skill
echo "→ Detected blocklet-server repository, switching to blocklet-server-dev-setup skill"
fi
| Repository | Handling |
| ------------------ | --------------------------------------------------------------------- |
| blocklet-server | Stop current skill, redirect to blocklet-server-dev-setup skill |
| Other repositories | Continue to Step 2 |
Step 2: Check gh CLI availability and permissions
# Check if gh is installed and authenticated
if command -v gh &> /dev/null && gh auth status &> /dev/null; then
GH_AVAILABLE=true
else
GH_AVAILABLE=false
fi
Step 3: Handle based on gh availability
| gh Status | Handling | | ----------------------- | ------------------------------------------------------------- | | Available with auth | Read issue content for deeper analysis (multi-repo detection) | | Not available / No auth | Use repository from URL directly, skip issue content analysis |
If gh available - Read issue content:
gh issue view $ISSUE_NUMBER --repo $ORG/$REPO --json title,body,labels
Then analyze issue content:
If gh not available - Use URL only:
Simply use the repository extracted from the Issue URL ($ORG/$REPO) and proceed to Phase 2. Skip multi-repository detection.
Multi-repository scenario examples:
| Issue Location | Issue Content Keywords | Actual Repositories Involved |
| ----------------- | -------------------------------------------------- | ------------------------------------------------ |
| media-kit | "Discuss Kit image upload triggers twice" | media-kit (uploader) + discuss-kit (caller) |
| discuss-kit | "Image upload component onUploadSuccess exception" | discuss-kit + media-kit (component provider) |
| blocklet-server | "DID Connect login failed" | blocklet-server + did-connect |
| did-spaces | "PaymentKit payment callback issue" | did-spaces + paymentkit |
Decision logic:
If multiple repositories are identified:
Use AskUserQuestion to ask user:
{primary repository name}{primary repository name} + {related repository name}Record variables:
PRIMARY_REPO: Primary repository (where issue is located)RELATED_REPOS: Related repository list (may be empty)Execute subsequent Phases 2-6 for each selected repository
Match failure: Use AskUserQuestion to let user select or input complete GitHub path.
REPO_PATH="$HOME/arcblock-repos/$REPO"
[ -d "$REPO_PATH" ] && cd "$REPO_PATH" && git fetch origin
Clone to ~/arcblock-repos/$REPO (prefer SSH, fallback to HTTPS on failure).
find . -name "blocklet.yml" -o -name "blocklet.yaml" | grep -v node_modules
| Situation | Handling | | -------------- | -------------------------------------- | | Not found | Prompt this is not a blocklet project | | Found 1 | Auto-select | | Found multiple | Use AskUserQuestion for user selection |
Record variables:
REPO_ROOT: Repository root directory (dependencies installed here)BLOCKLET_DIR: Directory containing blocklet.yml (start here)Switch to main working branch according to blocklet-branch skill.
Skill location: blocklet-branch/SKILL.md
If not installed or version too low, use nvm to install Node.js 22.
corepack enable && corepack prepare pnpm@latest --activate
Must be installed but must not auto-start (Blocklet Server manages it).
macOS:
brew install nginx
Ubuntu/Debian:
# Must install nginx-extras, which includes ngx_stream_module and other required modules
sudo apt install -y nginx-extras
sudo systemctl stop nginx
sudo systemctl disable nginx
Verify nginx modules:
nginx -V 2>&1 | grep -o 'with-stream\|http_v2_module\|http_ssl_module'
# Should show: with-stream, http_v2_module, http_ssl_module
Note: Regular nginx package may lack ngx_stream_module, causing Blocklet Server startup failure.
If tmux is not available, help user install it for easier terminal process management.
macOS:
brew install tmux
Ubuntu/Debian:
sudo apt install -y tmux
npm install -g @blocklet/cli@beta
Update if version date is more than 1 week old.
Important: Must check before starting Blocklet Server, otherwise will cause worker_connections NaN error.
ulimit -n # Cannot be unlimited, recommend >= 10240
ulimit -n 65536 # Temporary setting
Blocklet Server has two modes of operation that cannot run simultaneously:
| Mode | Start Command | Detection Method | Data Directory |
| ------------------ | ----------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------- |
| Production version | blocklet server start | blocklet server status | ~/blocklet-server-data/ |
| Source development | bun run start (in blocklet-server repo) | tmux session exactly named blocklet with sub-windows webapp and event-hub | ~/blocklet-server-dev-data/ |
Must check both modes:
# Check method 1: Is production version running
PRODUCTION_RUNNING=false
CORRECT_DATA_DIR=false
EXPECTED_DATA_DIR="$HOME/blocklet-server-data"
if blocklet server status 2>/dev/null | grep -q "Running"; then
PRODUCTION_RUNNING=true
echo "✅ Detected Blocklet Server production version running"
# Check if it's using the expected data directory
CURRENT_DATA_DIR=$(blocklet server status 2>/dev/null | grep "Data Directory:" | sed 's/.*Data Directory: //' | tr -d '[:space:]')
if [ "$CURRENT_DATA_DIR" = "$EXPECTED_DATA_DIR" ]; then
CORRECT_DATA_DIR=true
echo "✅ Data directory matches: $CURRENT_DATA_DIR"
else
CORRECT_DATA_DIR=false
echo "⚠️ Data directory mismatch: $CURRENT_DATA_DIR (expected: $EXPECTED_DATA_DIR)"
fi
fi
# Check method 2: Is source development version running
# IMPORTANT: Must check BOTH conditions:
# 1. tmux session exactly named "blocklet" exists (not prefix match)
# 2. Session has "webapp" and "event-hub" windows (blocklet-server source dev structure)
# Note: `tmux has-session -t "blocklet"` uses prefix matching and will incorrectly
# match sessions like "blocklet-dev-payment-kit", so we must check exact session name
DEV_RUNNING=false
if tmux list-sessions -F '#{session_name}' 2>/dev/null | grep -qx "blocklet"; then
# Session exactly named "blocklet" exists, now check for webapp/event-hub windows
WINDOWS=$(tmux list-windows -t blocklet -F '#{window_name}' 2>/dev/null)
if echo "$WINDOWS" | grep -q "webapp" && echo "$WINDOWS" | grep -q "event-hub"; then
DEV_RUNNING=true
echo "✅ Detected blocklet-server source development version running (tmux session: blocklet)"
else
echo "ℹ️ Found tmux session 'blocklet' but missing webapp/event-hub windows - not source dev"
fi
fi
If production version is running but using a different data directory (not ~/blocklet-server-data), must stop it first:
if [ "$PRODUCTION_RUNNING" = "true" ] && [ "$CORRECT_DATA_DIR" = "false" ]; then
echo "⚠️ Stopping Blocklet Server running at different data directory..."
blocklet server stop -f
sleep 3
PRODUCTION_RUNNING=false
echo "✅ Stopped. Will start new instance with correct data directory."
fi
Reason: The skill uses ~/blocklet-server-data as the convention data directory. If user has a different Blocklet Server running (e.g., from another project or location), it must be stopped to avoid conflicts.
| Production Version | Data Dir Correct | Source Development | Handling | | ------------------ | ---------------- | ------------------ | --------------------------------------------------------------------------------------------------------------- | | Running | ✅ Yes | Not running | ✅ Use directly, skip to Phase 5 | | Running | ❌ No | Not running | Stop it (4.0.1), then start with correct data dir (4.2) | | Not running | N/A | Running | ⚠️ Ask user: stop source development and start production version, or continue using source development version | | Not running | N/A | Not running | Need to start production version, continue to 4.2 | | Running | Any | Running | ❌ Abnormal state, ask user which to stop |
Handling when source development version is running:
Use AskUserQuestion to ask user:
Detected blocklet-server source development version running (tmux session: blocklet).
Source development and production versions cannot run simultaneously.
Options:
A. Stop source development, start production version (Recommended for blocklet dev)
- Execute: tmux kill-session -t blocklet && blocklet server start
B. Continue using source development version
- Need to use bn-dev command (instead of blocklet dev)
- bn-dev runs directly in the blocklet directory WITHOUT arguments (NOT "bn-dev start")
- If bn-dev not configured, will automatically create symlink
C. Cancel operation
Stop source development version:
tmux kill-session -t "blocklet" 2>/dev/null
# Wait for port release
sleep 3
If user chooses to continue using source deve
<!-- Content truncated for initial SEO render. Open the source file tab for the full file. -->Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer