Communitygithub.com

alfathafp/portofolio-web-design

새로운 기능 작업을 시작할 때 현재 작업 공간과의 격리가 필요하거나 구현 계획을 실행하기 전에 사용합니다. 네이티브 도구 또는 git worktree 대비책을 통해 격리된 작업 공간을 보장합니다.

portofolio-web-design란 무엇인가요?

이 스킬은 AI 에이전트가 기능 개발 작업을 안전하게 격리된 환경에서 수행할 수 있도록 설계되었습니다. 핵심 원칙은 기존 격리 상태를 먼저 감지하고, 플랫폼의 네이티브 워크트리 도구를 우선 사용하며, 네이티브 도구가 없을 때만 수동 git worktree를 사용하는 것입니다. Claude Code, Cursor, Codex 등 모든 AI 에이전트 플랫폼에서 사용할 수 있으며, Step 0의 격리 감지 로직은 서브모듈과 이미 생성된 워크트리를 구분하여 불필요한 워크트리 생성을 방지합니다. 또한 작업 공간 디렉토리가 .gitignore에 등록되어 있는지 확인하여 실수로 리포지토리에 커밋되는 것을 방지하며, Node.js, Rust, Python, Go 등 다양한 언어 환경의 의존성 설치와 테스트 실행을 자동화하여 깨끗한 기준선(baseline)을 보장합니다. 샌드박스 제한으로 인해 워크트리 생성이 실패할 경우 자동으로 현재 디렉토리에서 작업을 진행하는 폴백(fallback) 메커니즘도 제공합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alfathafp/portofolio-web-design/tree/HEAD/.agents/skills/using-git-worktrees

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Git Worktree 사용하기

개요

작업이 격리된 작업 공간에서 이루어지도록 보장합니다. 플랫폼의 네이티브 워크트리 도구를 우선 사용하세요. 네이티브 도구를 사용할 수 없는 경우에만 수동 git worktree로 대비하세요.

핵심 원칙: 먼저 기존 격리 상태를 감지하세요. 그런 다음 네이티브 도구를 사용하세요. 그런 다음 git으로 대비하세요. 절대 harness와 싸우지 마세요.

시작 시 알리기: "저는 격리된 작업 공간을 설정하기 위해 using-git-worktrees 스킬을 사용하고 있습니다."

Step 0: 기존 격리 감지

아무것도 생성하기 전에, 이미 격리된 작업 공간에 있는지 확인하세요.

GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
BRANCH=$(git branch --show-current)

서브모듈 가드: GIT_DIR != GIT_COMMON은 git 서브모듈 내부에서도 참입니다. "이미 워크트리에 있다"고 결론 내리기 전에, 서브모듈에 있는지 확인하세요:

# 경로가 반환되면 서브모듈에 있는 것입니다. 워크트리가 아닙니다. 일반 리포지토리로 취급하세요.
git rev-parse --show-superproject-working-tree 2>/dev/null

GIT_DIR != GIT_COMMON (그리고 서브모듈이 아닌 경우): 이미 연결된(linked) 워크트리에 있습니다. Step 2 (프로젝트 설정)로 건너뛰세요. 다른 워크트리를 생성하지 마세요.

브랜치 상태와 함께 보고:

  • 브랜치에 있음: "이미 <path>의 <name> 브랜치에 격리된 작업 공간에 있습니다."
  • 분리된 HEAD: "이미 <path>에 격리된 작업 공간에 있습니다(분리된 HEAD, 외부 관리). 완료 시 브랜치 생성이 필요합니다."

GIT_DIR == GIT_COMMON (또는 서브모듈에 있는 경우): 일반 리포지토리 체크아웃에 있습니다.

사용자가 이미 지침에서 워크트리 선호도를 표시했습니까? 그렇지 않다면, 워크트리를 생성하기 전에 동의를 구하세요:

"격리된 워크트리를 설정해 드릴까요? 현재 브랜치를 변경 사항으로부터 보호합니다."

이미 선언된 선호도가 있으면 묻지 않고 따르세요. 사용자가 동의를 거부하면 현재 위치에서 작업하고 Step 2로 건너뛰세요.

Step 1: 격리된 작업 공간 생성

두 가지 메커니즘이 있습니다. 이 순서대로 시도하세요.

1a. 네이티브 워크트리 도구 (선호)

사용자가 격리된 작업 공간을 요청했습니다(Step 0 동의). 워크트리를 생성할 방법이 이미 있습니까? EnterWorktree, WorktreeCreate, /worktree 명령어, 또는 --worktree 플래그와 같은 이름의 도구일 수 있습니다. 있다면 사용하고 Step 2로 건너뛰세요.

네이티브 도구는 디렉토리 배치, 브랜치 생성 및 정리를 자동으로 처리합니다. 네이티브 도구가 있을 때 git worktree add를 사용하면 harness가 볼 수 없고 관리할 수 없는 팬텀 상태(phantom state)가 생성됩니다.

네이티브 워크트리 도구를 사용할 수 없는 경우에만 Step 1b로 진행하세요.

1b. Git Worktree 대비책

Step 1a가 적용되지 않는 경우에만 사용하세요 — 사용 가능한 네이티브 워크트리 도구가 없는 경우입니다. git을 사용하여 수동으로 워크트리를 생성하세요.

디렉토리 선택

다음 우선 순위를 따르세요. 명시적인 사용자 선호도는 항상 관찰된 파일 시스템 상태보다 우선합니다.

  1. 지침에서 선언된 워크트리 디렉토리 선호도를 확인하세요. 사용자가 이미 지정했다면 묻지 않고 사용하세요.

  2. 기존 프로젝트-로컬 워크트리 디렉토리를 확인하세요:

    ls -d .worktrees 2>/dev/null     # 선호 (숨김)
    ls -d worktrees 2>/dev/null      # 대안
    

    찾으면 사용하세요. 둘 다 존재하면 .worktrees가 우선합니다.

  3. 다른 지침이 없다면, 프로젝트 루트에 .worktrees/를 기본값으로 사용하세요.

안전 확인 (프로젝트-로컬 디렉토리만 해당)

워크트리를 생성하기 전에 디렉토리가 무시되는지 반드시 확인하세요:

git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

무시되지 않은 경우: .gitignore에 추가하고, 변경 사항을 커밋한 후 진행하세요.

중요한 이유: 워크트리 내용이 실수로 리포지토리에 커밋되는 것을 방지합니다.

워크트리 생성

# 선택한 위치에 따라 경로 결정
path="$LOCATION/$BRANCH_NAME"

git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"

샌드박스 대비책: git worktree add가 권한 오류(샌드박스 거부)로 실패하면, 샌드박스가 워크트리 생성을 차단했으며 현재 디렉토리에서 대신 작업한다고 사용자에게 알리세요. 그런 다음 현재 위치에서 설정 및 기준선 테스트를 실행하세요.

Step 2: 프로젝트 설정

자동 감지하여 적절한 설정을 실행하세요:

# Node.js
if [ -f package.json ]; then npm install; fi

# Rust
if [ -f Cargo.toml ]; then cargo build; fi

# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi

# Go
if [ -f go.mod ]; then go mod download; fi

Step 3: 깨끗한 기준선 확인

작업 공간이 깨끗하게 시작되는지 테스트를 실행하세요:

# 프로젝트에 적합한 명령어 사용
npm test / cargo test / pytest / go test ./...

테스트 실패 시: 실패를 보고하고, 계속 진행할지 또는 조사할지 물어보세요.

테스트 통과 시: 준비 완료를 보고하세요.

보고

<full-path>에 워크트리 준비 완료
테스트 통과 (<N>개 테스트, 0개 실패)
<feature-name> 구현 준비 완료

빠른 참조

상황조치
이미 연결된 워크트리에 있음생성 건너뛰기 (Step 0)
서브모듈에 있음일반 리포지토리로 취급 (Step 0 가드)
네이티브 워크트리 도구 사용 가능사용 (Step 1a)
네이티브 도구 없음Git worktree 대비책 (Step 1b)
.worktrees/ 존재사용 (무시 확인)
worktrees/ 존재사용 (무시 확인)
둘 다 존재.worktrees/ 사용
둘 다 없음지침 파일 확인 후 기본값 .worktrees/
디렉토리가 무시되지 않음.gitignore에 추가 + 커밋
생성 시 권한 오류샌드박스 대비책, 현재 위치에서 작업
기준선 테스트 중 실패실패 보고 + 질문
package.json/Cargo.toml 없음의존성 설치 건너뛰기

일반적인 합리화

변명현실
"분명히 워크트리가 아닌데 — 확인할 필요 없어"Step 0을 실행하세요. Harness가 생성한 격리와 서브모듈은 모두 육안으로 속일 수 있습니다. 감지 명령어가 해결해줍니다.
"git worktree add가 네이티브 도구를 찾는 것보다 빠르다"네이티브 도구(예: EnterWorktree)는 배치, 브랜칭 및 정리를 담당합니다. 이를 우회하는 것은 #1 실수입니다 — harness가 볼 수 없고 관리할 수 없는 팬텀 상태를 생성합니다.
"워크트리 디렉토리는 분명히 이미 무시되고 있을 거야"git check-ignore를 실행하세요. 무시되지 않은 워크트리 디렉토리는 전체 트리를 리포지토리에 커밋합니다.
"어떤 디렉토리 이름이든 상관없다"명시적 지침이 기존 프로젝트-로컬 디렉토리보다 우선하며, 이는 .worktrees/ 기본값보다 우선합니다.
"작업 공간이 깨끗하니까 기준선 테스트는 나중에 해도 돼"더러운 기준선은 이후의 모든 실패를 모호하게 만듭니다. 지금 테스트를 실행하세요. 실패를 넘어 진행하는 것은 사람 파트너의 결정입니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

alfathafp/portofolio-web-design

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

alfathafp/portofolio-web-design

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.

alfathafp/portofolio-web-design

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

alfathafp/portofolio-web-design

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.

alfathafp/portofolio-web-design

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

alfathafp/portofolio-web-design

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

alfathafp/portofolio-web-design

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

alfathafp/portofolio-web-design

Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need to figure out what broke and why — a systematic approach to finding and fixing the root cause rather than guessing.

alfathafp/portofolio-web-design

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

alfathafp/portofolio-web-design

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

alfathafp/portofolio-web-design

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

alfathafp/portofolio-web-design

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

alfathafp/portofolio-web-design

Records decisions and documentation. Use when you need to document an architecture decision (ADR) or the reasoning behind a design choice, when changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

alfathafp/portofolio-web-design

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production auth, security-sensitive logic, a high-stakes migration, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.

alfathafp/portofolio-web-design

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

alfathafp/portofolio-web-design

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

alfathafp/portofolio-web-design

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

alfathafp/portofolio-web-design

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, splitting uncommitted work in a messy working tree into clean atomic commits, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.

alfathafp/portofolio-web-design

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

alfathafp/portofolio-web-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

관련 스킬