본문으로 건너뛰기
cccskills
무료GitHub에 공개

dev-environment

Start, stop, and manage the local dev stack (Docker infra, backend, frontend). Works in any directory — worktree or main repo.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ayunis-core/ayunis-core스타 34(GitHub 34 + cccskills 0)
연동 도구DockerPostgreSQL

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md7.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Dev Environment

Starting the Stack

The ./dev script manages the local development stack. It works from any checkout — worktree or main repo.

By default, ./dev up omits the slow anonymisation service. Use this for routine backend, frontend, migration, and QA work:

# Requires a slot number on first run
./dev up --slot 2

# Subsequent runs remember the slot
./dev up

Before starting the stack, decide whether the task actually exercises anonymisation. Only include the service when the task tests or changes anonymisation behavior:

./dev up --slot 2 --with-anonymisation

What ./dev up does

  1. Starts Docker infrastructure (postgres, minio, mailcatcher, code-execution, redis, gotenberg, plus anonymize only when --with-anonymisation is set)
  2. Generates .env.dev with localhost connection config for the slot
  3. Runs database migrations
  4. Starts the backend natively (nest start --watch)
  5. Starts the frontend natively (vite)
  6. Waits for the backend health check, prints port summary, returns

Local Backend Environment Overrides

Put personal or task-specific backend settings in ayunis-core-backend/.env.local. This is the generic local override mechanism for feature flags, temporary API keys, service endpoints, and any other backend environment variable:

FEATURE_<NAME>_ENABLED=true

The file is gitignored, is not rewritten by ./dev, and has the highest precedence: .env.local overrides Infisical or other injected process values, the generated .env.dev, and .env.

Do not prefix ./dev up with an environment variable; the detached backend does not reliably inherit the invoking shell's environment. Do not edit .env.dev, because ./dev up regenerates it, and do not change a source-code default for a local configuration need.

The backend reads environment configuration at process startup. Restart after adding, changing, or removing an override:

./dev down
./dev up

Remove task-specific entries from .env.local when they are no longer needed.

Port Reference

Ports are offset by slot × 10:

ServiceFormulaSlot 2Slot 3Slot 4
Backend3000 + offset302030303040
Frontend3001 + offset302130313041
Postgres5432 + offset545254625472
MinIO9000 + offset902090309040

Avoid slots 0 and 1 — their ports (5432, 3000, etc.) often conflict with existing services on the host.

Checking Status and Logs

./dev status                      # Overview of all services
./dev logs backend                # Backend logs (last 80 lines)
./dev logs frontend               # Frontend logs
./dev logs infra                  # Docker infrastructure logs
./dev logs --tail 200 backend     # More lines

Restarting

The backend runs nest start --watch — it auto-reloads on code changes. If it crashes:

./dev logs backend    # Check what went wrong
./dev down
./dev up              # Slot is remembered; add --with-anonymisation only if needed

Stopping

./dev down

Troubleshooting

If ./dev up fails, check logs:

./dev logs backend
./dev logs infra

Migration fails with 42P07 duplicate-table — stale Postgres volume

Slots reuse their Postgres data volume across branches. If a previous branch on this slot already ran a migration that creates the same table as the current branch's pending migration, ./dev up fails with:

error: relation "<table>" already exists (PostgreSQL 42P07)

The volume is stale — it has the table but no record of the migration that created it. Resolving it means wiping the slot's Postgres volume so ./dev up replays migrations from scratch.

Do not run this yourself. Wiping a volume requires a destructive Docker flag (docker compose down -v), which is on the Forbidden Actions list in CLAUDE.md — volumes hold database data that cannot be restored. Instead, surface the situation to the user and let them decide. Tell them the slot's Postgres volume is stale and that recovering it requires:

# Run by the user — destroys the slot's Postgres data
docker compose -p ayunis-dev-<SLOT> down -v
./dev up --slot <SLOT>

Slots are per-developer scratch state (not shared), so this is normally safe — but it is the user's call, not the agent's.

Cross-worktree slot squat — frontend OR backend

When two worktrees both think they own the same slot (e.g. both ran ./dev up --slot 2 at different times), one of the slot's ports can end up held by a process from worktree A while you ./dev up in worktree B. Two flavors:

Frontend squat — vite/node from worktree A holds 3021/3031/... ./dev up sees the port bound, silently skips frontend startup, and the backend comes up fresh against your branch's code while the frontend serves worktree A's old code. ./dev status looks healthy.

Backend squat — nest/node from worktree A holds 3020/3030/3040/... The ./dev up in worktree B either skips backend startup or fails a health check. More insidiously, any tool that hits the backend port from worktree B (e.g. pnpm run openapi:update, which fetches http://localhost:<port>/api/docs-json) will silently pull from worktree A's server — regenerating a stale OpenAPI client that's missing endpoints you just added in worktree B.

Diagnose (same recipe, use the port relevant to the symptom):

# Frontend port: 3021 = slot 2, 3031 = slot 3, 3041 = slot 4
# Backend port:  3020 = slot 2, 3030 = slot 3, 3040 = slot 4
lsof -nP -iTCP:3040 -sTCP:LISTEN

# Inspect that process's cwd — if it points to a different worktree, that's the squatter
lsof -p <PID> | grep cwd

Before regenerating any code from a running dev server (OpenAPI schema, GraphQL codegen, etc.), verify the process serving the port is rooted in the current worktree — not another slot's stale backend.

Fix: the squatter must be stopped before ./dev up --slot <SLOT> succeeds and before any codegen-from-running-server is trustworthy. Do not kill it yourself — killing processes is on the Forbidden Actions list in CLAUDE.md. Report the offending PID and its worktree cwd to the user and let them stop it. If you want to keep both worktrees running, give them different slots instead.

Orphaned processes from a trashed worktree

When a git worktree is removed via git worktree remove — or moved to .git/wt/trash/… — while its ./dev stack is still running, the native nest/vite/esbuild children survive the worktree deletion and keep holding the slot's ports. Next ./dev up --slot <SLOT> from any worktree fails because those ports are still bound.

The distinguishing signal from a live cross-worktree squat is the cwd: an orphaned process's lsof -p <PID> | grep cwd resolves to a path under .git/wt/trash/… (or is deleted entirely and shows up as cwd (deleted)), not a real live worktree.

Prevent: always ./dev down in a worktree before trashing/removing it. The worktree skill's cleanup section names this too — respect it.

Recover: because the parent worktree is already gone, there's no ambiguity about whether the process is still owned — it isn't. Report the orphan PIDs plus the trashed cwd to the user and ask permission to kill <PID> them. Once approved, ./dev up --slot <SLOT> from your current worktree comes up clean. docker compose down alone does not clean these up — they're native processes, not containers.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Query Ayunis deployed-environment telemetry in AppSignal — incidents, occurrence counts and error traces via the `appsignal-cli` binary; structured log attributes (user.id, org.id, nestjs.context, custom metadata) via the v2 logs API. Use when investigating a production/staging incident or log data — NOT for local dev logs (see backend-debugging).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ayunis-core/ayunis-core342026년 10월 26일 업데이트

Ayunis Core backend specifics — module boundaries, key files, and project conventions. Complements the nestjs-hexagonal-backend skill.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ayunis-core/ayunis-core342026년 10월 26일 업데이트

Frontend development in ayunis-core. Use when creating, modifying, or debugging frontend code (React, Feature-Sliced Design, API client).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ayunis-core/ayunis-core342026년 10월 26일 업데이트

Debug backend runtime errors (500s, crashes, unexpected behavior). Use when something is broken at runtime — not for writing new code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ayunis-core/ayunis-core342026년 10월 26일 업데이트

Shared test fixtures for backend specs — port mock factories, domain builders, and shared IDs in a per-module testing/ folder. Use when a module's *.use-case.spec.ts files repeat the same mock-repository literal, inline entity construction, or hardcoded UUIDs across files.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ayunis-core/ayunis-core342026년 10월 26일 업데이트

Analyze Cursor Bugbot PR comments through a root-cause lens: is the finding valid, and is the suggested fix the real fix or a bandaid over a deeper problem? Use when the user asks to check, assess, or triage bugbot comments.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ayunis-core/ayunis-core342026년 10월 26일 업데이트

ayunis-core의 스킬 모두 보기

이 스킬의 문제 신고