Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

chore(agents): Ensure that coding agents use pnpm rather than npm (#8930)

Lincoln Stein62d21a5726b7
diff --git a/.github/AGENTS.md b/.github/AGENTS.md
new file mode 100644
index 0000000000..9f701a7e33
--- /dev/null
+++ b/.github/AGENTS.md
@@ -0,0 +1,24 @@
+# Agent Instructions
+
+## Package Management
+
+This project uses **pnpm** exclusively for package management in the frontend (`invokeai/frontend/web/`).
+
+- ✅ Use `pnpm` commands (e.g., `pnpm install`, `pnpm run`)
+- ❌ Never use `npm` or `yarn` commands
+- ❌ Never suggest creating or using `package-lock.json` or `yarn.lock`
+- ✅ The lock file is `pnpm-lock.yaml`
+
+Use the following pnpm commands for typical operations:
+
+- pnpm -C invokeai/frontend/web install
+- pnpm -C invokeai/frontend/web build
+- pnpm -C invokeai/frontend/web lint:tsc
+- pnpm -C invokeai/frontend/web lint:dpdm
+- pnpm -C invokeai/frontend/web lint:eslint
+- pnpm -C invokeai/frontend/web lint:prettier
+
+## Project Structure
+
+- Backend: Python in `invokeai/`
+- Frontend: TypeScript/React in `invokeai/frontend/web/` (uses pnpm)
diff --git a/.github/workflows/frontend-checks.yml b/.github/workflows/frontend-checks.yml
index 43bbfdec0a..df76767644 100644
--- a/.github/workflows/frontend-checks.yml
+++ b/.github/workflows/frontend-checks.yml
@@ -41,6 +41,17 @@ jobs:
steps:
- uses: actions/checkout@v4
+ - name: Fail if package-lock.json is added/modified (pnpm only)
+ shell: bash
+ working-directory: .
+ run: |
+ set -euo pipefail
+ git fetch --no-tags --prune --depth=1 origin "${{ github.base_ref }}"
+ if git diff --name-only "origin/${{ github.base_ref }}...HEAD" | grep -E '(^|/)package-lock\.json$'; then
+ echo "::error::package-lock.json was added or modified. This repo uses pnpm only."
+ exit 1
+ fi
+
- name: check for changed frontend files
if: ${{ inputs.always_run != true }}
id: changed-files
diff --git a/invokeai/frontend/web/scripts/package.json b/invokeai/frontend/web/scripts/package.json
index 3dbc1ca591..985bcf7d65 100644
--- a/invokeai/frontend/web/scripts/package.json
+++ b/invokeai/frontend/web/scripts/package.json
@@ -1,3 +1,4 @@
{
- "type": "module"
+ "type": "module",
+ "packageManager": "[email protected]"
}