Skip to content

Latest commit

 

History

History
72 lines (46 loc) · 9.07 KB

AGENTS.md

File metadata and controls

72 lines (46 loc) · 9.07 KB

Zi repository guidance

Organization instruction routing

Organization policy is owned by z-shell/.github AGENTS.md. Read it before non-trivial work. Repository guidance in this file and in the surfaces below narrows implementation detail and never overrides organization policy.

Before acting, select every surface below whose tasks and file patterns both match the work, and read each one. If your runtime does not load a listed file automatically, open it explicitly.

  • AGENTS.md (this file): tasks all; files **
  • .github/skills/code-review/SKILL.md: tasks code-review, review-readiness, organization-review, project-health, repository-health, repository-health-audit, repository-health-check; files **; organization skill vendored at approved revision ede9ed985dd2

Reporting issues

File an issue as Filing a new issue describes: one ### heading per field of the effective issue form, in form order. In the version or environment field, give the output of zi version.

After the form's fields, add these headings, writing Not applicable and the reason when one does not apply:

  • ### Zi diagnostics: The output of zi analytics and zi zstatus.
  • ### Ices and annexes: Every zi command involved, with all of its ice modifiers, and the annexes loaded.
  • ### When it fails: At load, at unload, only with turbo (wait) loading, or during install, update or zi self-update; for the last three, the paths and URLs involved.

These facts come from this repository's project profile under decision 0040; change them there, not here.

Organization-wide surfaces are routed by the organization manifest. This block is delivered and verified under decision 0031.

This repository follows the Z-Shell organization guidelines.

Zi is the canonical Zsh plugin manager for the organization. Changes can affect annexes, plugins, documentation, installers, and test environments.

Branch model

  • Ordinary work branches from current protected main and targets main, including fork contributions. Use the organization branch-type contract and preserve reviewed history.
  • Every merge is immediately consumable. Keep incomplete behavior in its topic branch and require full stable qualification, signatures, resolved threads and applicable review of record before merge; revalidate when the base changes.
  • Use native Closes #N only when the PR meets every acceptance criterion; use Refs #N for partial work. Code integration does not authorize a milestone release.
  • Preserve historical promotion ancestry and immutable signed tags. Do not force-push or reset stable history. See the verified migration record in docs/MAIN_MIGRATION.md.

Stable qualification and milestones

  • Every main PR and push runs full stable qualification in promotion-readiness.yml, retaining the existing Promotion gate context for check-name compatibility. The full Linux/macOS Zsh 5.8.1/5.9/5.9.2 suite, ZD compatibility, full Trunk, CodeQL, clean startup and real-object lifecycle checks must succeed; a failed, skipped or cancelled constituent fails the gate. Revalidate when the base changes.
  • Milestones use separately reviewed exact-SHA release plans and signed annotated tags. Ordinary merges never publish automatically. release-plan.yml is read-only; release.yml verifies signature, current main target, semantic version and all required exact-SHA post-merge workflows before publishing deterministic notes idempotently. Tag rules restrict authorized creators and protect immutable tags. No signing key is stored in Actions.
  • Keep installation and self-update on main. Tagged update channels are a separate product change. Never weaken qualification to speed delivery.

Before merging

  • Commit or push authorization does not authorize a merge or enabling auto-merge.
  • Before an authorized merge, read all PR conversation comments, review summaries (including findings without inline comments), and review threads with complete pagination. Check unresolved and outdated threads against the current head; outdated does not mean addressed. Record fixes or evidence-backed dispositions through the authorized review workflow before resolving threads.
  • Green CI and a COMMENTED review are not approval. Follow the organization review-of-record procedure, including its explicitly maintainer-elected fallback for class 3. Require every approval mandated by the applicable live rulesets and investigate every actionable finding. CODEOWNERS routes review; its presence alone does not prove enforced approval, and a fallback does not bypass a required code-owner approval or constitute independent approval.
  • Recheck the exact head SHA, required checks, approvals, and unresolved threads immediately before merging. New commits invalidate the prior merge assessment. Use --match-head-commit <reviewed-head-sha> for a GitHub CLI merge.
  • Do not use --admin or another ruleset bypass in the normal merge workflow. If protection blocks the merge, stop and report the unmet requirement; a bypass requires separate explicit authorization for that exact exception.

Implementation

  • Write Zsh-first code and avoid Bash-only syntax.
  • Run the existing Zsh syntax, integration, and focused tests for changed paths.
  • Keep user-facing documentation in the canonical wiki when practical.
  • Follow the organization commit policy and tool-attribution preference. Agents must omit automatic tool credits, AI co-author and session trailers, and session links, and verify outgoing text. Preserve accurate contributor credit and required third-party notices; never fabricate human credit or claim exclusively human authorship without evidence.

Code review

Use the shared code-review skill with the following Zi-specific context. Apply these checks to affected behavior; trace callers and failure paths before proposing a change.

  • Public contracts and consumers: Read the public-contract manifest for changes to commands, ice modifiers, annex/hook registration, compatibility wrappers, or message output. Check recorded downstream consumers and the contract-impact workflow. Treat the manifest as an inventory, not exhaustive proof of compatibility: unchanged signatures can still conceal changes to ordering, return status, side effects, or output bytes. Report migration and downstream verification needs without expanding the edit scope.
  • Loading and shell state: Check nested and deferred loads, hook ordering, autoload/completion paths, and propagation of failures through shared loaders. Verify that unload, reload, and failed initialization remove only state owned by the relevant plugin or annex, preserving caller state and other owners. Distinguish documented manager effects and explicit install/update commands from accidental state changes or network activity during passive sourcing.
  • Filesystem and update safety: Trace user-controlled paths, URLs, archive entries, and command arguments through download, extraction, installation, update, and cleanup. Check quoting, destination boundaries, symlinks, partial failures, and concurrent updates. A failed operation must preserve existing usable installations and must not remove unrelated user data.
  • Verification: Select focused regressions from the Zsh workflow and tests, including ownership, nested/deferred loading, updates, or snippet mirrors as relevant. Inspect tests before executing them and use isolated runtime state. Separate native syntax/compilation results from behavioral tests and ZD integration. Establish supported Zsh/platform versions from repository evidence; do not infer compatibility coverage from a green job whose matrix excludes it. Report exact checks run, missing coverage, and whether a regression test exercises the failing case.

Use available read-only GitHub context for linked acceptance criteria, affected consumer contracts, and CI evidence. Repository files remain the fallback when MCP is unavailable. Prioritize concrete correctness, compatibility, security, and state-integrity findings; distinguish observed defects from untested risks.