一键导入
worktree-setup
Set up a git worktree with an isolated dev database and full developer environment for a branch.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Set up a git worktree with an isolated dev database and full developer environment for a branch.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Turn a plain-text description of a business workflow into a ZAQ workflow use-case module (a `Zaq.Engine.Workflows.UseCases.*` module that builds a DAG of nodes + edges). Every step is mapped to a real tool from `lib/zaq/agent/tools` (resolved through `Zaq.Agent.Tools.Registry`) or a workflow Step like `HumanInTheLoop`. When a described step has no matching tool, the generated module gets a `missing_tools/0` function describing the tools that must be built first. Use when the user pastes/says a workflow they want as code.
Migrate legacy ZAQ web UI (components, LiveViews, layouts) styling to the --zaq-* token system. Reads DESIGN.md and CSS catalog (foundations, semantics, text-styles, btn, form, modal, table, layout, styles) before proposing changes. Accepts a Figma frame URL (design-led), a file path (audit), or --audit-all (full sweep). Typical position in workflow: after extract, before replace.
Build or extend ZAQ back-office UI using the --zaq-* design system. Read DESIGN.md first, consult Storybook, then use extract, design-migrate, or replace as appropriate. Human confirmation required before apply steps in each skill.
Find cohesive UI slices, cross-check against existing reusable components, report candidates for human approval, copy approved slices into new (or extended) ZaqWeb.Components.DesignSystem modules (original call-site code stays intact), and add or update Storybook. Does not wire LiveViews and never invokes replace — flag replace candidates in the report for a human follow-up after design-migrate. Use before design-migrate when markup lives under lib/zaq_web/live/.
Applies human feedback to an in-progress feature by updating the PRD, then re-running ux-design and prototype. Use after the initial pm-senior → ux-design → prototype pass when the reviewer sends changes, corrections, or new scope on the PRD, UX plan, or staged BO screens.
Stages UX-plan features on real BO routes using static fixtures. May update DSM (DesignSystem.*), existing components, CSS, router, and sidebar. Never touches backend (lib/zaq/**, NodeRouter, migrations). Use after /ux-design; hand off to /design for production-ready DS patterns and data wiring.
| name | worktree-setup |
| description | Set up a git worktree with an isolated dev database and full developer environment for a branch. |
| compatibility | opencode |
You are a developer environment setup agent for the ZAQ project.
Your goal is to create a fully isolated, ready-to-run git worktree for a given branch — with its own database, secrets, and editor configuration — so a developer can start coding immediately.
The branch name is passed as the skill argument (e.g. feat/my-feature). If no argument is provided, read the current git branch with git branch --show-current.
Follow these steps in order. Stop and report the error clearly if any step fails.
git branch --show-current.<branch>.| Value | Rule | Example |
|---|---|---|
| worktree slug | replace / with - in <branch> | feat-my-feature |
| worktree path | <parent of main repo>/zaq-<worktree-slug> | /workspace/zaq/zaq-feat-my-feature |
The main repo root is the current working directory. Its parent is one level up.
The database name does not need to be computed manually — config/dev.exs reads the git branch via System.cmd at compile time and derives it automatically (e.g. feat/my-feature → zaq_feat_my_feature).
Check if already exists:
git worktree list | grep "<worktree-path>"
If it does not exist:
git worktree add <worktree-path> <branch>git worktree add -b <branch> <worktree-path> mainIf it already exists, skip and continue.
This file is gitignored and absent from the new worktree. Copy it as-is — no modifications needed:
cp <main-repo>/config/dev.secret.exs <worktree-path>/config/dev.secret.exs
mkdir -p <worktree-path>/.claude
cp <main-repo>/.claude/settings.local.json <worktree-path>/.claude/settings.local.json
cd <worktree-path> && mix setup
This installs dependencies, creates the branch-isolated database, runs all migrations, and builds assets. The database name is derived automatically from the git branch by config/dev.exs at compile time.
On success, print:
Worktree ready
Path: <worktree-path>
Branch: <branch>
Database: zaq_<slug> (derived automatically from branch)
To start the server:
cd <worktree-path>
iex -S mix phx.server
On failure, print the step that failed and the full error output. Do not continue past a failed step.