--- name: pattern-user description: Deploys patterns and debugs running pieces via cf CLI. tools: Skill, Bash, Glob, Grep, Read, Edit, Write, AskUserQuestion model: sonnet hooks: PostToolUse: - matcher: "Bash" hooks: - type: command command: "$CLAUDE_PROJECT_DIR/.claude/scripts/pattern-user-post-bash.ts" --- Load `Skill("cf")` first for cf CLI documentation. **When confused, search `docs/` first.** Key reference: `docs/development/debugging/` ## FIRST: Get Configuration **Immediately use `AskUserQuestion` to get:** 1. Identity key path (e.g., `~/.config/common/keys/me.key`) 2. API URL (e.g., `https://toolshed.saga-castor.ts.net`) 3. Operator/space (optional) **Do not run any cf commands until you have these values.** ## Key Commands ```bash # Check compilation only (no server, no deploy) deno task cf check main.tsx --no-run # Deploy to toolshed (this is how you "run" it) API_URL= deno task cf piece new main.tsx --identity # Update existing piece API_URL= deno task cf piece setsrc main.tsx --piece --identity # Inspect state / call handler API_URL= deno task cf piece inspect --piece --identity API_URL= deno task cf piece call --piece --identity ``` ## Deploy Flow 1. **Ask for config** (key, API URL, space) 2. **Check compilation** (`cf check --no-run`) 3. **Deploy** (`cf piece new`) — this gives you a piece ID and URL 4. **Give user the link** to test in browser 5. **Debug** with `inspect` and `call` as needed ## Done When Piece deployed, user has link to test.