> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pastures.farm/llms.txt
> Use this file to discover all available pages before exploring further.

# Contributing

> Guidelines for contributing to the Pastures Rancher extension.

## Scope

This repository contains only the **Rancher UI extension**. Backend, corpus, and model code live in separate repositories and are not accepted here.

## Prerequisites

* **Node.js 22+** (use [nvm](https://github.com/nvm-sh/nvm) to manage versions)
* **Yarn 1.x** (classic)
* **Rancher 2.8+** (local or remote instance for testing)

## Workflow

<Steps>
  <Step title="Fork and clone">
    Fork the repository on GitHub, then clone your fork locally.

    ```bash theme={null}
    git clone https://github.com/<your-user>/pastures-rancher.git
    cd pastures-rancher
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    yarn install --ignore-engines
    ```
  </Step>

  <Step title="Build the extension">
    ```bash theme={null}
    yarn build-pkg pastures
    ```
  </Step>

  <Step title="Developer Load into Rancher">
    Start the package server with `yarn serve-pkgs`, then load the extension in Rancher via **Extensions → Developer Load** using `http://127.0.0.1:4500`.
  </Step>

  <Step title="Open a Pull Request">
    Push your branch and open a PR against `main`.
  </Step>
</Steps>

## Pull Request Requirements

* The build must pass (`yarn build-pkg pastures`).
* Use **conventional commits**:
  * `feat:` — new feature
  * `fix:` — bug fix
  * `docs:` — documentation only
  * `chore:` — maintenance, dependencies
* Keep PRs focused on a single change.

## Code Style

| Convention | Detail                                                                                                 |
| ---------- | ------------------------------------------------------------------------------------------------------ |
| Components | Vue 3 `<script setup lang="ts">` with Composition API                                                  |
| Styling    | Rancher CSS variables (`--body-text`, `--border`, `--primary`, `--box-bg`, etc.) — no hardcoded colors |
| API calls  | `engineFetch()` from `lib/pasturesApi.ts`                                                              |
| Demo mode  | Guard with `isGlobalDemoMode()`; load `DEMO_*` constants when true                                     |
| Types      | TypeScript interfaces for all API responses and component props                                        |

## Security Vulnerabilities

If you discover a security issue, **do not open a public issue**. Email **[security@pastures.farm](mailto:security@pastures.farm)** with a description and reproduction steps. We will respond within 48 hours.

## License

By contributing you agree that your contributions are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
