From e02df78aa3de2cab2780f67edf0a3feb4cf79a1d Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Wed, 15 Oct 2025 11:51:48 +0700 Subject: [PATCH] Add copilot instructions (#10092) Signed-off-by: Andrey Sobolev --- .github/copilot-instructions.md | 42 +++++++++++++++++++++++++++++++++ .gitignore | 3 +-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000000..b9134995a2 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,42 @@ +# Huly Platform - Copilot Instructions + +TypeScript/Svelte 4 monorepo using Rush.js (pnpm 10.15.1), Node >=20 <25, Webpack 5, Electron, Jest. + +## Code Style + +**TypeScript**: Strict types, interfaces over types, avoid `any`, export types separately +**Svelte**: Script/style/markup order, reactive `$:`, stores for state, small focused components +**Naming**: Files `kebab-case`, Components `PascalCase`, functions `camelCase`, constants `UPPER_SNAKE_CASE` + +## Structure + +- `models/*` - Shared types/models +- `server-*` - Server packages +- `plugins/*` - Client plugins +- `packages/*` - Reusable utilities +- Projects 2-3 levels deep, each with `package.json` + +## Rush Commands + +```bash +rush install # Install deps +rush build # Build all +rush build --to PKG # Build specific +rush add -p PKG # Add dependency +``` + +## Patterns + +- Always handle errors (proper Error subclasses, catch promises) +- Use async/await, Promise.all() for parallel ops +- Svelte stores for shared state, separate business logic +- JSDoc public APIs, tests alongside code +- Run `rushx test` before commit + +## Avoid + +❌ `any` without reason ❌ console.log() ❌ Mixed concerns ❌ Circular deps ❌ Ignoring TS errors + +## When Coding + +Infer location from context (models/server/plugins/packages), match existing patterns, include proper imports/types, add error handling, use existing utils first. diff --git a/.gitignore b/.gitignore index cbdd8bd1b0..b68af9de6b 100644 --- a/.gitignore +++ b/.gitignore @@ -112,5 +112,4 @@ dev/tool/history.json .aider* /combined_dependencies .tmp -ws-tests/docker-compose.override.yml -.github/copilot-instructions.md \ No newline at end of file +ws-tests/docker-compose.override.yml \ No newline at end of file