APIエンドポイントの追加・変更で、DTO、入力検証、OpenAPI仕様、MCPツールの説明や公開範囲を揃え、エージェントからも扱いやすいAPIに整えます。
- APIエンドポイントを追加したいとき
- DTOと入力検証を整えたいとき
- MCPツールとしてAPIを公開したいとき
新機能や修正の作業用ブランチを始める際に、worktreeごとの環境変数、データベース、依存関係、開発サーバーの準備手順を案内します。
Use when starting a new feature, Linear ticket, or bugfix in this repo — establishes the branch + worktree + env + DB + dev-server conventions so the work is immediately ready to code without fighting infra. Triggers on "start a new feature", "spin up a worktree", "begin ticket", "new branch".
実行スコア 未検証
インストール方法を見る新機能やバグ修正を始めるときに、作業用ブランチとworktreeの作成から、環境変数、データベース、依存関係、開発サーバーの扱いまで、リポジトリの手順に沿って準備します。新しいworktreeでは git worktree add のフックが環境設定やデータベース作成、インストール、マイグレーションなどを行うため、手動で同じ処理を重ねないよう案内します。複数のworktreeで開発サーバーを動かす場合の起動方法やポートの分け方、作業後のデータベースを含むクリーンアップにも触れます。
新しい機能や修正に着手する前の環境準備を揃えたいときや、複数のworktreeを使って並行作業するときに役立ちます。Linearのチケットから作業を始める場合にも、ブランチ名や作成元のルールを確認できます。
リポジトリ固有の手順です。worktreeの準備にはGitフック、Bun、Postgres、Prismaなどを使います。trigger dev はworktree間で分離できないため、同時に完全な開発サーバーを起動するのは1つだけにします。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
This repo has a lot of infrastructure pre-wired into git worktree add. Use it. Don't reinvent env copying, database setup, or dependency install flows in every new session.
bun install / bun run db:generate manually in a new directory.env files around by hand.githooks/README.md instead)origin/maincd /Users/mariano/code/comp # must be the MAIN clone, not another worktree
git fetch origin main
git worktree add .worktrees/<short-slug> -b <branch-name> origin/main
mariano/<ticket-slug>).mariano/<short-descriptive-name> or chore/<topic>.<short-slug> on the worktree path should match the branch's suffix (it becomes the Postgres DB slug after tr '-' '_').git worktree add fires the post-checkout hook at .githooks/post-checkout, which runs synchronously:
compdev_<slug> Postgres database (isolated per worktree).env* files from the main clone (copies the ones with DATABASE_URL, rewriting it to the isolated URL; symlinks the rest so API keys auto-propagate)bun install, applies Prisma migrations, regenerates clientsDo not run any of these by hand. If the hook logs a failure, diagnose and fix at the source — don't paper over with a manual install.
Skip toggles (rare):
SKIP_WORKTREE_DB=1 — share the main comp DB (drift risk; only for read-only worktrees)SKIP_WORKTREE_SETUP=1 — skip install + migrate + generate (for a "just files" worktree)SETUP_WORKTREE_WITH_BUILD=1 — also run bun run build (adds minutes; only when you need the built artifacts)Trigger.dev's trigger dev CLI cannot be isolated per worktree. Running bun run dev in multiple worktrees stomps on task registration.
bun run dev (full stack with trigger dev).bun run --filter '@trycompai/app' dev:no-trigger # Next.js only
bun run --filter '@trycompai/api' dev:no-trigger # NestJS only
PORT to avoid collision — add PORT=3001 (or 3334, etc.) to the worktree's .env.local. .env.local is not symlinked and stays per-worktree.bun run dev first so task registration is clean.Standard repo conventions apply (see CLAUDE.md). Highlights:
superpowers:test-driven-development)superpowers:brainstorming)audit-design-system after any frontend component editbunx turbo run typecheck --filter=<pkg>)Use the stale-worktree-cleanup skill when worktrees accumulate. It handles both git worktree remove and dropping the compdev_<slug> database in one pass. Never leave orphan databases — they pile up silently because git has no pre-worktree-remove hook.
# Spin up a new worktree (does env + DB + install + migrate + generate automatically)
git worktree add .worktrees/<slug> -b mariano/<branch-name> origin/main
# Start dev — ONLY in the worktree you're actively iterating on
cd .worktrees/<slug>
bun run dev
# Start dev in a background worktree (no trigger dev, custom port via .env.local)
echo "PORT=3001" >> apps/app/.env.local
bun run --filter '@trycompai/app' dev:no-trigger
# Clean up when branch is done
# (use the stale-worktree-cleanup skill)
If you catch yourself doing any of these, stop — the hook should have handled it:
bun install manually in a new worktreecp or ln -s to copy .env files into a worktreebun run db:migrate in a worktree right after creating itbun run dev in two worktrees instead of swapping to dev:no-trigger| Mistake | Fix |
|---|---|
| Creating the worktree from another worktree instead of the main clone | Always cd to /Users/mariano/code/comp first |
Editing .env in a worktree and expecting it to propagate | If it's a symlink, yes; if it's a real copy (has DATABASE_URL), no. Check with ls -la. |
Forgetting to bump PORT → two dev servers collide | Put PORT=<free-port> in the worktree's .env.local |
Running trigger dev in multiple worktrees | Switch to dev:no-trigger in all but one |
Not cleaning up → orphan compdev_* databases piling up | Use the stale-worktree-cleanup skill regularly |
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
APIエンドポイントの追加・変更で、DTO、入力検証、OpenAPI仕様、MCPツールの説明や公開範囲を揃え、エージェントからも扱いやすいAPIに整えます。
既存コードのデザインシステム利用状況を調べ、旧UI部品やlucide-reactのアイコンを@trycompai/design-systemの部品・Carbonアイコンへ置き換えるスキルです。
指定されたファイルのフックやAPI利用を点検し、禁止パターンをSWRやapiClientなどの指定方式へ修正するための監査手順と実装規約をまとめています。
NestJSのAPIとフロントエンドを調べ、権限チェックや監査ログのルール違反を修正するための確認項目を示します。
権限で表示や操作が変わるコンポーネントの単体テストを点検し、不足分の追加や失敗の修正を行って、管理者と閲覧専用ユーザーの動作を確かめます。
Better Authを使ったTypeScript認証の設定を支援し、データベース接続、セッション管理、メール認証、OAuth、プラグインやセキュリティ項目を整理します。