Communitygithub.com

G1Joshi/Agent-Skills

Zsh 전문가 도움말: 셸 커스터마이징, Oh My Zsh 플러그인, Zinit 플러그인 매니저, 프롬프트 엔지니어링(Starship/Powerlevel10k) 및 셸 스크립팅. .zshrc 설정, Zsh 자동화 스크립트 작성, 셸 시작 시간 최적화, 탭 완성 구성 시 사용하세요.

Agent-Skills란 무엇인가요?

이 스킬은 Zsh 셸 환경에 대한 고급 전문 지식을 제공합니다. macOS 기본 셸인 Zsh의 커스터마이징, Oh My Zsh 및 Zinit과 같은 플러그인 매니저, Starship 및 Powerlevel10k를 사용한 프롬프트 엔지니어링, 그리고 강력한 셸 스크립팅을 다룹니다. 사용자는 .zshrc 파일 최적화를 통해 셸 시작 시간을 20ms 미만으로 줄이고, 고급 글로빙 및 매개변수 확장을 활용한 효율적인 파일 조작 방법을 배울 수 있습니다. 또한 zsh-autosuggestions 및 zsh-syntax-highlighting과 같은 현대적인 플러그인을 가볍게 로드하는 방법, 지연 로딩을 통한 성능 최적화, 그리고 일반적인 오류 해결 방법을 포함한 모범 사례를 제공합니다. 이 스킬은 Claude Code, Cursor, Codex와 같은 AI 에이전트 플랫폼에서 사용할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/G1Joshi/Agent-Skills/tree/HEAD/skills/tools/zsh

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

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

문서

Zsh

Zsh는 macOS의 기본 셸입니다. 매우 사용자 정의가 가능하며 Bash와 호환됩니다.

사용 시기

  • 고생산성 대화형 셸: 대화형 자동 완성, 퍼지 탐색, 기록 검색, 브랜치 표시기.
  • 현대적인 CLI 플러그인 생태계: zsh-autosuggestions, zsh-syntax-highlighting, Starship 프롬프트로 셸 워크플로우 가속화.
  • 강력한 셸 스크립팅: 배열 조작과 글로빙을 사용하여 POSIX 호환 및 Zsh 확장 자동화 스크립트 작성.
  • 엔터프라이즈 환경 관리: macOS 및 Linux 서버에서 SDK 버전, PATH 내보내기, 별칭 관리.

빠른 시작

1. 최소 ~/.zshrc 설정

# History configuration
HISTFILE="$HOME/.zsh_history"
HISTSIZE=50000
SAVEHIST=50000
setopt HIST_IGNORE_DUPS
setopt SHARE_HISTORY

# Key bindings (emacs mode)
bindkey -e

# Autocompletion
autoload -Uz compinit && compinit

# Aliases
alias ll="ls -lah"
alias g="git"
alias gs="git status -sb"

2. 시작 시간 측정

# Profile zsh startup duration
time zsh -i -c exit

핵심 개념

고속 최신 Zshrc (~/.zshrc)

20ms 미만의 셸 시작, 스마트 완성, 기록 구성:

# ~/.zshrc
# History configuration
HISTFILE="$HOME/.zsh_history"
HISTSIZE=50000
SAVEHIST=50000
setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_VERIFY
setopt SHARE_HISTORY

# Directory navigation options
setopt AUTO_CD
setopt AUTO_PUSHD
setopt PUSHD_IGNORE_DUPS
setopt PUSHD_SILENT

# Fast Completion System (with caching)
autoload -Uz compinit
typeset -i updated_at=$(date +'%j' -r ~/.zcompdump 2>/dev/null || stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null)
if [ $(date +'%j') != $updated_at ]; then
  compinit -i
else
  compinit -C -i
fi

# Modern Keybindings: History search
bindkey -e
bindkey '^[[A' history-search-backward
bindkey '^[[B' history-search-forward

# Initialize Starship Prompt (if installed)
if command -v starship &> /dev/null; then
  eval "$(starship init zsh)"
fi

무거운 프레임워크 없이 가벼운 플러그인 로딩

자동 제안과 구문 강조를 직접 로드:

# Clone plugins to ~/.zsh/plugins/
# git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/plugins/zsh-autosuggestions
# git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/plugins/zsh-syntax-highlighting

source ~/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

# Configure suggestion color
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'

고급 Zsh 글로빙 및 매개변수 확장

재귀적 글로빙 및 수정자 활용:

# List all TypeScript files modified in the last 24 hours
ls -lh **/*.ts(m-1)

# Delete all empty directories recursively
rmdir -p **/*(/^F) 2>/dev/null

# Select only executable files in bin/
chmod +x bin/*(*)

일반적인 패턴

Zinit을 사용한 고속 플러그인 로딩

문제: Oh My Zsh 시작 시 무거운 즉시 로딩으로 인해 수백 밀리초가 소요됩니다. 해결책: 터보 모드(지연 로딩)와 함께 Zinit을 사용하세요.

# Install Zinit if missing
source ~/.local/share/zinit/zinit.git/zinit.zsh

# Turbo load syntax highlighting and autosuggestions asynchronously
zinit wait lucid for \
  atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
    zdharma-continuum/fast-syntax-highlighting \
  atload"_zsh_autosuggest_start" \
    zsh-users/zsh-autosuggestions \
  blockf \
    zsh-users/zsh-completions

강력한 셸 스크립팅 함수

문제: 옵션 파싱 및 오류 처리가 포함된 재사용 가능한 셸 함수 작성. 해결책: 표준 Zsh 매개변수 확장 사용.

# mkcd: Create directory and cd into it
mkcd() {
  if [[ -z "$1" ]]; then
    echo "Usage: mkcd <dir>" >&2
    return 1
  fi
  mkdir -p "$1" && cd "$1"
}

모범 사례 (2026)

  • 해야 할 일: ~/.zcompdump를 바이트 컴파일 파일(compdump.zwc)로 컴파일하여 셸 시작 시간을 가속화합니다.
  • 해야 할 일: setopt SHARE_HISTORY를 설정하여 모든 활성 터미널 탭 간에 명령 기록을 동기화합니다.
  • 해야 할 일: 비대한 레거시 프롬프트 테마 대신 Starship이나 간결한 네이티브 프롬프트를 사용합니다.
  • 해야 할 일: ~/.zshrc의 상단과 하단에 zmodload zsh/zprof를 사용하여 시작 지연 시간을 프로파일링합니다.
  • 하지 말아야 할 일: 수십 개의 불필요한 플러그인이 포함된 무겁고 비대한 프레임워크 구성(모놀리식 Oh-My-Zsh 구성)을 사용하지 마십시오.
  • 하지 말아야 할 일: ~/.zshrc에 평문 클라우드 자격 증명, API 토큰 또는 비밀을 저장하지 마십시오. 대신 개인 .env 파일이나 비밀 저장소를 사용하십시오.
  • 하지 말아야 할 일: 모든 대화형 셸 시작 시 느린 외부 명령(nvm, brew doctor)을 동기식으로 실행하지 마십시오.

문제 해결

오류 / 증상원인해결책
.zshrc 편집 후 zsh: command not found: ....zshrc의 구문 오류 또는 $PATH 할당이 추가 대신 덮어쓰기됨경로를 올바르게 추가: export PATH="$HOME/bin:$PATH"를 사용하고 source ~/.zshrc 실행.
zsh compinit: insecure directories, run compaudit/usr/local/share/zsh의 안전하지 않은 파일 권한`compaudit
Zsh 시작이 매우 느림 (> 500ms)동기식 nvm 또는 무거운 플러그인 초기화nvm에 지연 로딩 사용 또는 .zshrc 상단에 zmodload zsh/zprof, 하단에 zprof로 프로파일링.

참고 자료

Individual skills in this repo

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

G1Joshi/Agent-Skills

Expert Dask distributed computing assistance covering Dask DataFrames, Arrays, Futures, and cluster scaling. Use when analyzing datasets too large for pandas on a single machine or multi-node cluster.

G1Joshi/Agent-Skills

Expert dbt (data build tool) assistance covering SQL modeling, Jinja macros, tests, documentation, and semantic layer. Use when building analytics engineering pipelines on BigQuery, Snowflake, or PostgreSQL.

G1Joshi/Agent-Skills

Expert JAX assistance covering Autograd, XLA compilation (`jit`), vectorization (`vmap`), and parallelization (`pmap`). Use when building high-performance numerical computing and cutting-edge deep learning research.

G1Joshi/Agent-Skills

Expert Ray distributed computing assistance covering Ray Core (actors, tasks), Ray Train, Ray Tune, and Ray Serve. Use when scaling Python compute and ML training across multi-node clusters.

G1Joshi/Agent-Skills

Expert Git version control assistance covering branching, interactive rebase, cherry-pick, submodules, worktrees, and conflict resolution. Use when managing source code history and collaboration workflows.

G1Joshi/Agent-Skills

Expert K9s CLI assistance covering terminal Kubernetes cluster navigation, real-time log streaming, port forwarding, and pod debugging. Use when managing and troubleshooting Kubernetes clusters with speed.

G1Joshi/Agent-Skills

Expert SWC assistance covering high-performance Rust-based JavaScript/TypeScript compilation, .swcrc configuration, Jest testing via @swc/jest, and minification. Use when replacing Babel with SWC for faster builds, accelerating test execution, or compiling modern ECMAScript features.

G1Joshi/Agent-Skills

Expert Tig assistance covering text-mode interface for Git, interactive staging, commit graph visualization, diff exploration, and blame navigation. Use when navigating Git commit history in the terminal, staging hunks interactively, browsing file changes, or reviewing revisions.

G1Joshi/Agent-Skills

Expert Vim assistance covering modal editing, .vimrc configuration, registers, macros, search/replace, and plugin management via vim-plug. Use when editing text efficiently in terminal environments, writing Vimscript, recording macros, or configuring core Vim settings.

G1Joshi/Agent-Skills

Expert Zed editor assistance covering high-performance Rust-based text editing, multi-buffer editing, language server protocols (LSP), and AI assistant integrations. Use when configuring Zed settings.json, setting up language extensions, collaborating in real-time channels, or optimizing editor startup speed.

G1Joshi/Agent-Skills

Expert [skill-name] assistance covering [feature 1], [feature 2], and [feature 3]. Use when [working with X], [debugging Y], or [implementing Z].

관련 스킬