AGENT SKILL

configuring-zsh

Chooses the zsh startup file (.zshenv, .zprofile, .zshrc, .zlogin, or a custom plugin under ZSH_CUSTOM) for a configuration change and edits the dotfiles repo source behind the symlink. Use when the user says "update the zsh config", or when adding or moving environment variables, PATH entries, aliases, functions, setopt or zstyle options, or completions in zsh config.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 2
Forks
0

01 前言 Front Matter

name
configuring-zsh
metadata
{ "bashPattern": [ "source\\s+\\S*\\.?z(shrc|shenv|profile|login)", "\\b(un)?setopt\\b" ], "filePattern": [ "zsh/*", "**/zshrc", "**/zprofile", "**/zshenv", "**/zlogin", "**/zlogout", "**/.zshrc", "**/.zprofile", "**/.zshenv", "**/.zlogin", "**/*.plugin.zsh" ] }
description
Chooses the zsh startup file (.zshenv, .zprofile, .zshrc, .zlogin, or a custom plugin under ZSH_CUSTOM) for a configuration change and edits the dotfiles repo source behind the symlink. Use when the user says "update the zsh config", or when adding or moving environment variables, PATH entries, aliases, functions, setopt or zstyle options, or completions in zsh config.

02 资源文件 2

03 SKILL.md 正文

Configuring zsh

Edit the source, not the symlink

  • Startup files usually live in a dotfiles repo and are symlinked into $HOME (or $ZDOTDIR).
  • Write to the repo file, not the link: many editors and write tools replace a symlink with a regular file.
  • Register a new startup file wherever the repo creates its links, and ask before running its installer.
  • If the repo links a <name>.plugin.zsh into ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/<name>/, follow the oh-my-zsh plugin layout.

Choose the startup file

  • .zprofile: PATH, tool init that sets it (eval "$(brew shellenv)"), variables for programs (EDITOR). Not .zshenv: macOS path_helper moves its entries behind the system paths. Not .zshrc: it never runs for programs started outside an interactive shell.
  • .zshenv: variables every shell needs, including scripts (ZDOTDIR, guard flags). Keep it fast and silent.
  • .zshrc: setopt, zstyle, prompt, framework and plugin list; FPATH additions before compinit (with oh-my-zsh, before sourcing oh-my-zsh.sh); aliases, functions, their compdef, and interactive variables (LESS) after compinit, or in the custom plugin file.

Before adding an alias or function, check that an enabled plugin does not already define it: zsh -ic 'whence -v <name>'.

Aliases that shadow commands

  • An alias that replaces a standard command (ls, cat, grep, rm, cd) breaks scripts and agents that shell out through this config.
  • Agent harnesses may replay aliases captured from an interactive shell, so an interactivity check alone does not protect them.
  • If the config already has a guard for shadowing aliases, put the new alias behind it.
  • Otherwise ask the user before adding one, and suggest a guard that also checks agent markers such as CLAUDECODE.
  • Aliases with new names (lg, gti) need no guard.

Validate

  1. zsh -n <file> for each edited file.
  2. Confirm the change with zsh -c for .zshenv, zsh -lc for .zprofile, zsh -ic for .zshrc or a plugin.
  3. For a guarded alias, read every marker the guard tests, then confirm the definition prints with all of them unset (env -u CLAUDECODE -u AI_AGENT zsh -ic 'alias <name>', one -u per marker) and is gone with one set (CLAUDECODE=1 zsh -ic 'alias <name>').

04 同仓库更多 Skills

bostonaholic
bostonaholic/skills

writing-system-prompts

Writes and reviews system prompts for AI tools, agents, chatbots, and LLM products using a fixed section order and a quality checklist. Use when the user says "write a system prompt", or when drafting a system prompt or auditing one for missing stop criteria, tool rules, constraints, or examples. Not for compressing an existing prompt; use improving-prompts.

★ 2
bostonaholic
bostonaholic/skills

writing-prose

Writes and edits prose for people in a plain, conversational, short house style with no em dashes. Use when the user says "write this up", or when drafting or revising documentation, READMEs, explanations, blog posts, or other human-facing prose. Not for prompts written for agents; use writing-system-prompts or composing-agent-prompts.

★ 2
bostonaholic
bostonaholic/skills

writing-acceptance-criteria

Writes or rewrites acceptance criteria until each is provable: one observable outcome with a named check that can fail. Use when the user says "write acceptance criteria", or asks to write, rewrite, or tighten acceptance criteria or a definition of done. Not for proving work meets them; use proving-claims.

★ 2
bostonaholic
bostonaholic/skills

summarizing-shipped-work

Summarizes the user's merged GitHub PRs for a timeframe into a grouped, linked shipped-work report with highlights, and offers to update a brag document. Use when the user says "what shipped?", or when asked what the user shipped (this week, last month, a quarter, since a date), for a status update, or to update a brag doc.

★ 2
bostonaholic
bostonaholic/skills

running-retros

Mines a session transcript, past agent sessions, or named sources such as PR review comments for durable learnings, then proposes approval-gated edits to skills, AGENTS.md, or docs and tracker issues. Use when the user says "retro", or when the user explicitly asks for a retrospective. Never infer from session end or friction.

★ 2
bostonaholic
bostonaholic/skills

learning-from-mistakes

Codifies the latest correction or mistake in the conversation as a short imperative rule in the project or global CLAUDE.md or AGENTS.md, after the user approves it. Use when the user says "learn from this mistake", or when the user asks to learn from a mistake, remember a lesson for next time, add a rule to CLAUDE.md, or not repeat a behavior. Not for a whole session; use running-retros.

★ 2