deployment
Deploy and update patterns. Use when deploying new patterns, updating existing deployments, or testing syntax. Includes deployment commands and the first custom pattern celebration.
Best use case
deployment is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Deploy and update patterns. Use when deploying new patterns, updating existing deployments, or testing syntax. Includes deployment commands and the first custom pattern celebration.
Teams using deployment should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/deployment/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How deployment Compares
| Feature / Agent | deployment | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Deploy and update patterns. Use when deploying new patterns, updating existing deployments, or testing syntax. Includes deployment commands and the first custom pattern celebration.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Pattern Deployment ## ⚠️ CRITICAL DEPLOYMENT RULES **These are CRITICAL and MUST be followed every time:** 1. **✅ ALWAYS use `http://localhost:8000`** - This is the toolshed (backend) server 2. **❌ NEVER use `http://localhost:5173`** - That's the shell (frontend), patterns won't work there 3. **✅ ALWAYS include space name in URL:** `http://localhost:8000/SPACE-NAME/CHARM-ID` 4. **❌ NEVER use:** `http://localhost:8000/CHARM-ID` (missing space name) 5. **✅ ALWAYS include ALL THREE parameters:** `--api-url`, `--identity`, `--space` 6. **✅ ALWAYS use `./scripts/cf`** - The wrapper script that handles directory changes **If you violate these rules, the pattern will not work. No exceptions.** ## 🚨 NEVER USE `piece setsrc` - ALWAYS USE `piece new` **This is the #1 cause of broken piece instances.** `piece setsrc` has a known framework bug that corrupts piece state. Symptoms include: - Piece shows blank when navigated to directly - Conflict errors during updates - Piece data exists but UI won't render **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. ## Test Syntax Before deploying, check that your pattern compiles correctly: ```bash ./scripts/cf dev patterns/$GITHUB_USER/pattern.tsx --no-run ``` This verifies: - TypeScript types are correct - All imports resolve - Pattern structure is valid - No syntax errors ## Deploy Pattern Deploy a new pattern instance: ```bash ./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:** - ✅ CORRECT: `http://localhost:8000/SPACE-NAME/CHARM-ID` - ❌ WRONG: `http://localhost:8000/CHARM-ID` (missing space name) - ❌ WRONG: `http://localhost:5173/SPACE-NAME/CHARM-ID` (wrong port) - ❌ WRONG: `http://localhost:5173/CHARM-ID` (wrong port AND missing space) ## First Custom Pattern Deployment 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. ## Update Deployed Pattern **⚠️ 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`:** ```bash # ❌ 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?** - Known framework bug causes conflict errors - Updates frequently fail - Cryptic error messages about state conflicts - `piece new` is reliable and always works **See superstition:** `community-docs/superstitions/2025-11-22-deployment-setsrc-conflicts-use-new-instead.md` ## Inspect Pattern See pattern details: ```bash ./scripts/cf piece inspect \ --api-url http://localhost:8000 \ --identity ../labs/claude.key \ --space claude-my-pattern-1130-1 \ --piece PIECE-ID ``` ## Environment Variables You can set these to avoid repeating flags: ```bash 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 ``` ## Deployment Troubleshooting **Pattern not loading after deployment?** Check these in order: 1. **Wrong port?** MUST be `:8000` NOT `:5173` - ✅ `http://localhost:8000/...` - ❌ `http://localhost:5173/...` 2. **Missing space name in URL?** - ✅ `http://localhost:8000/SPACE-NAME/CHARM-ID` - ❌ `http://localhost:8000/CHARM-ID` 3. **Missing required parameters in deploy command?** - ALL THREE REQUIRED: `--api-url`, `--identity`, `--space` - Check your command includes all three 4. **Used `piece setsrc`?** - DON'T use setsrc (framework bug) - Use `piece new` instead **Servers not running?** ```bash # 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?** 1. **Deploy a NEW instance** with `piece new` (DON'T use setsrc) 2. You'll get a new charm ID - use that one 3. Hard refresh browser: Cmd+Shift+R (Mac), Ctrl+Shift+R (Windows) **Identity key missing?** ```bash # 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 - ``` ## Related Skills - **testing** - Test deployed patterns with Playwright - **pattern-development** - Development best practices - **session-startup** - Ensure dev servers are running
Related Skills
testing
Test patterns with Playwright browser automation. Navigate to deployed patterns, interact with UI elements, verify functionality. Use when testing patterns after deployment or when debugging pattern behavior in browser.
Superstition Verification Skill
Use this skill to systematically verify superstitions in
strategic-investigation
Proactive recovery using plan mode and subagents. After 1-2 failed attempts, STOP trying variations. Enter plan mode and launch parallel Explore/Plan agents to find idiomatic solutions instead of spinning wheels.
session-startup
Session initialization sequence for community-patterns development. Use at the start of every Claude Code session. Checks for upstream updates, loads workspace configuration, and ensures dev servers are running.
recovery-strategies
Escalation path when stuck on pattern development. Use when encountering TypeScript errors, framework confusion, unexpected behavior, or blocked progress. Five-step recovery: check docs, study examples, strategic investigation (plan mode + subagents), reset and retry, ask user.
pattern-dev
Day-to-day pattern development best practices. Use when actively developing patterns. Covers incremental development, commits, communication guidelines, and general development workflow.
land-branch
Land a feature branch: pull from main, rebase the branch, create a PR, and merge it via rebase with automatic branch deletion. Use when ready to land a completed feature branch.
issue-filing
File framework issues after exhausting other approaches. Document complex problems with multiple failed attempts for framework authors. REQUIRES user permission. Use only after checking docs, community-docs, and trying multiple approaches.
git-workflow
Git operations and pull request workflows. Create PRs, rebase branches, resolve conflicts, merge to upstream. Use when ready to create PR or when working with git branches and upstream.
community-docs
Community superstitions - unverified observations from pattern development. Use when encountering undocumented edge cases or framework quirks not in official docs. Verified knowledge should be upstreamed to labs docs.
claude-permissions-update
Sync auto-approved permissions from all community-patterns directories (including community-patterns-2, -3, etc.) to the shared project settings. Shows new permissions for review before adding.
securing-helm-chart-deployments
Secure Helm chart deployments by validating chart integrity, scanning templates for misconfigurations, and enforcing security contexts in Kubernetes releases.