Skip to content

Latest commit

 

History

History
146 lines (117 loc) · 9.58 KB

AGENTS.md

File metadata and controls

146 lines (117 loc) · 9.58 KB

Project Guidelines

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/agents/docusaurus-writer.agent.md: tasks documentation; files {docs,community,ecosystem}/**/*.mdx
  • .github/agents/localization-maintainer.agent.md: tasks documentation, localization; files **
  • .github/instructions/agent-docusaurus-writer.instructions.md: tasks documentation; files {docs,community,ecosystem}/**/*.mdx
  • .github/instructions/docs-authoring.instructions.md: tasks documentation; files {docs,community,ecosystem}/**/*.mdx
  • .github/instructions/docusaurus-api.instructions.md: tasks documentation, implementation; files src/**/*.{ts,tsx}, {docs,community,ecosystem}/**/*.mdx
  • .github/instructions/docusaurus-config.instructions.md: tasks implementation; files docusaurus.config.ts
  • .github/instructions/frontend-components.instructions.md: tasks implementation; files src/**/*.{ts,tsx}
  • .github/instructions/skill-codebase-health.instructions.md: tasks implementation, project-health; files src/**/*.{ts,tsx}
  • .github/instructions/skill-docs-readiness.instructions.md: tasks documentation, review-readiness; files {docs,community,ecosystem}/**/*.mdx
  • .github/instructions/skill-ui-design.instructions.md: tasks implementation; files src/**/*.{css,module.css}
  • .github/prompts/add-doc-section.prompt.md: tasks documentation; files **
  • .github/prompts/audit-consistency.prompt.md: tasks project-health; files **
  • .github/prompts/project-health.prompt.md: tasks project-health; files **
  • .github/prompts/review-pr.prompt.md: tasks code-review; files **
  • .github/skills/acquire-codebase-knowledge/SKILL.md: tasks onboarding; files **
  • .github/skills/codebase-health-audit/SKILL.md: tasks project-health; files **
  • .github/skills/context-map/SKILL.md: tasks context-engineering, implementation; files **
  • .github/skills/conventional-commit/SKILL.md: tasks commit; files **
  • .github/skills/create-llms/SKILL.md: tasks documentation; files **
  • .github/skills/docs-release-readiness/SKILL.md: tasks documentation, release, review-readiness; files **
  • .github/skills/documentation-writer/SKILL.md: tasks documentation; files **
  • .github/skills/editorconfig/SKILL.md: tasks repository-bootstrap; files **
  • .github/skills/ui-design/SKILL.md: tasks implementation; files src/**/*.{css,module.css}, src/**/*.tsx
  • .github/skills/what-context-needed/SKILL.md: tasks context-engineering; 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

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

This project follows the organization-wide Z-Shell Organization Guidelines.

Build, Lint, and Dev Commands

  • Use Node 24 LTS and pnpm 11 (see engines and devEngines in package.json).
  • Install dependencies with pnpm install.
  • pnpm start — local dev server at http://localhost:3000.
  • pnpm build — full production build (run before finishing substantial changes).
  • pnpm build:en — English-only build, faster for docs-only checks.
  • pnpm serve — serve the production build locally for verification.
  • pnpm clear — clear Docusaurus cache; use when the site behaves inconsistently after config or theme changes.
  • pnpm lint — Unified linting with Trunk (configs in .trunk/configs/). Fix with pnpm lint:fix.
  • pnpm validate:code-fences: require an explicit, supported language on every rendered code block.
  • pnpm write-heading-ids — regenerate heading IDs across all docs.
  • Trunk CI runs pre-commit formatting and pre-push linting (config: .trunk/trunk.yaml).

Architecture

  • Docusaurus site with three independent docs content roots. Each root has a fixed scope — do not cross these boundaries:
    • docs/ → /docs — Zi plugin manager user documentation only (installation, commands, usage guides).
    • community/ → /community — Z-Shell ecosystem community content: contributing, the Zsh handbook/plugin standard, and community tools such as ZUnit and Zsh Lint.
    • ecosystem/ → /ecosystem — third-party catalog: annexes, packages, plugins.
  • Maintainer, operational, and infrastructure runbooks do not belong on the public wiki. They live in z-shell/.github/runbooks/.
  • Each content root uses the shared sidebars.ts (autogenerated from directory structure) plus local _category_.json files for ordering.
  • Site config, plugins, and routing: docusaurus.config.ts. See .github/instructions/docusaurus-config.instructions.md for config structure, feature flags, and constraints.
  • Docusaurus client API (components, hooks, theme imports): .github/instructions/docusaurus-api.instructions.md — prefer native Docusaurus components over raw HTML equivalents.
  • Custom MDX components are globally available via src/theme/MDXComponents.tsx — no import needed in .mdx files:
    • <Highlight> — colored text spans
    • <Emoji> — accessible emoji rendering
    • <GhRepoBadge> — GitHub repository badges
    • <ShellCodeCopy> — copyable shell command blocks
    • <CardGrid> / <Card> — responsive landing-page card grids; use these instead of hand-rolling a grid with inline styles
  • Localization uses Crowdin (crowdin.yml). Never edit files under i18n/ directly.

Adding New Content or Infrastructure

When you add a new content area, feature, or infrastructure component, pick the content root using the scope rule above, then review and update these files so guidance stays current:

  • AGENTS.md (this file): content-root scope and conventions.
  • .github/instructions/docs-authoring.instructions.md — Content Root Selection. This file is generated: edit its source, knowledge/domains/documentation/wiki-authoring.md in z-shell/.github, and regenerate it rather than editing it here.

See the org runbook runbooks/instruction-update.md in z-shell/.github for the full cross-repo checklist.

Conventions

Documentation (MDX)

  • Numeric file prefixes control sidebar order: 01_first.mdx, 02_second.mdx.
  • Page structure: frontmatter → imports → content. Required frontmatter: id, title, sidebar_position.
  • Create _category_.json when adding new directories.
  • Use admonitions (:::tip, :::info, :::warning) for callouts.
  • Only edit English source files. Use pnpm crowdin:sync for localization.
  • Detailed patterns: .github/instructions/docs-authoring.instructions.md.

TypeScript / React

  • Use type declarations for props (not interface).
  • One default function component export per file.
  • Destructure props in the function signature; return type React.JSX.Element.
  • Import order enforced by ESLint: builtins → external (react, clsx) → internal (@theme/*, @site/*) → relative → types → styles.
  • Detailed patterns: .github/instructions/frontend-components.instructions.md.

CSS

  • Prefer CSS Modules (.module.css) co-located with the component.
  • Global overrides go in src/css/custom.css.
  • Colors must use HSL format (enforced by Stylelint).
  • Support both light and dark themes via [data-theme] selectors.

Formatting

  • Prettier: double quotes, semicolons, 2-space indent, 120 char print width, trailing commas (config: .prettierrc.json).
  • EditorConfig: UTF-8, spaces, final newline, trim trailing whitespace (except .md/.mdx).

Branching

  • main is the integration and production-deployment branch under organization ADR 0019. Branch from current main and target main.
  • Branch naming: feature-<issue>, bug-<issue> or hotfix-<issue> with an optional -<slug>, or <type>/<slug>, as commit-lint.yml enforces and the published contributor guide in community/00_contributing/01_getting_started.mdx describes.
  • Keep pull requests small and keep main releasable; deployment remains a separate workflow result after merge.

Agent Notes

  • Prefer small, scoped edits that match surrounding MDX and TypeScript style.
  • Link to existing docs rather than duplicating long guidance.
  • GitHub Copilot auto-applies matching scoped files in .github/instructions/ by applyTo glob. Other runtimes should follow this AGENTS.md and open the linked scoped instructions explicitly unless native discovery has been verified. Prefer updating scoped files for domain-specific guidance over modifying this file.
  • Do not introduce additional global instruction files beyond the documented repo entry points unless explicitly requested.