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

# Developer Setup

> Set up the Illegalcord repository for plugin development.

Plugin development happens inside the Illegalcord source tree. You do not need a separate plugin template or `manifest.json`.

## Requirements

* Node.js 22 or newer.
* `pnpm`.
* A local clone of Illegalcord.
* Discord desktop for testing desktop injection, or a browser target for `pnpm buildWeb`.

## Setup

<Steps>
  <Step title="Install dependencies">
    From the repository root:

    ```bash theme={null}
    pnpm install --frozen-lockfile
    ```
  </Step>

  <Step title="Choose a plugin folder">
    Use `src/userplugins/<name>` for Illegalcord-specific bundled plugins, `src/equicordplugins/<name>` for Equicord-specific work, or `src/plugins/<name>` for stock plugin changes.
  </Step>

  <Step title="Build in watch mode">
    For desktop work:

    ```bash theme={null}
    pnpm watch
    ```

    For web work:

    ```bash theme={null}
    pnpm watchWeb
    ```
  </Step>

  <Step title="Inject or reload">
    Use `pnpm inject` after a desktop build, then restart Discord. For web, reload the extension output from `dist`.
  </Step>
</Steps>

## Validation commands

Run focused checks before committing plugin work:

```bash theme={null}
pnpm testTsc
pnpm lint
pnpm lint:patches
pnpm generatePluginJson
```

If your plugin includes CSS:

```bash theme={null}
pnpm lint-styles
```

## New plugin checklist

* Add the SPDX header at the top of each new source file.
* Export `definePlugin({ ... })` as the default export.
* Include `name`, `description`, and `authors`.
* Use `Devs` or `EquicordDevs` for authors.
* Add `dependencies` for imperative API usage.
* Prefer declarative plugin fields.
* Clean up every timer, listener, observer, subscription, and manual registration.
* Regenerate plugin metadata with `pnpm generatePluginJson`.

<Tip>
  Keep the first version in one file. Split only when a second file is genuinely reusable or the plugin grows past a comfortable size.
</Tip>
