---
title: 🔧 Contributing to Zi
description: Guidelines for contributing to the zi plugin manager — branch model, commits, PR workflow, and what not to add.
canonical_url: https://wiki.zshell.dev/community/contributing/contributing_to_zi
markdown_url: https://wiki.zshell.dev/community/contributing/contributing_to_zi/index.md
locale: en
source_path: community/00_contributing/02_contributing_to_zi.mdx
---

<!-- Generated from the canonical Z-Shell Wiki build. The linked human-facing page remains the editorial source of truth. -->

# 🔧 Contributing to Zi

![](https://wiki.zshell.dev/img/svg/community/contributing-zi.svg)

Thank you for contributing to zi! This page covers the guidelines specific to the [`z-shell/zi`](https://github.com/z-shell/zi) repository. For the org-wide basics (branch model, commit format, PR checklist) see [Getting Started](https://wiki.zshell.dev/community/contributing/getting_started/index.md).

<a id="repository-overview"></a>

## Repository Overview

Zi is a Zsh plugin manager written entirely in Zsh. The entry point is `zi.zsh` at the repository root, with sourced implementation in `lib/zsh/`. The installer lives in [`z-shell/src`](https://github.com/z-shell/src).

```text
zi/
  zi.zsh            ← plugin manager entry point
  lib/zsh/          ← core plugin manager source
  docs/             ← repository-level docs (CONTRIBUTING.md, man page)
  tests/            ← focused Zsh regressions
  .github/
    workflows/      ← CI workflows and full stable qualification
```

<a id="setting-up-locally"></a>

## Setting Up Locally

```sh
git clone https://github.com/<your-username>/zi.git
cd zi
git remote add upstream https://github.com/z-shell/zi.git
git fetch upstream
git checkout -b feature-123 upstream/main
```

No build step is required — zi is pure Zsh. To test changes interactively, source the modified files in a Zsh session:

```zsh
zsh
source zi.zsh
```

<a id="running-tests"></a>

## Running Tests

Run native syntax checks and the focused Zsh regressions affected by your change:

```zsh
zsh -f -n zi.zsh
zsh -f tests/ice-tokenizer.zsh
zsh -f tests/ci-registration.zsh
```

Read each test before running it and isolate inherited installation prefixes such as `ZPFX`. The [contribution guide](https://github.com/z-shell/zi/blob/main/docs/CONTRIBUTING.md) and [Zsh workflow](https://github.com/z-shell/zi/blob/main/.github/workflows/zsh-n.yml) define the suite. Full stable qualification also runs the ZD integration suite, clean startup, and real-object lifecycle checks. Add or update focused tests when your change affects behavior.

<a id="zi-specific-commit-scopes"></a>

## Zi-Specific Commit Scopes

In addition to the [standard commit types](https://wiki.zshell.dev/community/contributing/getting_started/index.md#commit-message-format), prefer these scopes when relevant:

<table><thead><tr><th>Scope</th><th>Covers</th></tr></thead><tbody><tr><td><code>core</code></td><td><code>zi.zsh</code> and its <code>lib/zsh/</code> implementation</td></tr><tr><td><code>install</code></td><td>installer scripts in <code>src</code></td></tr><tr><td><code>ci</code></td><td>GitHub Actions workflows</td></tr><tr><td><code>docs</code></td><td>repository-level documentation</td></tr><tr><td><code>annex</code></td><td>annex API surface changes</td></tr></tbody></table>

Examples:

```text
fix(core): resolve fpath duplication on plugin reload
feat(annex): expose atdelete hook to external annexes
docs(ci): document workflow trigger conditions
```

<a id="what-not-to-add-to-zi"></a>

## What Not to Add to Zi

Off-limits

-   `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `.cursorrules`, or any AI-specific config files
-   Secrets, credentials, or tokens of any kind
-   Files unrelated to the plugin manager itself

<a id="opening-issues"></a>

## Opening Issues

Before starting significant work, [open an issue](https://github.com/z-shell/zi/issues/new/choose) to discuss the change. Use the appropriate issue template:

<table><thead><tr><th>Template</th><th>When to use</th></tr></thead><tbody><tr><td>Bug report</td><td>Reproducible misbehavior</td></tr><tr><td>Feature request</td><td>New capability</td></tr><tr><td>Annex proposal</td><td>Proposing a new annex</td></tr></tbody></table>

<a id="stable-branch-promotion"></a>

## Protected main contributions

Branch from current `main` and open your pull request into protected `main`:

1.  Keep feature, fix, and hotfix branches short-lived and linked to an issue.
2.  Every merge must pass full stable qualification and the required review.
3.  Ordinary pull requests use squash merge. Historical promotion ancestry remains preserved in `main`.

`main` remains the directly consumable stable ref. Signed version milestones are separate maintainer actions on the qualified current `main` commit; merging a pull request does not create a release. See [ADR 0039](https://github.com/z-shell/.github/blob/main/decisions/0039-zi-main-integration-and-signed-milestones.md) and the [contribution guide](https://github.com/z-shell/zi/blob/main/docs/CONTRIBUTING.md) for the current contract.

<a id="see-also"></a>

## See Also

-   [Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/)
-   [Getting Started](https://wiki.zshell.dev/community/contributing/getting_started/index.md) — org-wide branch and commit conventions
-   [Project Management](https://wiki.zshell.dev/community/contributing/project_management/index.md) — how work is tracked across the org
