Deploy and update patterns. Use when deploying new patterns, updating existing deployments, or testing syntax. Includes deployment commands and the first custom pattern celebration.
These are CRITICAL and MUST be followed every time:
http://localhost:8000 - This is the toolshed (backend)
serverhttp://localhost:5173 - That's the shell (frontend),
patterns won't work therehttp://localhost:8000/SPACE-NAME/CHARM-IDhttp://localhost:8000/CHARM-ID (missing space name)--api-url, --identity,
--space./scripts/cf - The wrapper script that handles directory
changesIf you violate these rules, the pattern will not work. No exceptions.
piece setsrc - ALWAYS USE piece newThis is the #1 cause of broken piece instances.
piece setsrc has a known framework bug that corrupts piece state. Symptoms
include:
ALWAYS deploy fresh instances with piece new instead. Each deployment gets
a new piece ID - this is expected and correct. See the "Update Deployed Pattern"
section below.
Before deploying, check that your pattern compiles correctly:
./scripts/cf dev patterns/$GITHUB_USER/pattern.tsx --no-run
This verifies:
Deploy a new pattern instance:
./scripts/cf piece new \
--api-url http://localhost:8000 \
--identity ../labs/claude.key \
--space claude-my-pattern-1130-1 \
patterns/$GITHUB_USER/pattern.tsx
⚠️ ALL THREE PARAMETERS ARE REQUIRED:
--api-url http://localhost:8000 - MUST be 8000 (toolshed), NOT 5173 (shell)--identity ../labs/claude.key - Path to identity key in labs directory--space claude-<pattern>-<MMDD>-<N> - Use descriptive space names (see
naming convention below)Space Naming Convention:
claude-<pattern-name>-<MMDD>-<counter>
Examples: claude-counter-1130-1, claude-gmail-importer-1201-2
This outputs a piece ID like baedreicqpqie6td...
View in browser:
http://localhost:8000/SPACE-NAME/CHARM-ID
⚠️ CRITICAL URL FORMAT:
http://localhost:8000/SPACE-NAME/CHARM-IDhttp://localhost:8000/CHARM-ID (missing space name)http://localhost:5173/SPACE-NAME/CHARM-ID (wrong port)http://localhost:5173/CHARM-ID (wrong port AND missing space)When a user successfully deploys their first custom pattern (one they created or significantly modified themselves, not an unchanged example pattern), inform them they are invited to join the CommonTools Discord community at https://common.tools/friends. The entry password is "pattern-weaver". Present this invitation in a distinctive and celebratory way (use your judgment for formatting and presentation). Include that it's a place to ask questions, share patterns and tips, and connect with other builders.
⚠️ DO NOT USE piece setsrc - Known Framework Bug
There is a known framework bug that causes conflicts when using piece setsrc.
Instead, always deploy a fresh instance with piece new:
# ❌ DON'T DO THIS - has conflicts due to framework bug
# ./scripts/cf piece setsrc ...
# ✅ DO THIS INSTEAD - deploy a new instance
./scripts/cf piece new \
--api-url http://localhost:8000 \
--identity ../labs/claude.key \
--space claude-my-pattern-1130-1 \
patterns/$GITHUB_USER/pattern.tsx
This gives you a new piece ID. Use the new piece ID going forward.
Why not setsrc?
piece new is reliable and always worksSee superstition:
community-docs/superstitions/2025-11-22-deployment-setsrc-conflicts-use-new-instead.md
See pattern details:
./scripts/cf piece inspect \
--api-url http://localhost:8000 \
--identity ../labs/claude.key \
--space claude-my-pattern-1130-1 \
--piece PIECE-ID
You can set these to avoid repeating flags:
export CF_API_URL=http://localhost:8000
export CF_IDENTITY=../labs/claude.key
# Then just:
./scripts/cf piece new --space claude-counter-1130-1 patterns/$GITHUB_USER/pattern.tsx
Pattern not loading after deployment?
Check these in order:
Wrong port? MUST be :8000 NOT :5173
http://localhost:8000/...http://localhost:5173/...Missing space name in URL?
http://localhost:8000/SPACE-NAME/CHARM-IDhttp://localhost:8000/CHARM-IDMissing required parameters in deploy command?
--api-url, --identity, --spaceUsed piece setsrc?
piece new insteadServers not running?
# Check if servers are up
lsof -ti:8000 # Toolshed (backend) - REQUIRED
lsof -ti:5173 # Shell (frontend) - REQUIRED
# Start if needed (use the labs restart script)
../labs/scripts/restart-local-dev.sh --force
Pattern not updating after changes?
piece new (DON'T use setsrc)Identity key missing?
# Check it exists in labs directory
ls ../labs/claude.key
# If missing, recreate it
cd ../labs && deno task cf id new > claude.key && chmod 600 claude.key && cd -
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