本文へ移動
cccskills
無料GitHub で公開日本語紹介

new-feature-setup

新機能や修正の作業用ブランチを始める際に、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".

trycompai/compスター 2,058(GitHub 2,058 + cccskills 0)
連携ツールLinearPostgreSQL

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 新機能用のworktreeを準備したいとき
  • Linearチケットの作業を始めたいとき
  • 複数worktreeで開発環境を分けたいとき

日本語での紹介

できること

新機能やバグ修正を始めるときに、作業用ブランチとworktreeの作成から、環境変数、データベース、依存関係、開発サーバーの扱いまで、リポジトリの手順に沿って準備します。新しいworktreeでは git worktree add のフックが環境設定やデータベース作成、インストール、マイグレーションなどを行うため、手動で同じ処理を重ねないよう案内します。複数のworktreeで開発サーバーを動かす場合の起動方法やポートの分け方、作業後のデータベースを含むクリーンアップにも触れます。

こんなときに便利

新しい機能や修正に着手する前の環境準備を揃えたいときや、複数のworktreeを使って並行作業するときに役立ちます。Linearのチケットから作業を始める場合にも、ブランチ名や作成元のルールを確認できます。

使い方の例

  • 「このチケット用のworktreeを作って、作業を始められる状態にして」
  • 「新しいブランチでバグ修正を始める手順を案内して」
  • 「別のworktreeで開発サーバーを起動したい」

注意点

リポジトリ固有の手順です。worktreeの準備にはGitフック、Bun、Postgres、Prismaなどを使います。trigger dev はworktree間で分離できないため、同時に完全な開発サーバーを起動するのは1つだけにします。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md5.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

New Feature Setup (comp monorepo)

Overview

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.

When to Use

  • User says "start a new feature", "spin up a worktree for X", "begin this Linear ticket", "new branch for …"
  • Before running bun install / bun run db:generate manually in a new directory
  • Before copying .env files around by hand

When NOT to Use

  • User is editing an existing worktree (already set up)
  • Infra repair / debugging of the hook itself (read .githooks/README.md instead)

Workflow

1. Create the worktree from origin/main

cd /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
  • For Linear tickets, use Linear's suggested branch name (mariano/<ticket-slug>).
  • For infra / chore work, use mariano/<short-descriptive-name> or chore/<topic>.
  • The <short-slug> on the worktree path should match the branch's suffix (it becomes the Postgres DB slug after tr '-' '_').

2. Let the hook do everything else

git worktree add fires the post-checkout hook at .githooks/post-checkout, which runs synchronously:

  1. Creates compdev_<slug> Postgres database (isolated per worktree)
  2. Links .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)
  3. Runs bun install, applies Prisma migrations, regenerates clients

Do 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)

3. Start the dev server — coordinate with the "active worktree" rule

Trigger.dev's trigger dev CLI cannot be isolated per worktree. Running bun run dev in multiple worktrees stomps on task registration.

  • One active worktree runs bun run dev (full stack with trigger dev).
  • All other worktrees run:
    bun run --filter '@trycompai/app' dev:no-trigger    # Next.js only
    bun run --filter '@trycompai/api' dev:no-trigger    # NestJS only
    
  • Non-active worktrees need a different 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.
  • When swapping which worktree is active, kill the old full bun run dev first so task registration is clean.

4. Code the feature

Standard repo conventions apply (see CLAUDE.md). Highlights:

  • TDD for any non-trivial change (superpowers:test-driven-development)
  • Brainstorm before building new UX (superpowers:brainstorming)
  • Plans + subagent-driven execution for multi-step work
  • Run audit-design-system after any frontend component edit
  • Always run typecheck before declaring a change done (bunx turbo run typecheck --filter=<pkg>)

5. When done, clean up

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.

Quick Reference

# 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)

Red Flags

If you catch yourself doing any of these, stop — the hook should have handled it:

  • Running bun install manually in a new worktree
  • cp or ln -s to copy .env files into a worktree
  • Writing a script that "creates a database for my branch"
  • Running bun run db:migrate in a worktree right after creating it
  • Ignoring a failing bun run dev in two worktrees instead of swapping to dev:no-trigger

Common Mistakes

MistakeFix
Creating the worktree from another worktree instead of the main cloneAlways cd to /Users/mariano/code/comp first
Editing .env in a worktree and expecting it to propagateIf 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 collidePut PORT=<free-port> in the worktree's .env.local
Running trigger dev in multiple worktreesSwitch to dev:no-trigger in all but one
Not cleaning up → orphan compdev_* databases piling upUse the stale-worktree-cleanup skill regularly

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

api-endpoint-contract

無料概要あり

APIエンドポイントの追加・変更で、DTO、入力検証、OpenAPI仕様、MCPツールの説明や公開範囲を揃え、エージェントからも扱いやすいAPIに整えます。

  • APIエンドポイントを追加したいとき
  • DTOと入力検証を整えたいとき
  • MCPツールとしてAPIを公開したいとき
trycompai/comp2,0582026年10月24日 更新

audit-design-system

無料概要あり

既存コードのデザインシステム利用状況を調べ、旧UI部品やlucide-reactのアイコンを@trycompai/design-systemの部品・Carbonアイコンへ置き換えるスキルです。

  • 旧UI部品を移行したいとき
  • アイコンをCarbonに置き換えたいとき
  • 画面のデザインシステム準拠を確認するとき
trycompai/comp2,0582026年10月24日 更新

audit-hooks

無料概要あり

指定されたファイルのフックやAPI利用を点検し、禁止パターンをSWRやapiClientなどの指定方式へ修正するための監査手順と実装規約をまとめています。

  • 既存コードのAPI利用を点検したいとき
  • 生のfetchをapiClientに置き換えたいとき
  • 更新処理をSWRのmutateにそろえたいとき
trycompai/comp2,0582026年10月24日 更新

audit-rbac

無料概要あり

NestJSのAPIとフロントエンドを調べ、権限チェックや監査ログのルール違反を修正するための確認項目を示します。

  • APIの権限チェックを点検したいとき
  • 画面操作の権限制御を確認したいとき
  • RBAC違反を修正したいとき
trycompai/comp2,0582026年10月24日 更新

audit-tests

無料概要あり

権限で表示や操作が変わるコンポーネントの単体テストを点検し、不足分の追加や失敗の修正を行って、管理者と閲覧専用ユーザーの動作を確かめます。

  • 権限別の単体テストを追加したいとき
  • 管理者と監査ユーザーの表示を検証したいとき
  • 失敗する権限テストを修正したいとき
trycompai/comp2,0582026年10月24日 更新

better-auth-best-practices

無料概要あり

Better Authを使ったTypeScript認証の設定を支援し、データベース接続、セッション管理、メール認証、OAuth、プラグインやセキュリティ項目を整理します。

  • Better Authで認証を導入したいとき
  • DBやORMアダプターを接続したいとき
  • セッションの保存方法を設定したいとき
trycompai/comp2,0582026年10月24日 更新

trycompai のスキルをすべて見る

このスキルの問題を報告する