Skip to content

Commit d89bf38

Browse files
update agent instructions
1 parent 66479c4 commit d89bf38

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

AGENTS.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,24 @@
2626
## Project Overview
2727

2828
- **Tech Stack**: React 18, TypeScript, Vite, Tailwind CSS, Redux Toolkit (with persistence), Apollo Client, Keycloak, i18next.
29-
- **Package Manager**: `npm` / `bun`. All scripts are defined in `package.json` and are **compatible with `bun run <script>`**.
29+
- **Package Manager**: `bun`. All scripts are defined in `package.json` and are **compatible with `bun run <script>`**.
3030
- **Path Alias**: `@/*` resolves to `src/*` (defined in `vite.config.ts` & `tsconfig.json`).
31-
- **Code Generation**: GraphQL types & hooks are generated via `npm run generate:graphql`.
31+
- **Code Generation**: GraphQL types & hooks are generated via `bun run generate:graphql`.
3232
- **Testing**: Vitest + React Testing Library + MSW for API mocking.
3333
- **Formatting**: Prettier with `prettier-plugin-tailwindcss` (installed but configuration falls back to defaults).
3434

3535
---
3636

3737
## Common Development Commands
3838

39+
**CRITICAL:** Before running any tests or building the project, **always regenerate the GraphQL files** to ensure they are up‑to‑date. Run:
40+
41+
```bash
42+
bun run generate:graphql
43+
```
44+
45+
This command re‑generates the GraphQL types and hooks (e.g., `src/graphql/generated.ts`). It must be executed any time the GraphQL schema changes and must be run before `bun run test` or `bun run build`. Ensure this step is included in any CI pipeline or local workflow.
46+
3947
| Command | Description |
4048
| -------------------------- | ------------------------------------------------------------------- |
4149
| `bun run dev` | Starts Vite dev server (default port 3000). |
@@ -61,7 +69,7 @@ Agents often need to run or debug a specific test file. Use any of the following
6169
bun run test -- src/pages/dashboard/Dashboard.test.ts --run
6270
```
6371

64-
**Tip:** The double‑dash `--` separates the npm script arguments from the script itself.
72+
**Tip:** The double‑dash `--` separates the bun script arguments from the script itself.
6573

6674
---
6775

@@ -76,7 +84,7 @@ All agents should respect the linting rules defined in `.eslintrc.cjs`. The foll
7684
- **Single‑quotes** for strings, **double‑quotes** only when the string contains a single‑quote.
7785
- **Semi‑colons** are required (`semi: true`).
7886
- **Tailwind ordering**: thanks to `prettier-plugin-tailwindcss`, class names are automatically sorted alphabetically.
79-
- Run `npm run lint` (which runs ESLint with Prettier integration) before committing.
87+
- Run `bun run lint` (which runs ESLint with Prettier integration) before committing.
8088

8189
### Imports & Path Aliases
8290

@@ -184,8 +192,8 @@ export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector
184192

185193
- The **ESLint** config extends `eslint:recommended`, `@typescript-eslint/recommended`, and `plugin:react-hooks/recommended`.
186194
- **Prettier** is enforced via `eslint-config-prettier` – any formatting deviation is reported as an ESLint error.
187-
- **`npm run lint`** fails on **any warning** (`--max-warnings 0`).
188-
- CI (GitHub Actions) runs `npm ci && npm run lint && npm run test && npm run coverage`.
195+
- **`bun run lint`** fails on **any warning** (`--max-warnings 0`).
196+
- CI (GitHub Actions) runs `bun install && bun run lint && bun run test && bun run coverage`.
189197
- No `--fix` flag is used in CI – agents must commit correctly formatted code.
190198

191199
---
@@ -209,15 +217,17 @@ The repository does **not** contain a `.cursor/` directory or a `.github/copilot
209217

210218
---
211219

212-
**Agent Restrictions**: Agents must not modify any files outside the project directory.
220+
**Agent Restrictions**: Agents must not modify any files outside the project directory.
221+
222+
**CRITICAL:** Agents must **never** modify any auto‑generated files (e.g., GraphQL generated files such as `src/graphql/generated.ts`).
213223

214224
**CRITICAL:** Agents must **never** commit any changes without **explicit user permission**. ALWAYS ask for review and obtain approval **before** running any `git add` / `git commit` commands.
215225

216226
**Shell Environment**: Agents should execute commands using **zsh** (as the user’s default shell) to ensure compatibility with tools installed in that environment.
217227

218-
**Node Version Management**: Agents must always verify that **nvm** (Node Version Manager) is installed before invoking any `node` or `npm` commands. If `nvm` is not available, they should inform the user and suggest installing it. Agents should never run Node directly without first ensuring the appropriate version is selected via `nvm`.
228+
**Node Version Management**: Agents must always verify that **nvm** (Node Version Manager) is installed before invoking any `node` commands. If `nvm` is not available, they should inform the user and suggest installing it. Agents should never run Node directly without first ensuring the appropriate version is selected via `nvm`.
219229

220-
**Package Manager Preference**: All dependency management should be performed using **bun**. Agents must use `bun install` (or `bun add`/`bun remove` as appropriate) instead of `npm install`. Before running any bun command, agents must check that **bun** is installed; if it is missing, they should inform the user and suggest installing bun (e.g., via `curl -fsSL https://bun.sh/install | bash`).
230+
**Package Manager Preference**: All dependency management should be performed using **bun**. **Important:** Always use `bun` for all commands in this project; any other package manager must not be used. Agents must use `bun install` (or `bun add`/`bun remove` as appropriate) instead of any other package manager. Before running any bun command, agents must check that **bun** is installed; if it is missing, they should inform the user and suggest installing bun (e.g., via `curl -fsSL https://bun.sh/install | bash`).
221231

222232
**Branch Management**: Agents must avoid making code changes directly on the **main** (or **master**) branch. Any modification to code should be performed on a separate feature branch. Agents should always ask for explicit user permission before creating a new branch, and must recommend creating one when working on the main branch.
223233

0 commit comments

Comments
 (0)